Reading environment variables
Posted in 2005
Topics: Server Administration
People,
Is there a way to read the environment variables from within dbaccess?
for example
select '$INFORMIXDIR' from systables where tabid =1'
Thanks in advance
Kenneth
KENNETH PENZA said:
>
> People,
>
> Is there a way to read the environment variables from within
> dbaccess?
>
> for example
>
> select '$INFORMIXDIR' from systables where tabid =1'
dbaccess dbname <<!EOF
!echo $INFORMIXDIR
!EOF
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien à dire qu'il faut fermer sa gueule"
- Coluche
A smile is a gift that is free to the giver and precious to the recipient.
But giving someone the finger is free too, and I find it more personal and
sincere.
KENNETH PENZA wrote:
> People,
>
> Is there a way to read the environment variables from within dbaccess?
>
> for example
>
> select '$INFORMIXDIR' from systables where tabid =1'
>
> Thanks in advance
>
> Kenneth
>
>
No, but SQSL will do that for you
Source code at http://www.4glworks.com/sqslsource.htm
Language reference at http://www.4glworks.com/sqslref.htm
--
Ciao,
Marco
______________________________________________________________________________
Marco Greco /UK /IBM Standard disclaimers apply!
Informix faq http://www.iiug.org/techinfo/faq/informix.htm
4glworks http://www.4glworks.com
Informix on Linux http://www.4glworks.com/ifmxlinux.htm
Hi,
If you include dbaccess in a shell script, you could do it, but NOT within
the interactive mode of dbaccess.
ex:
... any shell commands
ENV_INFX_DIR=`dbaccess <database> - <<EOF 2>/dev/null
select '$INFORMIXDIR' as env1 from systables where tabid=1;
EOF
.. any other shell commands
Regards,
Khaled Bentebal
ConsultiX
Tél: 33 (0) 1 39 12 18 00
Fax: 33 (0) 1 39 12 18 18
Mobile: 33 (0) 6 07 78 41 97
Email: khaled.bentebal@consult-ix.fr
Site Web: http://www.consult-ix.fr
----- Original Message -----
From: "KENNETH PENZA" <kenneth.penza@gov.mt>
To: <ids@iiug.org>
Sent: Thursday, July 07, 2005 9:50 AM
Subject: Reading environment variables [5368]
> People,
>
> Is there a way to read the environment variables from within
dbaccess?
>
> for example
>
> select '$INFORMIXDIR' from systables where tabid =1'
>
> Thanks in advance
>
> Kenneth
>
>
--0__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: multipart/alternative;
Boundary="1__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5"
--1__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: text/plain; charset=US-ASCII
Content-transfer-encoding: quoted-printable
To read environment variable that $INFORMIXDIR
should have to be processed and that facility is not available with
Informix database engine
But if you want in program you can use fgl_getenv() to retrieve the con=
tent
of Environment Variable
Regards,
Prateek Jain
Reliance Industries Limited
(M) - 09426387793
(O) - 079 - 30215010 (Ext - 383)
=
"Marco Greco " =
<marco@4glworks.c To: ids@iiug.org =
om> cc: =
Sent by: Subject: Re: Reading en=
vironment variables [5372]
forum.subscriber@ =
iiug.org =
=
=
07/07/05 03:44 PM =
=
KENNETH PENZA wrote:
> People,
>
> Is there a way to read the environment variables from within
dbaccess?
>
> for example
>
> select '$INFORMIXDIR' from systables where tabid =3D1'
>
> Thanks in advance
>
> Kenneth
>
>
No, but SQSL will do that for you
Source code at http://www.4glworks.com/sqslsource.htm
Language reference at http://www.4glworks.com/sqslref.htm
--
Ciao,
Marco
_______________________________________________________________________=
_______
Marco Greco /UK /IBM Standard
disclaimers apply!
Informix faq
http://www.iiug.org/techinfo/faq/informix.htm
4glworks
http://www.4glworks.com
Informix on Linux
http://www.4glworks.com/ifmxlinux.htm
=
--1__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: text/html; charset=US-ASCII
Content-Disposition: inline
Content-transfer-encoding: quoted-printable
<html><body>
<p>To read environment variable that $INFORMIXDIR <br>
should have to be processed and that facility is not available with Inf=
ormix database engine<br>
But if you want in program you can use fgl_getenv() to retrieve the con=
tent of Environment Variable<br>
<br>
<br>
<br>
Regards,<br>
Prateek Jain<br>
Reliance Industries Limited<br>
(M) - 09426387793<br>
(O) - 079 - 30215010 (Ext - 383)<br>
<img src=3D"cid:10__=3DEABBFAA4DFD6B1D58f9e8a93df938690@ril.com" width=3D=
"16" height=3D"16" alt=3D"Inactive hide details for "Marco Greco &=
quot; <marco@4glworks.com>">"Marco Greco " <marco@4g=
lworks.com><br>
<br>
<br>
<table V5DOTBL=3Dtrue width=3D"100%" border=3D"0" cellspacing=3D"0" cel=
lpadding=3D"0">
<tr valign=3D"top"><td width=3D"1%"><img src=3D"cid:20__=3DEABBFAA4DFD6=
B1D58f9e8a93df938690@ril.com" border=3D"0" height=3D"1" width=3D"72" al=
t=3D""><br>
</td><td style=3D"background-image:url(cid:30__=3DEABBFAA4DFD6B1D58f9e8=
a93df938690@ril.com); background-repeat: no-repeat; " width=3D"1%"><img=
src=3D"cid:20__=3DEABBFAA4DFD6B1D58f9e8a93df938690@ril.com" border=3D"=
0" height=3D"1" width=3D"225" alt=3D""><br>
<ul>
<ul>
<ul>
<ul><b><font size=3D"2">"Marco Greco " <marco@4glworks.com=
></font></b><br>
<font size=3D"2">Sent by: forum.subscriber@iiug.org</font>
<p><font size=3D"2">07/07/05 03:44 PM</font></ul>
</ul>
</ul>
</ul>
</td><td width=3D"100%"><img src=3D"cid:20__=3DEABBFAA4DFD6B1D58f9e8a93=
df938690@ril.com" border=3D"0" height=3D"1" width=3D"1" alt=3D""><br>
<font size=3D"1" face=3D"Arial"> </font><br>
<font size=3D"2"> To: </font><font size=3D"2">ids@iiug.org</font><br>
<font size=3D"2"> cc: </font><br>
<font size=3D"2"> Subject: </font><font size=3D"2">Re: Reading environm=
ent variables [5372]</font></td></tr>
</table>
<br>
<br>
<tt>KENNETH PENZA wrote:<br>
> People,<br>
> <br>
> Is there a way to read the environment variabl=
es from within dbaccess?<br>
> <br>
> for example<br>
> <br>
> select '$INFORMIXDIR' from systables where tabid =3D1'<br>
> <br>
> Thanks in advance <br>
> <br>
> Kenneth<br>
> <br>
> <br>
<br>
No, but SQSL will do that for you<br>
<br>
Source code at </tt><tt><a href=3D"http://www.4glworks.com/sqslsource.h=
tm">http://www.4glworks.com/sqslsource.htm</a></tt><tt><br>
Language reference at </tt><tt><a href=3D"http://www.4glworks.com/sqslr=
ef.htm">http://www.4glworks.com/sqslref.htm</a></tt><tt><br>
-- <br>
Ciao,<br>
Marco<br>
_______________________________________________________________________=
_______<br>
Marco Greco /UK /IBM &nb=
sp; Standard disclaimers apply!<br>
<br>
Informix faq &n=
bsp; </tt><tt><a href=3D"http://www.iiug.org/techinfo/faq/inform=
ix.htm">http://www.iiug.org/techinfo/faq/informix.htm</a></tt><tt><br>
4glworks =
=
</tt><tt><a href=3D"http://www.4glworks.com=
">http://www.4glworks.com</a></tt><tt><br>
Informix on Linux &nbs=
p; </tt><tt><a href=3D"http://www.4glworks.c=
om/ifmxlinux.htm">http://www.4glworks.com/ifmxlinux.htm</a></tt><tt><br=
>
<br>
<br>
</tt>
</body></html>=
--1__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5--
--0__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: image/gif;
name="graycol.gif"
Content-Disposition: inline; filename="graycol.gif"
Content-ID: <10__=EABBFAA4DFD6B1D58f9e8a93df938690@ril.com>
Content-transfer-encoding: base64
R0lGODlhEAAQAKECAMzMzAAAAP///wAAACH5BAEAAAIALAAAAAAQABAAAAIXlI+py+0PopwxUbpu
ZRfKZ2zgSJbmSRYAIf4fT3B0aW1pemVkIGJ5IFVsZWFkIFNtYXJ0U2F2ZXIhAAA7
--0__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: image/gif;
name="ecblank.gif"
Content-Disposition: inline; filename="ecblank.gif"
Content-ID: <20__=EABBFAA4DFD6B1D58f9e8a93df938690@ril.com>
Content-transfer-encoding: base64
R0lGODlhEAABAIAAAAAAAP///yH5BAEAAAEALAAAAAAQAAEAAAIEjI8ZBQA7
--0__=EABBFAA4DFD6B1D58f9e8a93df938690918cEABBFAA4DFD6B1D5
Content-type: image/gif;
name="pic15350.gif"
Content-Disposition: inline; filename="pic15350.gif"
Content-ID: <30__=EABBFAA4DFD6B1D58f9e8a93df938690@ril.com>
Content-transfer-encoding: base64
R0lGODlhWABDALP/AAAAAK04Qf79/o+Gm7WuwlNObwoJFCsoSMDAwGFsmIuezf///wAAAAAAAAAA
AAAAACH5BAEAAAgALAAAAABYAEMAQAT/EMlJq704682770RiFMRinqggEUNSHIch