[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

Re[2]: Database name variable?



     I've had this same problem; why SQR doesn't have a global variable for
     the database name I don't know.  In Sybase however it's easy enough to
     accomplish by running the following select:

     Begin-Select
     db_name()   &db_name
     End-Select

     This will give you the name of the active database in the variable
     &db_name.

     Good luck,
     Tim Green                                       Tim_Green@mercer.com
     Administrative Solutions Group
     "An ADP Mercer Alliance"


______________________________ Reply Separator _________________________________
Subject: Re: Database name variable?
Author:  SQR-USERS@USA.NET at uucp
Date:    12/01/97 11:14 AM


I am currently using Sybase. What was your alternate plan?

Bob Smith
Litton Enterprise Solutions
smith_robert_s@prc.com


> -----Original Message-----
> From: Ray Ontko [SMTP:rayo@ONTKO.COM]
> Sent: Sunday, November 30, 1997 9:52 PM
> To:   Multiple recipients of list SQR-USERS
> Subject:      Re: Database name variable?
>
> Bob,
>
> If you're using Oracle, there is a data dictionary table/view
> called SYS.V_$DATABASE which contains a column called NAME.
> Normally, only sys and system have access to this table.
> You may have to grant access on sys.v_$database to the user
> which runs the report.
>
> If you're using sybase or some other rdbms, I'm not sure.
> There may be a similar catalog table which contains what
> you're looking for, I don't know.  I had a similar problem
> on a project using sybase, but I ended up taking a different
> approach.  If you come across a solution, let me know.
>
> Ray
>
> > I'm sorry, I meant to say you name the database such as 'EPDMO' or
> > 'FSDMO'. I want to retrieve that name for some adhoc reports.
> >
> > Bob Smith
> > Litton Enterprise Solutions
> >
> > > -----Original Message-----
> > > From: Ray Ontko [SMTP:rayo@ONTKO.COM]
> > > Sent: Sunday, November 30, 1997 10:57 AM
> > > To:   Multiple recipients of list SQR-USERS
> > > Subject:      Re: Database name variable?
> > >
> > > > There should be a variable holding the database name. What is
> this
> > > > called? Does anyone have a list of variables that SCRiBE uses
> > > besides
> > > > the page of them in the SQR book?
> > >
> > > Bob Smith,
> > >
> > > I think $sqr-database is what you're loking for.  This contains a
> > > value like ORACLE, DB2, SYBASE, ODBC, etc.  This is the name of
> the
> > > RDBMS.  This is also available as {sqr-database}.
> > >
> > > Hope this is what you're looking for.
> > >
> > > Ray
> > >
> ----------------------------------------------------------------------
> > > Ray Ontko       |  Ray Ontko & Co  |  "Ask me about SQR and the
> WEB"
> > > rayo@ontko.com  |  Richmond, In    |  See us at
> http://www.ontko.com/
> >
>
> ----------------------------------------------------------------------
> Ray Ontko       |  Ray Ontko & Co  |  "Time for a new signature line."
> rayo@ontko.com  |  Richmond, In    |  See us at http://www.ontko.com/