Unix Technical Forum

Re: [Info-Ingres] Embedded SQL

This is a discussion on Re: [Info-Ingres] Embedded SQL within the Ingres forums, part of the Database Server Software category; --> Hi Mohan, Try this... cc your.c -o your_executable -L${II_SYSTEM}/ingres/lib Then if there are still errors can you please cut ...


Go Back   Unix Technical Forum > Database Server Software > Ingres

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-20-2008, 09:47 PM
martin.bowes@ctsu.ox.ac.uk
 
Posts: n/a
Default Re: [Info-Ingres] Embedded SQL

Hi Mohan,

Try this...
cc your.c -o your_executable -L${II_SYSTEM}/ingres/lib

Then if there are still errors can you please cut and paste your attempts
to do this into a response.

People have been bending over backwards to help you and have been
forced to work blind as you are not providing a lot of detail in your
postings.

Martin Bowes

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-20-2008, 09:48 PM
kodaliece@gmail.com
 
Posts: n/a
Default Re: Embedded SQL

Hi,
Following the Embedded SQL program I've written:
#include <stdio.h>

EXEC SQL INCLUDE SQLCA;

void main()
{
EXEC SQL CONNECT causp;

EXEC SQL WHENEVER SQLERROR STOP;

EXEC SQL DELETE FROM skeletons WHERE id = 40;

EXEC SQL DISCONNECT;
}

After writing this I've used the command : esqlc TestKt.sc. This
command generated the TestKT.c file.

TestKT.c is as follows:

# include "C:\IngresII\ingres\files\eqdef.h"
#include <stdio.h>
# include "C:\IngresII\ingres\files\eqsqlca.h"
__declspec(dllimport) IISQLCA sqlca; /* SQL Communications Area
*/
void main()
{
/* # line 7 "TestKT.sc" */ /* connect */
{
IIsqInit(&sqlca);
IIsqConnect(0,"causp",(char *)0, (char *)0, (char *)0, (char *)0,
(char *)0, (char *)0, (char *)0, (char *)0, (char *)0, (char *)0,
(char *)0, (char *)0, (char *)0);
}
/* # line 11 "TestKT.sc" */ /* delete */
{
IIsqInit(&sqlca);
IIwritio(0,(short *)0,1,32,0,"delete from skeletons where
id=40");
IIsyncup((char *)0,0);
if (sqlca.sqlcode < 0)
IIsqStop(&sqlca);
}
/* # line 13 "TestKT.sc" */ /* disconnect */
{
IIsqInit(&sqlca);
IIsqDisconnect();
if (sqlca.sqlcode < 0)
IIsqStop(&sqlca);
}
/* # line 14 "TestKT.sc" */ /* host code */
}

When I try to run this file using TurboC I am getting the following
errors:
ERROR D:\TestKT.c 4: 'sqlca' not an argument in function __declspec
ERROR D:\TestKT.c 6: 'main' not an argument in function __declspec
ERROR D:\TestKT.c 6: Declaration syntax error in function __declspec

Thanks
Mohan


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 11:58 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com