As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.
Join the TIBCO Community TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.
From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
Request access to the private WebFOCUS User Group (login required) to network with fellow members.
Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.
I have a procedure that uses SQL Passthru code. I have some Amper Variables in the SQL Code. When I create an HTML Lauch Page for the procedure everything works fine until I try to select multiple values from my listboxes. Then I get an error message like (FOC1400) SQLCODE IS 4145 (HEX: 00001031) XOPEN: 42000 : Microsoft OLE DB Provider for SQL Server: [42000] An expression of non-b : oolean type specified in a context where a condition is expected, near ' : AND'. [42000] Statement(s) could not be prepared. [] Deferred prepare co : uld not be completed. L (FOC1405) SQL PREPARE ERROR. (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT BYPASSING TO END OF COMMAND
It looks like the way the code is parsed is not acceptable by MS SQL. Consider the following...
ENGINE SQLMSS SET DEFAULT_CONNECTION WF_Dev
SQL SQLMSS PREPARE SQLOUT FOR
SELECT IND_SECT, EQUIP_CLASS, PROD_VOC, OE_BRAND, OE_NAME, OE_MODEL, ENG_SUPP, ENG_MODEL, ENG_COUNTRY
FROM OE_DATA_VIEW
WHERE (PROD_QTY > 0) AND
(IND_SECT IN(&IND_SECT))
If I select 'Marine Auxilliary' from the listbox on my launch page the WHERE clause looks like...
WHERE (PROD_QTY > 0) AND
(IND_SECT IN('Marine Auxilliary'))
This works OK.
If I select more than one item from the lisbox on my launch page the WHERE clause looks like...
WHERE (PROD_QTY > 0) AND
(IND_SECT IN('Marine Auxilliary' OR 'Marine Propulsion'))
This does not work because the correct SQL syntax should be...
WHERE (PROD_QTY > 0) AND
(IND_SECT IN('Marine Auxilliary', 'Marine Propulsion'))
Anybody know if this should work? If so, is there something different I need to do with my SQL Passthru code or with my Launch Page?
Thanks,
DanThis message has been edited. Last edited by: Dan Pinault,
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
The idea is to transform the OR-separated list to a comma-separated list, using a -SET statement with STRREP(), before you get to the line in the report that references the amper var. -------------------------------------------------------------------------------------------------- Syntax: How to Replace Character Strings
I was hoping to avoid the extra coding. One would think that if the WebFOCUS parser can turn FOCUS procedures into properly formed SQL that it would be able to pass parameters to a SQL Passthru procedure.
In any event. Thanks for the workaround. I'll test it out right now.
Regards,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
The other thing I had to remember was to put all my WHERE clauses on separate lines so those who defaulted to FOC_NONE would go away and still leave the others in tact.
Thanks again!
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
I'm looking a the documentation on the STRREP function. Just to be clear, the reason &before is set to ''' OR ''' is because it requires three single quotes to get the result of ' OR ', is that right?
Also, you have the output string as 'A&IND_SECT.LENGTH'. Can you tell me why you have it formatted like that instead of just using 'IND_SECT'?
Thanks,
Dan
7.7.05M/7.7.03 HF6 on Windows Server 2003 SP2 output to whatever is required.
Posts: 393 | Location: St. Paul, MN | Registered: November 06, 2007
"Just to be clear, the reason &before is set to ''' OR ''' is because it requires three single quotes to get the result of ' OR ', is that right?" --yes. Within a quote-literal, single-quote marks are represented by a pair of single-quotes. The literal ends after an even-numbered quote-mark not immediately followed by another one.
"Also, you have the output string as 'A&IND_SECT.LENGTH'. Can you tell me why you have it formatted like that instead of just using 'IND_SECT'?" -- In DEFINE you can code the final argument as either a format literal (like 'A24') or the name of a variable with the same format as the desired result (typically, the very variable that you are defining -- it 'exists' and has a fixed format, regardless of its current content).
In Maintain's COMPUTE you can only use the latter form.
In dialog manager -SET you can, in principle, use either form -- but you generally cannot use the name of the variable you are setting, because it does not 'exist' at the time of evaluation; and using another variable will overlay that one's value (see example below) -- so I generally stick with 'Ann'.