Re: Prepare statement in SPL
Posted in 2001
At 03:06 01/01/15 +0100, Pike wrote: Hi Pike. How about this ? in SPL define str char(256); define mytable char(256); mytable = "mytable" str = "select max(blah) from " || mytable; prepare myquery from str; Regards. >Hi > >If I get it right, below is a valid ESQL statement > PREPARE myquery FROM " select max(blah) from ? " ; >And a way to use it would be > EXECUTE myquery USING "mytable" into :myresults ; > >The manuals only described it only in ESQL-C, I'm trying to do this in SPL, >and some parser won't eat the prepare statement. It seems. > >Is that correct ? ... why ? > >As in the example, I want to use a variable for a tablename, in SPL. >Is there a workaround ? > >very curious, >*-pike >*----------pike-------------* > >Instructions for Life in the new millennium (2001>) from the Dalai Lama: >* Take into account that great love and great achievements involve great >risk. >* When you lose, do not lose the lesson. >* Follow the three Rs: Respect for self, respect for others, >responsibility for all your actions. >* Remember that not getting what you want is sometimes a wonderful stroke >of luck. >* Learn the rules so you know how to break them properly. >* Do not let a little dispute injure a great friendship. >* When you realize you have made a mistake, take immediate steps to >correct it. >* Spend some time alone every day. >* Open your arms to change, but do not let go of your values. >* Remember that silence is sometimes the best answer. >* Live a good, honorable life. Then, when you get older and think back, > you will be able to enjoy it a second time. >* A loving atmosphere in your home is the foundation for your life. >* In disagreements with loved ones, deal only with the current > situation. Do not bring up the past. >* Share your knowledge. It is a way to achieve immortality. >* Be gentle with the earth. >* Once a year, go someplace you have never been before. >* Remember that the best relationship is one in which your love for > each other exceeds your need for each other. >* Judge your success by what you had to give up in order to get it. >* Approach love and cooking with reckless abandon. > > -- Tsutomu Ogiwara Technical Group & Red Brick Group, Informix Sales Promotion Dept CTC, ITOCHU Techno-Science Corporation Yasukuni Kudan-Minami Bldg., 2-3-14, Kudan-Minami Chiyoda-Ku TOKYO, 102-0074 JAPAN Phone:+81-3-5212-4891 Fax:+81-3-5212-4889 E-mail:Tsutomu.Ogiwara@ctc-g.co.jp / tsutoo@my-deja.com