Using NVL function in Dynamic SQL
1007698May 8 2013 — edited May 8 2013Hi ,
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