Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Problem with PB and SELECT
We have a powerbuilder application (version 5.04, using
the native driver, sqlnet 2.3.3) which runs the following
SELECT statement in our development environment
(Oracle 7.3.3.4.0 on AIX, sqlnet 2.3.3.4.0)
SELECT "CCCLIENTDOCS"."DOCTYPECD",
"CCCLIENTDOCS"."DOCDT",
"CCCLIENTINFO"."PHIN",
"CCCLIENTINFO"."GIVENNAME",
"CCCLIENTINFO"."SURNAME",
"CCCLIENTINFO"."CHECKEDOUTIND",
"CCCLIENTDOCS"."EXISTSONORACLE",
to_char( "CCCLIENTINFO"."PHIN" ) strphin, to_char( "CCCLIENTINFO"."MHSCREGNO" ) FROM "CCCLIENTDOCS",
"CCSYSDOCTYPE",
"CCCLIENTINFO"
WHERE ( "CCCLIENTDOCS"."DOCTYPECD" = "CCSYSDOCTYPE"."DOCTYPECD" ) and ( "CCCLIENTDOCS"."PHIN" = "CCCLIENTINFO"."PHIN" ) and ( ( to_char("CCCLIENTDOCS"."PHIN") = :strphin ) )
:strphin is defined as string in the application.
However, when the same statement is run on identical data on production (Oracle 7.3.2.2.1 on Novell 4.11, sqlnet 2.3.2.2.0) the application receives an error
A database error has occurred.
Database error code: 602
Database error message:
Select error: ORA-00602 internal programming exception
We have found a solution to the problem by changing the WHERE clause to
WHERE ( "CCCLIENTDOCS"."DOCTYPECD" = "CCSYSDOCTYPE"."DOCTYPECD" ) and
( "CCCLIENTDOCS"."PHIN" = "CCCLIENTINFO"."PHIN" ) and ( ( "CCCLIENTDOCS"."PHIN" = :strphin ) )
(removed the 'to_char' on the third line)
I know that the newer versions of sqlnet will typecast CHAR variable into NUMBER (and vice versa) if appropriate for comparisons (without having to use the 'to_char' or 'to_number' conversions functions). Is it possible that sqlnet 2.3.3 or the powerbuilder native driver does not support this function?
Both environments have the same table definitions ...
CCCLIENTDOCS
Name Null? Type ------------------------------- -------- ---- PHIN NOT NULL NUMBER(9) DOCTYPECD NOT NULL CHAR(2) DOCDT NOT NULL DATE ACTIVECD NOT NULL CHAR(2)
-Keith Received on Thu Feb 11 1999 - 08:13:32 CST