Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> User-defined SQL Function

User-defined SQL Function

From: David Zuzga <dzuzga_at_isdinc.com>
Date: 2000/07/11
Message-ID: <8kg20p07l4@enews4.newsguy.com>#1/1

Does anyone have an idea how to implement the following?

I have a table t1 with 20 columns, say c1-c20. I would like to write a function that I can call like this:

select func(99999) from t1;

The 99999 will be replaced with a bit-representation of the columns that I wish to add together. For example, if I execute func(5), it will return c3+c1, func(7) will return c3+c2+c1, func(15) will return c4+c3+c2+c1.

I can't think of a straightforward way of doing this. Any help will be greatly appreciated.

Thanks,

Dave Zuzga
dzuzga_at_isdinc.com Received on Tue Jul 11 2000 - 00:00:00 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US