[comp.databases] Ingres OSL-passing parameters from command line

overby@agrigene.UUCP (Scott Overby) (04/03/89)

Can one pass in parameters/values to an Ingres OSL program at the time of
program execution? e.g. progamname frame value,...,value.  If so, how?

Scott Overby
Agigenetics
Madison, WI

bg0l+@andrew.cmu.edu (Bruce E. Golightly) (04/05/89)

I haven't tried it, but defining things as symbols or logicals might
provide the necessary functionality. I have not successfully passed
run time parameters to ABF/OSL. I consistantly get an error complaining
about the attempt (I don't remember the message off hand - haven't tried
for a while.).

This is a point I wish we could get around easily at times. Every once in
a while, I come up with a case where I really like to call a frame with
parameters directly from the operating system level.

Bruce

jkrueger@daitc.daitc.mil (Jonathan Krueger) (04/05/89)

In article <470@agrigene.UUCP>, overby@agrigene (Scott Overby) writes:
>Can one pass in parameters/values to an Ingres OSL program at the time of
>program execution? e.g. progamname frame value,...,value.

No command line args, other than the name of the first frame.

Other ways to pass information (not my ideas, nor recommended by me):
	environmental variables, read with trnlog() or getenv()
	write to file, read from file
	append to database table, retrieve from table

-- Jon
-- 
-- 

mitchell@wdl1.UUCP (Jo Mitchell) (04/06/89)

	Or you could have your OSL call a QC procedure
	which could extract parameters from logicals or environment variables.

	Or you could embed your executable in a script or command procedure. When your 
	command procedure receives the parameters have it place these in a database 
	table (private).  Now, in your OSL retrieve from this
	table your parameters. 

	Or you could prompt your user.

	

DMasterson@cup.portal.com (David Scott Masterson) (04/06/89)

In message <470@agrigene.UUCP>, overby@agrigene.UUCP writes:
>
>Can one pass in parameters/values to an Ingres OSL program at the time of
>program execution? e.g. progamname frame value,...,value.  If so, how?
>
>Scott Overby
>Agigenetics
>Madison, WI
>
By definition -- NO!   !@#%&^*?!

OSL programs are started at frames.  Frames do not have parameters, they
have field names (as in the forms that they display).  OSL procedures
have parameters.  Therefore, the only way that it might be done is to
call a procedure from the command line.

However, I do not believe that the main procedure that Ingres supplies
with ABF is set up for command line arguments beyond the database name
(-ddbname) and the framename.  You could look around in ~ingres/files
for abfmain.[co] (I think) which should be the installed main routine
that is called by the compiled program.  You could try replacing it with
your own routine, but I never saw any documentation on what functionality
the main() routine has to support, so you're on your own.

How about a quick hack?  Define a relation within the database for
passing arguments to your programs.  Then develop a shell/command 
file (you are using Unix or VMS, aren't you ;-) that reads the command
line arguments, calls sql/quel to insert the values into the relation,
then starts up your application with the appropriate frame name.  The
definition of the frame would include an "initialize" section that 
would retrieve the values from the relation and populate the fields
on the form accordingly (or whatever else you wanted to do with them).
Not exactly a barn burner, but should provide the functionality you
are after.  Later, you could convert the shell/command file into an
EQUEL/EQSL file.  Think about it.

David Masterson
DMasterson@cup.portal.com