Re: variable_name

Re: variable_name

 

  

OK this syntax is wrong in so many levels. Please start with the CREATE
FUNCTION (SQL scalar, row, table), go from there to
COMPOUND STATEMENT (dynamic) and also look at EXPRESSIONS.
http://publib.boulder.ibm.com/infocenter/db2help/index.jsp

Cheers
Serge


"Amit Singal " <db2udbdba-ezmlmshield-x76367434.[Email address protected]
wrote on 07/28/2005 06:34:08 AM:

> 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