RE: Oracle ODBC sql [ORA-00972: identifier is too long]
| From: | Greig, Euan | Date: | Thu, 22 Mar 2001 14:20:58 +0000 |
| Subject: | RE: Oracle ODBC sql [ORA-00972: identifier is too long] | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-45119@lists.php.net to get a copy of this message | ||
I haven't used Oracle with ODBC, but nothing leaps out at me from your code. Some
comments/ideas:
The full meaning of error 0972 is that the name of a schema object (table, view, username etc) is
too long (longer than 30 characters, maybe more for Oracle 8). The query statement you are using
looks OK. How about displaying $username and $password? And have you isolated which line is causing
the error?
The relevance of ' and " I suppose is this. By default Oracle is not case sensitive about
the names of database objects, but it is if when you create them you enclose the name in double
quotes. For instance if you simply say 'create table euan', then you will be able to
access it with 'select * from euan', 'select * from EUAN', 'select * from
Euan' etc. But if you say 'create table "euan"', then you will forever have
to say 'select * from "euan"'.
Problems can indeed arise when interfacing between Access and Oracle, because I believe that Access
is case sensitive by default, and Oracle programmers tend not to expect this. But none of this seems
very applicable to your case... or is it?
-----Original Message-----
From: Brooks, Ken [mailto:KBrooks@netEPS.com]
Sent: 22 March 2001 14:04
To: 'Greig, Euan'; php-general@lists.php.net
Subject: Oracle ODBC sql [ORA-00972: identifier is too long]
I'm getting this message when i try to run a query on an Oracle database
thru ODBC.
I can connect to the database just fine.
here is the code i'm trying to use.
$td_oracle = odbc_connect($dsn, $username, $password) OR DIE("Unable to
connect to oracle aradmin database");
$si_oracle_query = "SELECT * FROM SERVICE_INSTRUCTIONS";
$si_oracle_result = odbc_exec($td_oracle, $si_oracle_query);
the result i get is:
Warning: SQL error: [Oracle][ODBC Oracle Driver][Oracle OCI]ORA-00972:
identifier is too long., SQL state 37000 in SQLExecDirect in c:\program
files\apache group\apache\htdocs\odbc_test.php3 on line 34
i'm connecting to an MSAccess database thru odbc just fine and sending a
similar query, it works just fine.
do i need to do something different because it is an oracle database?
(I read somewhere that oracle uses ' and/or " for Identifiers) Is that on
the right track?
thanks!
-ken
**************************************************************************
Any opinions expressed in this email are those of the individual and
not necessarily the Company. This email and any files transmitted with
it, including replies and forwarded copies (which may contain alterations)
subsequently transmitted from the Company, are confidential and solely for
the use of the intended recipient. If you are not the intended recipient
or the person responsible for delivering to the intended recipient, be
advised that you have received this email in error and that any use is
strictly prohibited.
**************************************************************************