Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

SQL script with PHP OK?

2 posts in PHP Last posting was on 2007-11-14 19:45:36.0Z
Chuck Jopson Posted on 2007-11-13 16:02:01.0Z
Date: Tue, 13 Nov 2007 08:02:01 -0800
From: Chuck Jopson <chucknews@growpro-inc.com>
User-Agent: Thunderbird 2.0.0.6 (Windows/20070728)
MIME-Version: 1.0
Newsgroups: advantage.PHP
Subject: SQL script with PHP OK?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.31.88.154
Message-ID: <4739cba0@solutions.advantagedatabase.com>
X-Trace: 13 Nov 2007 09:06:56 -0700, 208.31.88.154
Lines: 23
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!208.31.88.154
Xref: solutions.advantagedatabase.com Advantage.PHP:836
Article PK: 1135320

I am using Advantage PHP extension version 5.2.3.3 with PHP version
5.2.4. Single SQL statements work fine.

When I try to use SQL scripting, I get no errors but the result set is
always empty. The same script outputs OK in Advantage Architect.
I have used stored procedures, but would prefer the convenience of using
script directly in PHP.

Is SQL scripting supported by Advantage PHP?
If scripting is supported, how do I get the output to be seen by PHP?
Is this a consequence of the version mismatch between PHP and Advantage PHP?

An inane example script:
select * from company;
select * from company;

This outputs the contents of company once in Architect, empty result in PHP.

Another example script with temp tables:
select * into #temp from company;
select * from #temp;

This also works fine in Architect but has empty result in PHP.


Alex Wong (ADS) Posted on 2007-11-14 19:45:36.0Z
From: "Alex Wong \(ADS\)" <nobody@sybase.com>
Newsgroups: advantage.PHP
References: <4739cba0@solutions.advantagedatabase.com>
Subject: Re: SQL script with PHP OK?
Date: Wed, 14 Nov 2007 12:45:36 -0700
Lines: 47
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.3138
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 10.24.38.219
Message-ID: <473b4f27@solutions.advantagedatabase.com>
X-Trace: 14 Nov 2007 12:40:23 -0700, 10.24.38.219
Path: solutions.advantagedatabase.com!solutions.advantagedatabase.com!10.24.38.219
Xref: solutions.advantagedatabase.com Advantage.PHP:838
Article PK: 1135322

Hi Chuck,

We did a bit of investigation and found out that scripts do not return
cursor in ODBC which the php driver is based on. The reason is that these
drivers rely on the meta data returned from preparing the statement or
script. Since the result from the script is not known until after executing
the script, these clients were not able to set up the correct cursor
structures. The Data Architect works because it uses ACE which receives the
cursor meta data after executing the script.

I entered this into our bug tracker as a enhancement request. In the mean
time, you will need to execute the last SELECT statement separately or use a
stored procedure.

--
Alex

"Chuck Jopson" <chucknews@growpro-inc.com> wrote in message
news:4739cba0@solutions.advantagedatabase.com...
>I am using Advantage PHP extension version 5.2.3.3 with PHP version 5.2.4.
>Single SQL statements work fine.
>
> When I try to use SQL scripting, I get no errors but the result set is
> always empty. The same script outputs OK in Advantage Architect.
> I have used stored procedures, but would prefer the convenience of using
> script directly in PHP.
>
> Is SQL scripting supported by Advantage PHP?
> If scripting is supported, how do I get the output to be seen by PHP?
> Is this a consequence of the version mismatch between PHP and Advantage
> PHP?
>
> An inane example script:
> select * from company;
> select * from company;
>
> This outputs the contents of company once in Architect, empty result in
> PHP.
>
> Another example script with temp tables:
> select * into #temp from company;
> select * from #temp;
>
> This also works fine in Architect but has empty result in PHP.