Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8644

Re: EXEC/EXECUTE IMMEDIATE statement with input variable

$
0
0

Hello Sumeet,

 

you cannot use the input parameter directly within the string of the EXEC statement, because then it is interpreted as ":v_in_id".

 

You have to prepare the statement before. E.g.

 

DECLARE lv_statement string;

 

lv_statement := 'SELECT * from "BEST"."REGIO_TEMP" where "REGIO_TEMP_ID" = "' || :v_in_id || '"';

EXEC lv_statement.

 

But please consider that SQL injections are possible with that set up.

 

Best Regards,

Florian


Viewing all articles
Browse latest Browse all 8644

Trending Articles