Ask Your Question
2

In an Oracle concurrent program parameter, how can multiple comma-separated names be sent as parameters, in the format of first name and last name separated by a comma?

asked 2022-04-18 11:00:00 +0000

plato gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-11-04 07:00:00 +0000

ladyg gravatar image

One way to send multiple comma-separated names as parameters in Oracle concurrent program is by using a delimited string value.

For example, in the program parameter definition, set the parameter type as Character and specify the Delimited type as Comma-separated. Then, in the value field, enter the comma-separated list of names with the format of first name and last name separated by a comma.

When the concurrent program is run, the program code can retrieve the parameter value as a string and parse it using the comma as a delimiter to get individual names. The following is an example code snippet to extract names from the delimited string:

DECLARE vnames VARCHAR2(4000) := :PNAMES; vnamearray apexapplicationglobal.vcarr2; BEGIN -- convert delimited string to array vnamearray := apexutil.stringtotable(v_names, ',');

-- loop through each name and extract first and last names FOR i IN 1..vnamearray.count LOOP vfirstname := substr(vnamearray(i), 1, instr(vnamearray(i), ',')-1); vlastname := substr(vnamearray(i), instr(vnamearray(i), ',')+1);

-- do further processing with the extracted names
...

END LOOP; END;

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2022-04-18 11:00:00 +0000

Seen: 7 times

Last updated: Nov 04 '22