Focal Point
[SOLVED] Default Connection ... with Table File?

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

March 02, 2007, 08:47 AM
Deborah Sullivan
[SOLVED] Default Connection ... with Table File?
I know you can set or override a default connection with SQL passthru, but is there a way to do essentially the same thing with a TABLE FILE request? I'm not seeing anything documented. Thanks much for any insight.

This message has been edited. Last edited by: <Kathryn Henning>,
March 02, 2007, 08:50 AM
Tom Flynn
Deborah,

APP PREPENDPATH foldername places that foldername at the beginning of the path, modifying the WebFOCUS PATH set in EDASPROF.prf

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 02, 2007, 08:54 AM
Deborah Sullivan
Thanks for the reponse, and so quickly! Does this also apply when I need to reference a different server though?
March 02, 2007, 08:56 AM
Tom Flynn
Deborah,

No, that is APP MAP servername/path; we usually place that in EDASPROF.prf so it is automaticalyy added to the PATH...

Here's an ecxample:

APP MAP DDNAME "//servername/path1/path2/etc"

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 02, 2007, 09:03 AM
mgrackin
Deborah,

Are you looking to override the CONNECTION attribute in the ACX file for an MFD?


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
March 02, 2007, 09:08 AM
Deborah Sullivan
Thanks. This would actually be the connection specified in the ACX file. We routinely override this in a SQL Passthru statement with "ENGINE SQLSYB SET DEFAULT_CONNECTION servername" but I have an app where the I need to change this for some TABLE FILE requests. I can change the ACX files, I just thought that it would be easier to do it on the report side, if it is doable anyway.
March 02, 2007, 09:13 AM
mgrackin
Deborah,

I think if you remove the CONNECTION attribute from the ACX file it will use the DEFAULT database. I think. I'm not sure. This of course would require issuing the ENGINE statement all the time sinc the ACX would not tell it what to use.


Thanks!

Mickey

FOCUS/WebFOCUS 1990 - 2011
March 02, 2007, 09:14 AM
Tom Flynn
Deborah,

We usually put the acx and mas into a different folder for a different server and use APP PREPENDPATH to access that table...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
March 03, 2007, 12:11 PM
Danny-SRL
Deborah,
I have a similar situation where I have more than one connection to access different databases. For example:
ENGINE SQLMSS SET CONNECTION_ATTRIBUTES ABC ...
ENGINE SQLMSS SET CONNECTION_ATTRIBUTES DEF ...
ENGINE SQLMSS SET CONNECTION_ATTRIBUTES XYZ ...

The default connection is the first one.
In order to access another database through the second connection I use in my FOCEXEC the following:
SQL SQLMSS SET SERVER DEF
Of course DEF could be a parameter.
Does this help?


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 04, 2007, 06:09 PM
Deborah Sullivan
quote:
SQL SQLMSS SET SERVER DEF


Thanks. It perhaps helps, but this looks like code you would use with a SQL statement, not a TABLE FILE statement. I'll try it though. Thanks again.
March 05, 2007, 03:57 AM
<JJI>
Deborah,
quote:
SQL SQLMSS SET SERVER DEF


This statement is indeed no statement that you should use in TABLE FILE code. You should use it just before the TABLE FILE code, to set the connection that has to be used for the code that follows. Hope this helps,

This message has been edited. Last edited by: <JJI>,
March 05, 2007, 11:35 AM
Danny-SRL
Deborah and JJI,

Correct!
SQL SQLMSS SET SERVER DEF
has to be issued prior any TABLE request which wants to access the database connected by DEF.


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

March 06, 2007, 03:59 PM
Deborah Sullivan
I ended up just using SQL Passthru to gather the data first. Thanks for the help!
August 11, 2014, 07:34 AM
Wep5622
I was looking for a solution to this same problem, but the suggested statement didn't change anything.
In our case, I used:
SQL SQLORA SET SERVER OracleUnilabTst


Instead, I copied the ENGINE SQLORA SET CONNECTION_ATTRIBUTES statement relevant to the database to query over from the edasprof.prf file and adjusted it to so that the name was that of the database to override. I put that line before the first TABLE request in our procedure.

For example:
ENGINE SQLORA SET CONNECTION_ATTRIBUTES AdapterName TNS_NAME/USERNAME,1234567890ABCDEF1234567890ABCDEF



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 :