I am using a barcode scanner to scan in barcodes (that consist of the order^location – I use the ^ as a separator) which i then need to separate and put the two values into two text fields. The idea is to scan the barcode into a third text field and then its separated using a process after save is pressed – These are then saved into separate table columns. I have the below which separates the text but I am now trying to get the values held in the array into the text fields on the APEX form.
I have the below code which works in SQL developer with the following lines however when i changed them to try put the value into a text field it fails. I wondered whether i have it correct or maybe incorrect syntax?
dbms_output.put_line(v_array(1)); -- This works in SQL Developer
:P1_ORDER := dbms_output.put_line(v_array(1)); -- Fails in SQL Developer & APEX
I get the following when i attempt to run the below in SQL developer. Please can someone help me pass the values in my array to the text fields on my APEX Form. Thanks.
ORA-06550: line 17, column 13:
PLS-00222: no function with name ‘PUT_LINE’ exists in this scope
ORA-06550: line 17, column 5:
PL/SQL: Statement ignored
declare
v_array apex_application_global.vc_arr2;
P1_ORDER number;
P1_LOCATION number;
begin
-- Convert delimited string to array
v_array := apex_util.string_to_table(:P1_JOB_NUMBER,'^');
--dbms_output.put_line(v_array(1));
--dbms_output.put_line(v_array(2));
:P1_ORDER := dbms_output.put_line(v_array(1));
:P1_LOCATION := dbms_output.put_line(v_array(2));
end;
See put_line is not a function ,its a procedure in dbms_output package .
You can’t assign dbms_output.put_line to any variable .
Try this