On 10/22/12 1:44 PM, "Guillaume Saumure" <gsaumur...@videotron.ca> wrote:


>Le 2012-10-22 15:35, Paul van Helden a écrit :
>>> It would be possible to implement TRUNCATE TABLE on top of that, but
>>> this would be only syntactic sugar.
>>>
>> ..or better portability. TRUNCATE TABLE works (since only a few years)
>> nearly everywhere. So when writing portable applications it seems a bit
>> silly to make an exception for SQLite if the solution is that simple and
>> won't break anything.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@sqlite.org
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>Personally, I have ask the question why TRUNCATE TABLE don't work
>because this command is not listed on http://www.sqlite.org/omitted.html
>This site list the non-supported feature of SQL92 standard and TRUNCATE
>TABLE is not listed so it should work.

SQLite is based on the 1992 SQL standard.  TRUNCATE TABLE is from the 2008
SQL standard, so of course it isn't included in a list of commands from
the SQL 92 standard that SQLite doesn't implement.

Will




>Even if I built programs since 2003,
>the use of database has never been necessary until last week. In one
>week I have figure out enough of functionality to use them but what
>command is part of this standard and what is not it's little bit
>difficult to know for a database newbie like me. Anyway Something I can
>do with
>PureBasic is :
>
>Procedure.b TruncateDatabaseTable(DataBaseID.l, TableName.s)
>
>   If DatabaseUpdate(DatabaseID, "TRUNCATE TABLE " + TableName)
>     Protected Success.b = #True
>   Else
>     If DatabaseUpdate(DatabaseID, "DELETE * FROM " + TableName)
>       Success = #True
>     Else
>       If DatabaseUpdate(DatabaseID, "DELETE FROM " + TableName)
>         Success = #True
>       Else
>         Success = #False
>       EndIf
>     EndIf
>   EndIf
>
>   ProcedureReturn Success
>EndProcedure
>
>If "TRUNCATE TABLE" fail the procedure fall back to "DELETE * FROM" and
>if this fail the procedure try "DELETE FROM" then if this also fail give
>up and return #false. Little bit intense for a simple database operation
>but as long as it work, I'm happy.
>
>Best regards
>Guillaume
>
>_______________________________________________
>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

Reply via email to