This is the PL/SQL code. I want to DBMS output the complete query as it is executed since it fails.
vSql := 'SELECT :p_nomeCampo FROM :vTable WHERE :vPkColumn = :p_id';
EXECUTE IMMEDIATE vSql INTO vOutput USING p_nomeCampo, vTable, vPkColumn, p_id;
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Not directly answering the question, but it’s probably failing because you can only bind variable values, not object names; so only
:p_idis valid here. The best you can probably do is:Of course you need to be sure the values you have for
p_nomeCampo,vTableandvPkColumnaren’t susceptible to SQL injection.It helps to show the error you’re getting, though again in this case that’s not directly the point of the question…