Postgres execute(sql)

  1. 6 years ago

    Joel_Eisenstat

    17 Jun 2017 User since 2016

    Good morning,
    In using execute(sql) to update a false always results for the record set . I typically setup and test statements in Postico and/or
    SEQUEL . In this case an update - UPDATE "CRM_Pat" SET lastname = 'harrison' WHERE id = 1, executes on these platforms .
    Variations in Creo for the method execute(sql) as seen in the select(sql) doesn't seem to work.

    // load window variables
    Console.write(lastnameText.text);
    Console.write(firstnameText.text);
    Console.write(patid.text);

    //var sql = 'UPDATE "CRM_Pat" SET "lastname" = "Jackson" ,WHERE id =/(patid.text) ';
    //var sql = 'UPDATE "CRM_Pat" SET "lastname" = "Jackson" ,WHERE "id" =/(patid.text) ';
    //var sql = 'UPDATE "CRM_Pat" SET lastname = "Jackson" ,WHERE id =/patid.text) ';
    //var sql = 'UPDATE "CRM_Pat" SET lastname = "Jackson" ,WHERE id = "1003" ';
    var sql = 'UPDATE "CRM_Pat" SET lastname = "Jackson" ,WHERE id = 1003) ';
    var rs = PostgreSQL1.execute(sql);
    Console.write(rs)
    false

    Anyone else working with Postgres your comments are appreciated .

    Regards

    Joel

  2. marco

    17 Jun 2017 Administrator User since 2016

    Seems like each case contain a syntax error to me.
    I would try with:

    var sql = 'UPDATE "CRM_Pat" SET lastname = "Jackson" WHERE id = 1003';
    var rs = PostgreSQL1.execute(sql);
    Console.write(rs)
  3. Joel_Eisenstat

    17 Jun 2017 User since 2016

    Yes I see where the , was placed in dragging over but the recommended statement still give a false result. ( as well as the above without the ',' . )
    var sql = 'UPDATE "CRM_Pat" SET lastname = "Jackson" WHERE id = 1003';
    var rs = PostgreSQL1.execute(sql);
    Console.write(rs);
    false
    I'll keep trying variations ...

  4. marco

    18 Jun 2017 Administrator User since 2016

    Hi @Joel_Eisenstat you are right, we just found (and fixed) an issue in the PostgreSQL execute method that always returned false. We should release an update on Monday.
    Thanks!

  5. Joel_Eisenstat

    18 Jun 2017 User since 2016

    Thanks for working so hard on Creo ( 24/7 ) . Looking forward to the release.
    Regards
    Joel

or Sign Up to reply!