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.
Anyone have experience to relate on using synonyms of External SQL Script files in Oracle?
I'd like to know what features of Oracle's SQL dialect it supports, and which not.
For instance, does it understand --
Subquery factoring ("WITH ..." preceding the main SELECT)
Nonscalar functions
-- at least sufficiently to identify the answer-set columns, and generate proper queries based on the script?This message has been edited. Last edited by: Kerry,
- Jack Gross WF through 8.1.05
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005
I would suggest trying with a simple example? For subquery factoring, I was able to run a FOCEXEC using this SQL:
ENGINE SQLORA SET DEFAULT_CONNECTION MYORA
SQL SQLORA PREPARE SQLOUT FOR
with generator as (
select
rownum id
from dual
connect by
rownum <= 4000
)
select
/*+ gather_plan_statistics */
count(*)
from (
select
/*+ no_merge */
rownum id
from
generator,
generator
where
rownum <= 1000
)
;
END
TABLE FILE SQLOUT
PRINT
COUNT___
ON TABLE SET PAGE-NUM NOLEAD
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT HTML
ON TABLE SET HTMLCSS ON
ON TABLE SET STYLE *
INCLUDE = IBFS:/EDA/EDASERVE/_EDAHOME/ETC/endeflt.sty,
$
ENDSTYLE
END
I do recall a error [(FOC1405) SQL PREPARE ERROR] being thrown using CASE statements that seemed to require them to be wrapped in parentheses as a work-around. For example:
Produces an Error: CASE WHEN…. THEN…. END AS COLUMN
No Error: (CASE WHEN…. THEN…. END) AS COLUMN
Hope this helps...
8.0.02M, Oracle 11.2 (AIX), Windows 2008R2, HTML, PDF, Excel
Haven't run into anything that is a problem using ENGINE SQLORA SET DEFAULT_CONNECTION MYORA SQL SQLORA PREPARE SQLOUT FOR , other than these few querks;
- Nested CASE statements, might have to put those in line.
- For comments Use -* not -- but /* */ works
- May need to cast some vars
- Don't allow functions to create their own field names, they can quickly exceed the available witdh
When you create a synonym for an external SQL script the requirement documented in Managing ORACLE Metdata is
quote:
A Synonym candidate can be any file that contains one (and only one) valid SQL Query and does not contain end-of-statement delimiters (";" or "/") and comments.
A WITH clause preceding the SQL is OK. For example a synonym can be created for this simple query and then used for retrieval:
WITH dept_count AS (
SELECT deptno, COUNT(*) AS dept_count
FROM scott.emp
GROUP BY deptno)
SELECT e.ename AS employee_name,
dc.dept_count AS emp_dept_count
FROM scott.emp e,
dept_count dc
WHERE e.deptno = dc.deptno
This simple query works; there is just one SELECT statement and it's last.
This functionality has been enhanced in Release 7.7.05 to support more complex queries.
N/A
Posts: 397 | Location: New York City | Registered: May 03, 2007