On Fri, Jul 2, 2010 at 8:52 PM, Pavel Ivanov <paiva...@gmail.com> wrote:
>> I tried the following two commands. Neither of them work. Would
>> you please let me know what is the command to insert a record with the
>> default value?
>
> Try this:
> insert into test default values;
>
>


Peng, Now that Pavel has shown you the correct syntax, you can also
look at the syntax diagram at http://www.sqlite.org/lang_insert.html
and familiarize yourself with how to figure out the syntax for common
SQL commands.

Also, since you noted that you don't have much SQL experience, look
for free tutorials on the web. There are many SQL tutorials that you
can benefit from.


> Pavel
>
> On Fri, Jul 2, 2010 at 9:40 PM, Peng Yu <pengyu...@gmail.com> wrote:
>> Hi,
>>
>> create table test (value text default 'unknown', value2 text default 
>> 'unknown');
>> insert into test (value) values('xxx');
>>
>> The above code works correctly. But if there is only one column with a
>> default value, I don't see how to insert a record with the default
>> value. I tried the following two commands. Neither of them work. Would
>> you please let me know what is the command to insert a record with the
>> default value?
>>
>> create table test (value text default 'unknown');
>> insert into test () values();
>> insert into test values();
>>
>> --
>> Regards,
>> Peng
>> _______________________________________________
>> 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
>



-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to