User bio
404 bio not found
Member since Mar 2
Posts:
Replies:

@Robert Cemper 

What am I missing? Thank you

=======

ClassMethod SelectNS

{

ZN "HSACCESS"
&SQL(DROP TABLE %ZZ.resultset
Set sql=2,
sql(1)="CREATE GLOBAL TEMPORARY TABLE %ZZ.resultset as ",
sql(2) ="SELECT * FROM Ens.MessageHeader"
Set statement=##class(%SQL.Statement).%New()
Set result=statement.%ExecDirect(.statement,.sql)
Set = result.%SQLCODE // a = 0 
ZN "HSCUSTOM"
// Attempt to verify via MP>"HSACCESS">SQL:
// SELECT * FROM Ens.MessageHeader  > Row count: 8..
// SELECT * FROM %ZZ.resultset  > Row count: 0 ...
// Pay attention that there is NO error "Table '%ZZ.RESULTSET' not found"
// Attempt to verify via MP>"HCUSTOM">SQL:
// SELECT * FROM %ZZ.resultset  > Row count: 0 ...
// Pay attention that there is NO error "Table '%ZZ.RESULTSET' not found"

}

@Robert Cemper I understand about extended global reference - it is not an issue. 

I have issue to execute "..CREATE GLOBAL TEMPORARY TABLE %ZZ.resultset.." related steps from QobjectScript. 

Creating a temp (%ZZ..)  table, following by it's population and finally dropping it (as you described in your post) must be done programmatically from ObjectScript. 

Thank you for guidance.

@Robert Cemper 

Thank you—this looks promising. However, when I attempt to reproduce it in Caché ObjectScript, I’m running into syntax errors. Could you please provide a complete ObjectScript example that implements all the steps described above? Thank you.
Certifications & Credly badges:
Mikhail (VetsEZ) has no Certifications & Credly badges yet.
Followers:
Mikhail (VetsEZ) has no followers yet.
Following:
Mikhail (VetsEZ) has not followed anybody yet.