471,886 Members | 1,086 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,886 software developers and data experts.

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 1894
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
reply views Thread by YellowAndGreen | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.