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

temporary table "disapears"

Thread Next
From:
Andon Tschauschev
Date:
May 9, 2007 08:31
Subject:
temporary table "disapears"
Message ID:
676144.32004.qm@web33215.mail.mud.yahoo.com
Hello,

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->execute();
$sth = $dbh->prepare('insert into #foo values (1)');
$sth->execute();

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));
 $sth->execute();
 
at once...

How can I avoid this problem? 

Regards!

Andon

 
---------------------------------
Sucker-punch spam with award-winning protection.
 Try the free Yahoo! Mail Beta.

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About