go to post Vitaliy Serdtsev · Aug 19, 2022 See documentation for $SYSTEM.SQL.QueryToTable(): THIS METHOD IS DEPRECATED. Refer to $SYSTEM.SQL.Schema.QueryToTable instead.2021.1 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? Benjamin De Boe For 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 :-) Because this feature has appeared since version IRIS 2022.1 (see link above).
go to post Vitaliy Serdtsev · Aug 4, 2022 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()
go to post Vitaliy Serdtsev · Aug 4, 2022 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.
go to post Vitaliy Serdtsev · Aug 4, 2022 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()
go to post Vitaliy Serdtsev · Aug 4, 2022 .. 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
go to post Vitaliy Serdtsev · Aug 4, 2022 I like @Yaron Munz version better Class dc.test [ Abstract ] { ClassMethod Test() { s v=0, v($i(v))=$lb("2021-11-27","2022-08-04"), v($i(v))=$lb("2020-02-28","2023-02-27"), v($i(v))=$lb("2020-02-28","2023-03-01"), v($i(v))=$lb("2017-03-01","2020-02-28") f i=1:1:$o(v(""),-1) { s d1 = $li(v(i),1), d2 = $li(v(i),2), age1 = $e(d2,1,4)-$e(d1,1,4)-($e(d1,6,10)]$e(d2,6,10)), age2 = $number($zabs($zdh(d2,3)-$zdh(d1,3))/365.25,0), age3 = $zdh(d2,3)-$zdh(d1,3)\365.25 w d1," ",d2," (age1 = ",age1,", age2 = ",age2,", age3 = ",age3,")",! } } }Result: USER>d ##class(dc.test).Test() 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)
go to post Vitaliy Serdtsev · Aug 4, 2022 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 Limitations Resource usage is limited to the following: Total data: 10 GB Connections: 5 Cores: 8
go to post Vitaliy Serdtsev · Aug 4, 2022 See my old article Indexing of non-atomic attributes, chapter "Date (time, etc.)"
go to post Vitaliy Serdtsev · Aug 4, 2022 A simple example of combining: Class dc.test Extends %Persistent { Property DOB As %Date; Property DOBTime As %Time; ClassMethod Test() { d ..%KillExtent() &sql(insert into dc.test(DOB,DOBTime) select {d '2020-01-01'},{t '23:59:59'} union all select {d '2022-12-31'},{t '10:10:10'}) s st=##class(%SQL.Statement).%New() s st.%SelectMode=2 s sql=5 s sql(1)="select *" s sql(2)=",%odbcout(DOB)||' '||%odbcout(DOBTime) DOBString" s sql(3)=",CAST(%odbcout(DOB)||' '||%odbcout(DOBTime) as DATETIME) DOBDateTime" s sql(4)=",UNIX_TIMESTAMP(DOB||','||DOBTime) DOBUnixTimeStamp" s sql(5)="from dc.test" d st.%ExecDirect(.st,.sql).%Display() } }Result: USER>d ##class(dc.test).Test() 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 2 Rows(s) Affected
go to post Vitaliy Serdtsev · Aug 4, 2022 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 yourtable
go to post Vitaliy Serdtsev · Aug 3, 2022 I 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
go to post Vitaliy Serdtsev · Aug 3, 2022 The very first message contains a link from where you can download the ODBC-2022.1.0.209.0 driver for different operating systems.
go to post Vitaliy Serdtsev · Aug 3, 2022 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.
go to post Vitaliy Serdtsev · Jul 27, 2022 And can do it even easier by using a ready-made method Base64FromStream()
go to post Vitaliy Serdtsev · Jul 25, 2022 I checked on version 2022.2CE & Win11 - everything is displayed as it should.
go to post Vitaliy Serdtsev · Jul 19, 2022 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() }
go to post Vitaliy Serdtsev · Jul 19, 2022 If this feature is not available in the Community Edition, then it makes no sense for me to try it. I just thought that in the preview version, all the features for testing are available. But thanks anyway for the quick response.
go to post Vitaliy Serdtsev · Jul 19, 2022 Let's say you need to write a classmethod that updates a single property. Update where: in memory or on disk? Using SQL, you cannot update the value of a field in memory, but only on disk. On the other hand, OpenId() reads data from disk and knows nothing about the changes on disk that occurred after its call. To avoid confusion, I would look to the side Version Checking (Alternative to Concurrency Argument) or/and <propertyname>GetStored()
go to post Vitaliy Serdtsev · Jul 19, 2022 I decided to try Columnar Storage (IRIS CE): Property p As %String(STORAGEDEFAULT = "columnar");When compiling a class, I get the following error: ERROR #15804: Columnar Storage (STORAGEDEFAULT=COLUMNAR) is not available with this license I turn to the documentation to find out what's the matter: Error Codes 15000 and Higher There is no description of error #15804 next, I check the current license restrictions: InterSystems IRIS Community Edition Limitations There are no Columnar Storage restrictions
go to post Vitaliy Serdtsev · Jul 19, 2022 See: %OpenId(id As %String = "", concurrency As %Integer = -1, ...) Object Concurrency Options or Version Checking (Alternative to Concurrency Argument)