469,352 Members | 1,677 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,352 developers. It's quick & easy.

UDF in GENERATED ALWAYS column

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
2 1859
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
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.

Similar topics

2 posts views Thread by db2group88 | last post: by
1 post views Thread by Robert Stearns | last post: by
3 posts views Thread by Jurgen Haan | last post: by
1 post views Thread by Ben.Combrink | last post: by
1 post views Thread by Frank Swarbrick | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by suresh191 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.