Skip to content
Permalink
Browse files
Create Integration
  • Loading branch information
khalilh2 committed Mar 24, 2019
1 parent 5648a7c commit dec733d27caeaf26e4e1e4fd145224ca0ef49789
Showing 1 changed file with 43 additions and 0 deletions.
@@ -0,0 +1,43 @@
include<stdio.h>
#include <SQLAPI.h>
int main(int argc, char* argv[])
{
SAConnection con;
SACommandcmd;
try
{

con.Connect("test", "tester", "tester", SA SQL_Client);

cmd.setConnection(&con);

cmd.setCommandText("create table characters(name varchar(30) primary key, health int(20), attack int (10), sheild int(5)");
cmd.Execute();

cmd.setCommandText("Insert into characters values (”Gnull”,20, 10, 5 )");
cmd.setCommandText("Insert into characters values (”Gollum”,20, 10, 5 )");
cmd.setCommandText("Insert into characters values (”Archer”,20, 10, 5 )");
cmd.setCommandText("Insert into characters values (”barberian”,20, 10, 5 )");
cmd.setCommandText("Insert into characters values (”Swordsman”,20, 10, 5 )");
cmd.Execute();

con.Commit();
printf("Table created, row inserted!\n");1
}

catch (SAException &x)
{

try
{

con.Rollback();
}
catch (SAException &)
{
}


printf("%s\n", (const char*)x.ErrText());
}
return 0;}

0 comments on commit dec733d

Please sign in to comment.