Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » MSSQL strange problem and ugly workaround patch...
MSSQL strange problem and ugly workaround patch... [message #19292] Mon, 24 November 2008 18:47 Go to previous message
mirek is currently offline  mirek
Messages: 13976
Registered: November 2005
Ultimate Member
I have found a very strange problem with MSSQL:

When fetching @@IDENTITY column while inside doing inserts inside select/fetch loop, I am getting Nulls until the last portion of data passed from MSSQL and client (in Prefetch routine).

Something like:

Sql sql;
sql * Select(...).From(...);
while(sql.Fetch()) {
    SQL * Insert(...) // table has INDENT columne
    DUMP(SQL % Select("@@IDENTITY"));
}


Really weird. I have not authored OleDB and I am a little bit lost in all those Ole interfaces, but I see nothing particulary wrong there anyway. Other selects work just as expected, just this one if wrong.

I have found a working workaround using IDENT_CURRENT('tablename'). Of course, it requires the name of table to be stored, so we have to look into statement executed if it is insert and what is after 'into'. Anyway, seems to fix the issue....

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: PostgreSQL string insert fix [with patch]
Next Topic: SqlArray/SqlCtrl/Select problem
Goto Forum:
  


Current Time: Thu May 09 11:39:17 CEST 2024

Total time taken to generate the page: 0.02453 seconds