Alaska Software Inc. - SqlStatement:query() does not work
Username: Password:
AuthorTopic: SqlStatement:query() does not work
Itai DishonSqlStatement:query() does not work
on Tue, 24 Feb 2015 06:33:15 +0100
Hi,
the following code do not return any value in the array passed to it.

  aRes := {}
  
  DbeLoad("pgdbe")
  DbeSetDefault("pgdbe")

  cConnStr := "DBE=pgdbe;server=localhost;"
  cConnStr += "db=mdidemo;uid=postgres;pwd=postgres"

  oSession := DacSession():New(cConnStr)
  IF(!oSession:IsConnected())
    MsgBox("Connection failed ("+Var2Char(oSession:GetLastMessage())+")")
    QUIT
  ENDIF

  str := "Select * From Customer"
  oStmt := DacSqlStatement(oSession):fromChar(str)
  oStmt:build()
  oStmt:query(USQL_RESULT_ARRAY, @aRes)

Result: aRes = {}

Note: The data does exist in the workarea but there is no sense of a do 
while loop to read it to an array if the functionality exist after all we 
are trying to get rid of all this extra coding with SQL

Thank you
itai dishon