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?

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?

USEEXTENTSET=1 is a default one now if you use DDL to create a class. Maybe for ObjectScript is a default as well.

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?

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.

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? )

Id location is in place - and has Ids in the first index, like ^myclassD(1),^myclassD(2), etc.

But nothing is set in ^myclassD

Other parameters I have:

Property id As %Library.BigInt [ SqlColumnNumber = 14 ];

Parameter ALLOWIDENTITYINSERT = 1;

Index MYCLASSPKEY1 On id [ IdKey, PrimaryKey, SqlName = MYCLASSPKEY1, Unique ];

And I import IDs from the csv file.

Yes, $I is the short of $Increment.

But from which global?

$Seq is a faster option of $Increment

Evgeny Shvarov · Dec 29, 2025 go to post

Wow. ObjectScript is like an endless book of surprises :) You never know what you can find the next day :) 
Don't know if I ever used something like this. For me, #dim can be useful to easily suggest a possible method or property while coding, but good to know about such an option!

Thank you @Vitaliy Serdtsev !

Evgeny Shvarov · Dec 28, 2025 go to post

Thanks @Robert Cemper !

I this case Query was a slightly better alternative to me vs Embedded SQL (more readable SQL). So… 

But knowing once again that everything is possible is always good, especially a few days before New Year! :)

Evgeny Shvarov · Dec 28, 2025 go to post

Thanks for the clarification, @Ashok Kumar T !

What can I say - it's not obvious (that it is only for SELECT), and it's a pity as the "Query" functionality that works great for SELECT can also be leveraged with INSERT, DELETE and UPDATE.

Sounds like a good candidate for the Ideas portal :)

Evgeny Shvarov · Dec 28, 2025 go to post

#DIM is just a hint for VSCode ObjectScript code completion and also a hint for a developer "what this thing is about". Compiler skips #dim lines.

Evgeny Shvarov · Dec 26, 2025 go to post

Found one option!

ClassMethod DivideByZeroPython() [ Language = python ]

{

import sample

import iris

try:

print("divide by zero=" + str(sample.dividezero(1)))

except ZeroDivisionError as e:

errobj=iris.cls("%Exception.General")._New(str(e),42)

a=errobj.Log()

print("Caught exception: " + str(e))

}

This stores the error in Apps Log, but no stack (of course):

Any ideas how I can store at least the class and line of code in parameters? I can provide the name and location to %Exception.General class that will be stored in the App Log.

Evgeny Shvarov · Dec 23, 2025 go to post

I'd appreciate any example of a ready-made .code-workspace file, thank you in advance!

Evgeny Shvarov · Dec 21, 2025 go to post

Interesting! Do you want to share an example of .code-workspace files and how to switch between servers?