Author |
Message
|
brin_seb |
Posted: Tue Jul 03, 2007 6:40 am Post subject: SHARED Variable and Database |
|
|
Novice
Joined: 10 Jun 2003 Posts: 24 Location: Luxembourg
|
I set shared variables. I set variables to different values depending environment.
Everything works fine except using Database.{host}
I receive this message : Unresolvable Database table reference "Database.{host}" |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jul 03, 2007 6:42 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What is the value of {host}? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
brin_seb |
Posted: Wed Jul 04, 2007 1:00 am Post subject: |
|
|
Novice
Joined: 10 Jun 2003 Posts: 24 Location: Luxembourg
|
DECLARE environnement EXTERNAL CHARACTER;
DECLARE host SHARED CHARACTER;
DECLARE hostTransidiom SHARED CHARACTER;
DECLARE portTransidiom SHARED INTEGER;
DECLARE dbhost SHARED CHARACTER;
DECLARE dbsoxx SHARED CHARACTER;
DECLARE dbpfint SHARED CHARACTER;
DECLARE dbicms SHARED CHARACTER;
CREATE PROCEDURE EnvInit()
BEGIN
if (environnement = 'dev') then
SET host = 'ICMSPTB';
SET hostTransidiom = 'magda';
SET portTransidiom = 1208;
SET dbhost = 'Database.ICMSPTB';
SET dbsoxx = 'cdedev1';
SET dbpfint = 'cdedev1.cdepfint00';
SET dbicms = 'P6B3';
elseif (environnement = 'rec') then
SET host = 'ICMSPTB';
SET hostTransidiom = 'magda';
SET portTransidiom = 1208;
SET dbhost = 'Database.ICMSPTB';
SET dbsoxx = 'cderecette';
SET dbpfint = 'cderecette.cdepfint00';
SET dbicms = 'P6B3';
elseif (environnement = 'prod') then
SET host = 'ICMSPTA';
SET hostTransidiom = 'magda2';
SET portTransidiom = 1208;
SET dbhost = 'Database.ICMSPTA';
SET dbsoxx = 'ptprod51';
SET dbpfint = 'ptprod51.cdepfint00';
SET dbicms = 'ICMS';
end if;
END; |
|
Back to top |
|
 |
elvis_gn |
Posted: Wed Jul 04, 2007 1:44 am Post subject: |
|
|
 Padawan
Joined: 08 Oct 2004 Posts: 1905 Location: Dubai
|
Hi brin_seb,
First of all, why do you have different table names in dev, test and production ? I can understand database name being different, but tables also ??
I think External variables should have a default value set in esql.
Code: |
DECLARE environnement EXTERNAL CHARACTER '<something>'; |
Did you take a trace and check what the broker made out of Database.{host}....most probably it was a non-existent table...
Regards. |
|
Back to top |
|
 |
marcin.kasinski |
Posted: Wed Jul 04, 2007 5:10 am Post subject: |
|
|
Sentinel
Joined: 21 Dec 2004 Posts: 850 Location: Poland / Warsaw
|
elvis_gn wrote: |
I think External variables should have a default value set in esql.
Code: |
DECLARE environnement EXTERNAL CHARACTER '<something>'; |
|
You can leave it blank here and initialize in bar during deployment. _________________ Marcin |
|
Back to top |
|
 |
wbi_telecom |
Posted: Thu Jul 05, 2007 9:19 am Post subject: |
|
|
 Disciple
Joined: 15 Feb 2006 Posts: 188 Location: Harrisburg, PA
|
Its very important that your EXTERNAL varible gets a value. if you initialize inside the node and then change it during the bar deployment the value you put during bar deployment takes precedence but if you do not set it to any default in the node and then forget to initialize it during bar deployment you are bound to get an error. So I would suggest have a default and overwrite it if you need to during deployment.
Cheers, |
|
Back to top |
|
 |
|