#include <sqludf.h> extern int SQL_API_FN sqludf_free_locator( udf_locator * udfloc_p)Service Program Name: QSYS/QSQAPIS
The sqludf_free_locator() function frees a LOB locator.
No authorization is required.
returns an integer. Possible values are:
Message ID | Error Message Text |
---|---|
SQL7034 D | LOB locators are not allowed with COMMIT(*NONE). |
SQL0901 D | SQL system error. |
SQL0952 D | Processing of the SQL statement ended. |
CPF9872 E | Program or service program &1 in library &2 ended. Reason code &3. |
This example creates a CLOB locator and then frees the locator. The operations performed with the locator are left to the user to add.
Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.
#include <stdlib.h> #include <string.h> #include <stdio.h> #include <sql.h> #include <sqludf.h> int main(int argc, char* argv[]) { int rc; /* return code variable for API calls */ udf_locator * udfloc_p; /* pointer to locator */ udf_locator locator; /* locator value */ udfloc_p = &locator; /* set address to locator */ /* Create the locator */ rc = sqludf_create_locator(SQL_TYP_CLOB, &udfloc_p); if (rc) { /* If create locator returned an error then return now */ goto exit; } /* Perform operations using the locator */ /* Free the locator */ rc = sqludf_free_locator(udfloc_p); if (rc) { /* If free locator returned an error then return now */ goto exit; } exit: /* used for errors, which will override null-ness of output. */ return rc; }
Referring to this code, observe that:
SQL_TYP_CLOB
used in the sqludf_create_locator()
call is
defined, and sqludf.h
, where the type udf_locator
is defined.This is an example of using the sqludf_free_locator API to free a locator.