[Info-Ingres] Embedded SQL

MOHAN KRISHNA KODALI kodaliece at gmail.com
Thu Mar 22 23:30:40 CDT 2007


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


On 22/03/07, martin.bowes at ctsu.ox.ac.uk <martin.bowes at ctsu.ox.ac.uk> wrote:
>
>  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
>



-- 
Ever Yours
Mohan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.kettleriverconsulting.com/mailman/private/info-ingres/attachments/20070323/3aaedd5b/attachment.html 


More information about the Info-Ingres mailing list