Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

ORA-00907: missing right parenthesis in Oracle PLSQL procedure native dynamic clause

mist123Feb 13 2024

Hi All,

I am using a native dynamic SQL statement to insert records into a custom GT table in Procedure.

Oracle 17 version

v_sql:='insert into XXC_PO_DETAILS_GT
        (po_num,
		po_amount,
		sum(total) over (parition by inv_id) po_total,
		from(select po_num,
		            po_amount,
					total,
					inv_id
			from tables...
			)';
			

if p_create_date is NOT NULL
THEN 

v_sql:=v_sql||' AND po.po_create_date>=''''l_date''''');
END IF;
.
.
.
EXECUTE IMMEDIATE v_sql;

While executing getting below error.

Unexpected error while generating data: ORA-00907: missing right parenthesis
ORA-00907: missing right parenthesis at Before trigger part before query formation
Comments
Post Details
Added on Feb 13 2024
20 comments
1,093 views