Re: Determining what database your connected to in a SP
Posted in 1998
In article <362BA7EC.FFF65030@cfer.com>, D. Sandmann <sandman@cfer.com> writes >I have a stored procedure that is distributed accross many databases >(development, testing, certification, training and production). The >development and testing db reside on the same box in two different >instances. The certification and training database reside on the same >box on the same instance. The production database resides on its own >system and instance. > >The stored procedure makes a system call that runs a shell script which >then calls a 4GL program to generate a report. > >I would like the stored procedure to tell my shell script which >database/instance it is being called from. Based on that information the >shell would then know what environment variables to set up and what 4gl >program to call. > >I do not want to hardcode that information into the stored procedure >because we sometimes take a snapshot of the production database and >place the snapshot on the other databases. > $INFORMIXSERVER IS set when the stored procedure is run! ^^ This appears to work ok!! I would use $INFORMIXSERVER (and nothing else!). Nothing guarantees it is set but it appears to be, try a stored procedure which does env > /tmp/1 first!! >Any help!! > >Thanks in advance, >David S. > -- David Williams Maintainer of the Informix FAQ Primary site (Beta Version) http://www.smooth1.demon.co.uk Official site http://www.iiug.org/techinfo/faq/faq_top.html I see you standin', Standin' on your own, It's such a lonely place for you, For you to be If you need a shoulder, Or if you need a friend, I'll be here standing, Until the bitter end... So don't chastise me Or think I, I mean you harm... All I ever wanted Was for you To know that I care