Hi,
I'm having some trouble and was hoping that someone might be able to
enlighten me a tad.
I'm using DBD::Sybase and trying to perform a transaction, which is
behaving rather weirdly.
My transaction is of the form:
* $dbh->{AutoCommit}=0
* $dbh->do('declare @foo int')
* $dbh->do(".. insert a tupple some place.. ")
* $dbh->do('select @foo=(select @@identity)')
* $dbh->do('insert into bar(f1,..,fi) values (v1,..,(select @foo), ..,vi)')
* more inserts like this with the same reference to @foo
* $dbh->commit if all_eval_ok
Now what winds me up is that it'll happily declare @foo, however from that
point on all else seems to fall into trouble.
It will declare fine, however when I hit the first reference to @foo (ie.
in the 'select @foo=(select @@identity)') it starts to spew errors telling
me that I need to declare @foo before I can procede. This error is
reproduced for each of the subsequent inserts.
I'd be hugely greatful for any help?
Cheers,
Raf