Re: [sqlite] BLOB & Other Data Type

2013-08-26 Thread _ph_
You can see that e.g. with a select statement:

create table test ( Name TEXT, Age Int);
INSERT INTO Test VALUES ('Klaus', 22);
INSERT INTO Test VALUES ('Meier', '022');
SELECT * FROM Test WHERE Age=22;

In this case, the comparison is made on integers, '022' converted to integer
with be equal to 22:

   Klaus|22
   Meier|22

If you use a blob for the age, 

create table testb ( Name TEXT, Age BLOB);
INSERT INTO TestB VALUES ('Klaus', 22);
INSERT INTO TestB VALUES ('Meier', '022');
SELECT * FROM TestB WHERE Age=22;

you get a binary comparison, returning only

   Klaus|22




--
View this message in context: 
http://sqlite.1065341.n5.nabble.com/BLOB-Other-Data-Type-tp70605p70681.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


Re: [sqlite] BLOB & Other Data Type

2013-08-22 Thread Hick Gunter
Your declarations affect the AFFINITY of the columns (integer, text, integer) 
vs. (none, none, none). In both cases the actual types are (integer, text, 
integer) and will be stored exactly thus. The difference can be seen only when 
the declared type of the column and the actual type of the data differ (see the 
referenced page for examples).

-Ursprüngliche Nachricht-
Von: techi eth [mailto:techi...@gmail.com]
Gesendet: Donnerstag, 22. August 2013 06:08
An: General Discussion of SQLite Database
Betreff: [sqlite] BLOB & Other Data Type

Hi,

 What is difference by using Colum data type as blob or Any other
(Text,INT,REAL,NUMERIC)

http://www.sqlite.org/datatype3.html

According to above link I understand "The value is a blob of data, stored 
exactly as it was input".I beleive that it what required.

Ex : Please let me know difference between below two operration.

CREATE TABLE Test ( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE
INT)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

 Or

CREATE TABLE Test ( ID BLOB PRIMARY KEY NOT NULL, NAME BLOB NOT NULL, AGE
BLOB)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

Cheers -

Techi
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


--
 Gunter Hick
Software Engineer
Scientific Games International GmbH
Klitschgasse 2 – 4, A - 1130 Vienna, Austria
FN 157284 a, HG Wien
Tel: +43 1 80100 0
E-Mail: h...@scigames.at

This e-mail is confidential and may well also be legally privileged. If you 
have received it in error, you are on notice as to its status and accordingly 
please notify us immediately by reply e-mail and then delete this message from 
your system. Please do not copy it or use it for any purposes, or disclose its 
contents to any person as to do so could be a breach of confidence. Thank you 
for your cooperation.
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users


[sqlite] BLOB & Other Data Type

2013-08-21 Thread techi eth
Hi,

 What is difference by using Colum data type as blob or Any other
(Text,INT,REAL,NUMERIC)

http://www.sqlite.org/datatype3.html

According to above link I understand “The value is a blob of data, stored
exactly as it was input”.I beleive that it what required.

Ex : Please let me know difference between below two operration.

CREATE TABLE Test ( ID INT PRIMARY KEY NOT NULL, NAME TEXT NOT NULL, AGE
INT)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

 Or

CREATE TABLE Test ( ID BLOB PRIMARY KEY NOT NULL, NAME BLOB NOT NULL, AGE
BLOB)

INSERT INTO Test (ID,NAME,AGE)

VALUES (1, 'Test', 32);

Cheers -

Techi
___
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users