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!

Using NVL function in Dynamic SQL

1007698May 8 2013 — edited May 8 2013
Hi ,

I have created a procedure using the Dynamic SqL and while using the NVL() getting the following error . ORA-00936: missing expression.
The query I have written as

SQL_Txt:=' INSERT INTO VF.tblCData (A, B, C, D, E, F,G,H,I,J)
SELECT '||l_A||',
'||l_B||',
'||l_C||',
'||l_D||',
NULL ,
'||L_F||',
NVL('||Param1||',''''),
NVL('||Param2||',''''),
NVL('||Param3||',''''),
NULL
FROM '||ParamTbl1||' WHERE ' ;
and so on.
For Param1 I have data for one execution and Param2 and Param3 is null for that execution.
While executing the same I am getting below

INSERT INTO VF.tblCData (A, B, C, D, E, F,G,H,I,J)
SELECT 25,
1,
7,
6,
NULL ,
5,
NVL(PurchaseDate,''),
NVL(,''),
NVL(,''),
NULL
FROM xyz.PBuyer@pocdb WHERE

and error ORA-00936: missing expression is popping up for Param2 and Param3 NVL(,'')
Any suggestion to resolve this issue is highly appreciable.

Thanks
Sudipta
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 5 2013
Added on May 8 2013
10 comments
4,138 views