Determining what database your connected to in a SP
Posted in 1998
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. Any help!! Thanks in advance, David S.