Focal Point
[CLOSED] Truncating a MS table

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

October 29, 2013, 02:57 PM
BigE
[CLOSED] Truncating a MS table
I have privs to truncate a table in MS Visual Studio, but I can not do this inside of my fex. The MSSQL connector is set up with the same account. I have tried the following:

ENGINE SQLMSS SET DEFAULT_CONNECTION LOAD_DATA
SQL SQLMSS
BEGIN TRANSACTION;
TRUNCATE TABLE BISSVTNAS;
COMMIT;
END
-RUN

I don not get an error.

This message has been edited. Last edited by: <Kathryn Henning>,
October 29, 2013, 03:34 PM
Francis Mariani
I have successfully truncated MS SQL Server tables without wrapping the command in a transaction:

SET SQLENGINE=SQLMSS

ENGINE SQLMSS SET DEFAULT_CONNECTION autumn

SQL
TRUNCATE TABLE apple.bushel;
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
October 29, 2013, 03:41 PM
Waz
BigE, I suspect that you have too many commands with semicolons, it probably never got to the TRUNCATE command.

Francis' post only has the one command.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

October 29, 2013, 04:04 PM
Francis Mariani
Waz is right. here is SQL that truncates multiple tables - no semi-colons:

SQL
TRUNCATE TABLE apple.transaction_tfcdbr
TRUNCATE TABLE apple.transaction_tfcd
TRUNCATE TABLE apple.transaction_tfc
TRUNCATE TABLE apple.transaction_tdbr
TRUNCATE TABLE apple.transaction_td

TRUNCATE TABLE apple.transaction_sfcdbr
TRUNCATE TABLE apple.transaction_sfcd
TRUNCATE TABLE apple.transaction_sfc
TRUNCATE TABLE apple.transaction_sdbr
TRUNCATE TABLE apple.transaction_sd
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
October 29, 2013, 04:21 PM
Francis Mariani
Some time ago I tried running a transaction as SQL passthru and had no luck. My notes suggest it used to work before WF v7.6.


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