C to SQL Connentivity
-
I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
#include<stdio.h>
#include<conio.h>int main(void)
{
int number;
char fname[80], lname[80];
clrscr();
printf("Enter a number : ");
scanf("%d",&number);
printf("Enter your first name : ");
scanf("%s",fname);
printf("Enter your last name : ");
scanf("%s",lname);
execl sql include sqlca;
execl sql insert into Table1
values(number,",'",fname,"','",lname,"'");
getch();
return 0;
} -
I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
#include<stdio.h>
#include<conio.h>int main(void)
{
int number;
char fname[80], lname[80];
clrscr();
printf("Enter a number : ");
scanf("%d",&number);
printf("Enter your first name : ");
scanf("%s",fname);
printf("Enter your last name : ");
scanf("%s",lname);
execl sql include sqlca;
execl sql insert into Table1
values(number,",'",fname,"','",lname,"'");
getch();
return 0;
} -
Ishaan Karnik wrote:
I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
Could you explain what it is that does not work?
The error i recieve while compiling
Compiling ..\SOURCE\SQL.C
Error ..\SOURCE\SQL.C 15: Undefined symbol 'execl'
Error ..\SOURCE\SQL.C 15: Statement missing ;
Error ..\SOURCE\SQL.C 16: Statement missing ; -
The error i recieve while compiling
Compiling ..\SOURCE\SQL.C
Error ..\SOURCE\SQL.C 15: Undefined symbol 'execl'
Error ..\SOURCE\SQL.C 15: Statement missing ;
Error ..\SOURCE\SQL.C 16: Statement missing ; -
Ishaan Karnik wrote:
Undefined symbol 'execl'
Well I guess there is no such command in the C language!
I have taken the command from SQL The Complete Reference.
-
I have taken the command from SQL The Complete Reference.
-
I have taken the command from SQL The Complete Reference.
-
I have written a C program to insert a row in SQL Server 2000 but it seems not to work.
#include<stdio.h>
#include<conio.h>int main(void)
{
int number;
char fname[80], lname[80];
clrscr();
printf("Enter a number : ");
scanf("%d",&number);
printf("Enter your first name : ");
scanf("%s",fname);
printf("Enter your last name : ");
scanf("%s",lname);
execl sql include sqlca;
execl sql insert into Table1
values(number,",'",fname,"','",lname,"'");
getch();
return 0;
}Ishaan Karnik wrote:
execl sql include sqlca; execl sql insert into Table1 values(number,",'",fname,"','",lname,"'");
See here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons