Amit,
Pls. take a look at the examples given in DB2 Doc. Search for "CREATE FUNCTION (SQL Scalar, Table, or Row) statement"
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp?topic=/com.ibm.db2.udb.doc/ad/c0007034.htm
If you are trying to execute dynamic SQL you may look at this article.
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0402greenstein/
Hope this helps.
Regards
Praveen
PS. People are just trying to help taking their time out so don't be frustrated.
-----Original Message-----
From: Amit Singal
[mailto:db2udbdba-ezmlmshield-x87622960.[Email address protected]
Sent: 28 July 2005 11:46
To: LazyDBA Discussion
Subject: Re: variable_name
I AM WRITING IT IN DB2 FUNCTION
Regards
Amit Singal
----- Original Message -----
From: "Sahoo, Deba" <Deba.[Email address protected]
To: "Amit Singal" <[Email address protected]
Sent: Thursday, July 28, 2005 4:06 PM
Subject: RE: variable_name
What is Host language ?? Syntax which suggested can be used in COBOL.
With Regards,
Deba
Team Leader ,
DB2 DBA support,
FMR India,
Bangalore - 560076
Ph : 91-80-56916775
Ce : 91-9880929866
IP : +508-305-5647
-----Original Message-----
From: Amit Singal [mailto:[Email address protected]
Sent: Thursday, July 28, 2005 4:04 PM
To: DBA; Sahoo, Deba
Subject: Re: variable_name
create function fn( pk_ur integer)
DECLARE VAR1 VARCHAR(500);
SET var1='SELECT COUNT(CASENO) FROM CASEDATA WHERE DEPTID=':PK_UR;
ERROR:
AN UNEXCEPTED TOKEN ':'
Regards
Amit Singal
----- Original Message -----
From: "Sahoo Deba " <Deba.[Email address protected]
To: <[Email address protected]
Sent: Thursday, July 28, 2005 3:42 PM
Subject: RE: variable_name
> **A LazyDBA.com subscriber has responded to your lazydba.com post**
> **LazyDBA.com mail shield has forwarded you this email,
> **and removed any attachments, and kept your email address secret
> **from this person, and any viruses/trojans.
> **If you reply to this email, the person will see your email address
as
normal
> **Anything below this line is the original email text
>
>
> Try this ..
> SELECT COUNT(*) INTO :HOST-COUNT
> FROM CASEDATE WHERE DEPTID = :HOST-VAR;
>
> With Regards,
> Deba
>
>
>
> -----Original Message-----
> From: Amit Singal
> [Email address protected]
> Sent: Thursday, July 28, 2005 3:34 PM
> To: LazyDBA Discussion
> Subject: variable_name
>
>
> Hi,
>
> pls suggest me how to pass varible in a select query;
> i.e
> set output = select count(CaseNo) from casedata where DEPTID=
> variable_name;
>
> i am writing this query in a function.
>
> Regards
>
> Amit Singal
>
> ----- Original Message -----
> From: "sonika " <db2udbdba-ezmlmshield-x338828.[Email address
protected]
> To: "LazyDBA Discussion" <[Email address protected]
> Sent: Thursday, July 28, 2005 3:16 PM
> Subject: How to reduce Logical I/O
>
>
> >
> >
> > Hi Great DBA's
> >
> >
> >
> > Please tell me how can I reduce Logical I/O
> >
> >
> >
> > The role of arraysize & clustering factor
> >
> >
> >
> > Thanks & Regards
> >
> >
> >
> > Sonika Choudhary
> >
> >
> >
> > Times Internet Limited.
> >
> > MPD Tower, Sector Road Zone-VI,
> >
> > DLF Phase-V,Opp DLF Golf Course,
> >
> > Gurgaon-122002,Haryana
> >
> > Tel. No.-0124-5187000/100/200,Extn-2355
> >
> > Mobil-9891378817.
> >
> >
> >
> >
> >
> >
---------------------------------------------------------------------
> > PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> > website: http://www.LazyDBA.com
> > To unsubscribe: http://www.lazydba.com/unsubscribe.html
> >
> >
>
>
>
>
> ---------------------------------------------------------------------
> PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
> website: http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
---------------------------------------------------------------------
PLEASE CLICK REPLY-ALL TO SEND A REPLY TO EVERYONE
website: http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
DB2 & UDB email list listserv db2-l LazyDBA home page