Hi, On Sun, Apr 28, 2013 at 12:14 AM, Newbie89 <sh_ta...@hotmail.com> wrote:
> previously It used log file to save data. I need to identify the variables > which need to logged and save into database. So I need to create the table > from this file.c > struct HOST > { > char Src_MAC[18]; > char Src_IP[16]; > long int Cap_Bytes; > int TCP,UDP,ICMP,IP,ARP,OTH_Net, OTH_Trans; // Protocols > int ftp,ssh,telnet,domain,www,netbios,other; // Services > }; > > into this > create table HOST (Src_MAC[18] char,Src_IP[16] char,Cap_Bytes long int,TCP > int,UDP int,ICMP int,IP int,ARP int,OTH_Net int,OTH_Trans int,ftp int,ssh > int,telnet int,domain int,www int,netbios int,other int); > Nope. The proper syntax is: CREATE TABLE host( Src_MAC char(18), Src_IP char(16), Cap_Bytes integer, TCP integer, UDP integer, ICMP integer....); But it's much more than that. You should really check what you program does, which queries you will issue, what other tables you will need, the relationships between different tables and how you construct you queries for better performance. Thank you. > > right? > How to I link so that the live data is save into the database? > I'm not very well in the connection? > can give me some guides? > > > > > -- > View this message in context: > http://sqlite.1065341.n5.nabble.com/How-to-save-live-data-into-sqlite-database-using-c-language-tp68519.html > Sent from the SQLite mailing list archive at Nabble.com. > _______________________________________________ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users