Print Thread
Array DML & longs
#534 05/16/00 06:48 AM
Joined: May 2000
Posts: 4
Irvine, CA, U.S.A.
E
Member
OP Offline
Member
E
Joined: May 2000
Posts: 4
Irvine, CA, U.S.A.
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 ;

Re: Array DML & longs
#535 05/18/00 08:04 PM
Joined: Aug 1999
Posts: 22,221
Member
Offline
Member
Joined: Aug 1999
Posts: 22,221
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


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.141s Queries: 13 (0.043s) Memory: 2.5008 MB (Peak: 3.0428 MB) Data Comp: Off Server Time: 2024-05-20 08:32:22 UTC
Valid HTML 5 and Valid CSS