background image
<< Loading a DLL—Locally | Loading a DLL—Globally >>
<< Loading a DLL—Locally | Loading a DLL—Globally >>

DLL using the standard sequence

Calling External Functions
Creating Vuser Scripts
465
In the following example, the
insert_vals
function, defined in
orac1.dll
, is called,
after the creation of the Test_1 table.
Note: You can specify a full path for the DLL. If you do not specify a path,
lr_load_library searches for the DLL using the standard sequence used by the
C++ function, LoadLibrary on Windows platforms. On UNIX platforms you can set
the LD_LIBRARY_PATH environment variable (or the platform equivalent). The
lr_load_dll function uses the same search rules as
dlopen
. For more information,
see the man pages for
dlopen
or its equivalent.
int LR_FUNC Actions(LR_PARAM p)
{
lr_load_dll("
orac1
.dll");
lrd_stmt(Csr1, "create table Test_1 (name char(15), id integer)\n", -1,
1 /*Deferred*/, 1 /*Dflt Ora Ver*/, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
/* Call the insert_vals function to insert values into the table. */
insert_vals();
lrd_stmt(Csr1, "select * from Test_1\n", -1, 1 /*Deferred*/, 1 /*Dflt Ora Ver*/,
0);
lrd_bind_col(Csr1, 1, &NAME_D11, 0, 0);
lrd_bind_col(Csr1, 2, &ID_D12, 0, 0);
lrd_exec(Csr1, 0, 0, 0, 0, 0);
lrd_fetch(Csr1, -4, 15, 0, PrintRow14, 0);
. . .