develooper Front page | perl.dbi.users | Postings from May 2007

temporary table "disapears"

Thread Next
Andon Tschauschev
May 9, 2007 08:31
temporary table "disapears"
Message ID:

I am using DBI 1.51 and DBD::ODBC 1.13, connecting to MSSQL2005.

Executing following statements:
$sth = $dbh->prepare('create table #foo  (a int not null)');
$sth = $dbh->prepare('insert into #foo values (1)');

generate an error:
[Microsoft][ODBC SQL Server Driver][SQL Server]Invalid object name '#foo'.

So, the temporary table "disapears".... (I tested it on Sybase, using DBD::Sybase, too, there is no an error). Since the two statements are dynamically created (between come other statements), I cannot execute in one batch
$sth = $dbh->prepare('create table #foo  (a int not null)
insert into #foo values (1));
at once...

How can I avoid this problem? 



Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.
Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About