Focal Point
[CLOSED] DB2 SQL Passthru WITHOUT DEFAULT_CONNECTION

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

April 18, 2018, 01:31 PM
Francis Mariani
[CLOSED] DB2 SQL Passthru WITHOUT DEFAULT_CONNECTION
In a fex I would like to run a SQL Passthru command, but I would like to NOT set the DEFAULT_CONNECTION. Is there some other way to specify the connection? If I use SET DEFAULT_CONNECTION, it may override something else that occurs in the fex.

Thanks,

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
April 18, 2018, 01:45 PM
FP Mod Chuck
Francis

The first connection listed in the edasprof.prf will be the default connection.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
April 18, 2018, 02:13 PM
Francis Mariani
I would like to run a SQL Passthru command without altering what the default connection is.

If the first connection in edasprof.prf is zzz and I want to use a SQL Passthru command that needs to connect to aaa and which is included in all fexes, how do I access aaa without overriding the first connection zzz? Does SQL COMMIT undo the DEFAULT_CONNECTION that I used to connect to aaa?


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
April 18, 2018, 02:18 PM
Francis Mariani
If I must use DEFAULT_CONNECTION then maybe this command undoes this back to the default connection of the first connection listed in edasprof.prf:

ENGINE aaa SET AUTODISCONNECT ON COMMIT


As long as I also have a COMMIT command...


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
April 18, 2018, 03:50 PM
Aswin Ravikumar
 
SQL SQLORA
select * from db_name where rownum<5;
;
TABLE FILE SQLOUT
PRINT *
END
 


This works for me . It automatically takes the first defined adapter configuration from edaprof


Webfocus 8.1
Windows x64
Excel
April 18, 2018, 03:51 PM
Aswin Ravikumar
quote:
Originally posted by Aswin Ravikumar:
the first defined adapter configuration from edaprof


By this i mean first configured oracle adapter.


Thanks,
Aswin Ravikumar


Webfocus 8.1
Windows x64
Excel
April 18, 2018, 03:54 PM
Francis Mariani
I don't want the first configured adapter, I need one specific adapter for one request, then the default (or specified) adapter for any other requests.


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
April 19, 2018, 07:01 AM
Martin vK
Hi Francis,
Is it possible to put the SQL Passthru command in a separate fex and execute it with EX to run in a separate agent with its own database connection, so the original procedure keeps its own connection as well.
If the SQL Passthru is dependant on all kind of parameters in the original procedure which would not be available in the EXecuted procedure, maybe you could dynamically create this procedure.
Hope this works.


WebFocus 8203M, iWay DataMigrator, Windows, DB2 Windows V10.5, MS SQL Server, Azure SQL, Hyperstage, ReportCaster
April 19, 2018, 07:29 AM
Frans
Is it an option to do the SQL passthru in the masterfile (create a separate .sql file and reference it with DATASET)?


Test: WF 8.2
Prod: WF 8.2
DB: Progress, REST, IBM UniVerse/UniData, SQLServer, MySQL, PostgreSQL, Oracle, Greenplum, Athena.
April 19, 2018, 08:39 AM
Francis Mariani
Martin, I like your idea.
Frans, your idea is a possibility too.

Thanks very much.


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