Re: Changing the format of returned values from a stored procedure
Posted in 1997
Robert
I believe that this should do the trick for you:
CREATE PROCEDURE concat() RETURNING CHAR(50);DEFINE expr1 CHAR(20); -- or whatever
DEFINE expr2 CHAR(20); -- or whatever
DEFINE expr3 CHAR(20); -- or whatever
DEFINE exprf CHAR(50); -- or whatever
LET expr1 = "Smith";
LET expr2 = "John";
LET expr3 = "123 Main Street";
LET exprf = TRIM(expr1) || "|" || TRIM(expr2) || "|" || TRIM(expr3) || "|";
RETURN exprf;
END PROCEDURE;
This can be done using the || operator in the SQL itself, but you asked for
a non-SQL solution, so I assume that the expressions come from different
tables that cant be joined.
HTH
Sujit Pal
}
}
} I am presently running Online 7.22 on DEC UNIX 4.0. I am interested in any
} suggestions that can
} efficiently change the following results from a stored procedure (SQL is not
} an option):
}
}
} (expression) Smith
} (expression) John
} (expression) 123 Main Street
}
} to:
}
} Smith|John|123 Main Street.
}
} Thanks in advance for your help.
}
} robert_wines@emsinfo.com
}
} Robert
}