How do I execute an SQL string statement in DB2? I’m using IBM Data Studio.
Share
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.
Do you mean executing a dynamic SQL string? Something like:
You can only do that in a stored proc though. One defined as
CREATE PROCEDURE GetDeptInfo (deptNumber VARCHAR(5))for this example. Read aboutEXECUTEandPREPAREin the db2 docs http://publib.boulder.ibm.com/infocenter/db2luw/v9r5/index.jsp