go to post Evgeny Shvarov · Jan 9 Thanks @Enrico Parisi ! Yes, sometimes 3641144 could be enough to store a file.
go to post Evgeny Shvarov · Jan 9 Faced the same issue. What is the size limitation on working with streams in DynamicObjects/JSON? 1MB?
go to post Evgeny Shvarov · Jan 8 This is how our ^%REST service is organized, that consumes OpenAPI spec (unfortunately not the latest one, but still workable 2.0) and generates package.spec.cls with map , package.disp.cls with dispatch and params handling and package.impl.cls with business logic implementation stubs. But what ^%REST doesn't provide - it doesn't generate unit-tests to make sure that all the impl.cls methods and dispatch methods work as expected. @David.Hockenbroch's article here is very focused exactly on this gap, thank you, Dave.
go to post Evgeny Shvarov · Jan 7 I'm still curious what does [identity] do here? property id as %Library.BigInt [ identity ]; is it only for "Object" access and not for SQL?
go to post Evgeny Shvarov · Jan 6 Ah, I see - VALUES (saleId,companyId,productId,saleDate,saleAmountUSD) Impressive indeed.
go to post Evgeny Shvarov · Jan 6 I'm curious how and if the approach work if the id name in csv is diffent of "id", e.g.."CompanyId"?
go to post Evgeny Shvarov · Jan 6 Wow. Thanks @Vitaliy Serdtsev ! This is impressive. So if I understand properly, LOAD DATA guesses somehow that id is the idkey and primarykey here? &sql(LOAD DATA FROM FILE 'C:\data\companies.csv' INTO dc_onetomany.companies(id,name,industry,description,website) USING {"from":{"file":{"header":true}}}) if AllowIdentityInsert =1?
go to post Evgeny Shvarov · Jan 6 Thanks @Dan Pasco ! So this $system.SQL.SetIdentityInsert(1) is a system-wide setting, right? It looks like there is an option to have it as a parameter for a class as well, like @Vitaliy Serdtsev shared above
go to post Evgeny Shvarov · Jan 5 Thanks Dan! I’m having these property in my class that allows inserting ID values via SQL: Parameter ALLOWIDENTITYINSERT = 1; is it what you are talking about?
go to post Evgeny Shvarov · Jan 5 define a property as IDENTITY I’m defining an index on an property id: Index COMPANIESPKEY1 On id [ IdKey, PrimaryKey, SqlName = COMPANIES_PKEY1, Unique ]; Is it enough?
go to post Evgeny Shvarov · Jan 5 USEEXTENTSET=1 is a default one now if you use DDL to create a class. Maybe for ObjectScript is a default as well.
go to post Evgeny Shvarov · Jan 5 Yes. But we can omit it here (set 0) for simplification. Still the issue is in IDs
go to post Evgeny Shvarov · Jan 5 Thanks, @Dan Pasco! My task is to understand how can I better deal in IRIS if I need to export data into csv that contains records that reference IDs. So I be able to import this data back into IRIS (same or another) preserving all the existing linkages. I posted an example app illustrating the task. What I came up with so far is: introducing my own index as IDKEY and PrimaryKey - that works well for importing data from csv containing IDs. But if when I’m introducing new records then with ObjectScript it wants me to create new IDs. This is where I have questions - how do I do it in the best way. You say I can try %Counter instead of %BigInt?
go to post Evgeny Shvarov · Jan 5 Thank you, @Herman Slagman This is how I'm tackling it now - setting it after importing data and using $I(myclassD) after.
go to post Evgeny Shvarov · Jan 5 I wish you use IRIS ID maintanence - but don't see how is it possible in this way. Published an example app - maybe you can make it. more details in the comment below.
go to post Evgeny Shvarov · Jan 5 Thank you @Matjaz Murko , @Robert Cemper , @Vitaliy Serdtsev @Herman Slagman . Of course, I'd love to let IRIS maintain IDs. But I don't see if it is possible at all if I need to export data into csv that is connected to each other e.g. via IDs. I've created an example app of a "SuperSystems Enterprise" software company, that produces software products of different kinds, and there are companies that exist and buy these products from time to time. So there are 3 entities in such a given system: products, companies, and sales. And sales entity contains IDs of companies and products they purchased along with date and sum. Here is the code - if you build it in docker it will load the data from 3 csv files in /data folder: companies.csv, products.csv and sales.csv into related classes. Notice that companies.cls and products.cls in this case maintain their own ID not an IRIS one as I don't know the other way it can be performed in IRIS so that data on sales connecting products and companies can be imported accurately to the history before reflected in csv. Other than way I chose here. I suggest anyone who is interested in an exercise to fork the project and change the iris classes structure, or IDs, or ways of loading data, so that still the history of sales will be accurate - in order to check it easie,r I've provided a unittest that will check the sums of sales for 103 and 104 companies as : USER>zpm ipm:USER>test dc-onetomany-case What do you think? )