Re: [sqlite] Array Accessing in SQLite3
They are all the same to SQLite and declare a column with TEXT affinity. -Ursprüngliche Nachricht- Von: techi eth [mailto:techi...@gmail.com] Gesendet: Montag, 15. Juli 2013 06:35 An: General Discussion of SQLite Database Betreff: Re: [sqlite] Array Accessing in SQLite3 I found so many Type name to be used while creating table for array type.What is significance of size under bracket ?.What is differences among all ? http://www.sqlite.org/datatype3.html --- CHARACTER(20) VARCHAR(255) VARYING CHARACTER(255) NCHAR(55) NATIVE CHARACTER(70) NVARCHAR(100) TEXT --- Thanks On Fri, Jul 12, 2013 at 1:07 PM, Hick Gunter <h...@scigames.at> wrote: > Please read up on SQL, there are numerous tutorials available online. > > There is no "array" in SQL other than that a table may be considered > as an array of records. > > Your example creates a table with two fields named 'test' and 'name' > and with declared datatypes of '10' and '50' respectively. > > -Ursprüngliche Nachricht- > Von: techi eth [mailto:techi...@gmail.com] > Gesendet: Freitag, 12. Juli 2013 09:13 > An: General Discussion of SQLite Database > Betreff: [sqlite] Array Accessing in SQLite3 > > I have query regarding accessing single & multidimensional array in > SQLite3. > > Example: I have created table with (test [10] INTEGER, name [50] TEXT). > > How do I pass a value to insert each element of array? > > How do I read back? (I am using callback function for read back) > > > Please cover answer by considering multidimensional array case as well. > > Thanks-- > ___ > 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-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
Re: [sqlite] Array Accessing in SQLite3
On 15 Jul 2013, at 5:35am, techi ethwrote: > I found so many Type name to be used while creating table for array > type.What is significance of size under bracket ?.What is differences among > all ? > http://www.sqlite.org/datatype3.html > --- > CHARACTER(20) > VARCHAR(255) > VARYING CHARACTER(255) > NCHAR(55) > NATIVE CHARACTER(70) > NVARCHAR(100) > TEXT > --- In SQLite, the the numbers in brackets are ignored. All values are stored just as they are when you supply them. In some versions of SQL, the numbers are the maximum length. For example NCHAR(55) means that if you supply 30 characters, SQL stores 30 characters, but if you supply 80 characters, SQL cuts the end off and stores only the first 55. In other versions of SQL, the numbers are the length. For example NCHAR(55) means that if you supply 30 characters, SQL adds blanks on the end and stores 55 characters, but if you supply 60 characters, SQL cuts the end off and tores only the first 55. Simon. ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Array Accessing in SQLite3
In the back end? None. SQLite will accept any value in any field completely ignoring the typecast you define. * SQLite version 3.7.15.1 2012-12-19 20:39:10 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> create table TestTable (SomeInt integer); sqlite> .table TestTable sqlite> insert into TestTable (SomeInt) values ('This is a string'); sqlite> select * from TestTable; This is a string sqlite>* This is perfectly valid in SQLite. The types are there mostly for your viewing pleasure, and makes it easier to determine if a field name of 'Amount' is supposed to be of a currency/float type, or an integer type. I say "mostly for your viewing pleasure" because I'm not sure if SQLite internally pays attention to the type and changes up the indexing mode depending if results are expected to be numeric or not. But just because SQLite doesn't pay attention to typecasts, doesn't mean your application should be ignorant to them. If your application is expecting only integers, and somehow a string was entered into the field, you'll either get a run time error, or, zero for a result. (This would depend on the wrapper for SQLite you're using, or how you're linking in the library) On Mon, Jul 15, 2013 at 12:35 AM, techi eth <techi...@gmail.com> wrote: > I found so many Type name to be used while creating table for array > type.What is significance of size under bracket ?.What is differences among > all ? > http://www.sqlite.org/datatype3.html > --- > CHARACTER(20) > VARCHAR(255) > VARYING CHARACTER(255) > NCHAR(55) > NATIVE CHARACTER(70) > NVARCHAR(100) > TEXT > --- > > > Thanks > > > On Fri, Jul 12, 2013 at 1:07 PM, Hick Gunter <h...@scigames.at> wrote: > > > Please read up on SQL, there are numerous tutorials available online. > > > > There is no "array" in SQL other than that a table may be considered as > an > > array of records. > > > > Your example creates a table with two fields named 'test' and 'name' and > > with declared datatypes of '10' and '50' respectively. > > > > -Ursprüngliche Nachricht- > > Von: techi eth [mailto:techi...@gmail.com] > > Gesendet: Freitag, 12. Juli 2013 09:13 > > An: General Discussion of SQLite Database > > Betreff: [sqlite] Array Accessing in SQLite3 > > > > I have query regarding accessing single & multidimensional array in > > SQLite3. > > > > Example: I have created table with (test [10] INTEGER, name [50] TEXT). > > > > How do I pass a value to insert each element of array? > > > > How do I read back? (I am using callback function for read back) > > > > > > Please cover answer by considering multidimensional array case as well. > > > > Thanks-- > > ___ > > 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-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] Array Accessing in SQLite3
I found so many Type name to be used while creating table for array type.What is significance of size under bracket ?.What is differences among all ? http://www.sqlite.org/datatype3.html --- CHARACTER(20) VARCHAR(255) VARYING CHARACTER(255) NCHAR(55) NATIVE CHARACTER(70) NVARCHAR(100) TEXT --- Thanks On Fri, Jul 12, 2013 at 1:07 PM, Hick Gunter <h...@scigames.at> wrote: > Please read up on SQL, there are numerous tutorials available online. > > There is no "array" in SQL other than that a table may be considered as an > array of records. > > Your example creates a table with two fields named 'test' and 'name' and > with declared datatypes of '10' and '50' respectively. > > -Ursprüngliche Nachricht- > Von: techi eth [mailto:techi...@gmail.com] > Gesendet: Freitag, 12. Juli 2013 09:13 > An: General Discussion of SQLite Database > Betreff: [sqlite] Array Accessing in SQLite3 > > I have query regarding accessing single & multidimensional array in > SQLite3. > > Example: I have created table with (test [10] INTEGER, name [50] TEXT). > > How do I pass a value to insert each element of array? > > How do I read back? (I am using callback function for read back) > > > Please cover answer by considering multidimensional array case as well. > > Thanks-- > ___ > 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-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Array Accessing in SQLite3
On Fri, Jul 12, 2013 at 12:43:16PM +0530, techi eth scratched on the wall: > I have query regarding accessing single & multidimensional array in SQLite3. > > Example: I have created table with (test [10] INTEGER, name [50] TEXT). > > How do I pass a value to insert each element of array? > > How do I read back? (I am using callback function for read back) > > Please cover answer by considering multidimensional array case as well. Although the SQL99 and SQL2003 standard includes specs for an ARRAY column type, SQLite does not support them. As far as I'm aware, PostgreSQL is the only major database that supports the ARRAY column type. Oracle has VARRAYs, which are very similar, but the common wisdom seems to be that nested-tables are better. Arrays are a pretty specialized case. Most people deal with this type of storage need by using a one-to-many relationship to another table. -j -- Jay A. Kreibich < J A Y @ K R E I B I.C H > "Intelligence is like underwear: it is important that you have it, but showing it to the wrong people has the tendency to make them feel uncomfortable." -- Angela Johnson ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] Array Accessing in SQLite3
Please read up on SQL, there are numerous tutorials available online. There is no "array" in SQL other than that a table may be considered as an array of records. Your example creates a table with two fields named 'test' and 'name' and with declared datatypes of '10' and '50' respectively. -Ursprüngliche Nachricht- Von: techi eth [mailto:techi...@gmail.com] Gesendet: Freitag, 12. Juli 2013 09:13 An: General Discussion of SQLite Database Betreff: [sqlite] Array Accessing in SQLite3 I have query regarding accessing single & multidimensional array in SQLite3. Example: I have created table with (test [10] INTEGER, name [50] TEXT). How do I pass a value to insert each element of array? How do I read back? (I am using callback function for read back) Please cover answer by considering multidimensional array case as well. Thanks-- ___ 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] Array Accessing in SQLite3
I have query regarding accessing single & multidimensional array in SQLite3. Example: I have created table with (test [10] INTEGER, name [50] TEXT). How do I pass a value to insert each element of array? How do I read back? (I am using callback function for read back) Please cover answer by considering multidimensional array case as well. Thanks-- ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users