DB query null value

  1. 5 years ago

    Joel_Eisenstat

    27 Jun 2018 User since 2016

    Good afternoon,
    I am still confused as to why I obtain null value for a Postgres query using Creo programatically after testing positive using Creo PostgreSQL query and Postico . No errors are obtained.
    Creo PostgreSQL and Postico query > SELECT *FROM information_schema.columnsWHERE table_name = 'Chart_Odont_Material'.
    Creo Window method ;
    //async method
    Console.write(identifier); // Chart_Odont_Material - correct table name from query ;
    SELECT table_name FROM information_schema.tables WHERE table_schema='public' AND table_type='BASE TABLE';

    var rs
    var onError = {
    var alert = Alert("WARNING", PostgreSQL1.errorMessage);
    alert.show();
    };
    var onComplete = func (db, rs) {
    TableView1.dataSet = rs ;
    };
    var sql = 'SELECT *FROM information_schema.columnsWHERE table_name = $$/(identifier)$$';

    // perform async query
    PostgreSQL1.select(sql, onComplete, onError);
    Console.write(rs);// null ?

    TableView1.dataSet = rs;
    TableView1.reload(true);

    Any direction / correction is always appreciated.
    Regards,
    Joel

  2. marco

    27 Jun 2018 Administrator User since 2016
    Edited 5 years ago by marco

    @Joel_Eisenstat seems like there is a typo in the sql statement, no space between columns and WHERE statement and it should be also $$\(identifier)$$' and not $$/(identifier)$$'

  3. Joel_Eisenstat

    27 Jun 2018 User since 2016

    thanks Marco , thats what you get typing on a lounge chair .

  4. Joel_Eisenstat

    27 Jun 2018 User since 2016

    Fixed the typos ( single spaces and \ ) but still returns null for rs

  5. Joel_Eisenstat

    27 Jun 2018 User since 2016

    However rejigged the Cell with custom view so the columns are now visible
    The connection speed I guess is the culprit as I am on a satellite feed so rs is not showing in the console.

or Sign Up to reply!