Re: How to pass VAR from SQL forms to UNIX env.? Help!

From: Paul Mickel <mickel_at_OES.ORST.EDU>
Date: 6 Jul 1993 02:33:25 GMT
Message-ID: <21ao9l$g7_at_gaia.ucs.orst.edu>


In article <216rna$dl0_at_panix.com> gsa_at_panix.com (Gary Assa) writes:
>>Can any of you tell me how to pass VAR from SQL forms to unix env. and
>>vice versa?
>>I don't have pro*C or other languages that I can use for USER_EXIT.
>>Thanks in advanced.
>>
>Hw about this (although there must be better ways)
>Write the variable to a temp table, then when you exit the form, do a SQL
>statement to select from the table, and write out to a file. Then do a
>VARNAME=`cat {filename}`; export VARNAME

As for exporting a VAR out, one could also call a 'host' command with the 'ENVVAR=<whatever>' or the appropriate command contained in a string in a trigger, for instance. This would be the ideal way if you need a environment variable set for a particular program (such as a reportwriter) and you don't need it for anything else. Bear in mind that only the process executing the 'host' command will get the environment variable setting, and will be lost when control is passed back to sqlforms30, since the 'host' command executes as a separate process (as far as I can tell, anyway).

As for the other way around, I can't offer much off the top of my head.

-Paul

-- 
Paul M. Mickel			  	   Internet:mickel_at_oes.orst.edu
Database Programmer, Teledyne Wah Chang    Albany, OR   97321
Disclaimer: My employer never claims my opinions (unless it makes a profit).
Received on Tue Jul 06 1993 - 04:33:25 CEST

Original text of this message