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,
 

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,

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,

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.