1

I want to call oracle function

select field2, 
        listagg(field, ', ') within group (order by field1) as smpl_func
from table
group by field2

with another name and the substituted parameters, how in this example:

select field2,
       smpl_func(field1)
from table
group by field2 

maybe synonym or call from function?

ExcepOra
  • 117
  • 9
  • I don't know how to do that, but if you don't like listagg you can use wm_concat. It fits your example and works in Oracle 10g – Multisync Nov 09 '14 at 18:21
  • Calling a same function with different name? don't think Oracle or any RDBMS provide function overloading feature. – Rahul Nov 09 '14 at 18:22
  • 1
    LISTAGG is a builtin SQL aggregate function - you can't overload it. Why would you want to? – Jeffrey Kemp Nov 10 '14 at 02:36
  • 1
    So you want to write your own LISTAGG function which accepts the name of the field as a parameter? – Bob Jarvis - Слава Україні Nov 10 '14 at 04:00
  • I have my own string aggregation function, write on oracle and this function have specific name and parameters, I want to create similar function in tibero database, but have difficult with this, because some syntax of pl/sql dont support in tibero, tibero database have a similar function aggr_concat(field, ', ') and I want to know can I call this function with another name, like in my example smpl_func(field1). – ExcepOra Nov 10 '14 at 12:03
  • As I said in my comment on [your other question about Tibero](http://stackoverflow.com/questions/26843008/how-create-oracle-type-object-in-tibero-database), it appears that no one on StackOverflow knows anything about this product. I suggest you contact Tibero support. Best of luck. – Bob Jarvis - Слава Україні Nov 10 '14 at 17:26

0 Answers0