Hey everyone!

With the holiday season upon us, we want to share our upcoming working hours:

After that, we’ll return to our regular schedule and assist you as quickly as possible.

In the meantime, you can explore our documentation for Amelia and wpDataTables. You'll find tons of helpful resources, including articles and handy video tutorials on YouTube (Amelia's YouTube Channel and wpDataTables' YouTube Channel), which might just have the answers you need while we’re away.

Thanks a bunch for your understanding and support!

Warm regards and happy holidays!

TMS

Okay
  Public Ticket #3510779
Edit / Add row
Closed

Comments

  • Alessandro started the conversation

    Hello, i have created a SQL query table and i cannot edit or add new rows to the table. The SQL i am using is :

    SELECT
        post_id,
        MAX(CASE WHEN meta_key = 'valoare' THEN meta_value END) AS valoare,
        MAX(CASE WHEN meta_key = 'data_emiterii' THEN meta_value END) AS data_emiterii,
        MAX(CASE WHEN meta_key = 'data_scadenta' THEN meta_value END) AS data_scadenta,
        MAX(CASE WHEN meta_key = 'banca' THEN meta_value END) AS banca,
        MAX(CASE WHEN meta_key = 'beneficiar' THEN meta_value END) AS beneficiar,
        MAX(CASE WHEN meta_key = 'notite' THEN meta_value END) AS notite,
        MAX(CASE WHEN meta_key = 'locatie' THEN meta_value END) AS locatie,
        MAX(CASE WHEN meta_key = 'user' THEN meta_value END) AS user
    FROM wpti_postmeta
    GROUP BY post_id
    HAVING valoare IS NOT NULL


    The error i am facing when editing or adding new row is :

    CloError! There was an error trying to update the row! Error: Unknown column 'valoare' in 'field list'

  •  1,847
    Miloš replied

    Hi Alessandro,

    Our SQL Feature is not the same as a Database Management Tool, and is not meant to be used as one.

    Our SQL Logic of the plugin is based on a PHP & SQL Parser, which has certain limitations for pulling / editing / and filtering/searching data as well.

    In regards to editing, we can see you are making the "max / case when" which is creating Custom Dynamic Columns, unfortunately you will not be able to edit our Tables with this function added.

    Also with the "Group By" you will most probably not be able to edit since that is also not pulling the values directly as columns+rows from the SQL Database Table, but is grouping the rows by a column.

    Our Plugin needs to have fixed Column and row values pulled from your Database in order to be able to edit them.

    That is why our SQL Parser throws that error, it can not properly recognise the 'valoare' as a Column Name from an SQL DB Table, because you are making it as a custom dynamic field with the "MAX ( CASE WHEN" statement.

    You can see other editing limitations for our Plugin explained on this Documentation.

    I hope that helps.

    Kind Regards, 

    Miloš Jovanović
    [email protected]

    Rate my support

    Try our FREE mapping plugin! MapSVG - easy Google maps, interactive SVG maps and floor plans, choropleth maps and much more - https://wordpress.org/plugins/mapsvg-lite-interactive-vector-maps/

    wpDataTables: FAQ | Facebook | Twitter | InstagramFront-end and back-end demo | Docs

    Amelia: FAQ | Facebook | Twitter | InstagramAmelia demo sites | Docs | Discord Community

    You can try wpDataTables add-ons before purchasing on these sandbox sites:

    Powerful Filters | Gravity Forms Integration for wpDataTables | Formidable Forms Integration for wpDataTables | Master-Detail Tables