Pro*C, '\0' and LONG columns

From: John Ratcliffe <jgr_at_cix.compulink.co.uk>
Date: Wed, 19 May 1999 11:46:01 GMT
Message-ID: <FBzA0p.3p6_at_cix.compulink.co.uk>



[Quoted] I would like to have a Pro*C routine that inserts and fetches text in and out of a LONG column. The text can be longer than the 32k limit on PL/SQL. In order to interface with other external systems the requirements are that this text must contain embedded ASCII null characters ('\0' in C).

Does anyone know of a way of using Pro*C to do this?

John Ratcliffe

jgr_at_cix.compulink.co.uk

BACKGROUND: Pro*C generates code that uses the C str* functions like strlen(), which doesn't help.

[Quoted] Pro*C data types are built around the idea of C style strings, so any data type I tried did not help. I have tried VARCHARS, STRINGS, CHARZ but all [Quoted] expect/use C style strings. Insertion meant that the string was inserted up to the first null character then space filled up to the specified length.

I have tried altering the CHAR_MAP and DBMS pre compiler settings.

I tried coercing data types for example, VARCHAR -> VARCHAR2, but that didn't help. It needs more code, and I found that I was getting some strange side effects, and life is too short.

I know PL/SQL can do this, so it is not an Oracle restriction. However, I can't use PL/SQL because I want to handle strings > 32k. Received on Wed May 19 1999 - 13:46:01 CEST

Original text of this message