查找

ディスカッション (8)1
続けるにはログインするか新規登録を行ってください
質問
· 2017年7月12日

Estimation techniques in intersystems

how do we do estimation in Intersystems ? what is the unit of  work that we refer for intersystems ? let's say for example if we to add 200 fields how many business classes ( Business service, Business process, Business operations) that we must change  ?

Any thumb rule ? Please let know

4 Comments
ディスカッション (4)1
続けるにはログインするか新規登録を行ってください
質問
· 2017年7月11日

dotenv: Read enviroment variables from a .dotenv or straight from your OS

You might find it useful or not. It depends on what you can imagine it to be used with, like I had to.

Either way, I created a lib that can fetch environment variables from a file or from the OS where Caché is running.

Mostly know as dotenv. Many languages have it, so why not Caché?

The usage is pretty simple:

If you want to use OS env vars exclusively, just use the method:

##class(DotEnv.Parser).FromOS()

Otherwise, if you want to specify a .env file containing your variables to complement the OS ones use the method:

##class(DotEnv.Parser).FromPath("/path/to/file")

Both methods return an %ArrayOfDataTypes containing the env variables.

3 Comments
ディスカッション (3)0
続けるにはログインするか新規登録を行ってください
質問
· 2017年7月10日

Cache SQL and multiple-event triggers

Greetings,

I am working on the first of many triggers which will have identical code upon row insertion or update of a single column.  According to the document I should be able to define a multiple-event trigger using Cache SQL/DDL.

Here is a link to the current CREATE TRIGGER documentation.  Within the description section is the following paragraph:

A single-event trigger is triggered by a specified INSERT, DELETE, or UPDATE operation. A multiple-event trigger is defined to execute when any one of the specified events occurs on the specified table. You can define an INSERT/UPDATE, an UPDATE/DELETE, or an INSERT/UPDATE/DELETE multiple-event trigger.

I have no issue creating the single-event triggers, but I cannot work out the proper syntax to create a multiple-event trigger.

Here's a sample table:

CREATE TABLE TESTING.MULTI_EVENT_TRIGGERS (
 %PUBLICROWID
 , FIELD_DATA VARCHAR(80)
 , FIELD_UPD_TS TIMESTAMP
)

and a corresponding update trigger:

CREATE TRIGGER TESTING.MULTI_EVENT_TRIGGERS_DATA AFTER UPDATE OF FIELD_DATA
 ON TESTING.MULTI_EVENT_TRIGGERS
 REFERENCING NEW ROW AS NEWDATA
BEGIN
 UPDATE TESTING.MULTI_EVENT_TRIGGERS SET FIELD_UPD_TS = CURRENT_TIMESTAMP WHERE ID = NEWDATA.ID;
END

Here are the three various ways that I've tried to create the multiple-event trigger:

CREATE TRIGGER TESTING.MULTI_EVENT_TRIGGERS_DATA AFTER INSERT/UPDATE OF FIELD_DATA
CREATE TRIGGER TESTING.MULTI_EVENT_TRIGGERS_DATA AFTER INSERT OR UPDATE OF FIELD_DATA
CREATE TRIGGER TESTING.MULTI_EVENT_TRIGGERS_DATA AFTER INSERT UPDATE OF FIELD_DATA

The error message I receive is always the same:

[%msg: < ON expected, OR found^CREATE TRIGGER TESTING.MULTI_EVENT_TRIGGERS_DATA AFTER INSERT or>]

Does anyone have insight into creating multiple event triggers?  At this point I'm starting to think that the documentation is not correct and multiple-event triggers can only be created in ObjectScript, not in DDL.  I can also accept that I am the source of the problem and this is a case of me not being able to see the forest through the trees and I'm just not using the syntax correctly (or reading the documentation correctly).

1 Comment
ディスカッション (1)0
続けるにはログインするか新規登録を行ってください
質問
· 2017年7月3日

How to escape the single quote in the single quoted string

I have a stored procedure like below:

Call USER.SP('select * from Sample.Person where SSN='aaaaa'','0','S')

How could I escape the single quotes for aaaaa? I try double single quotes but in vain.

Thanks you.

11 Comments
ディスカッション (11)0
続けるにはログインするか新規登録を行ってください