• Resolved aravinddhiva

    (@aravinddhiva)


    Hi, I tried the update and delete query using import file it does not work how to resolve this.
    If I want to update more than 100 data in postmeta table using import file options is possible.

    • This topic was modified 4 years, 11 months ago by aravinddhiva.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Aravindh,

    You can use the Data Explorer to perform SQL insert and update statements. You can also perform multiple SQL statements at once (one file). Make sure that every SQL statement ends with a ; and a new line.

    Can you confirm that your SQL statements end with a ; and a new line?

    Best regards,
    Peter

    Thread Starter aravinddhiva

    (@aravinddhiva)

    I’m using this query inside sql file

    UPDATE wp_postmeta SET meta_value=’sampleTest1′ WHERE post_id = 1;
    UPDATE wp_postmeta SET meta_value=’sampleTest2′ WHERE post_id = 2;
    UPDATE wp_postmeta SET meta_value=’sampleTest3′ WHERE post_id = 3;

    but it not working for me.
    result : INFO: Imported 0 rows (2 failed).

    Thread Starter aravinddhiva

    (@aravinddhiva)

    Insert query alone working for me.

    • This reply was modified 4 years, 11 months ago by aravinddhiva.
    • This reply was modified 4 years, 11 months ago by aravinddhiva.
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Hi Aravindh,

    From where are you running your script? From the Data Explorer main page or a Data Explorer table page?

    If you explorer a specific table and click the import button on that page, you can only import rows for that table. If you want to perform an update, you must run your script directly on the Data Explorer main page.

    This is a security issue. If you give users access to specific tables, they can only insert data into that table. A user must have admin privileges to perform update or delete statements.

    Can you try to run your script directly from the Data Explorer main page?

    Best regards,
    Peter

    Thread Starter aravinddhiva

    (@aravinddhiva)

    Hi Peter,
    I tried to run the script directly from the Data Explorer main page. It comes like

    ERROR: Import test.sql failed [check import file]

    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    Can you send me your script file Aravindh? Wanna test if it works on my computer.

    Thanks,
    Peter

    Thread Starter aravinddhiva

    (@aravinddhiva)

    Hi Peter,
    Can you share mail id

    Inside the script file, only three update statement is present.

    UPDATE wp_postmeta SET meta_value=’sampleTest1′ WHERE post_id = 1;
    UPDATE wp_postmeta SET meta_value=’sampleTest2′ WHERE post_id = 2;
    UPDATE wp_postmeta SET meta_value=’sampleTest3′ WHERE post_id = 3;

    • This reply was modified 4 years, 11 months ago by aravinddhiva.
    Plugin Author Passionate Programmer Peter

    (@peterschulznl)

    You can send me a message on the plugin website: wpdataaccess.com

    Please scroll down and look for contactform. I’ll reply to your mail.

    Best regards,
    Peter

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Bulk Update action using import file’ is closed to new replies.