<div>Hi Darren and Joe,</div> <div> </div> <div>Sorry for the late reply, just back from a long break.</div> <div>Thanks for the suggestion and it does work! It appears that I can't do a dynamic string to the SQL statement and I am kind of hoping the dynamic string will work. If it does, it will save lots of time to cut down programming logics.</div> <div>Thanks again guys.</div> <div> </div> <div>cheers,</div> <div>Kim Han<BR><BR><B><I>Darren Reely <darren.reely@latticesemi.com></I></B> wrote:</div> <BLOCKQUOTE class=replbq style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #1010ff 2px solid">It doesn't seem you can be as dynamic as your looking for. I think that <BR>is because the compile process requires knowledge of how the cursor will <BR>appear.<BR><BR>Assuming your only using one table, you could try something like this;<BR><BR>sql in mydb declare mytest cursor for &<BR>select name, ic-no from mytable &<BR>::where<BR><BR>if tmp_where_cnt =
1<BR>then sql open mytest where(where name = :tmp_a)<BR>else sql open mytest where(where name = :tmp_a and ic_no = :tmp_b)<BR><BR>Darren<BR><BR><BR>I H LIM wrote:<BR>> Hi all,<BR>> <BR>> I have difficulties on executing sql statement through cursor in QUICK. <BR>> Below is my statement :<BR>> <BR>> let tmp_where_cnt = 0<BR>> let tmp_where = "where"<BR>> if tmp_a <> ""<BR>> then begin<BR>> let tmp_where = " name = '"+tmp_a+"'"<BR>> let tmp_where_cnt = 1<BR>> end<BR>> <BR>> if tmp_b <> ""<BR>> then begin<BR>> if tmp_where_cnt = 1<BR>> then let tmp_where = tmp_where + "and ic_no = '"+tmp_b+"'"<BR>> else let tmp_where = tmp_where + "ic_no = '"+tmp_b+"'"<BR>> end<BR>> <BR>> .....<BR>> <BR>> SQL OPEN "cursor_name" where ((tmp_where))<BR>> ----------------------------------------------<BR>> <BR>> I need to substitute the "WHERE" statement using the "tmp_where" field.<BR>> Can SQL statement in
Powerhouse able to be substituted as above?<BR>> For your information, I'm running Powerhouse Web Version 8.4D1 under <BR>> Windows platform using Axiant 3.4D1<BR>> <BR>> Thank You<BR>> <BR>> Regards<BR>> Kim Han<BR></BLOCKQUOTE><BR><p>
                <hr size=1>Brings words and photos together (easily) with<br>
<a href="http://us.rd.yahoo.com/mail_us/taglines/PMall/*http://photomail.mail.yahoo.com">PhotoMail </a> - it's free and works with Yahoo! Mail.