General question about OleDb+transaction logic

Discussion forum about all things SqlBase.
Kiki7

General question about OleDb+transaction logic

Post by Kiki7 » 25 Jul 2008, 09:57

Hi all,

this is not a specific question for TD 5.1, but maybe someone of you can give me a hint how to change my solution. Our old application was running with odbc and in one part of the program we use a named cursor with SqlSetResultSet(...), SqlOpen(...) etc.(Select...For Update...)
Under OleDb this isn`t working any more. The help sais: Note: this function will return an error if called against an OLE DB database connection.
So what is the best way to update my solution? Would you lock the whole transaction before reading the data (this would imply, that the performance goes down) and unlock it after ending the process (that would lock the whole table)? Or is it a better way to set a flag (in a new column) in the table, showing which row is still selected? (more update statement and holding all rows in the cache, because of deleting the flags after process)....
Which kind of solution would you use?

Thanks in advance
Kiki

herve

Re: General question about OleDb+transaction logic

Post by herve » 01 Oct 2008, 16:25

Hello,

First, how you open your OLEDB connection ?

Here is the way :

Hello,
:

If you open a session you need to free it with SqlFreeSession :

So the code example used for the SQLRouter/Oracle connection would change from
Set SqlDatabase = ‘oradb’
Set SqlUser = ‘sysadm’
Set SqlPassword = ‘sysadm’
Call SqlConnect(hSql)
….
Call SqlDisconnect(hSql)
to
Set SqlDatabase = ‘oradb’
Set SqlUser = ‘sysadm’
Set SqlPassword = ‘sysadm’
Call SqlCreateSession(hSession, "Provider=OraOLEDB.Oracle;")
Call SqlCreateStatement(hSession, hSql)
….
Call SqlFreeSession(hSession)
where hSession is a declared Session Handle variable.


look at the following documentation :
http://www.guptaworldwide.com/Downloads ... 2OLEDB.pdf

OLEDB page 14.


Regards

Herve

srinivas

Re: General question about OleDb+transaction logic

Post by srinivas » 19 Jul 2015, 19:59

If anybody having any sample code please provide
At sreeni646@gmail.com

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests