Re: OCESQL and Data Types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Kevin,

What is the problem ?

"unlimited" unfortunately is always limited :-)
ESQL can NOT read the CLOB/BLOB by chunks. You have to allocate the memory for the whole CLOB/BLOB.

i.e. you have
           EXEC SQL BEGIN DECLARE SECTION END-EXEC.
       01  G.
           10 G1.
              49 G-LEN    PIC S9(8) USAGE COMP.
              49 G-TEXT   PIC X(15).
           EXEC SQL END DECLARE SECTION END-EXEC.

And G1 will be recognized as VARCHAR.
When you doing SELECT xxx INTO :G1
you can get SQL error that that data is truncated.
Than you should have the same structure in LINKAGE SECTION and allocate enough memory to hold this CLOB.

Or, you can have initially
              49 G-TEXT   PIC X(15000000).

And not to worry about :-)

Regards,
Sergey


On 2/19/2023 4:13 PM, Kevin Monceaux wrote:
James,

On Sun, Feb 19, 2023 at 08:31:57AM -0500, James K. Lowden wrote:
Can you give me a sense of the kind of information stored in that
column?  If it's what it should be -- an atomic datum -- then it's
misdefined in the database, and the question of how to handle it is a
management problem, not a technical one (because the display will
truncate the data arbitrarily).
I tend to use unlimited character varying fields for text fields that might
contain long-ish strings, though not necessarily ridiculously long strings.

The database I was wanting to try out with OCESQL is one loaded with some
basic title details from the IMDb's title basics data set available at:

     https://datasets.imdbws.com/

The description of the title.basics.tsv.gz file doesn't specify how long any
of the string columns might be, so I defined them as unlimited character
varying columns.  The longest column is the primaryTitle column.  At the
moment, the longest primaryTitle in the data I have loaded is 419
characters.

I would like to set up a GnuCOBOL application to catalog my DVD/Blu-Ray
collection, including details available from the IMDb's datasets, etc.  I
would probably want to add a plot summary column, which might range in size
from a few words to several paragraphs.









[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux