Re: Stored Procedure Question
Posted in 1994
> Does anyone know of a way to uniquely identify an instance > of a stored procedure call within the stored procedure? > > My problem is that I am doing a system call within the > stored procedure to execute a program that takes a very > large parameter list. There seems to be a 256 character limit > on a string passed to a system call within a stored procedure, > so what I was trying to do is write the executable call to a > file via a number of system calls then execute that. The problem with this > approach is that I need to uniquely identify the file I am writing > to per stored procedure instance because there is a good chance > that multiple instances could be executing at the same time. How about: In the first run of the system program that is creating this file. The program chooses a numeric name for the file that it is going to create. For example it could use the process id number as a start and then check that no such file already exists. If it does add one and try again, if it doesn't create file and write initial data to it. Then program would then exit with an error status of the value of the name of the file. The stored procedure would trap the error message and pick up the name of the file from the ISAM error number. The next call to the program would pass the file name as a parameter and the program run would use that to open the correct file. The last run would then need to run the final process and then delete the file created. Hope that helps. Your choice of numbers may be constrained by the max size of the operating system error number. Cheers - Jim My opinions are my own. They may vary with time but they remain MINE! ---------------------------------------------------------------------- Name: Jim Gordon Internet: jgordon@ssf-sys.DHL.COM Company: DHL Systems Inc Phone: (415) 375-5222 Address: 700 Airport Blvd. #300 Fax: (415) 375-5019 Burlingame, CA 94010-1937 ----------------------------------------------------------------------