Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Embedded SQL

 
Goto page 1, 2
   Database Forums (Home) -> Ingres RSS
Next:  Building of indexes  
Author Message
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 1) Posted: Wed Mar 21, 2007 1:37 am
Post subject: Embedded SQL
Archived from groups: comp>databases>ingres (more info?)

Hi,
I am trying to use embedded SQL to work with the Ingres database.
Following is the simple program I have written:

EXEC SQL INCLUDE SQLCA;
EXEC SQL WHENEVER SQLERROR STOP;
EXEC SQL CONNECT causp;
EXEC SQL DELETE FROM indexes WHERE id = 40;
EXEC SQL DISCONNECT;

But these embedded sql statements are not getting recognized and are
resulting in errors.
I am using Microsoft Visual Studio 2005 to write the programs. Can
anyone please tell me how to overcome this?

Thanks in advance
Mohan

 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
John Dennis

External


Since: Jul 25, 2006
Posts: 14



(Msg. 2) Posted: Wed Mar 21, 2007 2:00 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Mohan,

You need to pre-process the embedded SQL code - esqlc is the utility.
This will convert the *.sc file to *.c which can then be compiled.

The process is described in the "Embedded SQL Companion Guide".

John

On Mar 21, 7:37 pm, wrote:
> Hi,
> I am trying to use embedded SQL to work with the Ingres database.
> Following is the simple program I have written:
>
> EXEC SQL INCLUDE SQLCA;
> EXEC SQL WHENEVER SQLERROR STOP;
> EXEC SQL CONNECT causp;
> EXEC SQL DELETE FROM indexes WHERE id = 40;
> EXEC SQL DISCONNECT;
>
> But these embedded sql statements are not getting recognized and are
> resulting in errors.
> I am using Microsoft Visual Studio 2005 to write the programs. Can
> anyone please tell me how to overcome this?
>
> Thanks in advance
> Mohan

 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Tim Ellis

External


Since: Feb 25, 2005
Posts: 21



(Msg. 3) Posted: Wed Mar 21, 2007 2:04 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Mar 21, 8:37 am, wrote:
> Hi,
> I am trying to use embedded SQL to work with the Ingres database.
> Following is the simple program I have written:
>
> EXEC SQL INCLUDE SQLCA;
> EXEC SQL WHENEVER SQLERROR STOP;
> EXEC SQL CONNECT causp;
> EXEC SQL DELETE FROM indexes WHERE id = 40;
> EXEC SQL DISCONNECT;
>
> But these embedded sql statements are not getting recognized and are
> resulting in errors.
> I am using Microsoft Visual Studio 2005 to write the programs. Can
> anyone please tell me how to overcome this?
>
> Thanks in advance
> Mohan

You are remembering to pre-compile the code before compiling it?
For C programs use esqlc -f<output filename> <input filename>
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 4) Posted: Wed Mar 21, 2007 2:13 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,
I've tried the command "esqlc -l file.cpp". But the error is: 'esqlc'
is not recognized as an internal or external command,
operable program or batch file.

Mohan




On Mar 21, 2:00 pm, "John Dennis" wrote:
> Mohan,
>
> You need to pre-process the embedded SQL code - esqlc is the utility.
> This will convert the *.sc file to *.c which can then be compiled.
>
> The process is described in the "Embedded SQL Companion Guide".
>
> John
>
> On Mar 21, 7:37 pm, wrote:
>
>
>
> > Hi,
> > I am trying to use embedded SQL to work with the Ingres database.
> > Following is the simple program I have written:
>
> > EXEC SQL INCLUDE SQLCA;
> > EXEC SQL WHENEVER SQLERROR STOP;

> > EXEC SQL CONNECT causp;
> > EXEC SQL DELETE FROM indexes WHERE id = 40;
> > EXEC SQL DISCONNECT;
>
> > But these embedded sql statements are not getting recognized and are
> > resulting in errors.
> > I am using Microsoft Visual Studio 2005 to write the programs. Can
> > anyone please tell me how to overcome this?
>
> > Thanks in advance
> > Mohan- Hide quoted text -
>
> - Show quoted text -
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
jpzuate

External


Since: Mar 19, 2007
Posts: 7



(Msg. 5) Posted: Wed Mar 21, 2007 2:23 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 21 mar, 10:13, wrote:
> Hi,
> I've tried the command "esqlc -l file.cpp". But the error is: 'esqlc'
> is not recognized as an internal or external command,
> operable program or batch file.

