Solved

sqlite 3 c++

Posted on 2010-11-16
2
490 Views
Last Modified: 2012-05-10
Hello.. i was able to connect my sqlite3 and c++ fine.. but i wanted to know what commend i use to insert data into my  tables .this is what i have so far. thank you also how do i create another table with a varchar value? so for example something like FirstName VarChar (50) , NULL :) thanks guys/gals

  #include <stdio.h>
#include <stdlib.h>
#include "sqlite3.h"

sqlite3* db;
char* db_err;

int main(int argc, char** argv) {

    db_err="AircraftTransponder";

    sqlite3_open(db_err, &db);
    sqlite3_exec(db,"create table 'HelloWorld'(id integer);", NULL, 0, &db_err);
	sqlite3_exec(db,"create table 'test'(id integer);", NULL,0,&db_err);
	sqlite3_exec(db,"create table 'bhayani'(id integer);", NULL,0,&db_err);
    sqlite3_close(db);
    return (EXIT_SUCCESS);
}  

Open in new window



0
Comment
Question by:businessesatoz
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 500 total points
ID: 34184271
insert:
use the query "insert into helloWorld values (123);"

create another table

sqlite3_exec(db,"create table newtable(vccol varchar(10));", NULL, 0, &db_err);

The varchar(10) can be omitted. SQLite fields are type-less, but it is useful for your own reference.
0
 

Author Closing Comment

by:businessesatoz
ID: 34215706
thank you
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now