select(sql)

  1. 5 months ago

    Joel_Eisenstat

    Jun 13 User since 2016

    Good morning,
    Is there a difference between select(sql) for SQLite and Postgres ? I substituted Postgres in the tutorial but obtained a null record set ( where SQLIte is Console.write(rs) => <SQLiteRecordSet: 0x6180010eaa80>)
    The statement being "SELECT * FROM CRM_Pat WHERE id=\(self.identifier)"; I also tried the syntax from the Query object but obtained the same results.
    Thanks
    Joel

  2. marco

    Jun 13 Administrator User since 2016

    Hi @Joel_Eisenstat have you tried that query with a PostgreSQL specific tool?
    I guess you need to specify the schema object but I could be wrong.

  3. Joel_Eisenstat

    Jun 13 User since 2016

    SELECT * FROM "CRM_Pat" WHERE id=1 works in Postico, SEQUEL for Postgres, but generates
    Semantic Error
    Identifier CRM_Pat not found.
    for Creo.
    just <CRM_pat> gives a null value if that helps

  4. marco

    Jun 15 Administrator User since 2016

    Query failed and so the returned RecordSet is null.
    Seems like something is wrong with the specified CRM_Pat table.

  5. Joel_Eisenstat

    Jun 15 User since 2016

    The query with Postgres1.Query for the db object ( SELECT * FROM "CRM_Pat" WHERE "id" =1 ) gives the
    proper result . I am just guessing but could there be a difference in parsing between Postgres1.Query and select(sql) in Creo/gravity ?

  6. Joel_Eisenstat

    Jun 15 User since 2016

    Got it - 'SELECT * FROM "CRM_Pat" WHERE "id" = 1'; "" for Postgres
    Thanks
    Joel

or Sign Up to reply!