Are Ingres variables setted in your environment ? (II_SYSTEM, PATH,
LIB and so on)
Jean-Pierre
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 6) Posted: Wed Mar 21, 2007 2:52 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

what I am doing is write a C++ file and compile it. Is it not possible
to do in this way?
How can we know whether pre-processor is installed or not?


On Mar 21, 2:31 pm, "Roy Hann"
wrote:
> wrote in message
>
>
>
> > Hi,
> > I've tried the command "esqlc -l file.cpp". But the error is: 'esqlc'
> > is not recognized as an internal or external command,
> > operable program or batch file.
>
> Is the pre-processor installed on the machine where you are doing this?
> What is the PATH for the user who is compiling?
>
> (Also it looks like you are trying to pre-process the wrong file. esqlc
> expects a file with a .sc suffix.)
>
> Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
jpzuate

External


Since: Mar 19, 2007
Posts: 7



(Msg. 7) Posted: Wed Mar 21, 2007 3:07 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On 21 mar, 10:52, wrote:
> what I am doing is write a C++ file and compile it. Is it not possible
> to do in this way?
> How can we know whether pre-processor is installed or not?

pre-processor come with the installation of Ingres ...

Are you trying to compile programm for Ingres without Ingres on the
machine ?
Even just a small client installation ?

Look if you can find files like version.rel or config.dat somewere on
your disks, you'll find then the root directory of Ingres (II_SYSTEM).

esqlc should be in the $II_SYSTEM/ingres/bin directory (or %II_SYSTEM%
\ingres\bin)

HTH
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 8) Posted: Wed Mar 21, 2007 4:36 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,
I have Ingres installed on my machine but I couldn't find esqlc.exe
and esqlcc.exe in my C:\IngresII\ingres\bin directory.
Is there any way to get these files.


On Mar 21, 3:11 pm, "Roy Hann"
wrote:
> wrote in message
>
>
>
> > what I am doing is write a C++ file and compile it. Is it not possible
> > to do in this way?
>
> The words EXEC SQL ... are not C++ code are they? They have to be
> translated into API calls in C++ syntax before the C++ compiler ever gets to
> see the code.
>
> > How can we know whether pre-processor is installed or not?
>
> There are various ways. I am old and reactionary so I would do it as
> follows. Log in as the user who is trying to compile the code, start a DOS
> window, and (assuming everying is on the C: drive):
>
> cd %II_SYSTEM%\ingres\bin
> dir esql*.exe
>
> You should see esqlc.exe and esqlcc.exe.
>
> Also, still in the DOS window:
>
> set
>
> And look for PATH to see if the above ingres\bin directory is in the path.
>
> Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Roy Hann3

External


Since: Oct 20, 2004
Posts: 472



(Msg. 9) Posted: Wed Mar 21, 2007 5:56 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote in message

> Hi,
> I've tried the command "esqlc -l file.cpp". But the error is: 'esqlc'
> is not recognized as an internal or external command,
> operable program or batch file.

Is the pre-processor installed on the machine where you are doing this?
What is the PATH for the user who is compiling?

(Also it looks like you are trying to pre-process the wrong file. esqlc
expects a file with a .sc suffix.)

Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Roy Hann3

External


Since: Oct 20, 2004
Posts: 472



(Msg. 10) Posted: Wed Mar 21, 2007 5:57 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote in message

> what I am doing is write a C++ file and compile it. Is it not possible
> to do in this way?

The words EXEC SQL ... are not C++ code are they? They have to be
translated into API calls in C++ syntax before the C++ compiler ever gets to
see the code.

> How can we know whether pre-processor is installed or not?

There are various ways. I am old and reactionary so I would do it as
follows. Log in as the user who is trying to compile the code, start a DOS
window, and (assuming everying is on the C: drive):

cd %II_SYSTEM%\ingres\bin
dir esql*.exe

You should see esqlc.exe and esqlcc.exe.

Also, still in the DOS window:

set

And look for PATH to see if the above ingres\bin directory is in the path.

Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 11) Posted: Wed Mar 21, 2007 7:13 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi
I've tried re-installing, but this didn't create the files esqlc.exe
and esqlcc.exe. Ingres gets installed on my machine when i install a
tool. Is this the reason for not installing those files. If so, what
can be the way to get these files?

Mohan

