Question
· Mar 2, 2018
$zt

Can anyone guide me where is the documentation for $zt?

The google seems suggest it may be "$ztime" or "$ztrap".

Thanks.

0 3
0 544
Question
· Feb 15, 2018
The Index on a String field

I noticed that the subscript of the index map is actually the collated field (%SQLUPPER).

Is String the only data type going through this transformation? Any other data type would also go through this transformation?

Thanks.

0 1
0 283
Question
· Jan 11, 2018
How to use zb to debug

Hi,

I want to monitor some variables in my program.

So I do this "zb *varname", however, i don't really want to get break went the program touch "varname" every time.

I only want to get break when certain conditions are meet. For example, $d(varname(1,2,3)) > 0, then break.

Is there any way to achieve this?

Thanks.

0 2
0 344

I use zf(-2) to spawn a external a Java application in a *nix instance.

I would like to kill this process after some conditions met.

I would like to leverage $zf("kill ... ") but this requires its the pid of this child process.

So is there a way to acquire the pid for the child process when I create it ?

If not, how is the suggested way to kill this process?

Thanks.

0 1
0 325
Question
· Nov 27, 2017
"Contains" operation for bitstring

aa=$zwc(411,1,1,3)/*$bit(1,3,5)*/
bb=$zwc(403,1,0,2)/*$bit(1,3)*/

Is there a handy function to test wether one bit string is covered by another one bitstring? For example, "bb" is covered by "aa".

I currently implement this by one AND operation and then do a bitcount, I just want to know any default function is already out there.

Thanks.

0 3
0 334
Question
· Nov 5, 2017
How to avoid dirty read

I get two methods below: I would run both methods concurrently.

However, the "testRead" would always read the uncommitted results from "testInsert".

Anyway to avoid that? Thanks.

ClassMethod testInsert()
{
  &sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED, READ WRITE)
  &sql(insert into Test.Table(AttrA,AttrB,AttrC,AttrD) values(1,2,3,4))
  hang 15
  &sql(ROLLBACK)
}

ClassMethod testRead()
{
  &sql(START TRANSACTION ISOLATION LEVEL READ COMMITTED)
  &sql(select count(*) into :ans from Test.Table)
  &sql(COMMIT)
  w !,ans
}
0 5
0 657
Question
· Oct 17, 2017
How to wrap %SQLCODE into %Status

I have a method would return %Status,

this method would run some sql queries and if the execution of these queries fail, I would like to return asap.

So how could I wrap the %SQLCODE into a %Status variable?

Thank for your help.

0 5
0 881
Question
· Oct 14, 2017
Multiple joins in a SQL query

HI,

I have a query like below but its syntax is not accepted by Cache.

I would like to perform a left join on two tables first and then make a inner for this result with another table.

Given the constraint that we only allow one SELECT in the query, it is possible to achieve this semantics ?

Thank for your help.

Select *
FROM ( sample . employee e
LEFT JOIN sample . company c
on c . id = e . id ) g
JOIN sample . vendor v
on v . %id = g . attr

0 3
0 974