From: mike <mik...@gm...> - 2005-11-03 04:06:27
|
hi i am using the Sybase connecttion object "execute(sql)" to call an SQL statement to my Sybase ASE here is the statement that i want to execute. basically to change a user password and update a table SQL=3D ''' declare @res int exec @res =3D sp_password 'sapass' ,'userpass', 'user' if @res =3D 0 begin update passwdtable set pswd =3D 'userpass' user_name =3D 'user' select convert(int,1) --to return a int end else begin select convert(int,-1) end ''' In the sybase manual, it says under the "Connections object" execute(sql) ...... The return value is a list of logical results. Each logical result is a lis= t of row tuples. ...... db =3D connect (....., auto_commit=3D1) def exec_stmt(SQL): try: a,b =3D db.execute(SQL) db.commit() db.close() return a,b except Sybase.DatabaseError: return -1 c,d=3D exec_stmt(SQL) when the result is returned, it shows a list of tuples ([(0,)], [(1,)]) . the password is changed and the update is successful by the way. may i know how to interpret this results of tuples? thanks ---------------------------------------------------------------------------= ---------------------------------------------------------- _______________________ Privileged/Confidential information may be contained in this message. If you are not the intended recipient, please notify the sender immediately= . Check out our website at http://www.mpa.gov.sg |