Focal Point Banner


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.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Issue with passing date in drilldown report

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED]Issue with passing date in drilldown report
 Login/Join
 
Platinum Member
posted
Hello,

I have a very standard SQL pass-thru report which has an ID column with a drilldown link to a detail report. Along with the ID column, I also have to pass the date from another column on the main report. I am facing issues with passing the date to the detail report.

Both reports have a simple SQL:
Main report SQL:
SELECT * FROM TABLE
WHERE DATE = TRUNC(SYSDATE)-5

Sample main report:
ID_NUM DATE NAME ADDR PHONE EMAIL .....
(Drilldown link)

MY drilldown statement:
TYPE=DATA, COLUMN=ID_NUM, FOCEXEC=DETAIL_REPORT(ID_NUM = ID_NUM DATE = DATE), $

Detail Report SQL:
SELECT * TABLE_B
WHERE ID_NUM = &ID_NUM
AND DATE = &DATE


I get the error:
(FOC1400) SQLCODE IS 907 (HEX: 0000038B)
 : ORA-00907: missing right parenthesis
 : Error context area: 017/09/20 00:00:00)
 L    (FOC1405) SQL PREPARE ERROR.
 0 ERROR AT OR NEAR LINE     12  IN PROCEDURE threshold_report_detail
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
 0 ERROR AT OR NEAR LINE     15  IN PROCEDURE threshold_report_detail
 (FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
 BYPASSING TO END OF COMMAND


I tried so many things with the date field, like passing DATE.EVAL in the FOCEXEC statement, also tried TO_DATE ('&DATE', 'YYYYMMDD') in the SQL of the detail report, but nothing works.. get a new error everytime...

How can I pass a date value successfully for the detail report to filter on?

Thanks in advance!

This message has been edited. Last edited by: Nova27,


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Expert
posted Hide Post
SELECT * TABLE_B
WHERE ID_NUM = &ID_NUM
AND DATE = &DATE
Are you missing the FROM in the SQL statement?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Platinum Member
posted Hide Post
Hi Francis,

I do have a FROM statement in my SQL, I think I just missed typing it here..

Any idea how do I pass the date so as to avoid SQL errors?

Thanks!


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
Expert
posted Hide Post
As this is SQL passthru I would suggest doing -
  • viewing the source HTML to see what anchor link is being produced
  • an &ECHO = ON to see what is being produced by WebFOCUS
  • capturing the SQL trace to see what is finally being passed to your RDBMS


then compare to see if you can spot where the problem is.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
Try putting single quotes around the date variable.
 
SELECT * 
FROM TABLE_B
WHERE ID_NUM = &ID_NUM
AND DATE = '&DATE' 


Also double check the value of your variable. It looks like in the error that the date is a bit funky. like the year is missing the 2 for 2017
quote:
: Error context area: 017/09/20 00:00:00)


If your are using SQL Server, in the first SQL try the following to get the current date using T-SQL expression.

SELECT * FROM TABLE
WHERE DATE = CAST(GETDATE() AS DATE)
 

This message has been edited. Last edited by: Hallway,


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Master
posted Hide Post

If your are using SQL Server, in the first SQL try the following to get the current date using T-SQL expression.

SELECT * FROM TABLE
WHERE DATE = CAST(GETDATE() AS DATE)
 
If you're using SQL Server, in the first SQL try the following to get the current date using T-SQL expression.
 SELECT * FROM TABLE WHERE DATE = CAST(GETDATE() AS DATE)  


Oops, nevermind. I see that you are querying an Oracle DB


Hallway

 
Prod: 8202M1
Test: 8202M4
Repository:
 
OS:
 
Outputs:
 
 
 
 
 
Posts: 608 | Location: Salt Lake City, UT, USA | Registered: November 18, 2015Report This Post
Platinum Member
posted Hide Post
Thank you all for your help!

I used the &ECHO=ON to figure out the issue - since my date field was a date-time column, I Just used HDATE function to convert it to a date only column and then passed that to the SQL in the detail report.

I was using &ECHO=ALL and I think I wasn't really getting what I wanted to see.

Thanks again everyone for helping me out Smiler


WF 7.7.03, Win 7
 
Posts: 127 | Registered: January 12, 2017Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED]Issue with passing date in drilldown report

Copyright © 1996-2020 Information Builders