2009年1月9日星期五

RE: [fw-db] Multiple SQL queries

Sorry.

At least it works for me on MySQL. My solution can be useful for somebody who needs same functionality on MySQL.

We need somebody with ZF + MSSQL experience.

Regards,
Joseph

-----Original Message-----
From: Jan Olsen [mailto:janpolsen@gmail.com]
Sent: Friday, January 09, 2009 4:55 PM
To: Joseph Chereshnovsky
Subject: Re: [fw-db] Multiple SQL queries

Hi Joseph and thanks for the response.

I had hope that your suggestion would work, but I just get an error about
@bob being an unknown variable:

L:\internet\datadump>php test_multisql.php

Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message
'SQLSTATE[HY000]: General error: 10007 Must declare the variable '@bob'.
[10007] (sev
erity 5) [(null)]' in
L:\Internet\php\includes\ZendFramework-1.7.1\library\Zend\Db\Statement\Pdo.php:238
Stack trace:
#0
L:\Internet\php\includes\ZendFramework-1.7.1\library\Zend\Db\Statement.php(283):
Zend_Db_Statement_Pdo->_execute(Array)
#1
L:\Internet\php\includes\ZendFramework-1.7.1\library\Zend\Db\Adapter\Abstract.php(430):
Zend_Db_Statement->execute(Array)
#2
L:\Internet\php\includes\ZendFramework-1.7.1\library\Zend\Db\Adapter\Pdo\Abstract.php(220):
Zend_Db_Adapter_Abstract->query('SET @bob = 52', Array)
#3 L:\Internet\Datadump\test_multisql.php(6):
Zend_Db_Adapter_Pdo_Abstract->query('SET @bob = 52')
#4 {main}
thrown in
L:\Internet\php\includes\ZendFramework-1.7.1\library\Zend\Db\Statement\Pdo.php
on line 238

Best regards,
Jan

On Fri, Jan 9, 2009 at 15:13, Joseph Chereshnovsky <Joseph007@ukr.net>wrote:

> Hi,
>
> As I understand you can just:
>
> $db->query("DECLARE @bob INT");
> $db->query("SET @bob = 42");
> $db->query("SELECT @bob AS bob");
>
> Regards,
> Joseph
>
>
> -----Original Message-----
> From: janpolsen [mailto:janpolsen@gmail.com]
> Sent: Friday, January 09, 2009 1:27 PM
> To: fw-db@lists.zend.com
> Subject: Re: [fw-db] Multiple SQL queries
>
>
> I am becoming more and more desperate about this matter (along with the
>
> http://www.nabble.com/Res%3A-Parsing-through-large-result-sets-td20264721.ht
> ml<http://www.nabble.com/Res%3A-Parsing-through-large-result-sets-td20264721.html>
> large resultset problem).
>
> I am also very puzzled if I am the only one in need of such a feature?
>
> Can it really be true that I am the only one using Zend Framework,
> connecting to a MSSQL server with PDO and in need of executing multiple
> queries? Or am I just missing something?
>
>
> janpolsen wrote:
> >
> > Is it possible to run multiple SQL queries either at the same time or one
> > after another?
> >
> > Let's say I want to make the following:
> > DECLARE @bob INT;
> > SET @bob = 42;
> > SELECT @bob AS bob;
> >
>
> --
> View this message in context:
> http://www.nabble.com/Multiple-SQL-queries-tp20717372p21370546.html
> Sent from the Zend DB mailing list archive at Nabble.com.
>
>
>
>

没有评论: