On Tue, Feb 24, 2009 at 5:35 PM, John Machin <sjmac...@lexicon.net> wrote:
> On 25/02/2009 10:19 AM, Leo Freitag wrote:
>> Hallo,
>>
>> I'm trying to insert the highest value of tblName into tblZO.
>>
>> There fore I followed the hints in this article ...
>> http://www.nabble.com/How-to-use-the-ROWID-of-the-last-inserted-row-for-FK-insert-into-other-tables--td19085514.html#a19085514
>>
>> ... but I got a error (see below)
>>
>> SQLite version 3.3.13
>> Enter ".help" for instructions
>> sqlite> create 'tblName' ('id' integer primary key, 'text' text);
>> SQL error: near "'tblName'": syntax error
>> sqlite> create table 'tblName' ('id' integer primary key, 'text' text);
>> sqlite> insert into 'tblName' Values (NULL, 'one');
>> sqlite> insert into 'tblName' Values (NULL, 'two');
>> sqlite> insert into 'tblName' Values (NULL, 'three');
>> sqlite> insert into 'tblName' Values (NULL, 'four');
>> sqlite> insert into 'tblName' Values (NULL, 'five');
>> sqlite> create table 'tblRefMaxName' ('ref' integer, 'nn' text);
>> sqlite> insert into 'tblRefMaxName' Values (select max(id) from tblName,
>> 'eins')
>> ;
>> SQL error: near "select": syntax error
>> sqlite>
>
> sqlite> insert into 'tblRefMaxName' Values ((select max(id) from
> tblName),'eins'
> );
> sqlite> select * from tblRefMaxName;
> 5|eins
> sqlite>
>
> BTW, don't you find all those '' around your table and column names
> rtaher irritating?
> _______________________________________________


I've often wondered why folks put [] or '', or even "" around their
column/table names. I guess it is for compatibility with other
software, or perhaps they are used doing so in other software
packages, and those habits continue here.

It is, no doubt, very hassly for me to even read all those extra
sigils. I can't imagine how it must be for them to use those in their
code over and over again.




-- 
Puneet Kishor
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to