Executing a single row select with a bind variable, fetching into a single define variable:
Is tsql a number or varchar2? You declare it as a varchar2, but do a select count(*) - which would be a number.Code:DECLARE str varchar2(200); val varchar2(20); ret varchar2(20); BEGIN str := 'select msg from msg where msg = :b1'; val := 'Hello'; EXECUTE IMMEDIATE str INTO ret USING val; dbms_output.put_line('Value fetched from table: '||ret); END;




Reply With Quote