Home » RDBMS Server » Server Administration » ORA-01722
ORA-01722 [message #374154] Mon, 28 May 2001 14:58 Go to next message
Stephen
Messages: 26
Registered: January 2000
Junior Member
A strange problem...
We run Fortran-programs on an Alpha-server connected to an Oracle DB (Oracle8).

I want to execute a query in the program (Embedded SQL) but I always get the error: ORA-01722

In the query I've put the CONCAT-function in the WHERE-clause. Trying this query in sql*plus and pl/sql didn't give any errors, so I think it should be executable. Maybe there is something wrong with the precompiler that generates Fortran or isn't it possible to use such a function in Embedded SQL?

The query is:
SELECT Field1, Field2
INTO :F1, :F2
FROM Table1
WHERE CONCAT(Field1,Field2) >= '3B01'
AND CONCAT(Field1,Field2) <= '3E05';

All the fields are alphanumeric

Anybody a solution?
Re: ORA-01722 [message #374162 is a reply to message #374154] Tue, 29 May 2001 01:49 Go to previous message
Sarada
Messages: 27
Registered: April 2001
Junior Member
Try using the actual concatenation operator "||" and rewrite your query.

I don't know the exact reason why it is failing, just my 2 cents.

From Oracle doc:

On most platforms, the concatenation operator is two solid vertical bars, as shown in Table 3-3. However, some IBM platforms use broken vertical bars for this operator. When moving SQL script files between systems having different character sets, such as between ASCII and EBCDIC, vertical bars might not be translated into the vertical bar required by the target Oracle environment. Oracle provides the CONCAT character function as an alternative to the vertical bar operator for cases when it is difficult or impossible to control translation performed by operating system or network utilities. Use this function in applications that will be moved between environments with differing character sets.

Orashark
Previous Topic: View
Next Topic: noprint
Goto Forum:
  


Current Time: Wed Jul 03 17:52:22 CDT 2024