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
September 28, 2006, 11:01 AM
Tony A
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.
TThis 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
September 28, 2006, 11:13 AM
Tony A
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
September 28, 2006, 11:27 AM
Francis Mariani
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
September 28, 2006, 11:57 AM
Francis Mariani
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
September 28, 2006, 12:01 PM
Tom Flynn
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