Home > database >  Pb and sybase database, quite strange questions
Pb and sybase database, quite strange questions

Time:10-04

Please read the following code:
The sqlca. The autocommit=false

Ls_sql="update pub_users set f_password='aa' where f_usercode='9999'"

The execute immediate: ls_sql;

The rollback.

Return 1
Program is running, I heard from my stand-alone database, perform normal, not updated record after the rollback, I received on the server database, running, the record is updated, the rollback didn't work, why ah! This problem bothering me for a few days, asked some people, hasn't been solved!!!!!!

CodePudding user response:

As long as it is in the connection when
The sqlca. The autocommit mode should have no problem=false
Look at the ODBC configuration!!!!

CodePudding user response:

The database is sybase 12.5

CodePudding user response:

The rollback is not rolled back?
Take a look at other configuration information, it should be a didn't pay attention to details

CodePudding user response:

The problem is that I am the same program, different database, program are the same!!!

CodePudding user response:

Please read the following code:
The sqlca. The autocommit=false

Ls_sql="update pub_users set f_password='aa' where f_usercode='9999'"

The execute immediate: ls_sql using sqlca;
If the sqlca. Sqlcode & lt;> 0 then the rollback;

commit;
The code above you did not commit the transaction.



Return 1

CodePudding user response:

You are using the ODBC connection database? See if you the ODBC data source Settings, set the disconnected automatically submit,

CodePudding user response:

Hanxianzhong, yeah, I just didn't have to submit, can record also update!!!!!!
Yohoo () I'm not using odbc! I am used to the transaction sqlca character value, connect to the database using connect!

CodePudding user response:

The execute immediate: ls_sql; Is submitted automatically, and the sqlca. The autocommit mode

CodePudding user response:

Dynamic SQL is submitted automatically, has nothing to do with the sqlca. The autocommit

CodePudding user response:

Da21 is that so? But the same program, why different results???
Tested and found today, code execution for the first time, f_password did update this field, and then I clean off him, then, is not updated!!!!!! ????? I am in a window in the click event of writing code, the other Windows in a program I also tried to do, and I wrote this code in the menu, regardless of how to perform, are not updated, also the theoretical results!! ??

CodePudding user response:

I'm sorry, I'm wrong, it should be:
Dynamic SQL is submitted automatically, has nothing to do with the commit and rollback, but before execution to the sqlca. The autocommit mode is set to true,


The following example for PB help file and its description:
Two examples are don't need to commit;
/* For SQL Server users: If you are connected to a SQL Server database, set the AUTOCOMMIT mode to TRUE before executing the CREATE (before execution to set the AUTOCOMMIT mode to TRUE).
*/

Case 1:
String Mysql

Mysql="CREATE TABLE Employee" & amp;
+ "(emp_id integer not null," & amp;
+ "dept_id integer not null," & amp;
+ "emp_fname char (1) not null," & amp;
+ "emp_lname char (20) not null)"

The EXECUTE IMMEDIATE: Mysql;

//These statements assume a transaction object named My_trans exists and is connected:

Example 2:
String Mysql

Mysql="INSERT INTO dept Values (1234, 'Purchasing')"

The EXECUTE IMMEDIATE: Mysql USING My_trans;

CodePudding user response:

Thank da21 % %
Sorry to ask, how did that help find? I see only in the index:
The EXECUTE
EXECUTE SQL statement
Are not related, I am using pb8

CodePudding user response:

And think of a problem, under the different databases, the effect of the execution, what reason be?

CodePudding user response:

Unknown LZ talking about
  • Related