I want to check if a query has bind variables with specified names. As I have a procedure, which process queries. These queries can have bind variables. Dependend on a bind variable name I wish to bind different values. I can use for example INSTR method like below:
IF INSTR(mySELECT, ':n1') > 0 THEN
DBMS_SQL.BIND_VARIABLE (myCursorId, 'n1', n1);
END IF;
IF INSTR(mySELECT ,':n2') > 0 THEN
DBMS_SQL.BIND_VARIABLE (myCursorId, 'n2', n2);
END IF;
But I think it is not the best way of doing it. Can someone give me a better one?