Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread COMPUTED columns and User Defined Functions
Sun, Jan 2 2011 1:59 PMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

Any idea when we might be able to use user defined functions in computed columns?

I have a concept in mind for allowing users to add additional "columns" into a database using an XML like structure in a CLOB

Roy Lambert
Tue, Jan 4 2011 6:09 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< Any idea when we might be able to use user defined functions in computed
columns? >>

Computed columns are something that needs to be re-computed client-side.
Generated columns, however, do not, so you can use UDFs with generated
columns without issue.

--
Tim Young
Elevate Software
www.elevatesoft.com
Tue, Jan 4 2011 7:51 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim

><< Any idea when we might be able to use user defined functions in computed
>columns? >>
>
>Computed columns are something that needs to be re-computed client-side.
>Generated columns, however, do not, so you can use UDFs with generated
>columns without issue.

1. I'm not sure I understand why there is a problem. Actually I'm certain I don't Smiley

2. Using generated means I have to store the data which defeats what I'm trying to do.

Roy Lambert
Tue, Jan 11 2011 2:50 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Roy,

<< 1. I'm not sure I understand why there is a problem. Actually I'm certain
I don't Smiley>>

UDFs are stored in the database catalog and require the ability to
compile/execute them in the correct context.  Remote sessions have none of
these things, and COMPUTED columns are calculated on the client-side.
Therefore, they cannot contain UDFs.

<< 2. Using generated means I have to store the data which defeats what I'm
trying to do. >>

GENERATED columns are dealt with server-side, COMPUTED columns are dealt
with client-side.  Therefore, GENERATED columns are what you need.

--
Tim Young
Elevate Software
www.elevatesoft.com
Wed, Jan 12 2011 4:52 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Tim


><< 1. I'm not sure I understand why there is a problem. Actually I'm certain
>I don't Smiley>>
>
>UDFs are stored in the database catalog and require the ability to
>compile/execute them in the correct context. Remote sessions have none of
>these things, and COMPUTED columns are calculated on the client-side.
>Therefore, they cannot contain UDFs.
>
><< 2. Using generated means I have to store the data which defeats what I'm
>trying to do. >>
>
>GENERATED columns are dealt with server-side, COMPUTED columns are dealt
>with client-side. Therefore, GENERATED columns are what you need.

Interesting, but I'm using file/server not client/server. I know I'm being thick but I can use UDFs in SQL and in Triggers so I don't understand why not here (I'm sure there's a good technical reason and what you've said above makes perfect sense but it goes straight over my head). Doesn't really matter anyway because unless my understanding is fatally flawed (not beyond the realms of possibility) GENERATED store data in the table which means that I'd be storing it in a CLOB and then in the GENERATED column in the same table.

I'll have a think about structuring the data so I can extract individual fields with straight SQL.

Roy Lambert
Image