By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,779 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,779 IT Pros & Developers. It's quick & easy.

UDF in GENERATED ALWAYS column

P: n/a
Hi,

DB2 UDB 8.2.2, Win32

I'm trying to create GENERATED ALWAYS column with UDF in definition
My code

CREATE FUNCTION ADM.F_AAAA(par_InStr VARCHAR(10))
RETURNS VARCHAR(10)
SPECIFIC F_AAAA
DETERMINISTIC
NO EXTERNAL ACTION
RETURN par_InStr
@

create table adm.aaa(
f1 varchar(10),
f2 varchar(10) generated always as (adm.F_AAAA(f1))
)

I recive error SQLSTATE=42621. What is wrong?
Can anybody help me? I am looking for simple example

Thanks
Yaro
Nov 12 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
A SQL FUNCTION is READS SQL DATA by default, and that is not allowed in
a GENERATED expression. So, specify CONTAINS SQL.

B.

Nov 12 '05 #2

P: n/a
A SQL FUNCTION is READS SQL DATA by default, and that is not allowed in
a GENERATED expression. So, specify CONTAINS SQL.
B.


Works, thank you
Yaro


Nov 12 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.