dbTalk Databases Forums  

Create Function or Create Procedure

comp.databases.ibm-db2 comp.databases.ibm-db2


Discuss Create Function or Create Procedure in the comp.databases.ibm-db2 forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Frank Neubert
 
Posts: n/a

Default Create Function or Create Procedure - 04-12-2005 , 12:24 PM






Hello!

I work with "IBM DB 2 Universal Database for Windows NT" Version 6. I want
to create Function, which are using in a Queries. I don't want to use
external function. I want to create a function, which returns the age of a
person. The parameters of the function or procedure are two variables (Type
is Date). The type of the value, who gives the function back is long.

I try it with these code-lines:

Create function age(Value1 Date, Value2 Date)
Returns long
return Year(Value2-Value1);


These lines produce mistakes.

I hope someone can understand me and can help me.


Thanks

Frank

Reply With Quote
  #2  
Old   
Serge Rielau
 
Posts: n/a

Default Re: Create Function or Create Procedure - 04-12-2005 , 12:37 PM






Frank Neubert wrote:
Quote:
Hello!

I work with "IBM DB 2 Universal Database for Windows NT" Version 6. I want
to create Function, which are using in a Queries. I don't want to use
external function. I want to create a function, which returns the age of a
person. The parameters of the function or procedure are two variables (Type
is Date). The type of the value, who gives the function back is long.

I try it with these code-lines:

Create function age(Value1 Date, Value2 Date)
Returns long
return Year(Value2-Value1);


These lines produce mistakes.

I hope someone can understand me and can help me.
SQL Functions were introduced in DB2 UDB V7 for LUW. Se the answre is:
Upgrade

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.