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] JOIN SQL passthru output to HOLD table

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] JOIN SQL passthru output to HOLD table
 Login/Join
 
Gold member
posted
I am trying to generate an exception report based on metadata and the output of a SQL sorred procedure which returns what should be present. Basically, I will examine two conditions:

1] If SQL says the synonym should be present, and it is not, CREATE SYNONYM

2] If synonym is present, but should not be, queue e-mail to start DELETE SYNONYM wqorkflow.

I am holding the data of current synonyms, since I am iterating through them to do a REFRESH SYNONYM on each:

TABLEF FILE _EDAHOME/CATALOG/SYSAPPS 
PRINT 
   APPNAME
   COMPUTE SYNNAME/A1250 = APPFULL || '/' || FNAME;
WHERE NOT APPNAME IN (..);
WHERE FEXT EQ 'mas';
ON TABLE HOLD AS HMASTER FORMAT ALPHA
END


Then, later, I run the passthur to get the master list, and try to JOIN to get exceptions:

ENGINE SQLMSS SET DEFAULT_CONNECTION N1_Report_POL_ASP2
SQL SQLMSS EX Report_Services.dbo.Query_Writer_Views_Get;
 
JOIN LEFT_OUTER SYNNAME IN HMASTER TO UNIQUE Name IN SQLOUT
TABLE FILE SQLOUT
PRINT *
WHERE SYNNAME IS MISSING
 END


this is where I can use some help, since I feel I am on the right track, but I am obviously astray, since I get the error:

                                                    
0 ERROR AT OR NEAR LINE      5  IN PROCEDURE SQLOUT  FOCEXEC *                  
(FOC258) FIELDNAME OR COMPUTATIONAL ELEMENT NOT RECOGNIZED: SYNNAME
BYPASSING TO END OF COMMAND
(FOC009) INCOMPLETE REQUEST STATEMENT


There must be something I am missing on doing the join...

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


WebFOCUS 7.7.04M/8001
Windows Server 2008
Excel, PDF, HTML, AHTML

http://www.plex.com
 
Posts: 73 | Location: Auburn Hills, MI | Registered: September 29, 2011Report This Post
Member
posted Hide Post
I am just taking a shot in the dark on this answer since our SQL passthru is annoyingly disabled.

  
ENGINE SQLMSS SET DEFAULT_CONNECTION N1_Report_POL_ASP2
SQL SQLMSS EX Report_Services.dbo.Query_Writer_Views_Get;

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HSQLOUT FORMAT ALPHA
END

JOIN LEFT_OUTER SYNNAME IN HMASTER TO UNIQUE Name IN HSQLOUT AS J0 END

TABLE FILE HMASTER
PRINT *
WHERE SYNNAME IS MISSING
 END


The above code is suggesting to print and hold the sqlout file, then do a join with your HMASTER hold.

Also depending on both hold file field names, you may get an ambiguous name error unless you fully write out the field.

Just to add again I may be absolutely incorrect but it is worth a try.


Developer Studio 7.7.02
Windows XP Pro SP3 and Windows 7 64bit
all output
 
Posts: 20 | Registered: January 27, 2010Report This Post
Gold member
posted Hide Post
Thanks! It seems like there still may be a syntax issue there, as I am getting

(FOC376) SYNTAX ERROR OR MISSING ELEMENT IN JOIN/COMBINE COMMAND:


I thought it might be some missing -RUNs, so I tried

TABLE FILE SQLOUT
PRINT *
ON TABLE HOLD AS HSQLOUT FORMAT ALPHA
END
-RUN
 
JOIN LEFT_OUTER SYNNAME IN HMASTER TO UNIQUE Name IN HSQLOUT AS J0 END
-RUN
...

But no luck, yet. I think this is going in the right direction, though.


WebFOCUS 7.7.04M/8001
Windows Server 2008
Excel, PDF, HTML, AHTML

http://www.plex.com
 
Posts: 73 | Location: Auburn Hills, MI | Registered: September 29, 2011Report This Post
Gold member
posted Hide Post
I got it working, basically, I found I had to:

1] Use FOCUS format for each hold table with an index

2] Make sure the JOIN columns were of the same data type.

Here is basically my finished code:

…

TABLEF FILE _EDAHOME/CATALOG/SYSAPPS 
PRINT 
   -*APPNAME
   CONNECT
   APPFULL
   FNAME
   COMPUTE SYNONYM_NAME/A256 = UPCASE(256, FNAME, 'A256');
   COMPUTE SYNNAME/A1250 = APPFULL || '/' || FNAME;
-*WHERE …
WHERE FEXT EQ 'mas';
ON TABLE HOLD AS HMASTER FORMAT FOCUS INDEX SYNONYM_NAME
-* Need to have same data types to join later: (FOC237) LINKED AND REAL FIELD HAVE DIFFERENT FORMATS: NAME
-*(FOC36390)  LW internal error: Indexed field 'SYNONYM_NAME' is too long (limit is A256)
-*FORMAT ALPHA
END
-RUN
 
…
 

-* seek any SQW Views to add
ENGINE SQLMSS SET DEFAULT_CONNECTION …
SQL SQLMSS EX Report_Services.dbo.Query_Writer_Views_Get;
 
TABLE FILE SQLOUT
PRINT 
   COMPUTE SQLVIEW/A256 = UPCASE(256, NAME, 'A256');
ON TABLE HOLD AS HSQLOUT FORMAT FOCUS INDEX SQLVIEW
END
-RUN

JOIN LEFT_OUTER SQLVIEW IN HSQLOUT TO UNIQUE SYNONYM_NAME IN HMASTER AS J0
-RUN

 
TABLE FILE HSQLOUT
PRINT *
END
-RUN
-EXIT
 
…

This message has been edited. Last edited by: TOM SCHULTE,


WebFOCUS 7.7.04M/8001
Windows Server 2008
Excel, PDF, HTML, AHTML

http://www.plex.com
 
Posts: 73 | Location: Auburn Hills, MI | Registered: September 29, 2011Report 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] JOIN SQL passthru output to HOLD table

Copyright © 1996-2020 Information Builders