I'm looking at the output validation code, not Output, where there are no spaces at all on the right. It is a pity that there is confusion because of this!
Class codeGolf.test.Pyramid
- Log in to post comments
I'm looking at the output validation code, not Output, where there are no spaces at all on the right. It is a pity that there is confusion because of this!
Class codeGolf.test.Pyramid
size = 50
ClassMethod Build(f As %Integer)
{
s a="#" f i=f:-1:1 w ?i-1,a,?f*2-1,! s a=a_"##"
}PS: if you look at the class codeGolf.test.Pyramid, you can see that the format of the output data for f=3 should be as follows:
" # " " ### " "#####"
So be careful.
Your example does not take into account which element is selected.
For example, if you select the last element, then the list wins instead of the delimited string.
s L=1e4,N=1e5,a="1",b=$lb(1) f i=2:1:L s a=a_"_"_i,b=b_$lb(i) s t=$zh f i=1:1:N s c=$p(a,"_",L) w $zh-t," s.",! s t=$zh f i=1:1:N s c=$li(b,L) w $zh-t," s.",!
I'll put in my five cents too.
Firstly, Apache for Windows is installed very easily: you just need to unpack the archive and, if necessary (this is done once), register the service. Secondly, it is not difficult to find the Apache distribution for Windows, for example here: Apache Haus Downloads Thirdly, I always remove PWS and use my own Apache, so I welcome removing PWS from the IRIS distribution
It is not entirely clear that you are using Caché or IRIS 2021.1:
#CachéI have two tables: one a local table using cache and the other is via an SQL gateway..
Product version: IRIS 2021.1
The presence/absence of restrictions on the execution of heterogeneous queries depends on this:
DELETE %NOCHECK FROM nodes
size = 79
ClassMethod Order(a As %String) As %String
{
s r=a f i=1:1:5e5{s s=$p(a," ",i),w=$tr(s,1e20/17),$p(r," ",$tr(s,w))=w} q r
}Have you looked at the type of fields in the metadata? For me, the INTEGER type (4) is returned for ID, and the BIGINT type (-5) is returned for %ID.
Try
<FONT COLOR="#0000ff">SELECT </FONT><FONT COLOR="#008000">id</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#008000">x</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#008000">y</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#008000">z </FONT><FONT COLOR="#000080">FROM </FONT><FONT COLOR="#008000">some_table </FONT><FONT COLOR="#000080">order by </FONT><FONT COLOR="#008000">%id</FONT>and
<FONT COLOR="#0000ff">d </FONT><FONT COLOR="#800000">rs</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#0000ff">%GetMetadata</FONT><FONT COLOR="#000000">().</FONT><FONT COLOR="#0000ff">%Display</FONT><FONT COLOR="#000000">()</FONT>
What are the default values for AdaptiveMode, AllowRowIDUpdate, IdKeyCPF, PKEY_IS_IDKEY ?
Try disabling AdaptiveMode.
There is a faster way without opening the object:
<FONT COLOR="#000080">Class dc.test Extends %Persistent
</FONT><FONT COLOR="#000000">{
</FONT><FONT COLOR="#000080">ClassMethod </FONT><FONT COLOR="#000000">Test()
{
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">classname</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#008000">"dc.test"</FONT><FONT COLOR="#000000">, </FONT><FONT COLOR="#800000">storagename</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#008000">"Default"
</FONT><FONT COLOR="#0000ff">w $$$defMemberKeyGet</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">classname</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000ff">$$$cCLASSstorage</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#800000">storagename</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#0000ff">$$$cSDEFdatalocation</FONT><FONT COLOR="#000000">)
}
</FONT><FONT COLOR="#000080">Storage </FONT><FONT COLOR="#000000">Default
{
<Data name="</FONT><FONT COLOR="#000080">testDefaultData</FONT><FONT COLOR="#000000">">
<Value name="</FONT><FONT COLOR="#000080">1</FONT><FONT COLOR="#000000">">
<Value>%%CLASSNAME</Value>
</Value>
</Data>
<DataLocation>^abc.1</DataLocation>
<DefaultData>testDefaultData</DefaultData>
<IdLocation>^dc.testD</IdLocation>
<IndexLocation>^dc.testI</IndexLocation>
<StreamLocation>^dc.testS</StreamLocation>
<Type>%Library.CacheStorage</Type>
}
}</FONT>
Result:
^abc.1
Here are two ways:
<FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">s</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#008000">"12162,CHAPTER I,Certain infectious and parasitic diseases (A00-B99),003 (A20-A28),Certain zoonotic bacterial diseases,A28,""Other zoonotic bacterial diseases, not elsewhere classified"",A28,""Other zoonotic bacterial diseases, not elsewhere classified"",N,N,N,N,N,,,,,,,,,,G" </FONT><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%DeepSee.TermList</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">%ParseCSVRecord</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">s</FONT><FONT COLOR="#000000">,.</FONT><FONT COLOR="#800000">arr1</FONT><FONT COLOR="#000000">) </FONT><FONT COLOR="#0000ff">zw </FONT><FONT COLOR="#800000">arr1</FONT><FONT COLOR="#0000ff">w </FONT><FONT COLOR="#000000">!
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">list</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#0000ff">$$</FONT><FONT COLOR="#ff0000">CSVtoList</FONT><FONT COLOR="#000000">^%occLibrary(</FONT><FONT COLOR="#800000">s</FONT><FONT COLOR="#000000">)
</FONT><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%ListOfDataTypes</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">BuildValueArray</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">list</FONT><FONT COLOR="#000000">,.</FONT><FONT COLOR="#800000">arr2</FONT><FONT COLOR="#000000">) </FONT><FONT COLOR="#0000ff">zw </FONT><FONT COLOR="#800000">arr2</FONT>
Take a look at the class methods %SQL.Util.Procedures
If there was a built-in function for expanding the list into a table, then the solution would be even shorter.
An example of such a function:
Class dc.golf.Kata [ Abstract ]
{
Query split(
s As %VarString,
delim As %VarString) As %Query(ROWSPEC = "word:%String") [ SqlProc ]
{
}
ClassMethod splitExecute(
ByRef qHandle As %Binary,
s As %VarString,
delim As %VarString) As %Status
{
d ##class(%ListOfDataTypes).BuildValueArray($lfs(s,delim),.qHandle)
s qHandle=0
q $$$OK
}
ClassMethod splitFetch(
ByRef qHandle As %Binary,
ByRef Row As %List,
ByRef AtEnd As %Integer = 0) As %Status [ PlaceAfter = splitExecute ]
{
s d=$o(qHandle(qHandle),1,v)
i d="" { s AtEnd=1 } else { s Row=$lb(v),qHandle=d }
q $$$OK
}
}Now you can do a variety of things with the string, for example:
select min(length(word)) "min",length(word) len,word from dc_golf.Kata_split('bitcoin take over the world maybe who knows perhaps',' ')Result:
| min | len | word |
|---|---|---|
| 3 | 7 | bitcoin |
| 3 | 4 | take |
| 3 | 4 | over |
| 3 | 3 | the |
| 3 | 5 | world |
| 3 | 5 | maybe |
| 3 | 3 | who |
| 3 | 5 | knows |
| 3 | 7 | perhaps |
This code can be reduced by two more characters.
There are no such methods, because the size of the stream (file) can exceed the maximum length of the string, which at the moment is 3641144, so the type of string (%String, %VarString, %xsd.base64Binary, etc.) will not always be able to hold all the data.
But also it is not difficult to read the stream into a line:ClassMethod StreamToStr(ByRef stream As %Stream.Object) As %String
{
s s=""
d stream.Rewind()
while 'stream.AtEnd {
s s=s_stream.Read($$$MaxLocalLength)
}
q s
}PS: above I have given methods, some of which are available in older versions of Caché.
Am I correct in saying that a create table as select is strictly as COPY operation of an existing table.Yes, see CREATE TABLE table AS SELECT query copies column definitions and column data from an existing table (or tables) into a new table based on the specified SELECT query.2022.1
To clarify, I used the $SYSTEM command to create table from query, because I kept getting errors with create table as select (didn't like my AS statement). What could have gone wrong there?Because this feature has appeared since version IRIS 2022.1 (see link above).Benjamin De BoeFor that purpose, the CREATE TABLE .. AS SELECT .. syntax is offered by several other databases, and will appear in IRIS SQL soon. As a matter of fact, a developer is working on that command this very week :-)
well, looks so, but there are no methods, which will return available connections.USER>d $system.License.ConnectionListFunc().%Display() or d $system.License.ProcessListFunc().%Display()
Try to play around with the SetConnectionLimit() & SetUserLimit() methods.
PS: I do not know what about DBeaver, but DbVisualizer has the ability to configure one physical connection.
I think it is necessary to focus on the $System.License.InstanceConnections()
PS: and is better in my opinion to use $SYSTEM.License.KeyPlatform(), not $SYSTEM.License.KeyCustomerName()
.. s sql=0 s sql($i(sql))="select *" s sql($i(sql))=",%external(DOB)||' '||%external(DOBTime) DOBString" s sql($i(sql))=",TO_CHAR(DOB||','||DOBTime,'MM/DD/YYYY HH24:MI:SS') DOBString2" s sql($i(sql))="from dc.test" d st.%ExecDirect(.st,.sql).%Display() ..Result:
USER>d ##class(dc.test).Test()
| ID (INTEGER) | DOB (DATE) | DOBTime (TIME) | DOBString (VARCHAR) | DOBString2 (VARCHAR) |
| 1 | 01.01.2020 | 23:59:59 | 01.01.2020 23:59:59 | 01/01/2020 23:59:59 |
| 2 | 31.12.2022 | 10:10:10 | 31.12.2022 10:10:10 | 12/31/2022 10:10:10 |
I like @Yaron Munz version better
<FONT COLOR="#000080">Class dc.test </FONT><FONT COLOR="#000000">[ </FONT><FONT COLOR="#000080">Abstract </FONT><FONT COLOR="#000000">]
{
</FONT><FONT COLOR="#000080">ClassMethod </FONT><FONT COLOR="#000000">Test()
{
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">=0,
</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$i</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#0000ff">$lb</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"2021-11-27"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"2022-08-04"</FONT><FONT COLOR="#000000">),
</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$i</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#0000ff">$lb</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"2020-02-28"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"2023-02-27"</FONT><FONT COLOR="#000000">),
</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$i</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#0000ff">$lb</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"2020-02-28"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"2023-03-01"</FONT><FONT COLOR="#000000">),
</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$i</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">))=</FONT><FONT COLOR="#0000ff">$lb</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">"2017-03-01"</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">"2020-02-28"</FONT><FONT COLOR="#000000">)
</FONT><FONT COLOR="#0000ff">f </FONT><FONT COLOR="#800000">i</FONT><FONT COLOR="#000000">=1:1:</FONT><FONT COLOR="#0000ff">$o</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">""</FONT><FONT COLOR="#000000">),-1) </FONT><FONT COLOR="#800080">{
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">d1 </FONT><FONT COLOR="#000000">= </FONT><FONT COLOR="#0000ff">$li</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">i</FONT><FONT COLOR="#000000">),1),
</FONT><FONT COLOR="#800000">d2 </FONT><FONT COLOR="#000000">= </FONT><FONT COLOR="#0000ff">$li</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">v</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">i</FONT><FONT COLOR="#000000">),2),
</FONT><FONT COLOR="#800000">age1 </FONT><FONT COLOR="#000000">= </FONT><FONT COLOR="#0000ff">$e</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d2</FONT><FONT COLOR="#000000">,1,4)-</FONT><FONT COLOR="#0000ff">$e</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d1</FONT><FONT COLOR="#000000">,1,4)-(</FONT><FONT COLOR="#0000ff">$e</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d1</FONT><FONT COLOR="#000000">,6,10)]</FONT><FONT COLOR="#0000ff">$e</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d2</FONT><FONT COLOR="#000000">,6,10)),
</FONT><FONT COLOR="#800000">age2 </FONT><FONT COLOR="#000000">= </FONT><FONT COLOR="#0000ff">$number</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$zabs</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#0000ff">$zdh</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d2</FONT><FONT COLOR="#000000">,3)-</FONT><FONT COLOR="#0000ff">$zdh</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d1</FONT><FONT COLOR="#000000">,3))/365.25,0),
</FONT><FONT COLOR="#800000">age3 </FONT><FONT COLOR="#000000">= </FONT><FONT COLOR="#0000ff">$zdh</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d2</FONT><FONT COLOR="#000000">,3)-</FONT><FONT COLOR="#0000ff">$zdh</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#800000">d1</FONT><FONT COLOR="#000000">,3)\365.25
</FONT><FONT COLOR="#0000ff">w </FONT><FONT COLOR="#800000">d1</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">" "</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#800000">d2</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">" (age1 = "</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#800000">age1</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">", age2 = "</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#800000">age2</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">", age3 = "</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#800000">age3</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">")"</FONT><FONT COLOR="#000000">,!
</FONT><FONT COLOR="#800080">}
</FONT><FONT COLOR="#000000">}
}</FONT>
Result:USER><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">dc.test</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">Test</FONT><FONT COLOR="#000000">()</FONT> 2021-11-27 2022-08-04 (age1 = 0, age2 = 1, age3 = 0) 2020-02-28 2023-02-27 (age1 = 2, age2 = 3, age3 = 2) 2020-02-28 2023-03-01 (age1 = 3, age2 = 3, age3 = 3) 2017-03-01 2020-02-28 (age1 = 2, age2 = 3, age3 = 2)
I am aware that we have 5 License Units on Community Edition.I think this is where the confusion lies, because the documentation says about 5 connections, not license units
InterSystems IRIS Community Edition LimitationsResource usage is limited to the following: Total data: 10 GB Connections: 5 Cores: 8
See my old article Indexing of non-atomic attributes, chapter "Date (time, etc.)"
A simple example of combining:
<FONT COLOR="#000080">Class dc.test Extends %Persistent
</FONT><FONT COLOR="#000000">{
</FONT><FONT COLOR="#000080">Property </FONT><FONT COLOR="#000000">DOB </FONT><FONT COLOR="#000080">As %Date</FONT><FONT COLOR="#000000">;
</FONT><FONT COLOR="#000080">Property </FONT><FONT COLOR="#000000">DOBTime </FONT><FONT COLOR="#000080">As %Time</FONT><FONT COLOR="#000000">;
</FONT><FONT COLOR="#000080">ClassMethod </FONT><FONT COLOR="#000000">Test()
{
</FONT><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#000000">..</FONT><FONT COLOR="#0000ff">%KillExtent</FONT><FONT COLOR="#000000">()
</FONT><FONT COLOR="#800080">&sql(</FONT><FONT COLOR="#0000ff">insert </FONT><FONT COLOR="#000080">into </FONT><FONT COLOR="#008000">dc</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#008000">test</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008000">DOB</FONT><FONT COLOR="#000000">,</FONT><FONT COLOR="#008000">DOBTime</FONT><FONT COLOR="#000000">)
</FONT><FONT COLOR="#0000ff">select </FONT><FONT COLOR="#000000">{</FONT><FONT COLOR="#000080">d </FONT><FONT COLOR="#008080">'2020-01-01'</FONT><FONT COLOR="#000000">},{</FONT><FONT COLOR="#000080">t </FONT><FONT COLOR="#008080">'23:59:59'</FONT><FONT COLOR="#000000">}
</FONT><FONT COLOR="#000080">union all
</FONT><FONT COLOR="#0000ff">select </FONT><FONT COLOR="#000000">{</FONT><FONT COLOR="#000080">d </FONT><FONT COLOR="#008080">'2022-12-31'</FONT><FONT COLOR="#000000">},{</FONT><FONT COLOR="#000080">t </FONT><FONT COLOR="#008080">'10:10:10'</FONT><FONT COLOR="#000000">}</FONT><FONT COLOR="#800080">)
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">st</FONT><FONT COLOR="#000000">=</FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">%SQL.Statement</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">%New</FONT><FONT COLOR="#000000">()
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">st</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#0000ff">%SelectMode</FONT><FONT COLOR="#000000">=2
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">=5
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">(1)=</FONT><FONT COLOR="#008000">"select *"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">(2)=</FONT><FONT COLOR="#008000">",%odbcout(DOB)||' '||%odbcout(DOBTime) DOBString"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">(3)=</FONT><FONT COLOR="#008000">",CAST(%odbcout(DOB)||' '||%odbcout(DOBTime) as DATETIME) DOBDateTime"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">(4)=</FONT><FONT COLOR="#008000">",UNIX_TIMESTAMP(DOB||','||DOBTime) DOBUnixTimeStamp"
</FONT><FONT COLOR="#0000ff">s </FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">(5)=</FONT><FONT COLOR="#008000">"from dc.test"
</FONT><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#800000">st</FONT><FONT COLOR="#000000">.</FONT><FONT COLOR="#0000ff">%ExecDirect</FONT><FONT COLOR="#000000">(.</FONT><FONT COLOR="#800000">st</FONT><FONT COLOR="#000000">,.</FONT><FONT COLOR="#800000">sql</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">%Display</FONT><FONT COLOR="#000000">()
}
}</FONT>
Result:USER><FONT COLOR="#0000ff">d </FONT><FONT COLOR="#000080">##class</FONT><FONT COLOR="#000000">(</FONT><FONT COLOR="#008080">dc.test</FONT><FONT COLOR="#000000">).</FONT><FONT COLOR="#0000ff">Test</FONT><FONT COLOR="#000000">()</FONT>
| ID (INTEGER) | DOB (DATE) | DOBTime (TIME) | DOBString (VARCHAR) | DOBDateTime (TIMESTAMP) | DOBUnixTimeStamp (NUMERIC) |
| 1 | 01.01.2020 | 23:59:59 | 2020-01-01 23:59:59 | 2020-01-01 23:59:59 | 1577923199.00 |
| 2 | 31.12.2022 | 10:10:10 | 2022-12-31 10:10:10 | 2022-12-31 10:10:10 | 1672481410.00 |
Instead of two separate fields, it would be easier to use the %TimeStamp (or %PosixTime) type, where the date and time are paired at once. For this type of data, you can make your own indexes for different parts and/or combinations of them: a separate date, a separate time, a separate year, a separate year and month, etc. You can also use these separate parts in the query (in SELECT and WHERE).
select datediff('yy',DOB,current_date) Age from yourtableI have already written, but I will repeat again: not everyone can download from WRC, but only registered customers with paid technical support.
There is an exception only for downloading the Community Edition version from WRC through the service evaluation.intersystems.com
The very first message contains a link from where you can download the ODBC-2022.1.0.209.0 driver for different operating systems.
What does the JDBC driver have to do with the question about the ODBC driver?
Unlike JDBC, the ODBC driver still yet needs to be registered in the OS (at least for Windows), which is what the installer does.
And can do it even easier by using a ready-made method Base64FromStream()
I checked on version 2022.2CE & Win11 - everything is displayed as it should.
Made some minor changes to your code and now everything works as expected.
ClassMethod ActivateSQL(customerId) As %Status
{
...
Quit $$$OK
}ClassMethod ActivateOO(customerId) As %Status
{
...
Quit $$$OK
}If mode=0 {
Do $system.OBJ.DisplayError(objCust.ActivateOO(id))
} else {
Do $system.OBJ.DisplayError(objCust.ActivateSQL(id))
Set objCust.Active = objCust.ActiveGetStored(id)
}
Or
If mode=0 {
Do $system.OBJ.DisplayError(objCust.ActivateOO(id))
} else {
Do $system.OBJ.DisplayError(objCust.ActivateSQL(id))
Do objCust.%Reload()
}