To create a dynamic SQL statement in PB i did this:
SQLTEST = "select id,name from ss_test where id = @i;";
DECLARE cursor_base DYNAMIC CURSOR FOR SQLSA;
PREPARE SQLSA FROM :SQLTEST;
OPEN DYNAMIC cursor_base USING :i;
FETCH cursor_base INTO :i2,:test2;
however i am getting the error "Mismatch between prepared number of substitution variables and execute parameters".. Which i don't understand? This same SQL runs on the database and the i is a int value just like in the database? What am i doing wrong?
I wanted to be able to do bind variables with the SQL.