[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-21 Thread Dominique Devienne
On Wed, Apr 20, 2016 at 8:09 PM, Dan Kennedy wrote: > ?If I read that correctly then a field has to be NULL or point to a record >> in the other table. I want it to point to a record if it is an INT and >> whem >> it is TEXT it is just the text. (And it should only be allowed to be an >> INT >>

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-21 Thread Dan Kennedy
On 04/20/2016 11:21 PM, Cecil Westerhof wrote: > 2016-04-20 18:07 GMT+02:00 R Smith : > >> >> On 2016/04/20 6:04 PM, Cecil Westerhof wrote: >> >>> I am thinking about creating a table where a certain field will be a >>> description, or a key to the description. Would it be possible to have a >>>

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread Cecil Westerhof
2016-04-20 19:27 GMT+02:00 R Smith : > > > On 2016/04/20 6:21 PM, Cecil Westerhof wrote: > >> 2016-04-20 18:07 GMT+02:00 R Smith : >> >> >>> On 2016/04/20 6:04 PM, Cecil Westerhof wrote: >>> >>> I am thinking about creating a table where a certain field will be a description, or a key to the

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread R Smith
On 2016/04/20 6:21 PM, Cecil Westerhof wrote: > 2016-04-20 18:07 GMT+02:00 R Smith : > >> >> On 2016/04/20 6:04 PM, Cecil Westerhof wrote: >> >>> I am thinking about creating a table where a certain field will be a >>> description, or a key to the description. Would it be possible to have a >>>

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread Cecil Westerhof
2016-04-20 18:07 GMT+02:00 R Smith : > > > On 2016/04/20 6:04 PM, Cecil Westerhof wrote: > >> I am thinking about creating a table where a certain field will be a >> description, or a key to the description. Would it be possible to have a >> constraint on this field that it is an id, that this id

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread R Smith
On 2016/04/20 6:04 PM, Cecil Westerhof wrote: > I am thinking about creating a table where a certain field will be a > description, or a key to the description. Would it be possible to have a > constraint on this field that it is an id, that this id points to an > existing record in a

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread Cecil Westerhof
I am thinking about creating a table where a certain field will be a description, or a key to the description. Would it be possible to have a constraint on this field that it is an id, that this id points to an existing record in a description table? -- Cecil Westerhof

[sqlite] Field FOREIGN KEY when it is a pointer

2016-04-20 Thread Simon Slavin
On 20 Apr 2016, at 5:21pm, Cecil Westerhof wrote: > I want it to point to a record if it is an INT and whem > it is TEXT it is just the text. If you could do this in SQL it would be horrible. Use two fields. One for the INT, the other for the TEXT. The one you're not using for that row is