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.
Hi all. I'm have some trouble saving a return value from SQL passthrough if it's an alpha value - the variable that gets saved is padded with spaces to whatever length that field is defined as:
SQL SELECT DISTINCT PROJ_ID AS PROJID FROM PROJECTS WHERE PROJ_ID='Test'; TABLE ON TABLE HOLD AS rep1 FORMAT ALPHA END -RUN
SET HOLDLIST=PRINTONLY TABLE FILE rep1 PRINT COMPUTE PROJ_ID/A16 = PROJID; ON TABLE HOLD AS rep1 FORMAT ALPHA END -RUN -READ rep1 &PROJ_ID.A16 SET HOLDLIST=ALL -TYPE project name is &PROJ_ID :
That prints: "project name is Test <12 spaces>:"
As you can see, the project id is padded with spaces to be 16 characters. I cannot define it to be A4 because it's not always A4 - it can be up to 16 characters..
Well, you can use TRIM to get rid of trailing blanks on a variable, after using a -READ.
However, in a DEFINE, we will always pad to the size of the field with blanks. Generally, in a report for instance, with SQUEEZE = ON and HTML, if everything is only 4 bytes, that column width will be 4. Can you give an example of why the trailing blanks are a problem?
Posts: 60 | Location: 2 penn | Registered: May 22, 2003
Thanks for the suggestions. I tried both TRIM and ||, but it does not get rid of the trailing spaces - maybe it's because I'm on an older version of webFOCUS - 4.36.
Francis Mariani, I tried your suggestion: it still pads it, but now prints it with quotes: "project name is 'Test' :"
Also, the SELECT fails to grab any data (it grabs data if I hard code 'Test' as the project id, so that's not the issue).
It seems that because I defined the field to be A16, it will always pad it to 16, so I'll probably end up using Oracle's TRIM function right in the SQL passthrough.
will translate to SELECT ... WHERE proj_id = 'test' ;...
which should not matter to the syntax of the SQL statement - the trailing blanks are outside the quoted selection criteria. That is why I suggested this method. This SHOULD work.
This works on 5.21 - I use it when the variable next has to go through a CTRAN function. That function really returns garbage in DM when there are trailing spaces in its input variable.
Posts: 391 | Location: California | Registered: April 14, 2003
I'm now experiencing trouble similar to this. In my situation, I have an oracle table that has the column REPORTING_GROUP defined as VARCHAR2(4).
In the FOCUS master, it is defined as A4.
I am reporting from the table and using the following WHERE:
WHERE REPORTING_GROUP EQ 'ERR'
This however is not returning any results. Even if I use 'ERR ', it still doesn't work. If I use :
WHERE REPORTING_GROUP LIKE 'ERR%', it does work.
From this thread, I've made a few of the changes as I deemed as having potential and still nothing has worked.
Any ideas on this one?
Sure, I could make the logic change to use LIKE and append the % to the end of the string, but this seems rather unreasonable for such an easy WHERE statement.
Ken
Prod - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE Dev - WF 7.6.4 Unix/Solaris - Self-Service, BI Dashboard, MRE Databases: Oracle 10g, SQL Server 2000, DB2.