Gaolai Peng · Jan 19, 2017 go to post

Thanks for your reply. I checked the document, it says "To create Caché namespaces, you use the Management Portal." There is no more details. Also, I was able to add a new server in the Studio by clicking Add in the Server Connection. I wonder what should I put for the IP_Address , Web Server IP Address and CSP Server Instance? I only want to create a server locally.

Gaolai Peng · Jan 19, 2017 go to post

Thanks for your help. I am able to create a new namespace. I do have a local instance installed. I wonder if I could create another instance with different port number locally?

Gaolai Peng · Jan 23, 2017 go to post

Hi Mike,

I tried this, but I got an error:

MyRoutine.INT(2) ERROR #1002: Invalid character in tag : '"Hello there!"' : Offset:1 ["Hello^MyRoutine]

Here is what I wrote in my routine:

MyRoutine
"Hello there!"
quit

Can you tell me what is wrong? In addition, is routine in cache similar to Main() in C/C++/C#? And the language used is the same as writing a class, such as ObjectScript?

Thanks,

Gaolai Peng · Feb 13, 2017 go to post

Thanks for responding so quickly. I tried logged in with my user id, SuperUser, and _System, none of them works. All of those users has roll of %All. Doesn't it include %HS_Administrator role?

Thanks,

Gaolai

Gaolai Peng · Sep 19, 2017 go to post

Can you provide me some sample code in ObjectScripts? Following sample code  is from the document, I don't really understand what is the purpose of the last three lines?

set rowtype = "StateFips VARCHAR(2),Zip_Code VARCHAR(5),State_Abbr VARCHAR(2),Name VARCHAR(200),Longitude_West Numeric(10,6),Latitude_North Numeric(10,6)"
set filename = "/Users/test/Documents/zip.csv"
set result = ##class(%SQL.Statement).%ExecDirect(,"call %SQL_Util.CSV(,?,?)",.rowtype,.filename)
set resultSet = result.%NextResult()
write resultSet.%Next()
write resultSet.StateFips

Thanks,

Gaolai Peng · Sep 20, 2017 go to post

Thanks Lebedyuk, that's very helpful. What if I have extra properties such as InsertTime in the Test.cvs class?

Gaolai Peng · Sep 20, 2017 go to post

 This is my sample code

Class CUSTOM.Util.Script.Temp.MyTest Extends %Persistent
{

Property CreatedOn As %TimeStamp [ InitialExpression = {$ZDT($H,3,1)} ];

Property RPPI As %String;

Property Name As %String;

Property BirthDate As %Date;

Property ProgramName As %String;

Property CaseTouchedWhen As %DateTime;

Property ActiveStatus As %Boolean;

Property Status As %String [ InitialExpression = "Pending" ];

Index idxRPPI On RPPI;

ClassMethod LoadFromFile()
{
  Set pFileName="C:\mytest.tsv"
 Set pDelimiter= $C(9)
 Set rowType="RPPI varchar(50),Name varchar(516),BirthDate Date,ProgramName varchar(50),CaseTouchedWhen DateTime,ActiveStatus Boolean,"
 Do ##class(%SQL.Util.Procedures).CSVTOCLASS(2, .rowType, pFileName, pDelimiter,,1,,,,)
}
}

And I run following command:

do ##class(CUSTOM.Util.Script.Temp.MyTest).LoadFromFile()

but I got following error

Error <PARAMETER>

Do you where is wrong in my code?

Thanks,