lobdeclaration − RWP*Load Simulator declare LOB locator
lobdeclaration ::= [ private ] clob identifier { , identifier }
A clob is declared in the same ways scalars are, and they can be publicly, private or local inside a procedure or function.
A clob is effectively like an OCILobLocator in Oracle Call Interface, and it must therefore be used like you would use them in a C program. Among other things, this means you must select the lob from a table before it can be used with the readlob or writelob statements.
Rwloadsim currently operates on complete lobs only and all data in the lob will be read or written at once; there is no support for piece wise reading or writing. This sets a practical limit to the size as all data need to be allocated in memory. Effectively, sizes up to megabytes can surely be handled while sizes in the order or gigabytes for all practical purposes cannot. The actual limit will depend on the available memory.
The following code snippet shows how you can use a clob to insert lob data into a table.
string (1000000) mydata; clob mylob; integer myid; sql insnewlob begin -- first create the new row with an empty clob insert into mytable(id,cl) values (mysequence.nextval, empty_clob()) returning id into :1; -- then select the lob locator select cl into :2 from mytable where id = :1; end; / bindout 1 myid, 2 mylob; end; mydata := ... # Assign some text to this string insnewlob; # Execute the PL/SQL block writelob mylob, mydata; # Write the data commit;
Copyright
© 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as
shown at https://oss.oracle.com/licenses/upl
simpledeclaration(1rwl), databasestatement(1rwl)