Focal Point
Error trying to create SQL Report

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/428101451

June 17, 2009, 03:40 PM
<AM>
Error trying to create SQL Report
I am trying to create a procedure in WebFocus using SQL. When I run the sql directly on the database the sql runs fine with no errors. But when I try to create a procedure using the "Type SQL" or SQL from file I get the below message? There is no error in the SQL for right paren?? Is there a limitation to the lines of SQL to be used in WebFocus, my sql code has 120 lines? Any idea's?

(FOC1400) SQLCODE IS 907 (HEX: 0000038B)
: ORA-00907: missing right parenthesis
: Error context area: NUM <= 100
L (FOC1405) SQL PREPARE ERROR.
(FOC205) THE DESCRIPTION CANNOT BE FOUND FOR FILE NAMED: SQLOUT
BYPASSING TO END OF COMMAND
June 17, 2009, 03:46 PM
Frans
Could you post your code? Then we can help you better with solving this issue.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
June 17, 2009, 04:24 PM
Francis Mariani
You don't say what DBMS the table is in.

What is the (+) syntax - I've never seen that.

You should check the Adapter Administration
for UNIX, Windows, OpenVMS, i5/OS, and z/OS manual to see if there are any restrictions to the SQl you can pass to WebFOCUS.


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
June 17, 2009, 04:36 PM
Frans
Does the SQL run if you do this:
  
SQL SQLORA
..your sql code..
;
END



Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
June 17, 2009, 04:47 PM
<AM>
Oracle is the DB, right join(+)
June 17, 2009, 04:50 PM
<AM>
quote:
Originally posted by Frans:
Does the SQL run if you do this:
  
SQL SQLORA
..your sql code..
;
END


No it does not
June 17, 2009, 05:05 PM
Frans
It looks like your doing multiple selects and your merging these selects. I'm not sure if the Oracle driver can handle this.

What you could do is break up the select statements and putting them in a holdfile. You can concatenate these holdfiles to get your final result.

To be sure contact IBI support or Oracle support to see if union select is supported in their ODBC.


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
June 17, 2009, 05:41 PM
Darin Lee
There is no limitation on # of lines as far as I know. We have a couple of procedures that use a couple hundred lines of SQL (don't ask!) If it does not run inside of SQL SQLORA and END as Frans suggests, there is something else wrong. That method is called SQL passthru, which instructs WF to completely pass the entire statement directly to the DBMS without parsing anything.
Your other alternative is to create a stored procedure which eliminates WF completely except for the fact that there is a master file that can use the results of the procedure. This is all in the documentation.


Regards,

Darin



In FOCUS since 1991
WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex
Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex
WF Client: 77 on Linux w/Tomcat
June 18, 2009, 08:39 AM
DeniseJ
Try removing the comments you have in your WHERE statements. You cannot use -- to comment a statement in a SQL Passthru. Use -* instead

WHERE request_type_id = 34395 -- Old Decom PPM Style

WHERE request_type_id = 38285 -- Lean Decom PPM Style