Problem using ProC for BLObs (long raw)

From: Seth Grimes <grimes_at_access.digex.net>
Date: 24 May 1993 10:09:44 -0400
Message-ID: <grimes.738252228_at_access>


I have been trying to write a double array into a BLOb (LONG RAW) from a ProC program and then read the data in another ProC program, so far unsuccessfully. Maybe someone can tell me what I'm doing wrong. (Actually, I'd rather not specify a length on the LONG RAW field; can I not do this, maybe by specifying the typedef as a pointer, malloc()ing to get the array storage, etc.?) Is there a better way to store a numeric array than this (besides one element per row, which wastes too much space with bad performance).

Thanks,

                                Seth, grimes_at_oecd.fr                                 


                                

Code fragments where I try to write a double array into a BLOb:

typedef double xdouble[1000];
EXEC SQL BEGIN DECLARE SECTION;
  EXEC SQL TYPE xdouble IS LONG RAW (8000);   xdouble x;
EXEC SQL END DECLARE SECTION;
/* Stuff deleted */

    EXEC SQL INSERT INTO tstable

      (identifier, title, units, factor, frequency, startd, type, 
       series_metadata, data )
     VALUES (

:identifier, :title, :units, :factor, :frequency, :startd, :type,
:series_metadata, :x );

Code fragments where I try to read the double array from the BLOb:

typedef double xdouble[1000];
EXEC SQL BEGIN DECLARE SECTION;
  EXEC SQL TYPE xdouble IS LONG RAW (8000);   xdouble x;
EXEC SQL END DECLARE SECTION;
/* Stuff deleted */

    EXEC SQL SELECT

       identifier, title, units, factor, frequency, startd, type, 
       series_metadata, data
     INTO

:identifier, :title, :units, :factor, :frequency, :startd, :type,
:series_metadata, :x
FROM tstable WHERE identifier = :ident; printf("\nIdentifier: %s\nx[0], x[1], x[999]:\n", identifier,x[0],x[1],x[999]);

SQL script where I create the table:

CREATE TABLE tstable (

	identifier VARCHAR2(20),
	title VARCHAR2(255), 
	units CHAR(4),
	factor FLOAT,
	frequency CHAR(4),
	startd CHAR(9),
	type CHAR(4),
	series_metadata VARCHAR(20),
	data LONG RAW );
Received on Mon May 24 1993 - 16:09:44 CEST

Original text of this message