29.22 GET_VALUE_AS_VARCHAR2 Function
This function can be used if you use GET_DATA2
to read the column values along with their original data types. It will convert and return the passed in p_value
as VARCHAR2
.
Syntax
function get_value_as_varchar2 (
p_data_type IN VARCHAR2,
p_value IN T_VALUE,
p_format_mask IN VARCHAR2 DEFAULT NULL )
RETURN VARCHAR2;
Parameters
Table 29-31 GET_VALUE_AS_VARCHAR2 Function Parameters
Parameter | Description |
---|---|
|
The data type of the value stored in |
|
The value of type |
|
The format mask used to convert the value into a |
Example
The following example emits all values stored in the data type aware l_column_value_list
array as VARCHAR2
.
declare
l_column_value_list apex_plugin_util.t_column_value_list2;
begin
-- Populate l_column_value_list by calling apex_plugin_util.get_data2
...
-- Emit returned data
sys.htp.p( '<table>' );
for l_row in 1 .. l_column_value_list( 1 ).value_list.count
loop
sys.htp.p( '<tr>' );
for l_column in 1 .. l_column_value_list.count loop
sys.htp.p (
'<td>' ||
apex_plugin_util.get_value_as_varchar2 (
p_data_type => l_column_value_list( l_column ).data_type,
p_value => l_column_value_list( l_column ).value_list( l_row )
) ||
'</td>' );
end loop;
sys.htp.p( '</tr>' );
end loop;
sys.htp.p( '</table>' );
end;
Parent topic: APEX_PLUGIN_UTIL