"how to convert columns data in comma separated list" Code Answer

3

i ended up creating following function by connecting to data dictionary but i got the error.

create function getreport_meds
   ( 
   pid varchar(15)
   )
   returns string
begin
declare meds string;
declare curmeds cursor as select  med_code from medication where patient = 
trim(pid) and end_date is null;
meds = "";
open curmeds;
while fetch curmeds do
meds = trim(meds)+trim(curmeds.med_code)+",";
end while;
close curmeds;
return left(meds,len(meds)-1);
end;
 poquery: error 7200:  aqe error:  state = hy000;   nativeerror = 5054;
  [ianywhere solutions][advantage sql][asa] error 5054:  the command cannot
 be completed with the current user permissions.  cannot 
create function object in the data dictionary.

i have requested the company who created this db/app to add this function in the db so i can use it, lets see where i land.

By Igor Tyulkanov on January 19 2022

Answers related to “how to convert columns data in comma separated list”

Only authorized users can answer the Search term. Please sign in first, or register a free account.