Or have the « Multiple: Add Quotes » option of the control set to yes will add the enclosed single quote and no need to convert the comma to « quote-comma-quote ».
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
February 12, 2015, 11:57 AM
Ram Prasad E
MartinY solution should be straight forward. You can try this.
Thanks Martin and Ram for the solution but unfortunately I think I did not put my question in the right way.
Say if in the below query,the column named board is getting the values such as first last(single value) from the database(table) and in the html page,the static value for &board are first(1st static value) and the next value is last....Please let me know how to check for first last i.e.,board value in the table with that of &board i.e,the values being are first and the next value is being last...Iam not sure which operator to use i.e, Contains,IN,etc... select * from table WHERE number IN ('&id') AND name IN ('&name'); AND board IN (&board); END
Am not sure what you're asking. Are you after WHERE board LIKE '&board|%' ;
7.7.05 Windows.
February 16, 2015, 05:08 AM
info4pal
Hi,
Thanks Darryl ! Say the value for the board column which Iam getting from the table/database is abcd xyz which is a single value and the value which Iam passing for &board[static values] is abcd from the html page. Please let me know how to check for board value with the &board value in the filter condition in the query used above....
Iam using IN operator and also used LIKE operator but nothing seem to be working... Hope Iam clear now.
Hi, In the code in your first post you have too many semi-colons - get rid of the one after the first of your AND statements.
7.7.05 Windows.
February 16, 2015, 06:01 AM
info4pal
Hi,
Sorry,that semicolon was present there by mistake. Here is the query : select * from table WHERE number IN ('&id') AND name IN ('&name') AND board IN (&board); END
So you tried the like as suggested? WHERE number IN ('&id') ; WHERE name IN ('&name') ; WHERE board LIKE '&board|%' ;
..and it doesn't work. Have you tried removing your two 'in' statements to make sure your problem is with &board?
7.7.05 Windows.
February 16, 2015, 07:20 AM
MartinY
You are looking for &board selected value anywhere in < board > field ? If you use the Focus TABLE FILE code, you won't have to worry about wild card characters. So having this (if we understand your request ), should work:
TABLE FILE ABC
PRINT *
WHERE number EQ &id;
WHERE name EQ '&name';
WHERE board CONTAINS '&board';
END
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
February 16, 2015, 07:42 AM
Darryl_uk
Hi MArtinY,
I considered suggesting that but have always assumed that a CONTAINS would have worse performance than a LIKE when you know the data you have is at the start of the string. Do you happen to know if my assumption is true or if I have made it up!
Many thanks
(and being an old SQL programmer I hadn't even noticed the 'select *' and was thinking 'table file' - so good point there)
7.7.05 Windows.
February 16, 2015, 09:18 AM
MartinY
Hi Darryl, It's true that a CONTAINS will try to find the character set (parameter value) anywhere in the search string (field), so may become a lack of performance. But if the searched string is at the beginning of the field, it will do the same thing as LIKE 'abc%'. The advantage of CONTAINS is that you're not limited to search at the beginning of the string without having to change your condition.
WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF In Focus since 2007
February 18, 2015, 06:31 AM
info4pal
Hi,
Thanks everyone for the solution. But Iam passing multiple values of &board from the html page and I will also be passing the value ALL(i.e.,FOC_NONE) and Iam not sure whether the operator CONTAINS works or not.