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] How to convert SQL query into WebFocus query

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] How to convert SQL query into WebFocus query
 Login/Join
 
Member
posted
Hi,
I am working with WebFocus for the first time and i dont know how to write the following sql query in Webfocus.I know we can write sql query in WebFocus but i want to know how to write in Webfocus syntax.Here is the query

select * from people_dim where MGR_CORP_ID in

(select MGR_CORP_ID from people_dim where CORP_ID='&corp_id' and end_dt is null )


If anyone can please help me out with this fast. Idea

This message has been edited. Last edited by: Kerry,
 
Posts: 10 | Registered: July 19, 2006Report This Post
Platinum Member
posted Hide Post
Hi,

Should be something like this :

TABLE FILE PEOPLE_DIM
PRINT *
WHERE (CORP_ID EQ '&corp_id' AND END_DT IS MISSING)
END

Make sure that the master and access-file for this table exist

P.


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Expert
posted Hide Post
.... or using SQL PASSTHRU -

 ENGINE SQLMSS SET SERVER [connector name]
-* Where [connector name] is a valid connector in your configuration
-* Check WebFOCUS manuals or consult with your WF administrator
-*
-* Set the engine to the SQL datasource you are going to use
 SET SQLENGINE = SQLMSS
-* Turn varchar recognition off - comment out if not required
 SQL SQLMSS SET VARCHAR OFF
-RUN

SQL
  SELECT *
    FROM people_dim
   WHERE MGR_CORP_ID in (SELECT MGR_CORP_ID
                           FROM people_dim
                          WHERE CORP_ID='&corp_id' AND end_dt is null)
;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS anyname
END
-RUN

TABLE FILE anyname
PRINT field ........
WHERE field EQ somevalue
END


I tend to use upper case for SQL syntax but you can use mixed case if you want. The column names MUST be as the datasource column name (as per SQL!).

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
Platinum Member
posted Hide Post
Yup T.,

But would this pass-thru suffice?

  
SQL
  SELECT *
    FROM people_dim
   WHERE CORP_ID='&corp_id' AND end_dt is null
;
TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS anyname
END



D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Expert
posted Hide Post
Just repeating the SQL provided Pete, not intending to teach SQL on this forum Wink Music

lol

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
Platinum Member
posted Hide Post
*smirk*


D: WF 7.6.2 P. : WF 7.6.2 on W2003
------------------------------------------------------------------
I see myself as an intelligent, sensitive human, with the soul of a clown which forces me to blow it at the most important moments.

-Jim Morrison-

 
Posts: 206 | Registered: February 25, 2005Report This Post
Expert
posted Hide Post
Hi all,

FYI, the issue has been resolved as Animesh tried the suggestions on this topic. Many thanks for everyone's input. Good One

Cheers,

Kerry


Kerry Zhan
Focal Point Moderator
Information Builders, Inc.
 
Posts: 1948 | Location: New York | Registered: November 16, 2004Report This Post
Member
posted Hide Post
Hi,
I am really sorry for the late response.I would like to thanx everyone for their valuable inputs & their precoius time. Good One
 
Posts: 10 | Registered: July 19, 2006Report This Post
Member
posted Hide Post
quote:
Originally posted by Animesh Verma:
Hi,
I am working with WebFocus for the first time and i dont know how to write the following sql query in Webfocus.I know we can write sql query in WebFocus but i want to know how to write in Webfocus syntax.Here is the query

select * from people_dim where MGR_CORP_ID in

(select MGR_CORP_ID from people_dim where CORP_ID='&corp_id' and end_dt is null )


If anyone can please help me out with this fast. Idea


Hi, i think this will help u..

TABLE FILE PEOPLE_DIM
PRINT *
WHERE (CORP_ID EQ '&corp_id' AND END_DT EQ '')
END


regards,
mathan Sathianathan


WebFOCUS 7.x
Windows, All Outputs
 
Posts: 19 | Registered: January 10, 2012Report This Post
Virtuoso
posted Hide Post
Hey Mathan,

Para-phrasing Tom Flynn when I did something similar a while ago, I'm sure Animesh already found a solution to this more than 5 years ago Big Grin

It's easy to get caught in the loop whenever one is looking for "stuff" here in the forum and ends up giving thought to really old posts which may not be relevant to author anymore ... been there, done that myself Roll Eyes

By the way, welcome to the forum! Smiler



Prod/Dev: WF Server 8008/Win 2008 - WF Client 8008/Win 2008 - Dev. Studio: 8008/Windows 7 - DBMS: Oracle 11g Rel 2
Test: Dev. Studio 8008 /Windows 7 (Local) Output:HTML, EXL2K.
 
Posts: 1533 | Registered: August 12, 2005Report 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] How to convert SQL query into WebFocus query

Copyright © 1996-2020 Information Builders