Re: [sqlite] Comparing two tables column by column

2013-07-30 Thread fnoyanisi
Yes, it is slow actually. But I could not do it with SQL. I wish I could do 
more with SQL than code, which would give a good performance improvement.

>From overall application point of view, I may be considering using threads to 
>read from database, so that the performance will be improved a bit.

On 30/07/2013, at 4:26 PM, "Stadin, Benjamin" 
 wrote:

> That can work, if performance is of no concern. Otherwise it will become 
> miserably slow.
> 
> 
> Von: Fehmi Noyan ISI 
> Antworten an: Fehmi Noyan ISI 
> Datum: Dienstag, 30. Juli 2013 01:54
> An: Benjamin Stadin , General 
> Discussion of SQLite Database 
> Betreff: Re: [sqlite] Comparing two tables column by column
> 
> The approach I am using to compare tableA_old and tableA_new is;
> 
> typedef struct container_t {
> // a structure to pass parameters into callbacks
> } container;
> 
> static int callback_2(){
> // compare two values in the resulting table if they are different 
> // write them into a resulting file
> }
> 
> static int callback_1(){
> for (each column){
> char sql[256];
> sprintf(sql,"select %s from tableA_old where 
> pkey=%s",columnName,primarykey);
> sqlite3_exec(db,sql,callback_2,,)
> }
> }
> 
> int main(){
>  // import CS file into DB
>  // for each pair of files (each file is a table and files have
>  // the same column names in the same order). Actually, these are 
>  // records for different dates
>  char sql[256] = "select * from tableA_new;";
>  container c;
>  sqlite3_exec(db,sql,callback_1,(void*)c,null)
>  
> }
> From: "Stadin, Benjamin" 
> To: Fehmi Noyan ISI ; General Discussion of SQLite 
> Database  
> Sent: Tuesday, July 30, 2013 9:00 AM
> Subject: Re: [sqlite] Comparing two tables column by column
> 
> If you like ruby, I have another idea to get you going (maybe without
> needing to write much code):
> 
> - Use a registered function to SQLite to create MD5 or SHA1 keys for rows
> in the table. Here is a ruby snippet that registers a SHA1 function:
> http://www.copiousfreetime.org/articles/2009/01/10/writing-sql-functions-in
> -ruby.html
> - Join both tables by your primary key and select those where the SHA keys
> don't match
> - go threw each column programmatically in your ruby code and simply
> compare column values with each other
> 
> If you then need performance and get by some means a trigger for your
> newly inserted records, add a sha1 field to all of your tables and
> precompute and index the sha1 for each table.
> 
> Benjamin Stadin
> 
> Am 30.07.13 01:07 schrieb "Fehmi Noyan ISI" unter :
> 
> >EXCEPT query gave the different rows in tables, but what I am after is
> >the different values for existing records.
> >
> >The column names are exactly the same, however the number of rows may
> >differ (with most of the records are the same).
> >
> >
> >
> > From: Simon Slavin 
> >To: General Discussion of SQLite Database 
> >Sent: Monday, July 29, 2013 9:10 PM
> >Subject: Re: [sqlite] Comparing two tables column by column
> > 
> >
> >
> >On 29 Jul 2013, at 12:36pm, Fabian Klebert
> > wrote:
> >
> >> Wouldn't 
> >> 
> >> SELECT * FROM table1
> >> EXCEPT
> >> SELECT * FROM table2
> >> 
> >> solve this problem?
> >> I think it does for the example provided. Not sure if it would work in
> >>real-world environment.
> >
> >There are two elements: making sure the same rows are present, and making
> >sure the contents of the rows match.  I would probably use EXCEPT
> >commands to find out entries in one database which weren't in the other,
> >then use INTERSECT command to check that the fields in the rows which
> >were in both.  But that's just at first glance.
> >
> >Simon.
> >___
> >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
> 
> 
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Comparing two tables column by column

2013-07-29 Thread fnoyanisi
Yes, it turned out that achieving the goal with C code is much simpler than 
using SQL statements (I also take my limited sql knowledge into account)

Now, I'll have two sqlite3_exec() calls, one of which is invoked by first 
call's callback function. This led having some natsy C structs around to pass 
parameters to sqlite3_exec() calls, but I could not find any other approach.

On 29/07/2013, at 7:48 PM, Simon Slavin  wrote:

> 
> On 29 Jul 2013, at 4:03am, Fehmi Noyan ISI  wrote:
> 
>> One point I forgot to mention; the number of columns is unknown.
> 
> There is no way in SQL to say "Give me the contents of all the columns of a 
> row of table in an unambiguous format.".
> 
> It would be possible to write the code you want in SQLite, by using various 
> PRAGMAs to inspect the table format, but this would lead to complicated code 
> which was highly tuned to how SQLite works.
> 
> I suspect you'd be better off writing C code which inspects whatever "SELECT 
> *' returns.
> 
> Simon.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] Using SQLITE to build database from tab delimited file

2013-07-26 Thread fnoyanisi
You can write your sql commands in a txt file (say mycmd.txt), and then 

sqlite3 your.databasefile < mycmd.txt

Or 

I have a simple API that lets you import / export csv (not necessarly CSV 
inderd, any kind of delimited file) files into SQLite, so you can do it via 
your own C/C++ application as well.

https://github.com/fnoyanisi/sqlite3_capi_extensions

On 26/07/2013, at 5:55 PM, "Rob Slater" <r...@champagnepcservices.com.au> wrote:

> I have an iPad app that uses several (4) different SQLITE databases and I
> currently build these databases using Mozilla Firefox SQLite Manager utility
> (on a Mac).  The databases are simple (single table) with a number of rows,
> and are created from a text file with tab delimited fields.
> 
> This all works but is clunky.  I would prefer to create the SQLITE databases
> on my Windows PC (where the text files are created).
> 
> My question is whether the SQLITE can do this job and how I go about it.  I
> suspect that I should be able to set up a file of SQL commands to build the
> new database(s), to automate the process somewhat
> 
> Any help much appreciated.
> 
> Rob Slater
> 
> 
> 
> ___
> 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


Re: [sqlite] What number(2) means?

2013-07-10 Thread fnoyanisi
This may help

http://stackoverflow.com/questions/5562322/difference-between-int-and-int3-data-types-in-my-sql

On 10/07/2013, at 6:33 PM, Woody Wu  wrote:

> On Wed, Jul 10, 2013 at 10:50:06AM +0200, Paolo Bolzoni wrote:
>> Yes, I think it is possible to put only for
>> compatibility reasons. Maybe in some
>> other db systems you can set the magnitude?
> Understood.  I also don't know why there are number(2) in the schema
> that I saw.  It's just a database created many years ago, probabaly
> sqlite supported that then.  Thanks for your explaination.
> 
>> On Wed, Jul 10, 2013 at 10:06 AM, Woody Wu  wrote:
>>> On Wed, Jul 10, 2013 at 09:53:41AM +0200, Paolo Bolzoni wrote:
 See here:
 http://www.sqlite.org/datatype3.html
 
 I think  it just means Integer. And its
 size depends on the magnitude of the
 number stored.
>>> 
>>> I've read the doc, it's not so easy to understand.
>>> 
>>> Did you mean, in number(N), N will not make difference, right?
>>> 
>>> Thanks!
>>> ___
>>> 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
> 
> -- 
> I can't go back to yesterday - because I was a different person then
> ___
> 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


Re: [sqlite] FW: problem sqlite3 c++ please

2013-06-07 Thread fnoyanisi
Is this a repeated post? 

You cannot use shell commands as Sql statements in c api. Write your own export 
routine. Here is one I wrote.

https://github.com/fnoyanisi/sqlite3_capi_extensions

On 06/06/2013, at 11:02 PM, Maxime Gerum <pilot@hotmail.fr> wrote:

> 
> Hello, i’m french, sorry if i make errors of langage In my school project, i 
> use sqlite3 with c++, i can make any request such as create table or select 
> *from, no problems. But i would export my database in a csv file, in sqlite3> 
> .mode csv 
>   .separator ,
>.output 
> client.csv
>select *from client; it works, but in c++, if 
> i make request[4]= ”.mode csv”
>   “.separator ,”  
> ”.output client.csv”  
> “select *from client” 
> only select *from client works, i have an error : near ”.” : syntax error 
> Please help me,  Maxime Envoyé depuis Windows 8   
>   
> ___
> 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


Re: [sqlite] SQLite init file from PHP

2013-05-31 Thread fnoyanisi
Use

http://php.net/manual/en/function.system.php

Or

http://www.php.net/manual/en/function.exec.php

On 30/05/2013, at 10:41 PM, Lior Hazan  wrote:

> Dear All,
> 
> If I'm using Command Line , I can use the next command
> 
> sqlite.exe -init FILENAME file.db
> This let me init the SQLite with some parameters and it works great
> 
> I wonder how can I do that using PHP?
> 
> Thanks in advance
> 
> Lior
> ___
> 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


Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread fnoyanisi
Once more, googling gives some handy stuff

http://code.google.com/p/csharp-sqlite

On 31/05/2013, at 8:46 PM, Ali Dirik  wrote:

> Thanks for answers.
> 
> I use c# (VS2008)
> I am looking for c# sample source code.
> 
> 
> 2013/5/31 Noel Frankinet 
> 
>> I've used C++, do you want to use anything else. It's of course easier in
>> C++ since sqlite is in C. You link statically, nothing to install.
>> 
>> 
>> On 31 May 2013 12:21,  wrote:
>> 
>>> This is the first shot from google
>>> http://sqlite-wince.sourceforge.net/index.html
>>> 
>>> If you'd like to use sqlitecin your app, I do not think it will be an
>>> issue for any playform once you have the proper C compiler. You may try
>> to
>>> statically compiling your application.
>>> 
>>> On 31/05/2013, at 7:42 PM, Ali Dirik  wrote:
>>> 
 Hello Noel Frankinet,
 
 Thank you for your answer.
 I using a hand-held terminal (
 http://www.ute.com/products_info.php?pc1=1=3=0=703) with
>>> windows
 mobile operating system.
 We use this device for counting.
 There is already an application that works with SQLCE (Microsoft SQL
 Compact Edition)
 I want to use SQLite instead of SQL CE.
 I found a sample source code on the Internet (
>> http://www.codeproject.com/Articles/22165/Using-SQLite-in-your-C-Application
 )
 I've tried it, but did not succeed source code.
 Do you have any idea about this?
 
 Best Regards
 Ali Dirik
 
 
 2013/5/31 Ali Dirik 
 
> Dear Friends,
> 
> I want to develop a application that runs Windows CE or Mobile
>> devices.
> I want to use the Sqlite database.
> May I find same sample source codes?
> 
> Best Regards
> Ali D
> i
> rik
 
 
 
 --
 İyi Çalışmalar
 Ali DİRİK
 ___
 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
>> 
>> 
>> 
>> --
>> Noël Frankinet
>> Strategis sprl
>> 0478/90.92.54
>> ___
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 
> 
> -- 
> İyi Çalışmalar
> Ali DİRİK
> ___
> 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


Re: [sqlite] Sqlite Sample Source Codes For Windows CE/Mobile

2013-05-31 Thread fnoyanisi
This is the first shot from google
http://sqlite-wince.sourceforge.net/index.html

If you'd like to use sqlitecin your app, I do not think it will be an issue for 
any playform once you have the proper C compiler. You may try to statically 
compiling your application.

On 31/05/2013, at 7:42 PM, Ali Dirik  wrote:

> Hello Noel Frankinet,
> 
> Thank you for your answer.
> I using a hand-held terminal (
> http://www.ute.com/products_info.php?pc1=1=3=0=703) with windows
> mobile operating system.
> We use this device for counting.
> There is already an application that works with SQLCE (Microsoft SQL
> Compact Edition)
> I want to use SQLite instead of SQL CE.
> I found a sample source code on the Internet (
> http://www.codeproject.com/Articles/22165/Using-SQLite-in-your-C-Application
> )
> I've tried it, but did not succeed source code.
> Do you have any idea about this?
> 
> Best Regards
> Ali Dirik
> 
> 
> 2013/5/31 Ali Dirik 
> 
>> Dear Friends,
>> 
>> I want to develop a application that runs Windows CE or Mobile devices.
>> I want to use the Sqlite database.
>> May I find same sample source codes?
>> 
>> Best Regards
>> Ali D
>> i
>> rik
> 
> 
> 
> -- 
> İyi Çalışmalar
> Ali DİRİK
> ___
> 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


Re: [sqlite] Getting Started with Sqlite

2013-05-22 Thread fnoyanisi
The dll and exe should be sufficient to run sqlite.

What version of sqlite are you using?
sqlite3 --version

Not sure about this, but may it be something related to user privilages?

On 22/05/2013, at 11:21 PM, Sean Dzafovic  wrote:

> On Wed, May 22, 2013 at 10:30 AM, Igor Tandetnik  wrote:
>> On 5/22/2013 8:58 AM, Sean Dzafovic wrote:
>>> 
>>> I downloaded the shell and the dll from the sqlite.org site. I put the
>>> .dll in the windows/system32 folder. However, when I try to create a
>>> test db using the command "sqlite3 test.db" as per the example, I get
>>> "Error: near "sqlite3" :syntax error.
>>> 
>>> What am I doing wrong?
>> 
>> 
>> You are running this command on sqlite3 command line (do you see "sqlite3>"
>> prompt?) Instead, you should run this command on Windows command line (Start
>>> Run > cmd), in order to start sqlite3 shell with a given DB file as a
>> parameter.
> 
> Tried it with the shell on my desktop and got the error.
> Moved it to the system32 folder along with the .dll and got the same
> error. (Both of these by clicking on the icon).
> 
> Same when I tried using the Windows command line.
> 
> Either way when I open the shell it gives me a sqlite> prompt, not sqlite3>
> ___
> 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


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread fnoyanisi
You may want to consider writing a bash/msdos-batch file and do your stuff from 
your OS command line

Bıt C API is quite handy, you can do most of the stuff with it.

On 14/05/2013, at 10:29 PM, Dulini Atapattu <dulini.atapa...@gmail.com> wrote:

> If anyway I omit these sqlite commands from script, so is there anyway of
> providing the script file to API?
> 
> 
> On Tue, May 14, 2013 at 6:07 PM, <fnoyan...@yahoo.com> wrote:
> 
>> If you are dealing with CSV files, there is a simple API I wrote you can
>> use.
>> 
>> https://github.com/fnoyanisi/sqlite3_capi_extensions
>> 
>> I was looking for .import functionality for C API, but I ended up writing
>> my own fınctions.
>> 
>> On 14/05/2013, at 9:39 PM, Richard Hipp <d...@sqlite.org> wrote:
>> 
>>> On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
>>> <dulini.atapa...@gmail.com>wrote:
>>> 
>>>> Hi all,
>>>> 
>>>> I have some sqlite scripts with some sqlite commands like:
>>>> 
>>>>  - .headers ON
>>>>  - .mode CSV etc.
>>>> 
>>>> Is there anyway of running this script in SqliteDB using Sqlite
>> interface
>>>> for C++, instead of redirecting the file to sqlite using sqlite command
>>>> line shell?
>>> 
>>> Those commands are implemented by the sqlite3 command-line shell, not by
>>> the SQLite library.
>>> 
>>> You can copy/paste the code out of the sqlite3 command-line shell source
>>> code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your
>> C++
>>> application, I suppose.
>>> 
>>> --
>>> D. Richard Hipp
>>> d...@sqlite.org
>>> ___
>>> 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
> ___
> 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


Re: [sqlite] Running sqlite script in Sqlite db using C++

2013-05-14 Thread fnoyanisi
If you are dealing with CSV files, there is a simple API I wrote you can use.

https://github.com/fnoyanisi/sqlite3_capi_extensions

I was looking for .import functionality for C API, but I ended up writing my 
own fınctions.

On 14/05/2013, at 9:39 PM, Richard Hipp <d...@sqlite.org> wrote:

> On Tue, May 14, 2013 at 1:53 AM, Dulini Atapattu
> <dulini.atapa...@gmail.com>wrote:
> 
>> Hi all,
>> 
>> I have some sqlite scripts with some sqlite commands like:
>> 
>>   - .headers ON
>>   - .mode CSV etc.
>> 
>> Is there anyway of running this script in SqliteDB using Sqlite interface
>> for C++, instead of redirecting the file to sqlite using sqlite command
>> line shell?
> 
> Those commands are implemented by the sqlite3 command-line shell, not by
> the SQLite library.
> 
> You can copy/paste the code out of the sqlite3 command-line shell source
> code (www.sqlite.org/src/artifact/2109d54f67) and add that code to your C++
> application, I suppose.
> 
> -- 
> D. Richard Hipp
> d...@sqlite.org
> ___
> 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


Re: [sqlite] How to read log file format into sqlite database?

2013-05-06 Thread fnoyanisi
Why don't you try to do yourself and ask the points you stuck? 

I provided a link which has an example, and there is Sqlite C/C++ Api doc.

I don't know the others, but I will not do your job/homework.

On 06/05/2013, at 6:02 PM, Newbie89 <sh_ta...@hotmail.com> wrote:

> Can you show me a simple tutorial?urgent...please...
> Is it the library u create I need to include only can function?
> 
> 
> 
> 
> Fehmi Noyan ISI wrote
>> To read txt, use fread() or fgets() . This is the most convenient answer I
>> think. 
>> 
>> It is up to your programming skills to read the file line by line and
>> parse each line according to your needs.
>> 
>> Here is an example
>> 
>> https://github.com/fnoyanisi/sqlite3_capi_extensions
>> 
>> On 05/05/2013, at 6:20 PM, Newbie89 
> 
>> sh_tan89@
> 
>>  wrote:
>> 
>>> let say is .txt file
>>> 
>>> 
>>> 
>>> --
>>> View this message in context:
>>> http://sqlite.1065341.n5.nabble.com/How-to-read-log-file-format-into-sqlite-database-tp68676p68678.html
>>> Sent from the SQLite mailing list archive at Nabble.com.
>>> ___
>>> sqlite-users mailing list
> 
>> sqlite-users@
> 
>>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> ___
>> sqlite-users mailing list
> 
>> sqlite-users@
> 
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> 
> 
> 
> 
> --
> View this message in context: 
> http://sqlite.1065341.n5.nabble.com/How-to-read-log-file-format-into-sqlite-database-tp68676p68686.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


Re: [sqlite] How to read log file format into sqlite database?

2013-05-05 Thread fnoyanisi
To read txt, use fread() or fgets() . This is the most convenient answer I 
think. 

It is up to your programming skills to read the file line by line and parse 
each line according to your needs.

Here is an example

https://github.com/fnoyanisi/sqlite3_capi_extensions

On 05/05/2013, at 6:20 PM, Newbie89 <sh_ta...@hotmail.com> wrote:

> let say is .txt file
> 
> 
> 
> --
> View this message in context: 
> http://sqlite.1065341.n5.nabble.com/How-to-read-log-file-format-into-sqlite-database-tp68676p68678.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


Re: [sqlite] How to read log file format into sqlite database?

2013-05-05 Thread fnoyanisi
What is your format? Please ask questions that make sense!

On 05/05/2013, at 6:09 PM, Newbie89  wrote:

> any example/tutorial?thanks.
> 
> 
> 
> --
> View this message in context: 
> http://sqlite.1065341.n5.nabble.com/How-to-read-log-file-format-into-sqlite-database-tp68676.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


Re: [sqlite] How to link the packet in C file then store in sqlite database?

2013-05-01 Thread fnoyanisi
I cannot understand "So I need to create a table Packet right?", but you do 
need to create a table first.

You may need to bother yourself by reading the API reference for the functions 
I gave.


On 01/05/2013, at 9:09 PM, Newbie89  wrote:

> So I need to create a table Packet right?
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


Re: [sqlite] How to save live data into sqlite database using c language?

2013-04-28 Thread fnoyanisi
He means, in your HOST struct, instead of defining a lot of in variables for 
each protocol type, just define your ENUM type to hold all possible protocol 
types, so you will insert only one protocol value into your sqlite db.

When you fetch data, it will be just a matter of simple switch/case statement 
to evaluate the protocol value of each record.

On 29/04/2013, at 2:25 PM, Newbie89  wrote:

> Teg-3 wrote
>> Hello Newbie89,
>> 
>> Sunday, April 28, 2013, 3:32:07 AM, you wrote:
>> 
>> N> Thanks for the correction
>> N> ok...I will check first.
>> 
>> 
>> 
>> N> --
>> N> View this message in context:
>> N>
>> http://sqlite.1065341.n5.nabble.com/How-to-save-live-data-into-sqlite-database-using-c-language-tp68519p68521.html
>> N> Sent from the SQLite mailing list archive at Nabble.com.
>> N> ___
>> N> sqlite-users mailing list
>> N>
> 
>> sqlite-users@
> 
>> N> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>> 
>> 
>> I suspect you want one protocol field
>> 
>> enum _protocols
>> {
>> C_PROTOCOL_TCP,
>> C_PROTOCOL_UDP,
>> ..
>> };
>> 
>> 
>> CREATE TABLE host
>> (
>> Src_MAC char(18),
>> Src_IP char(16),
>> Cap_Bytes integer,
>> Protocol integer,
>> 
>> );
>> 
>> With  a single protocol tag per insert. Then you tag each packet insert
>> with the protocol field.
>> 
>> -- 
>> Best regards,
>> Tegmailto:
> 
>> Teg@
> 
>> 
>> ___
>> sqlite-users mailing list
> 
>> sqlite-users@
> 
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
> 
> What do you mean that I want one protocol field?Sorry that I not very
> understand...can you give some example?thanks
> 
> 
> 
> --
> View this message in context: 
> http://sqlite.1065341.n5.nabble.com/How-to-save-live-data-into-sqlite-database-using-c-language-tp68519p68544.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