[nycphp-talk] PEAR::DB and Oracle insert error
Chris Hubbard
chubbard at next-online.net
Mon Mar 29 18:34:53 EST 2004
Well, it turns out if you have semi colon at the end of your sql then
you get the ORA-00911 error.
So:
INSERT INTO TABLENAME ("field", "field") VALUES ('one', 'two');
will result in an error, PEAR::DB returns "unknown error".
while:
INSERT INTO TABLENAME ("field", "field") VALUES ('one', 'two')
[note............................................................................................................^]
will work just fine.
Please note that the Oracle error: ORA-00911 doesn't say anything about
semicolons. Which is another reason why Oracle is better than MySQL.
Somebody shoot me now.
Chris
Daniel Convissor wrote:
>Hi Chris:
>
>On Mon, Mar 29, 2004 at 09:28:27AM -0800, Chris Hubbard wrote:
>
>
>
>>[nativecode=ORA-00911: invalid character]
>>
>>
>
> ORA-00911 invalid character
>
> Cause: Special characters are valid only in certain places. If
> special characters other than $, _, and # are used in a name and
> the name is not enclosed in double quotation marks ("), this
> message will be issued. One exception to this rule is for database
> names; in this case, double quotes are stripped out and ignored.
>
> Action: Remove the invalid character from the statement or enclose
> the object name in double quotation marks.
>
>
>Maybe, try getting rid of the quote marks around the field names. I'd
>also advise not using quoted identifiers in general, they cause more
>headaches than they solve.
>
>--Dan
>
>
>
--
Chris Hubbard
Sr Software Developer
Next Online
425 563 4153
More information about the talk
mailing list