lua-users home
lua-l archive

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


Thanks, I modified all the places in that function:

        -- get col names
        local allKeys = db.getColNames(tablename)
        -- get defaults
        local defaults = db.getDefaults(false, tablename)
        -- make strings
        for k,v in pairs(allKeys) do
                -- skip rowid column
                if (v ~= "_ROWID_") then
--                      insertPart = insertPart .. "\'" .. v .. "\', "
                        insertPart = insertPart .. "\'" .. conn:escape(v)|, .. "\', "
                        -- if post contained field already
                        if notFullKey and util.tableKeyExists(tableInput, v) then
--                              valuesPart = valuesPart .. "\'" .. tableInput[v] .. "\', "
                                valuesPart = valuesPart .. "\'" .. conn:escape(tableInput[v]) .. "\', "
--                      elseif util.tableKeyExists(tableInput, tablename .. "." .. v) then
                        elseif util.tableKeyExists(tableInput, tablename .. "." .. conn:escape(v)|,) then
--                              valuesPart = valuesPart .. "\'" .. tableInput[tablename .. "." .. v] .. "\', "
                                valuesPart = valuesPart .. "\'" .. tableInput[tablename .. "." .. conn:escape(v)|,] .. "\', "
                        -- else if default exists, use it
                        elseif defaults[tablename .. "." .. v] then
--                              valuesPart = valuesPart .. "\'" .. defaults[tablename .. "." .. v] .. "\', "
                                valuesPart = valuesPart .. "\'" .. defaults[tablename .. "." .. conn:escape(v)|,] .. "\', "
                        -- else use empty string
                        else
                                valuesPart = valuesPart .. "NULL, "
                        end
                end
        end



On Wed, Feb 3, 2010 at 10:10 AM, Florian Weimer <fw@deneb.enyo.de> wrote:
* Vasanta:

> Thanks Florian, I made those Two lines changes like below and I am
> going to try now.

You need to change more lines in a similar way, I was just a bit lazy.
Sorry about that.