Re: [sqlite] field length retreval

2014-04-18 Thread Simon Slavin
On 18 Apr 2014, at 7:29pm, Donald Griggs wrote: > I tried a simple test with recent [Postgres] (9.3.4) version (using default > settings, > if that matters) and verified that an insert with oversized string will > fail to insert, unless the overage characters are spaces

Re: [sqlite] field length retreval

2014-04-18 Thread Donald Griggs
I know very little about Postgres, but I see this interesting page in their documentation: http://www.postgresql.org/docs/8.0/interactive/datatype-character.html Excerpt: *An attempt to store a longer string into a column of these types will result in an error, unless the excess characters are

Re: [sqlite] field length retreval

2014-04-18 Thread Luuk
On 18-4-2014 18:56, Simon Slavin wrote: On 18 Apr 2014, at 5:28pm, Dominique Devienne wrote: I'm not sure where you get that declaring a column as varchar() implicitly truncate While I can't find any reference one way or another in a SQL standard, all implementations

Re: [sqlite] field length retreval

2014-04-18 Thread Simon Slavin
On 18 Apr 2014, at 5:28pm, Dominique Devienne wrote: > I'm not sure where you get that declaring a column as varchar() > implicitly truncate While I can't find any reference one way or another in a SQL standard, all implementations I've seen that understand VARCHAR(n)

Re: [sqlite] field length retreval

2014-04-18 Thread Dominique Devienne
On Fri, Apr 18, 2014 at 4:42 PM, Simon Slavin wrote: > On 18 Apr 2014, at 3:21pm, Dominique Devienne wrote: >> No need to resort to triggers. A simple check constraint will do > > A constraint can prevent you from putting too-long values in the field.

Re: [sqlite] field length retreval

2014-04-18 Thread Simon Slavin
On 18 Apr 2014, at 3:21pm, Dominique Devienne wrote: > On Fri, Apr 18, 2014 at 12:53 AM, Simon Slavin wrote: >> There are ways to enforce field length limits entirely within SQLite but >> they're complicated so post again if you want me to explain

Re: [sqlite] field length retreval

2014-04-18 Thread Dominique Devienne
On Fri, Apr 18, 2014 at 12:53 AM, Simon Slavin wrote: > On 17 Apr 2014, at 11:24pm, David Clark wrote: >> If I have a table of >> field1 varchar(25) >> field2 varchar(50) >> field3 varchar(75) > > You don't. SQLite does not support a datatype of

Re: [sqlite] field length retreval

2014-04-17 Thread Simon Slavin
On 17 Apr 2014, at 11:24pm, David Clark wrote: > If I have a table of > field1 varchar(25) > field2 varchar(50) > field3 varchar(75) You don't. SQLite does not support a datatype of varchar(). Fields you declare like that will be implemented as TEXT fields and handled

Re: [sqlite] field length retreval

2014-04-17 Thread Igor Tandetnik
On 4/17/2014 6:24 PM, David Clark wrote: If I have a table of field1 varchar(25) field2 varchar(50) field3 varchar(75) I know sqlite does not enforce limits, but in my program it would be useful if I could find the declared lengths of 25, 50 and 75 in this case. How might I do that in sqlite?

[sqlite] field length retreval

2014-04-17 Thread David Clark
If I have a table of  field1 varchar(25) field2 varchar(50) field3 varchar(75) I know sqlite does not enforce limits, but in my program it would be useful if I could find the declared lengths of 25, 50 and 75 in this case.  How might I do that in sqlite? Thank you, David Clark