Question
· Dec 13, 2018
Cache ODBC error

Hello All,

Hoping someone can help with this odd error.

A vbscript file is being used to perform an update to cache.

The file has worked without an issue for well over a year.

Recently, the update has begun to throw an error.

(class references modified to remove client data)

UPDATE CACHE.UCI.Reg.Pat (Column1) VALUES ('USERNAME') WHERE ID = '2190284'

C:\Web\Config\SchedTasks\script1.VBS(73, 6)

Microsoft OLE DB Provider for ODBC Drivers: [Cache ODBC][State : S1000][Native Code 105]

[c:\Windows\SysWOW64\cscript.exe]

0 3
0 496

Dear all,

In our application made in Caché object script, when we deploy some classes modified we have the option of calling "Purge queries" feature of Caché.

We only were doing this call when a %Persistent class definition (table) was modified, as we assume that no other changes affect the cached queries and we don't want to purge them by default, as the first run of a query becomes slow.

We had a case where no table definition was changed but a purge queries was the solution.

0 3
0 244

Hi guys,

I'm running a method on an instance of Cache 2010, which, when compiled, has $$$OK in it's .int code. This line throws an error, telling me that "the OK macro isn't recognized".

Some things I've tried;

- I looked it %occStatus, and the macro definition of OK is there.

- I changed $$$OK to 1 by hand in the .int code. It compiled successfully, but each time I recompile the original class, it's going to put that $$$OK back

0 4
0 481

I am trying to use %INLIST in SQL query using a cursor and the query fails to return results. It appears that the variable I use against %INLIST returns an empty string. All the examples I have seen use result sets and build the query as a string. Is it possible to use %INLIST in a cursor-based query? Below is a a snippet of the code I am using:

Property mylist as %String (MAXLEN="") [InitialExpression = "route1, route2, route3"];

set routeList = $LISTBUILD(mylist)

&sql(DECLARE MyReport CURSOR FOR

SELECT

ProcessStartDate,

0 3
0 587

We are trying to get a custom header that I have added to a request to Cache, and I have seen the following in another post, however it doesn't work for us:

You can do it as in any CSP page/class. With %request, which is object of class %CSP.Request

And headers available in property CgiEnvs, where every http header appear with a prefix HTTP_

So, you may try this code.

0 4
0 1.2K

Hi all,

I have an incoming JSON message with a string field exceeding in length the 'caché long-string limit' of 3641144 characters.

Using {}.%FromJSON(instream) I am able to create %DynamicObject properly. However, I am unable to access the long property, as in every assignment, I get the <MAXSTRING> error.

Is there any way for me to obtain contents of the 'too long' string field as a stream?

Thanks

Jiri

0 3
0 11.4K

When using the JSON_OBJECT() function in Caché SQL on a %String property that contains JSON syntax, it converts the %String into a JSON object instead of escaping it as a string literal. How can I prevent this? (without ridiculous hacks like "add a space to the beginning of the value" as we don't always know which properties will contain these values and I certainly don't want to have to check for nulls and add/remove a space every single place this value is used in the application)

I don't want these strings automatically marshalled into JSON objects.

For example:

0 12
0 1.2K
Question
· Nov 26, 2018
BPL - Foreach IF statement

As part of a BPL I am building I need to foreach over a some repeating elements and look for a certain value, if said value is present I need to forward the message to another operation.

I can't seem to get the if statement inside the foreach loop to work and I think I am doing something wrong?

The error message I am getting:

ERROR <Ens>ErrException: <UNDEFINED>zS2+2^GWH.Messages.Eobs.AKISegmentCheck.Thread1.1 *k1 -- logged as '-' number - @' Set k1=request.GetNextIndex("PIDgrpgrp("_(1)_").ORCgrp()",k1,.tSCTrans)'

Can anyone explain that error to me?

0 3
0 706
Question
· Nov 22, 2018
Embedded SQL bug?

Hi

Is this a bug? We came across it on an older version of Cache but I've also just tried it in version "Cache for Windows (x86-64) 2017.2.2 (Build 865U)" and got the same result.

Create a Class like so:

0 2
0 523
Question
· Nov 21, 2018
Short Cuts and Tweaks to Studio

I am quite new to Studio and I have been a Microsoft guy for a very long time and spoilt because of the short cuts provided and the flexibility of the IDE. Any tips and tricks for me to make my life easy while using the studio?

0 1
0 222

For each instance of an XML-enabled class I want to control whether a property is projected as an empty element or not projected at all. With string properties, I can set the value as $c(0) for an empty element, or an empty string for no projection. But it looks like this isn't consistent for properties with type %Boolean or %Integer. With booleans $c(0) gets projected as "false". With integers $c(0) stays as a zero-width space in the XML output (which gives me a SAX parser error if I try to read it).

Is there a way to do this that works for all datatype properties?

0 2
0 521

Hello ,

I want the datagrid to reflect values based on the value i select in the Combobox. How to pass value from the combobox to the

altJSONSQLProvider parameter and reload the datagrid ?

My combobox defines below method on change.

onchange="zenPage.rowSelected(zenThis.getValue());"

<altJSONSQLProvider id="PatchClassJsonId" OnGetSQL="GetSQL" >
<parameter paramName="1" value="C"/>
</altJSONSQLProvider>

<dataGrid

,......

</dataGrid>

0 1
0 199
Question
· Nov 19, 2018
JSON Syntax

Hi,

I'm using InterSystem Cache v2015.2.5 and I'm implementing a REST API and returning JSON.

Following the documentation I see examples like this

Set obj = {"destinations": ["London","Madrid","Tokyo"]}
Write obj.%ToJSON()

However, I have a compilation error

ERROR #1054: Invalid expression : '{"destinations":'

Is there something that needs to be enabled on Studio to allow this syntax?

Thank you,

Rui

0 5
0 473

I created a custom class for a process that does some basic manipulation to an HL7 message. I'd like to be able to write some debugging to the process event log. How would I do that?

I've tried ##class(Ens.Util.Trace).WriteTrace("system","HOSP.IHE.PDQProcess","MessageHeaderHandler","Discarding input message")

but I get a runtime error when I try that. I know this is pretty basic stuff, but any help would be appreciated.

0 2
0 722
Question
· Nov 15, 2018
SQL calculated property rollback

Greetings all,

I have a quick SQL question. I am working with a class, which has a calculated property, which in turned indexed.
The calculation for this property is created based on another property value via:
SqlComputeOnChange = attributes - so basically every time I add a property attribute to my class, my new property
is calculated based on some SqlComputeCode which calls some class method.

That initial setup works as designed.

0 1
0 259

I need to write a script to answer a couple of fairly simple questions:

1) What is the current routine DB (name and location) for this namespace?

2) What is the current data DB (name and location) for this namespace?

3) Is global ^ABC mapped to a different location than the default data DB?

Can anyone point me to some system APIs that would allow me to answer these questions?

Thanks!

Ben

0 2
0 439