[comp.databases] INGRES - Switching databases at run time ???

mohan@ihlpf.ATT.COM (Mohan Palat) (05/02/89)

	The Winter/Spring 1989 issue of the INGRES Connection newletter
	has an interesting technical suggestion that apparently does 
	not seem to work. It says, 

	"Any INGRES executable can be pointed to a database different
	from the one originally used for development. For example, if
	you created the application executable, newapp, while using a 
	database called testdb, that database is the one opened when you
	run newapp. To run the same application executable against another
	database (say fulldb), execute the command newapp -d fulldb."

	In other words, if I had a .qc program in which I open a database
	(say, ## ingres testdb), I should be able to replace testdb at run
	time with some other database by using the -d flag. Well, it looks
	like there's something more to it than what the newsletter suggests.
	Any ideas?

	Mohan Palat
	att!ihlpf!mohan

	P.S.: Of course, one can use an equel/c variable as the database
	      name, and pass in the name at run time as an argument.
-- 
MOHAN PALAT

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

In article <8372@ihlpf.ATT.COM>, mohan@ihlpf (Mohan Palat) writes:

>The Winter/Spring 1989 issue of the INGRES Connection newletter [said
>that] any INGRES executable can be pointed to an arbitrary database
>by executing the command with the sytax "appcmd -d dbname"

Not without specific code in the application to parse the -d option
and implement it as specified.  I suspect that's what the writer
meant, but it sure isn't what the article stated.

-- Jon
-- 

cs_bob@gsbacd.uchicago.edu (05/03/89)

>	"Any INGRES executable can be pointed to a database different
>	from the one originally used for development. 

I think that should read something like "Any INGRES 4GL executable..." .
This is important for OSL, since it doesn't provide an explicit CONNECT
statement.

>	P.S.: Of course, one can use an equel/c variable as the database
>	      name, and pass in the name at run time as an argument.

And that's exactly the kind of thing you'll have to do. If you think about
it for a minute, you really wouldn't want it to work any other way.

R.Kohout

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

I'm not sure what you're driving at. I have used executables in a number of
ways, running against a number of data bases. Can you explain further what
it is you're trying to do?

Bruce

robf@squid.rtech.com (Robert Fair) (05/03/89)

Current versions of ABF imaged programs (i.e xx.exe) automatically
recognise the -d option on the command line , and will connect
to alternate databases at runtime without any user programming required.

This is described in both the current VMS and UNIX ABF manuals, in the
section "Running the Application on a Different Database"

Robert Fair,
RTI Tech Support