Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

sqlite 3 c++

Posted on 2010-11-16
2
Medium Priority
?
502 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 58

Accepted Solution

by:
cyberkiwi earned 2000 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
This post contains step-by-step instructions for setting up alerting in Percona Monitoring and Management (PMM) using Grafana.
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…

688 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