databasestatement

NAME
SYNTAX
DESCRIPTION
NOTES
BUGS
COPYRIGHT
SEE ALSO

NAME

databasestatement − RWP*Load Simulator execute database calls

SYNTAX

databasestatement ::=
  commit
| rollback
| ociping
| modify database release
| modify database leak
| modify database connectionclass concatenation
| modify database identifier sessionpool expression [.. expression]
| modify database identifier cursorcache expression
| writelob identifier , concatenation [, expression]
| readlob identifier , identifier [, expression ,  expression]

DESCRIPTION

These statements are used to perform an operation other than actual sql execution against a database. The statements cannot have an at clause and refer to the current database, except those explicitly naming a database.

The following statements exist:

commit

Flush arrays used for DML and commit the database transaction. Note that commit (or rollback) must be done in the same session that has executed the DML. In particular for the main program, this means that you must wrap any DML and the associated commit (or rollback) with an execute block as otherwise the DML and the commit (or rollback) will be using different sessions. This is the case even if the default database is declared dedicated.

rollback

Cancel any arrays used for DML and rollback the database transaction.

ociping

Perform the OCIPing() call.

modify database release

During the next release of a session back to a session pool, which will take when a procedure finishes, the session will also be disconnected from the database.

modify database leak

During the next release of a session back to a session pool, which normally takes place when a procedure finishes, the session will not actually be returned to the pool. This can lead to all sessions being blocked and unavailable when the session pool reaches its maximum size, causing all processing to stop. The statement is silently ignored if it is called at any other place than inside a procedure that has a session from a session pool database.

modify database connectionclass s

Change the connectionclass for a database using sessionpool or drcp; this can only be done before the implicit OCISessionGet has been executed. As an example, if you have a procedure that executes some sql that you call from a controlloop that is started by a thread, the change of the connection class can be done in the controlloop, but not in the procedure as a session will already have been acquired.

modify database d sessionpool e
modify database d sessionpool l .. h

Change the size of a session pool. In the former case, both the min and max size of the pool will be set to the same new value; in the latter case, the min and max values will be set to respectively the expression before and after .. . If the new max value is lower than the current number of sessions in use, sessions will not disconnect from the database until they are released to the pool.

modify database d cursorcache e

Change the cursor (statement) cache size for the named database to some new value. If the database is a session pool, the new value will only be used by new sessions created in the pool; existing sessions will not have their value changed.

writelob l, v

The variable l must be of type clob on which OCILobWrite2() and OCILobTrim2() will be executed effectively writing the string contents of the value v to the start (offset 1) of the database CLOB.

writelob l, v, o

Perform the OCILobWrite2() and OCILobTrim2() operation starting at the sepcified offset.

readlob l, s

The variable l must be of type clob and s of type string; an OCILobRead2() call will be performed reading the value of the database CLOB into the string variable.

readlob l, s, b, o

The variable l must be of type clob, s of type string, and b and o are expression setting the amount of bytes and an offset. On OCILobRead2 call will be performed reading b bytes of the database CLOB into the string variable from offset o. Note that the offset 1 means from the beginning of the CLOB.

NOTES

If you have a default database that is declared anything but dedicated, you need to wrap database calls directly in your main program (such as a DML and the associated commit) with execute and end to make them be part of the same database transaction.

There is not support for two phase commit.

BUGS

There is currently no support for piece wise reading and writing of CLOB data.

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

sqlstatement(1rwl), statement(1rwl), lobdeclaration(1rwl), controlloop(1rwl), executionblock(1rwl)