View Single Post
 
Old July 2nd, 2010, 12:40 AM
vinod_pawar1 vinod_pawar1 is offline
Authorized User
 
Join Date: Jun 2004
Location: Aurangabad, Maharashtra, India.
Posts: 54
Thanks: 0
Thanked 1 Time in 1 Post
Cool SOLVED!!! Here is the solution with bind variable

DECLARE
XCONST VARCHAR2(20);
BEGIN
XCONST := 'some value';
EXECUTE IMMEDIATE 'INSERT INTO A_TABLE(SOME_VALUE, CLAIMNUMBER) SELECT (SELECT :b1 FROM DUAL), CLAIMNUMBER FROM TBLVOUCHERS WHERE ROWNUM <=4'
USING XCONST;
END;

In the code :b1 is a bind variable and "USING" replaces bind variable value with the passed value (passed variable value).

Thanks
__________________
Vinod Pawar
United States