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     Converting SQL Server query

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Converting SQL Server query
 Login/Join
 
<Derek>
posted
I need to migrate some MS SQL server queries to WebFOCUS. I'm not very familiar with the WebFOCUS reporting language so I'm trying to use the SQL translator to convert it to Oracle. However, I'm running into problems.

Here is one of the queries I'm trying to convert..

SELECT Year(DateAdd("m",3,[Approval_Date])) AS FY, Count(COPY_RIGHT_NUMBER) AS [Count of Copyrights]
FROM TBLCO_BASE
WHERE (((APPROVAL_DATE) Is Not Null))
GROUP BY Year(DateAdd("m",3,[Approval_Date]))
ORDER BY Year(DateAdd("m",3,[Approval_Date])) DESC;

This is what I'm trying to do...

SQL

SELECT YEAR(ADD_MONTHS(Approval_Date,3)) AS FY, COUNT(COPY_RIGHT_NUMBER) AS COUNT
FROM TBLCO_BASE
WHERE APPROVAL_DATE IS NOT NULL
GROUP BY Year(ADD_MONTHS(Approval_Date,3))
ORDER BY Year(ADD_MONTHS(Approval_Date,3)) DESC;

END

I'm receiving error messages because it doesn't recognize the Oracle Add_months() function. Can anyone show me a different way to convert this query to Oracle or even the WebFOCUS language.
 
Report This Post
Platinum Member
posted Hide Post
Hello Derek,

In WebFOCUS when u write the Oracle Query, use

SET SQLENGINE=SQLORA
SQL SQLORA

instead of just 'SQL'

If using the above syntax is not identifying your oracle tables, use the following syntax

SQL SQLORA SET SERVER <DSN>
SQL SQLORA

where DSN is the listener you use to connect to the oracle tables.
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
<Derek>
posted
Thanks Cyril. I tried that and it is now telling me that the table doesn't exist. Can you show me what that query would look like in WebFOCUS language? I would then be able to use it as a template to convert the others and not have to use the SQL translator.

Thanks...
 
Report This Post
Platinum Member
posted Hide Post
Hello Derek,

You can directly write the oracle sql query as follows:

SET SQLENGINE=SQLORA
SQL SQLORA
SELECT YEAR(ADD_MONTHS(Approval_Date,3)) AS FY, COUNT(COPY_RIGHT_NUMBER) AS COUNT
FROM <username.>TBLCO_BASE<@listenername>
WHERE APPROVAL_DATE IS NOT NULL
GROUP BY Year(ADD_MONTHS(Approval_Date,3))
ORDER BY Year(ADD_MONTHS(Approval_Date,3)) DESC
;
TABLE FILE SQLOUT
PRINT *
ON TABLE SET ONLINE-FMT HTML
END
-RUN

Note that the table name is now owner.table@listner.

If the above method is not working try the following also

SQL SQLORA SET SERVER <listener>
SQL SQLORA
SELECT YEAR(ADD_MONTHS(Approval_Date,3)) AS FY, COUNT(COPY_RIGHT_NUMBER) AS COUNT
FROM TBLCO_BASE
WHERE APPROVAL_DATE IS NOT NULL
GROUP BY Year(ADD_MONTHS(Approval_Date,3))
ORDER BY Year(ADD_MONTHS(Approval_Date,3)) DESC
;
TABLE FILE SQLOUT
PRINT *
ON TABLE SET ONLINE-FMT HTML
END
-RUN
 
Posts: 143 | Location: Rochester,NY. | Registered: August 20, 2004Report This Post
Platinum Member
posted Hide Post
Guys for some reason when I run the following code, I only get about 15 returns, when it should be way more, any clues?

SQL SQLORA
SELECT KEY FROM CAR
WHERE CARYEAR = '2007' AND COST > 100;

TABLE FILE SQLOUT
PRINT
*
END

I've already verified by running the script outside of focus, but is there a limit for the return length for SQLOUT?

This message has been edited. Last edited by: gregson06,
 
Posts: 87 | Registered: August 03, 2006Report This Post
Expert
posted Hide Post
Hi Gregson,

Has this issue been resolved?

I am wondering, do you have the code SET SQLENGINE=SQLORA before SQL SQLORA? Such as:

SET SQLENGINE=SQLORA
SQL SQLORA
...


Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Master
posted Hide Post
Gregson06

Didnt see any mention of

ENGINE SQLORA SET CONNECTION connectionstring
or
ENGINE SQLORA SET DEFAULT_CONNECTION connectionname

So assuming it in your EDASPROF.

Check any sql query through sqlplus to confirm lack of records is an Oracle (usually security on View) or WF problem.

Hope you find your answer.

Regards

John


John



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report 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     Converting SQL Server query

Copyright © 1996-2020 Information Builders