lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Actually I am importing tables from previous boot, all these tables adding at the end than in the beginning, I want to know by passing another parameter to query (INSERT INTO table VALUE), this query adds tables at the end of the table, by passing some arguement for the above query, can I insert in the beginning?
 
 


 
On Thu, Feb 4, 2010 at 5:32 PM, Gé Weijers <ge@weijers.org> wrote:
Your question was very confusing, without context 'table' means Lua
table on this mailing list.

A relational database table does not have a natural order, you have to
impose one by specifying a sort order in your query. If there's a lot of
data to be sorted you will need to make sure that your index or indices
support the order you requested, or your query will be slow because the
database engine will be sorting your data every time you generate a
query.

It's likely that you will need to study relational databases and SQL a
little before diving into creating an index.

Ge'

On Thu, 2010-02-04 at 16:56 -0500, Vasanta wrote:
> the imported file contains atleast 700 events, it does automatically
> by script, sctpit output shows like, this
>
> query  INSERT INTO eventLog ('component', 'facilityId', 'logLevel',
> 'textMessage', 'binMessage') VALUES ('UMI_COMP_PLATFORM', '3', '8',
> 'Tue Feb  2 22:02:07 2010 [MFD][System][PLATFORM] Checking for hlt
> inst', '')
>
>
> query  INSERT INTO eventLog ('component', 'facilityId', 'logLevel',
> 'textMessage', 'binMessage') VALUES ('UMI_COMP_PLATFORM', '3', '8',
> 'Tue Feb  2 22:02:07 2010 [MFD][System][PLATFORM] Done', '')
>
>
> Can I add 1 into query sting?
>
>
>
>
>
> On Thu, Feb 4, 2010 at 4:49 PM, Joseph Stewart
> <joseph.stewart@gmail.com> wrote:
>                 I am inserting some imported events into a Table,
>                 looklike it is inserting at the end, is there anyway I
>                 can insert at the beginning of Table?.
>
>
>
>
>
>         Yes:
>
>
>         table.insert(t,1,value)
>
>
>         (see http://www.lua.org/manual/5.1/manual.html#5.5)
>
>
>         -joe
>
>
>                 when I reboot the baord, I am importing previous log
>                 from a file, but those imported records inserting at
>                 the end of table (this table already have some boot
>                 info, I need imported event info at the beginning).
>                 can I do it?
>
>
>
--
Gé Weijers <ge@weijers.org>