The mi_lo_filename() function
The mi_lo_filename() function constructs a file name for smart-large-object data based on an LO handle and a file name specification.
Syntax
const char *mi_lo_filename(conn, LO_hdl, fname_spec)
MI_CONNECTION *conn;
MI_LO_HANDLE *LO_hdl;
const char *fname_spec;
- conn
- This value is one of the following connection values:
A pointer to a connection descriptor established by a previous call to mi_open(), mi_server_connect(), or mi_server_reconnect().
A NULL-valued pointer (database server only)
- LO_hdl
- A pointer to a valid LO handle.
- fname_spec
- A specification for the destination file path name. It can include wildcard characters.
Valid in client LIBMI application? | Valid in user-defined routine? |
---|---|
Yes | Yes |
Usage
The mi_lo_filename() function
generates a file name from the fname_spec argument that you
provide. Use the mi_lo_filename() function to determine
the file name that the mi_lo_to_file() function
would create for its fname_spec argument. This function uses
a template to specify the exact format of the result. By default,
the mi_lo_to_file() function generates a file name
of the form:
fname.hex_id
However, you can specify wildcards in the fname_spec argument that can change this default file name. You can use these wildcards in the fname_spec argument of mi_lo_filename() to see what file name these wildcards generate. For more information about the wildcards that are valid in the fname_spec argument, see the description of the mi_lo_to_file() function.
You are responsible for freeing the memory that the return value occupies.
Server only: The mi_lo_filename() function
does not need a connection descriptor to execute. If your UDR does
not need a valid connection for other operations, you can specify
a NULL-valued pointer for the conn parameter to establish a
NULL connection. For information about the advantages of a NULL connection,
see the HCL OneDB™
DataBlade® API Programmer's
Guide.
Return values
- A char pointer
- The character string that is the file name that the mi_lo_to_file() function would generate.
- NULL
- The function was not successful.