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
Comments
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>
}
}.png)
Hi @Marcel Schaefer !
Also take a look Global-dump-to-sql module by @Robert Cemper
you'll be able to do something like:
select TOP 15 * from zrcc_G.dump where zrcc_G.Dump(’^%SYS’,’“JOURNAL”’)=1
The only issue it is used to be available for IPM installation, now is not. @Robert Cemper , could you please help with it?
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"')=1Hello, 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?
find One-Line-Installer here ZPM is rather on top
try this
call %Library.Global_Get('%SYS','^xxxx')
.png)