Question Gautam Rishi · Oct 4, 2023 ObjectScript error: <CLASS DOES NOT EXIST>removeprj+7^%occClass * Hi all,I am trying to compile my swagger class file with swagger JSON which is a valid JSON as I created it and verified from swagger.io 2.0 spec.But getting below error. I am not very clear with the error message. Please help me resolve the same.ObjectScript error: <CLASS DOES NOT EXIST>removeprj+7^%occClass *SwaggerClass > ERROR #5091: An error has occurred while removing projection SwaggerClass:Reference. > ERROR #5030: An error occurred while compiling class 'SwaggerClass' #JSON #InterSystems IRIS 0 1 0 241
Question Gautam Rishi · Sep 8, 2023 How can i get Data type of column from resultset Hi all,I am trying to execute a query like the below code.set statement = ##class(%ResultSet).%New("some_class:query_method"). // here query method is empty and with rowspec some columname statement.Execute(param1) I want to fetch data type of column value returned from above. eg - Name - VARCHAR, amount - INTEGER etc.How can I get it. Or if not possible directly. Is there any other way to validate or get datatype of values returned. Line we have type() in python3 #Embedded Python #Python #SQL #Caché #InterSystems IRIS 0 5 0 1.1K
Question Gautam Rishi · Jul 27, 2023 Get sql statement that has been in executed by %ResultSet or %Library.ResultSet Hi all, I am using %Library.ResultSet to execute my query which I have something like this.Query GetABC() As %SqlQuery [SqlProc]{ } After I execute this query and a resultset it returns from this. Now What I want to know is the SQL statement which will have the values dynamically added into while execution. #SQL #InterSystems IRIS #InterSystems IRIS for Health 0 3 0 218
Question Gautam Rishi · Jul 26, 2023 how to put dynamic filter clause in Embedded SQL Hi All, I am facing some issues. I am having a SQL query that is executed using %SQL.Statement ExecDirect() method. Now I want to convert it into Embedded SQL using &SQL().But where clause is dynamic in my case and It may contain 3-4 clauses. #SQL #InterSystems IRIS #InterSystems IRIS for Health 0 2 0 169
Question Gautam Rishi · Jul 11, 2023 debugging %Library.ResultSet Hi All, I am trying to fetch resultset using the below code - set rs = ##class(%ResultSet).%New("Simple.Person:ValidateAge") do rs.Execute() it is giving me error while the same code I run it through iris terminal worked fine. I want to understand that problem behind this. Also how can I check the possible methods that I can use on 'rs' somewhat dir() does in python. #SQL #InterSystems IRIS #InterSystems IRIS for Health 0 2 0 168
Question Gautam Rishi · Jul 7, 2023 %Get() method on result set can i set a default value if column return empty string Hi all, I am using ExecDirect() method to get SQL resultset of type %SQL.StatementResult. now I am fetch a column something like this rs.%Get("Amount") but if amount column is empty then it is return me empty string. If There is any way to set something like this in IRIS rs.%Get("Amount",0.00) if that is possible. #SQL #InterSystems IRIS 0 2 0 256
Question Gautam Rishi · Jul 6, 2023 default value to property in classes Hi all,I am creating a property in my class something like below. I want to initialize it to 0.00 this a default value. Property currentLimit As %Numeric(SCALE = 2); #InterSystems IRIS 0 1 0 308
Question Gautam Rishi · Jun 30, 2023 how to handle %SQLCODE = 100 case in select statement Hi all,I am using ExecDirect() method to execute my SQL query which is something like "SELECT * from Account where AccountNumber = ? "But when I am providing a accountnumber that don't exists it doesn't return anything as aspected. while I am trying to check resultset.%SQLCODE in this case it is giving me 0 not 100. What's wrong with my SQL query and Also I there any other Property through which I check for if my resultset is null or it has some values. #SQL #InterSystems IRIS #InterSystems IRIS for Health 0 2 0 279
Question Gautam Rishi · Jun 29, 2023 mocking framework and how to setup it on local iris Hi All, I am writing few test for REST API need help from you guys as I am new to Objectscript. I want to implement mocking into testcase but didn't get any good resource for the same. please help me #InterSystems IRIS #InterSystems IRIS for Health 0 16 1 364
Question Gautam Rishi · Jun 29, 2023 Getting INVALID OREF error while unit testing Getting INVALID OREF error while unit testing. Also ResultDyanmicObj.Headers.%Size(),DummyResponse.Headers.%Size() these are working fine getting 7 value from both. but still it is not working. do $$$AssertEquals(ResultDyanmicObj.Headers.%Size(),DummyResponse.Headers.%Size(), "Validation for Headers") error - INVALID OREF>TestAccountSearchWithoutAccount+6 #Testing #InterSystems IRIS #InterSystems IRIS for Health 0 1 0 299
Question Gautam Rishi · Jun 29, 2023 Unit testing in object script assertion on objects Hi All,I want to write testcase in objectscript but stuck at this point where I am getting a DynamicObject from the class method and how can I assert this and check it is okay. Also if in any case error It will throw error custom exception class that I created. How to handle assertion for exception in this case also. #Testing #InterSystems IRIS #InterSystems IRIS for Health 0 0 0 197
Question Gautam Rishi · Jun 29, 2023 Unable to create directory while working on unit test Hi All,I was creating a unit test directory with the below script. But it not creating any directory as mentioned in code. I am working on MacBook with irisusr User as standard installation process. if '$data(^UnitTestRoot) { set mainFolder = "UnitTest\NewDir\" set st = ##class(%File).CreateDirectoryChain(mainFolder _ testSuite) if $$$ISOK(st) { set ^UnitTestRoot = mainFolder } else { write !, "UnitTestRoot folder could not be created. Consult with instructor." do $system.Status.DisplayError(st) } } #Testing #InterSystems IRIS #InterSystems IRIS for Health 0 2 0 257
Question Gautam Rishi · Jun 28, 2023 Need help with resultset return by ExecDirect method Hi All, I am trying to execute my SQL query using ExecDirect() method and it returns a ResultSet. No doubt it works fine after this I am trying to fetch each value using a loop code below. But before that, I am also checking for %SQLCODE = 100 which is for an empty resultset I think. However, It is not working as desired. In the case of an empty resultset also I am getting %SQLCODE = 0 until result.%Next() is called. Also, %ROWCOUNT is giving 0 in a case where my query is return 1 result row. I am so confused about this.while resultset.%Next() { // code } #SQL #InterSystems IRIS 0 4 0 234
Question Gautam Rishi · Jun 27, 2023 Getting error method does not exist *%New on class name I am creating a class code below Class Sample.Header { Property Key As %String; Property Show As %Boolean; } when I am trying to create an object of this class using set obj = ##class(Sample.Header).%New() getting error <METHOD DOES NOT EXIST> %New, Sample.Header #ObjectScript #InterSystems IRIS 0 3 0 415
Question Gautam Rishi · Jun 27, 2023 unable to see git gui page Hi all,I have install git-source-control to the namespace TEST. Also it is working fine as I am able to add files to my local git repo and see the changes in it.But while I try to open GUI for the same i am getting service unable error on this URL http://127.0.0.1:52773/isc/studio/usertemplates/gitsourcecontrol/gitproj... what's wrong with this. #Git #InterSystems IRIS #VSCode 0 0 0 128
Question Gautam Rishi · Jun 25, 2023 custom internal server error message in REST API Hello all,I am creating a REST API with a spec-first approach. However, I am using the try-catch method to handle any exception if any occurs. But whenever any error related to syntax or something occurs, we get internal server error { "errors": [ { "code": 6220, "domain": "%ObjectErrors", "error": "ERROR #6220: Internal Server Error", "id": "InternalError" } ], "summary": "ERROR #6220: Internal Server Error" } #InterSystems IRIS #InterSystems IRIS for Health 0 6 0 423
Question Gautam Rishi · Jun 22, 2023 how to convert DATE to epoch I am having a datatype DATE value from db 41966. And I want to convert it to epoch time.Also, in case of DATETIME value how can I convert it to epoch. #InterSystems IRIS 0 7 0 415
Question Gautam Rishi · Jun 21, 2023 I want to fetch both column name and value from resultset of sql query I want to fetch both column name and value from resultset of sql query . I am using ExecDirect() method for SQL execution. please help me out. #Key Question #InterSystems IRIS 0 15 0 582
Question Gautam Rishi · Jun 21, 2023 Need help with git-source-control setup in IRIS Hi everyone, I am new to "git-source-control", what i am doing so far will explain you in few steps.1. installed git-source-control into a namsapace TEST using ZPM "install git-source-control"2. configure the git settings and created a new mapping for as such #Git #InterSystems IRIS 0 5 2 449
Question Gautam Rishi · Jun 20, 2023 getting this error after installation of IRIS on MAC Unable to run iris terminal as well as on management portal I am getting permission error. ERROR in page definition:Error #940: Insufficient privilege for operation I already have created a User - irisusr and group - irisusr if I am running sudo iris terminal IRIS command then it open terminal But earlier it was working fine. #InterSystems IRIS #InterSystems IRIS for Health 0 2 0 289