dbTalk Databases Forums  

Embedded SQL

comp.databases.ingres comp.databases.ingres


Discuss Embedded SQL in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
kodaliece@gmail.com
 
Posts: n/a

Default Embedded SQL - 03-21-2007 , 02:37 AM






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


Reply With Quote
  #2  
Old   
John Dennis
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:00 AM






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, kodali... (AT) gmail (DOT) com wrote:
Quote:
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



Reply With Quote
  #3  
Old   
Tim Ellis
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:04 AM



On Mar 21, 8:37 am, kodali... (AT) gmail (DOT) com wrote:
Quote:
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>



Reply With Quote
  #4  
Old   
kodaliece@gmail.com
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:13 AM



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" <denj... (AT) hotmail (DOT) com> wrote:
Quote:
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, kodali... (AT) gmail (DOT) com 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 -



Reply With Quote
  #5  
Old   
jpzuate@gmail.com
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:23 AM



On 21 mar, 10:13, kodali... (AT) gmail (DOT) com wrote:
Quote:
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



Reply With Quote
  #6  
Old   
Roy Hann
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:31 AM



<kodaliece (AT) gmail (DOT) com> wrote

Quote:
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




Reply With Quote
  #7  
Old   
kodaliece@gmail.com
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 03:52 AM



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" <specia... (AT) processed (DOT) almost.meat>
wrote:
Quote:
kodali... (AT) gmail (DOT) com> wrote in message

news:1174468436.760937.198230 (AT) n76g2000hsh (DOT) googlegroups.com...

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



Reply With Quote
  #8  
Old   
jpzuate@gmail.com
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 04:07 AM



On 21 mar, 10:52, kodali... (AT) gmail (DOT) com wrote:
Quote:
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



Reply With Quote
  #9  
Old   
Roy Hann
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 04:11 AM



<kodaliece (AT) gmail (DOT) com> wrote

Quote:
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.

Quote:
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




Reply With Quote
  #10  
Old   
kodaliece@gmail.com
 
Posts: n/a

Default Re: Embedded SQL - 03-21-2007 , 05:36 AM



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" <specia... (AT) processed (DOT) almost.meat>
wrote:
Quote:
kodali... (AT) gmail (DOT) com> wrote in message

news:1174470742.777525.140080 (AT) b75g2000hsg (DOT) googlegroups.com...

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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.