Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: PHP -> ODBC -> ORACLE help needed!

Re: PHP -> ODBC -> ORACLE help needed!

From: Sergey Khochay <skhochay_at_pacbell.net>
Date: 2000/04/09
Message-ID: <WpWH4.809$Sz2.372209@news.pacbell.net>#1/1

try to do in the single quots

SELECT MAX(NVL(id,0) as ID FROM TABLE;

SErgey
<jean-pierre.parent_at_bpe.net> wrote in message news:8cl6ps$3su$1_at_nnrp1.deja.com...
> Hi, I'm trying to get the next id to insert using
> a select statement. I'm not using sequences since
> the goal is to make the application working on
> many databases.
>
> When I use SQL*Plus it works...
> SELECT MAX(id)+1 FROM entitites;
>
> Altough when I use the same call using PHP
> through ODBC it doesn't work.
>
> PHP returns an access violation. It looks like
> the handle that ODBC returns is not null but not
> valid. Here's the error:
>
> PHP has encountered an Access Violation at
> 04C2EA86
>
> And it generates an HTTP 500 - Internal Error.
>
> Any ideas?
>
> When I remove the MAX(id) and just select the id instead it works...
> Is there any know issues regarding MAX() function when using ODBC?
>
> Please I don't want to use MS SQL Server!
>
> Configuration:
> Oracle 8i Release 2 with its ODBC drivers and
> PHP 4.0 RC1 and IIS 4.0.
>
> Entities table looks like this:
> ID number(5,0) NAME varchar2(40) TAG char(6)
> -------------- ------------------ -----------
> 0 EntityName ENT001
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Received on Sun Apr 09 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US