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     Batch command to create WebFOCUS Synonyms

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Batch command to create WebFOCUS Synonyms
 Login/Join
 
Expert
posted
Does anyone know the batch command to create synonyms?

There is a REFRESH SYNONYM command that works on one previously created synonym. I searched the documentation CD for WebFOCUS 5.3.2 and have found no documentation on this command.

Since there is an annoying limitation on creating synonyms using the WebFOCUS 5.3.4 Server Console, I would like to use a batch command to create synonyms for about 500 DB2 tables.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Francis,

I think the syntax is something like -

CREATE SYNONYM [synonym name] FOR [target] AT [server]

If you parameterise the items in square brackets it should allow you to batch it.

T

This message has been edited. Last edited by: Tony A,



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
Expert
posted Hide Post
Just checked the syntax (memory from EDA 4.3.1 ish) and it is now -

CREATE SYNONYM [app name]/[new synonym] FOR [target table] DBMS [dbms type i.e. SQLMSS] AT [adapter name]
END

The END is important

You can also issue a DROP SYNONYM [app name]/[new synonym] if required

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
Expert
posted Hide Post
Tony, thanks very much. I suppose I will have to issue a DROP in case the synonym already exists, unless there's a replace command.

Where did you find the syntax - I've been looking everywhere!

Thanks.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Tony, I built a little fex to read the DB2 SYSCAT TABLES table and then use Dialog Manager to run DROP and CREATE SYNONYM command for each table.

Worked like a charm.

Cheers.


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Expert
posted Hide Post
Francis, found and copied this long ago:

APP HOLD IBISAMP
SQL SQLORA
SELECT OWNER, TABLE_NAME FROM ALL_TABLES;
TABLE FILE SQLOUT
PRINT TABLE_NAME
WHERE TABLE_NAME NOT CONTAINS '$' OR '/' OR 'SMP';
WHERE OWNER CONTAINS 'PCGRP';
ON TABLE HOLD AS LISTHOLD FORMAT ALPHA
END

APP DELETE TEST
APP CREATE TEST
-RUN
APP HOLD TEST
FILEDEF LISTHOLD DISK E:\ibi\apps\ibisamp\listhold.ftm
-RUN

-SET &TABLE=' ';
-LP
-READ LISTHOLD &TABLE.A30.
-IF &IORETURN NE 0 GOTO NOMORE;
CREATE SYNONYM &TABLE FOR &TABLE DBMS SQLORA
END
-GOTO LP
-NOMORE


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
 
Posts: 1972 | Location: Centennial, CO | Registered: January 31, 2006Report This Post
Expert
posted Hide Post
Tom, thank you. My fex is very similar.

SET HOLDFORMAT      = ALPHA
-RUN

TABLE FILE SYSCAT_TABLES
PRINT 
TABSCHEMA
TABNAME
WHERE TABSCHEMA IN ('BASEL', 'BSLC');
-***WHERE RECORDLIMIT EQ 10
ON TABLE HOLD AS HOLD01
END
-RUN
-SET &NBR_TABLES = &LINES;

-REPEAT END_REP001 &NBR_TABLES TIMES

-READ HOLD01 NOCLOSE &TABSCHEMA.A128. &TABNAME.A128.

-SET &TAB_NAME = &TABSCHEMA || '.' || &TABNAME;
-SET &SYN_NAME = &TABSCHEMA || '_' || &TABNAME;

-*CREATE SYNONYM [app name]/[new synonym] FOR [target table] DBMS [dbms type i.e. SQLMSS] AT [adapter name]

DROP SYNONYM basel/&SYN_NAME
END
-RUN

CREATE SYNONYM basel/&SYN_NAME FOR &TAB_NAME DBMS DB2 AT BSL
END
-RUN

-END_REP001


Cheers.

This message has been edited. Last edited by: Francis Mariani,


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
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 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     Batch command to create WebFOCUS Synonyms

Copyright © 1996-2020 Information Builders