On Mar 21, 5:56 pm, "Roy Hann"
wrote:
> wrote in message
>
>
>
> > Hi,
> > I have Ingres installed on my machine but I couldn't find esqlc.exe
> > and esqlcc.exe in my C:\IngresII\ingres\bin directory.
> > Is there any way to get these files.
>
> You should be able to just re-run the Ingres installer on your machine. It
> will discover the existing installation and leave it alone.
>
> I'm not sure an Ingres installation is enormous you should worry about
> selecting just the specific components you want, so make sure you install
> everything it offers you (including the documentation).
>
> Don't get over-enthusiastic and select (strict) SQL-92 compliance though;
> you certainly don't want that.
>
> Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Roy Hann3

External


Since: Oct 20, 2004
Posts: 472



(Msg. 12) Posted: Wed Mar 21, 2007 8:57 am
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote in message

> Hi,
> I have Ingres installed on my machine but I couldn't find esqlc.exe
> and esqlcc.exe in my C:\IngresII\ingres\bin directory.
> Is there any way to get these files.

You should be able to just re-run the Ingres installer on your machine. It
will discover the existing installation and leave it alone.

I'm not sure an Ingres installation is enormous you should worry about
selecting just the specific components you want, so make sure you install
everything it offers you (including the documentation).

Don't get over-enthusiastic and select (strict) SQL-92 compliance though;
you certainly don't want that.

Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Roy Hann3

External


Since: Oct 20, 2004
Posts: 472



(Msg. 13) Posted: Wed Mar 21, 2007 12:57 pm
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

wrote in message

> Hi
> I've tried re-installing, but this didn't create the files esqlc.exe
> and esqlcc.exe. Ingres gets installed on my machine when i install a
> tool. Is this the reason for not installing those files. If so, what
> can be the way to get these files?

Hmm. What is the name of the file that you downloaded from Ingres? I
wonder if the preprocessors aren't in the package you got?

Roy
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
John Dennis

External


Since: Jul 25, 2006
Posts: 14



(Msg. 14) Posted: Wed Mar 21, 2007 5:23 pm
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

What "tool" are you installing which also installs Ingres? Perhaps the
provider of that tool does not deliver the application development
environment with their embedded Ingres.

John

On Mar 22, 1:13 am, wrote:
> Hi
> I've tried re-installing, but this didn't create the files esqlc.exe
> and esqlcc.exe. Ingres gets installed on my machine when i install a
> tool. Is this the reason for not installing those files. If so, what
> can be the way to get these files?
>
> Mohan
>
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
kodaliece

External


Since: Mar 15, 2007
Posts: 23



(Msg. 15) Posted: Wed Mar 21, 2007 8:34 pm
Post subject: Re: Embedded SQL [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi,
I've installed Unicenter Service Plus Knowledge Tool on my machine.
This automatically installs the Ingres database.
Mohan



On Mar 22, 5:23 am, "John Dennis" wrote:
> What "tool" are you installing which also installs Ingres? Perhaps the
> provider of that tool does not deliver the application development
> environment with their embedded Ingres.
>
> John
>
> On Mar 22, 1:13 am, wrote:
>
>
>
> > Hi
> > I've tried re-installing, but this didn't create the files esqlc.exe
> > and esqlcc.exe. Ingres gets installed on my machine when i install a
> > tool. Is this the reason for not installing those files. If so, what
> > can be the way to get these files?
>
> > Mohan- Hide quoted text -
>
> - Show quoted text -
 >> Stay informed about: Embedded SQL 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
Embedded SQL programming - Hi, I am trying to pre-compile the following embedded SQl program: #include <stdio.h> void main() { EXEC SQL INCLUDE SQLCA; EXEC SQL WHENEVER SQLERROR STOP; EXEC SQL CONNECT causp; EXEC SQL DELETE FROM skeleton...

Process hanging on Endselect - We have a process which needs to produce an average figure over the last 16 qualifying weeks. The way it currently works is to select the rows from the two relevant tables ordered by date descending, then in a select loop check if the week qualifies and...

E_DM9063_LK_TABLE_MAXLOCKS - We have a weekly job that takes a COPY.OUT from the "Live" database and then does a COPY.IN to a development database in a separate installation. I've noticed that in one instance, the ERRLOG is getting a number of messages of the general form...

Help fo vnode - I am going to use the ingres replication. For that I have set vnodes using "netutil". I have configured all the things for replication on my local database using repmgr. Now I want to move the Configuration to the Remote Server database. When I...

Help for starting the replication server - I have configured the database for replication using repmgr command I also started the replication server. It is started and its status is active. But there are one error message comming which is related to the authorization of the remote database. Using...
   Database Forums (Home) -> Ingres All times are: Pacific Time (US & Canada)
Goto page 1, 2
Page 1 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]