1. ODBC - MySQL Commit Error
Hi,
I am using euphoria odbc.e v1.33 with MySQL Database v5.0.6 + MySQL ODBC driver
v3.51 on WinXP (SP2).
Created MySQL entry under User DSN.
MySQL by default has autocommit set to true. (autocommit=1)
With autocommit set to 1, my program properly reads and updates the table.
I am trying to use commit and rollback by setting autocommit to false (set
session autocommit=0;)
While executing
rc = commit(Pswrd_hndl)
I am getting the error "No Data".
I am executing the following steps:
1] connect to database using odbc - odbc-handle
2] execute "set session autocommit=0;" using prepareSQL() and executeSQL()
3] Prepare "begin;" using prepareSQL() - begin-handle
4] Prepare "update USERS set paswrd = ..;" using prepareSQL() - pswrd-handle
.
.
5] accept the new password
.
.
6] execute "begin;" using executeSQL(begin-handle)
7] Set parameters for password update using bindParameter(pswrd-handle,..)
8] execute "update users set paswrd = ..;" using executeSQL(pswrd-handle)
9] if rc >= 0 commit the transaction using commit(pswrd-handle)
At step 9, I am encountering this error "No Data".
The parameter for commit is "atom handle", I assumed it will be the statement
handle used for executing update statement.
I removed the "begin;" part and executed the code but ended up with same result.
Please advice.
Regards,
Rad.
2. Re: ODBC - MySQL Commit Error
Rad wrote:
>
> Hi,
>
> I am using euphoria odbc.e v1.33 with MySQL Database v5.0.6 + MySQL ODBC
> driver
> v3.51 on WinXP (SP2).
> Created MySQL entry under User DSN.
>
<snip>
> The parameter for commit is "atom handle", I assumed it will be the statement
> handle used for executing update statement.
> I removed the "begin;" part and executed the code but ended up with same
> result.
I think you should use the connection handle for commiting.
Matt Lewis
3. Re: ODBC - MySQL Commit Error
Matt Lewis wrote:
> <snip>
>
> > The parameter for commit is "atom handle", I assumed it will be the
> > statement
> > handle used for executing update statement.
> > I removed the "begin;" part and executed the code but ended up with same
> > result.
>
> I think you should use the connection handle for commiting.
>
Tried with connection handle, but encountering same error.
Rad.
4. Re: ODBC - MySQL Commit Error
Hi,
The parameter for commit is "atom handle", I assumed it will be the statement
handle used for executing update statement.
(tried with odbc-handle too, but got same result).
Further on the same topic, if I create a separate commit_handle by
prepareSQL(odbc_handle,"Commit;")
and use it afterwords with executeSQL(commit_handle) instead of
commit(odbc_handle) of ODBC.e,
the commit works fine.
Can anybody explain me what I am doing wrong with ODBC commit() ??
How to call commit() or rollback() using ODBC.e?
Regards,
Rad.