Home » Developer & Programmer » Forms » forms plsql (Oracle Database 11g Oracle developer forms 11g)
forms plsql [message #683250] Fri, 18 December 2020 14:42 Go to next message
akarra21
Messages: 6
Registered: December 2020
Junior Member
Hi I have a requirement to return a single string from multiple rows in one single row with comma separated plsql function in oracle forms 11g like

v_result_string

101,102,103,104,105,107,108,109



eg TABLE.

CREATE TABLE VAR_TEST

(VAR_IND VARCHAR(200 BYTE))

SET DEFINE OFF;

Insert into VAR_TEST (VAR_IND) values ('101,102');

Insert into VAR_TEST (VAR_IND) values ('103,104,105');

Insert into VAR_TEST (VAR_IND) values ('106,107,108,109');



i wrote a function in oracle forms 11g using listagg but i received an error.I am not sure if we can use listagg function in oracle forms 11g.but i got an error in oracle forms program units when trying to compile the below function.

CREATE OR REPLACE FUNCTION lstagg_test RETURN VARCHAR2 IS

p_var_ind VARCHAR2(2000);

BEGIN

SELECT

LISTAGG(var_ind, ',') WITHIN GROUP(ORDER BY var_ind) AS var_ind

INTO p_var_ind

FROM var_test;



RETURN p_var_ind;

END;



Error when compiled in oracle forms 11g



error 103 at line 5 column 38 encountered the symbol group when expecting one of the following from into bulk



can you please advise any work around for the above requirement.

thanks very much
Re: forms plsql [message #683259 is a reply to message #683250] Sat, 19 December 2020 14:14 Go to previous message
Littlefoot
Messages: 21678
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
The function itself is OK. It's just that you don't use CREATE OR REPLACE within Forms.
Previous Topic: sms
Next Topic: connect error in oracle forms 6i
Goto Forum:
  


Current Time: Wed Jun 23 17:21:38 CDT 2021