Question Marcel Schaefer · Dec 25, 2023

Access to a Global like ^name over odbc?

Dear Community,

i need help to access to a Global like ^name over ODBC (SQL)
i will visit this global in a loop from a php site. It a access over SQL or ODBC possible?

Thanks for help and marry Christmas

Product version: IRIS 2022.1
$ZV: IRIS for Windows (x86-64) 2022.1 (Build 209U)

Comments

Yuji Ohata · Dec 25, 2023

Hi,

You need use Persistent class.
https://docs.intersystems.com/irislatest/csp/documatic/%25CSP.Documatic…

Community article.
https://community.intersystems.com/post/art-mapping-globals-classes-1-3

Like this.(Display ^Hban global on Dbeaver what used SQL.)

Class Gbl.Hban Extends%Persistent [ SqlRowIdPrivate, StorageStrategy = MyGlobalStorage ]
{

/// Index
Index KeyIndex On (year, key) [ IdKey, Unique ];/// first keyProperty year As%Integer [ Required, SqlColumnNumber = 2 ];/// second keyProperty key As%String [ Required, SqlColumnNumber = 3 ];/// third keyProperty data As%String;

Storage MyGlobalStorage
{
<Description>
<![CDATA[]]></Description>
<SQLMap name="GblMap">
<Data name="data">
<Delimiter>"^"</Delimiter>
<Piece>1</Piece>
</Data>
<Global>^Hban</Global>
<RowIdSpec name="1">
<Expression>{L1}</Expression>
<Field>year</Field>
</RowIdSpec>
<RowIdSpec name="2">
<Expression>{L2}</Expression>
<Field>key</Field>
</RowIdSpec>
<Subscript name="1">
<Expression>{year}</Expression>
</Subscript>
<Subscript name="2">
<Expression>{key}</Expression>
</Subscript>
<Type>data</Type>
</SQLMap>
<StreamLocation>^Gbl.TestS</StreamLocation>
<Type>%Storage.SQL</Type>
}

}

0
Robert Cemper  Dec 26, 2023 to Evgeny Shvarov

It is still in IPM. OEX seems to have lost it.  ???
 

zpm:USER>search global-dump-sql
registry https://pm.community.intersystems.com:
global-dump-sql 1.0.2
zpm:USER>install global-dump-sql
 
[USER|global-dump-sql]  Reload START (C:\InterSystems\IRIS\mgr\.modules\USER\global-dump-sql\1.0.2\)
[USER|global-dump-sql]  Reload SUCCESS
[global-dump-sql]       Module object refreshed.
[USER|global-dump-sql]  Validate START
[USER|global-dump-sql]  Validate SUCCESS
[USER|global-dump-sql]  Compile START
[USER|global-dump-sql]  Compile SUCCESS
[USER|global-dump-sql]  Activate START
[USER|global-dump-sql]  Configure START
[USER|global-dump-sql]  Configure SUCCESS
[USER|global-dump-sql]  Activate SUCCESS
 
Just providing the global name results in a full global dump.
Example:
USER>zn"user"
IRISAPP>d$system.SQL.Shell()
SQL Command Line Shell
... select TOP 5 * from zrcc_G.dump where zrcc_G.Dump('^%SYS','"JOURNAL"')=1
0
Marcel Schaefer  Dec 26, 2023 to Robert Cemper

Hello, thanks , the modul is what i search, but my IRIS is limited. I think i dont have zpm function. Can you help me with the installation?

0
Shanshan Yu · Dec 26, 2023

    try this

   call %Library.Global_Get('%SYS','^xxxx')

0