Array DML & longs

I'm having trouble getting arrays to insert properly-standard fields work OK, but a long field gives wierd stuff.

I think I'm doing everything properly...
Let me know.
TIA, Eric Allen

Here's an example of what I'm doing:
const
nArraySize = 100 ;
var
asText : variant ;
oqryScript : tOracleQuery ;
j : integer ;
begin
oqryScript := tOracleQuery.Create ( Application ) ;
with oqryScript do
begin
session := OracleSession ( 0 ) ;
asText := VarArrayCreate ( [0 , nArraySize] , varVariant ) ;
DeclareVariable ( 'asText' , otLong ) ;
SQL.Add ( 'insert into zzz_SCRIPT_statement ' +
'(SCRIPT_STATEMENT) ' ) ;
SQL.Add ( 'values(:asText)' ) ;
for j := 1 to 10 do asText [j] := 'a test-this can be a huge SQL statement' ;
VarArrayRedim ( asText , j ) ;
SetVariable ( 'asText' , asText ) ;
execute ;
SQL.clear ;
SQL.add ( 'commit' ) ;
execute ;
free ;
end ;
end ;
 
The Array DML feature only works for data types that have a defined maximum size. For a Long variable this is unknown (well, 2GB actually, but that's not really a limit). Therefore you cannot use Long and Long Raw variables for Array DML. You can either use single inserts, or use string variables, in which case you are limited to 2000 (Oracle7) or 4000 (Oracle8) bytes.

------------------
Marco Kalter
Allround Automations
 
Back
Top