Focal Point
[CLOSED] Create temporary table to database.

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/5177072676

May 20, 2015, 06:19 PM
as2010
[CLOSED] Create temporary table to database.
Hi experts.

I have code where i create a table in database (Netezza) like this:

TABLE FILE TABLE_A
PRINT *
ON TABLE HOLD AS TMP FORMAT SQLNEZ

This creates every time i run the code a persistent table, which leads to concurrency problems.

What i would like to is create a table that is like a temporary table which lives in the session and has a unique name being discarted when session ends.

Is there any parameter to do that?

Thanks in advance.

This message has been edited. Last edited by: <Kathryn Henning>,


7706M
AIX 7.1
HTML
May 21, 2015, 08:50 AM
jgelona
There's no parameter to do that because the temporary table is in the database. You would need to use the DROP TABLE command somewhere in your job flow. However, with Oracle, DROP TABLE is a privileged command, I would assume that it is in Netezza as well.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.
May 21, 2015, 10:11 AM
yajmire
Before you execute code to generate new table drop existing table

ENGINE SQLNEZ SET DEFAULT_CONNECTION VirtualDebit
SQL SQLNEZ DROP TABLE TMP ;
END


WF7702
May 21, 2015, 10:18 AM
Francis Mariani
FYI, for MS SQL Server only, you can create a temporary table by prefixing the table name with a #:
TABLE FILE MSCRM_LIST
PRINT
LISTNAME
WHERE RECORDLIMIT EQ 10
ON TABLE HOLD AS #HLIST FORMAT SQLMSS
END



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
May 21, 2015, 11:01 AM
Wep5622
Just yesterday I stumbled about something like that in the documentation of the FORMAT keyword.

If your data is from the same database, apparently you can use FORMAT SAMEDB.
That will create a temporary table in the same DB with your table results.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :