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 <[email protected]> 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,
>> Teg                            mailto:
> 
>> 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
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to