Re: newbie ProC insertion question
Date: 5 Feb 1995 22:07:58 GMT
Message-ID: <3h3i7u$4hn_at_dcsun4.us.oracle.com>
dsticc_at_access.digex.net (DSTI Crystal City Office) writes:
>Hello Oracle Gurus,
>I've been trying to get a page of ascii into an oracle table for a couple
>of days with no success. The field in the table is a "long", and I'm
>using a varchar[12800] pseudotype as a host variable. My declaration reads:
>
[chomp]
>
>This runs without sqlerrors, but inserts only 80 characters of the host
>variable. Any insight on this problem will be greatly appreciated.
>
>thanks for your time,
>
>Vince Calcaterra
>DSTI Crystal City VA.
>
Are you using SQL*Plus to check the length? If so make sure that you issued a "set long 15000" (or some other big size) in sql*plus. SQL*Plus will silently truncate longs for display purposes. Issue a "show long" command to see what sql*plus is truncating it at.
Another option would be to read the data out in a pro*c program and print out the length field. For example in your sample program code the following after comitting work for the insert:
exec sql declare c1 cursor for select sow_text from statement_of_work; exec sql whenever not found do break;
exec sql open c1;
while( 1 ) { exec sql fetch c1 into :sow_text; printf( "length = %d, string = '%*.*s'\n", sow_text.len, sow_text.len, sow_text.len, sow_text.arr); }
exec sql close c1; Received on Sun Feb 05 1995 - 23:07:58 CET