Assign the Values to Dynamic Variable Names in SPL
Posted in 2006
Topics: Stored Procedures & SPL, Data Types & Schema Design
How to assgin the value to Dynamic Variable Names in SPL? Something like: DEFINE l_var1 VARCHAR(255); DEFINE l_var2 VARCHAR(5); DEFINE l_var3 VARCHAR(5); BEGIN FOR i=1 tp 3 LET l_var[i] = "value" || i; -- how to assing to a dynamic variable name END FOR; END; Thanks!
> >How to assgin the value to Dynamic Variable Names in SPL? Something >like: > > >DEFINE l_var1 VARCHAR(255); >DEFINE l_var2 VARCHAR(5); >DEFINE l_var3 VARCHAR(5); > >BEGIN > FOR i=1 tp 3 > LET l_var[i] = "value" || i; -- how to assing to a >dynamic variable name > END FOR; >END; > >Thanks! > Denise, You really aren't a programmer, are you? No offense, but you're declaring individual variables and then attempting to access them as if they are an array. (Any programming 101 course should teach you about variables and data types.) Now on to the fun stuff. FIRST THE OBLIGATORY: "RTFM". You can find them here: http://www-306.ibm.com/software/data/informix/pubs/library/ But which one to choose? Here's a list of IDS 10.x books: http://www-306.ibm.com/software/data/informix/pubs/library/ids_100.html You can use the following resources on SPL: Guide to SQL: Tutorial G251-2285-00 http://publib.boulder.ibm.com/epubs/html/25122850/25122850tfrm.htm - Online HTML Version Or choose the .pdf version and download it to your computer. And that should get you on your way. HTH -G _________________________________________________________________ >From photos to predictions, The MSN Entertainment Guide to Golden Globes has it all. http://tv.msn.com/tv/globes2007/
> -----Original Message----- > From: denise.ding@nasd.com [mailto:denise.ding@nasd.com] > Posted At: 27 December 2006 07:40 > Posted To: comp.databases.informix > Conversation: Assign the Values to Dynamic Variable Names in SPL > Subject: Assign the Values to Dynamic Variable Names in SPL > > > How to assgin the value to Dynamic Variable Names in SPL? Something > like: > > > DEFINE l_var1 VARCHAR(255); > DEFINE l_var2 VARCHAR(5); > DEFINE l_var3 VARCHAR(5); > > BEGIN > FOR i=1 tp 3 > LET l_var[i] = "value" || i; -- how to assing > to a dynamic variable name > END FOR; > END; > > Thanks! Not sure that will work, as I don't remember having array variables in SPL, you will need to use a IF ELSE IF statement Paul Watson Tel: +44 1414161772 Mob: +44 7818003457 Web: www.oninit.com Growing Old is Mandatory Growing Up is Optional Attend IDUG 2007 San Jose, North America May 6-10, 2007 Visit http://www.iiug.org/conf for more information.
Related threads
- Re: Re: Crash course for an Oracle DBA
- Re: IDS 7.30 do not start - NT
- Re: IDS 10 erratic run times
- Client SDK