Focal Point
[SOLVED] Is it possible to have a variable element in an Access File?

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

March 18, 2012, 07:11 AM
Don Garland
[SOLVED] Is it possible to have a variable element in an Access File?
Thank you in advance for taking a look at this.
-*------------------------
Customer has three WebFOCUS environments; DEV, QA and PROD.

Objects (fex,htm,sty,mas,acx) are created in DEV, promoted to QA then PROD.

Customer does not want to edit the files after they have moved from DEV to higher environments

Consider the following two example acx files, the issue is in each environment the db_owner is slightly different. For other Oracle reasons, they can not make the db_owner the same name.

The question is, can we have a variable db_owner name as illustrated in the 2nd example?

-* Current version with hard coded name
SEGNAME=ARTATTRIB, TABLENAME=DB_OWNER.ARTATTRIB, CONNECTION=ABC, KEYS=0, $


-* Proposed variable table
SEGNAME=ARTATTRIB, TABLENAME=&DBOWNER.EVAL.ARTATTRIB, CONNECTION=ABC, KEYS=0, $

This message has been edited. Last edited by: Kerry,


WebFOCUS Administrator @ Worldpay FIS
PROD/DEV/TEST: 8204, SANDBOX: 8206 soon - BIP, Reportcaster, Resource Manager, EUM, HyperStage soon, DB: HIVE,Oracle,MSSQL
March 18, 2012, 10:05 AM
WF_IL
Hi

Yes, its possible to replace the TableName with a && global variable. I think its available in 7702.
Using the Developer Studio Synonym Editor GUI :

1. You have to add the variable to the master file (as a container)

2. Then you can change the TABLENAME to be equal to the variable

3. You can set the variable value in a profile or on the fex level before the TABLE FILE

Yours

Eran


Yours,
Eran
SRL Products

http://www.srl.co.il

March 18, 2012, 11:50 AM
Don Garland
This is exactly what I was hoping for. Unfortunately the WG systems is @ 7.6.11.

I'm not sure what you mean by 'container' in the master file?

But the access file would look something like this?

SEGNAME=ARTATTRIB, TABLENAME=&&GLOBALVAR, CONNECTION=ABC, KEYS=0, $ 


Thank you
March 18, 2012, 05:01 PM
Waz
In our environment, we remove the owner, and connection, nad have the report set these.

Is the Table name unique in each environment ? are there multiple schemas ?


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!

March 18, 2012, 07:37 PM
Don Garland
Everything is the same, except the db_owner. THe "TABLENAME=" is the only difference. The goal being, don't change a thing once it leaves the DEV environment.

BTW, this isn't SQL Passthru.

So you guys use something like?

SET CONNECTION_ATTRIBUTES dbasename/user,password


This isn't a show stopper, just a nice to have feature. Its really a simple issue, one minor thing to change during the process and there maybe around 100 MDF files total. But, the group that promotes are not developers, they wouldn't necessarily see a problem if they made a mistake.

Another idea is automate this change, run a script, post promotion into each env. That would eliminate human error.
March 18, 2012, 08:24 PM
Waz
Yes we do issue a SET CONNECTION_ATTRIBUTES, well actually we use:

SQL SQLORA SET USER
SQL SQLORA SET SERVER



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!

March 23, 2012, 07:34 AM
Don Garland
[SOLVED] Actually, an unrelated issue with the complexity of the GOLD Database forced us into SQL Passthru and it became a non-issue for moving forward.

Thanks for the comments and thoughts
April 11, 2013, 07:35 AM
Danny-SRL
To add to this converstion: in order to have a variable schema you can do the following.

In the MASTER after the FILENAME definition, add:
VARIABLE NAME=&&SCHEMA, [DEFAULT=owner,] $

In the ACCESS, code:
SEGNAME=segment, TABLENAME=&&SCHEMA..tablename, ... {notice the 2 periods after the &&variable}

Then you can either use the default value of &&SCHEMA or set it, either in EDASPROF or before you retrieve data from your table.

A very nice feature.


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

April 12, 2013, 10:34 AM
jgelona
I believe what Danny is describing is a 7.7 feature. I could use it much like the first poster but alas I am stuck on 7.6.11 (not my choice).


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.