cancel
Showing results for 
Search instead for 
Did you mean: 

ODBC and temporary tables no rows returned

Former Member
0 Kudos

Issue with global temporary tables and ODBC.

I created global temporary table and inserted couple records.

select * from table does not return any results.

I tried couple commercial products whic use ODBC and they do not return results either.

Sybase IQ Interactive SQL does return inserted rows.

What has to be set for ODBC in order for this to work?

Accepted Solutions (0)

Answers (1)

Answers (1)

tom_kim
Employee
Employee
0 Kudos


when you ran the DDL to define the global temp, did you add the clause 'on commit preserve rows'?

Former Member
0 Kudos

I did not, but it does work in Interactive SQL without preserve rows clause

Former Member
0 Kudos

Ok. If I add preserve rows than it works. Still puzzled why it works in Interactive SQL when preserve rows not present, but does not work in my case.

tom_kim
Employee
Employee
0 Kudos

it works because you probably did not issue a 'commit' in your session. if you issued a commit, you would get the same result (no data) as your ODBC connection. You probably have your ODBC configuration as 'autocommit'.

Former Member
0 Kudos

You are correct. Defafult ODBC mode is autocommit on.

After changing to autocommit off everything works as expected.

Thank you very much for your help