Re: CONNECTING FROM EMBEDDED-SQL/C

From: <gsalem_at_fr.oracle.com>
Date: 1996/11/06
Message-ID: <32806A78.2BD0_at_fr.oracle.com>#1/1


matzner wrote:
>
> i am having difficulty connecting to databases using the 'at database'
> option from within an embedded sql/C.
>
> the syntax (i know) is 'connect user/pass at database using :string
> where database has been declared using EXEC SQL DECLARE database
> DATABASE.
>
> the problems are:
> 1) is database (small case) the actual database name, or can i use
> a string variable or a host variable. if it's the actual name, i
> seem to have trouble using my db name because it contains a period.
> i tried quoting it which gives a compilation error- i think this is
> a bug.
> 2) what goes into :string in 'using :string'- is it even necessary to
> define it, since the databases are local- there are 3 of them locally
> installed that needs to be separately accessed from within the code.
>
hi,
first, the using should be what appears in your tnsnames.ora (if using net 2.X), using the dots or not depends on sqlnet.ora and db_domain param
second, database (small case), should be a literal (without quotes), or a variable (i.e. :some_name). Using vars lets you be more efficient as you can reduce the code needed to apply the same statement to different databases
rgds Received on Wed Nov 06 1996 - 00:00:00 CET

Original text of this message