lobdeclaration

NAME
SYNTAX
DESCRIPTION
USAGE
EXAMPLE
COPYRIGHT
SEE ALSO

NAME

lobdeclaration − RWP*Load Simulator declare LOB locator

SYNTAX

lobdeclaration ::=
  [ private ] clob identifier { , identifier }

DESCRIPTION

A clob is declared in the same ways scalars are, and they can be publicly, private or local inside a procedure or function.

USAGE

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.

EXAMPLE

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

Copyright © 2023 Oracle Corporation
Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl

SEE ALSO

simpledeclaration(1rwl), databasestatement(1rwl)