Home » RDBMS Server » Server Administration » Dynamic SQL and Update table question!
Dynamic SQL and Update table question! [message #370478] Thu, 02 December 1999 01:42 Go to next message
Semenov
Messages: 6
Registered: December 1999
Junior Member
Hello !
I have a problem when i try updating table using dbms_sql.It's not working and my table is not updating. The code is:

procedure tmp3(
ur1 varchar2:=null,
ur2 varchar2:=null,
ur3 varchar2:=null,
nammenu varchar2:=null,
dproc varchar2:=null,
locked varchar2:=null,
popup varchar2:=null)

is
cname integer; -- dbms_sql cursor name
rp integer; --rows processed
begin

cname:=dbms_sql.open_cursor;
dbms_sql.parse(cname,'update dispmenu
set nammenu=:nm,dproc=:dp, locked=:l, popup=:p where ur1=:u1 and ur2=:u2 and ur3=:u3',dbms_sql.native);
dbms_sql.bind_variable(cname, ':u1', ur1);
dbms_sql.bind_variable(cname, ':u2', ur2);
dbms_sql.bind_variable(cname, ':u3', ur3);
dbms_sql.bind_variable(cname, ':nm', nammenu);
dbms_sql.bind_variable(cname, ':dp', dproc);
dbms_sql.bind_variable(cname, ':l', locked);
dbms_sql.bind_variable(cname, ':p', popup);


rp := dbms_sql.execute(cname);
COMMIT;
dbms_sql.close_cursor(cname);
end;

Why it's not working?

Regards, D.Semenov
Re: Dynamic SQL and Update table question! [message #370479 is a reply to message #370478] Thu, 02 December 1999 05:24 Go to previous message
hmg
Messages: 40
Registered: March 1999
Member
replace
locked = :1 => locked = :variable_name
dbms_sql.bind_variable(cname, ':l', locked) =>
dbms_sql.bind_variable(cname, ':variable_name', locked)
where variable_name begins with a letter
Previous Topic: Query!!1
Next Topic: Using variables for record groups
Goto Forum:
  


Current Time: Sat Oct 24 04:46:18 CDT 2020