Caché

Syndicate content 116 

I have a process that takes data from a CSV file (actually a record mapper object) and creates a nicely formatted JSON string I would love to send this along to a RESTful business operation.  However no matter what I try, I continually get <INVALID OREF> errors when trying to populate the object that extends Ens.Request to give it the JSON string.

I can add strings, other objects, you name it - but stuffing a JSON formatted variable/object into another object I want to send someplace is proving to be an impossibility.

Does anyone have an example of sending an Ens.Request or other object (not an HTTPRequest object - but some other custom object) containing a JSON string to an Operation where the operation ultimately pulls the JSON from the object that was sent to it, makes the REST POST call and sends the response back

Last comment 1 hour 15 min ago
0   0 4
19

views

0

rating

Hello,

I am trying to run a simple SELECT STATEMENT in USER NAMESPACE.

SELECT * FROM projectname.table

What is the syntax if i need to get data for a table in another namespace eg. SAMPLES., SYS

SELECT * FROM SAMPLES.projectname.table  is not working.

Thanks in advance.

Jimmy Christian.

Last answer 9 hours 50 min ago Last comment 2 hours 28 sec ago
0   0 4
53

views

0

rating

Dear team,

I am trying to experiment the Docker container in our development environment. I have successfully build an image and running the container. When I access the CSP portal home page ( http://<host-ip>:57772/csp/sys/%25CSP.Portal.Home.zen?$NAMESPACE=%25SYS), I am getting the following error:

Caché Server Pages Version 2017.1.1.111.0.17521
 
Server Availability Error
Server is currently unavailable

 

I logged in to the running container (docker exec -it <container-id> sh), issued the command, 'ccontrol list' where the state says 'warn'

Last answer 14 hours 11 min ago Last comment 10 hours 8 min ago
0   0 3
30

views

0

rating

Class ICT.Experiments.A Extends %Persistent
{
Property Name As %String;
Property Collection As list Of ICT.Experiments.B;
Property Collection2 As array Of ICT.Experiments.C;
}

Class ICT.Experiments.B Extends %Persistent
{
Property Name As %String;
}

Class ICT.Experiments.C Extends %Persistent
{
Property Name As %String;
}

I have the classes above and I can select columns from the array collection by using two joins as follows:

SELECT 
mainTable.ID, mainTable.Name, c.Name
FROM ICT_Experiments.A mainTable
LEFT JOIN ICT_Experiments.A_Collection2 arrayTable ON arrayTable.A = mainTable.%ID
LEFT JOIN ICT_Experiments.C c ON c.%ID = arrayTable.Collection

Last answer 3 days ago
0   1 3
0

comments

30

views

0

rating

I am still new to cache objectscript and am trying to figure out how I would go about removing the escape characters from my JSON below. When I call the $toJSON method it's adding the "\" character in the file path.

 

{"FileStatus":"P","Path":"\/somepath\/test\/test123\/filename.txt","InterchangeOID":"100458"}

My Code

Last answer 3 days ago Last comment 4 days ago
0   0 3
50

views

0

rating

What is the process in importing a role from one server to another server?

Let's say Server A is our main server that we maintain all of our resources / roles / users. We would like to get these over to Server B, Server C, Server D, etc.

It looks like when we import, there are tables and resources left in the destination servers that are not in the source server. It looks like whatever was in the destination server that was not part of the source server was not deleted from the import.

What is the proper way of exporting/importing a role so that this does not happen?

Last answer 4 days ago Last comment 4 days ago
0   0 1
27

views

0

rating

I'm using callin to get global values.

Here's a simple function to get string value from global and return it:

int GetGlobalStr(char *global, CACHE_EXSTRP result)
{
    int push = CACHEPUSHGLOBAL(strlen(global), global);

    // narg Number of subscript expressions pushed onto the argument stack.
    int narg = 0;

    // flag - Indicates behavior when global reference is undefined:
    // 0 — returns CACHE_ERUNDEF
    // 1 — returns CACHE_SUCCESS but the return value is an empty string.
    int flag = 1;

    int get = CACHEGLOBALGET(narg, flag);

    int pop = CACHEPOPEXSTR(result);

    return ZF_SUCCESS;
}

I get global value in result successfully. However I need to iterate over $lb. How can I do that?

Last answer 4 days ago Last comment 7 days ago
0   0 3
69

views

0

rating

I have problem with Cache installed on a colleague's Windows 10 laptop.  On the laptop, Cache was automatically configured to use IIS and this has worked fine with csp applications configured in the Management Portal.

Now this seems to have stopped working, and I can't work out why.  In IIS, the web application seems to be in the correct place.

I have manually mapped the various file extensions to CSPms, as per the documentation, but any attempt to navigate to a csp page produces an 500 error, which tells me precisely nothing about why this is happening.

For example,

http://localhost/csp/myapp/login.csp -> 500 error

 

 

 

I have re-installed Cache, with the repair option in the hope that this would reset any mappings or config settings to do with IIS, but it, too, has achieved nothing.

I am not a webserver guru, and this is the first time I have mucked around with IIS in literally years

0   0 1
0

answers

0

comments

12

views

0

rating

Hi Team,

I am using Angular 7 with angular material for my client application that connects and obtains Access token from IRIS Authorization Server (OAUTH 2.0).  The problem that I am facing right now is regarding this access token being exposed to browser and stores in the local storage of the browser.

0   0 1
0

answers

0

comments

23

views

0

rating

I have an xml that has non standard characters and I would like to transform it with xslt  so that those characters render in the format  &#nnn here is what I have so far any help appreciated 

xslt

 

 

<!--?xml version="1.0"?-->
<xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output encoding="Windows-1252" indent="yes" omit-xml-declaration="yes" method="xml">
>  <xsl:template match="/Recordset">
    <recordset><xsl:apply-templates></xsl:apply-templates></recordset>
  </xsl:template>
  <xsl:template match="*|@*">
    <xsl:copy>
      <xsl:apply-templates select="@*">
      <xsl:apply-templates>
    </xsl:apply-templates></xsl:apply-templates></xsl:copy>
  </xsl:template>
</xsl:output></xsl:transform>
 

XML

Last comment 5 days ago
0   0 4
0

answers

53

views

0

rating

Referencing this post:

https://community.intersystems.com/post/producing-json-sql

I'm not sure how to actually interact with the result set I get from doing something like this.  I want to return something like:

[{"field1":1, "field2":2}, {"field1":2, "field2":10}]

I'm finding it very difficult to get it in this format, since %Print appends a newline onto the end of the {} object it prints.

Here's the closest I've gotten:

set query = "select JSON_OBJECT('field1': field1, 'field2":field2) from MyTable where x=? and y=?"

    set tStatement = ##class(%SQL.Statement).%New()
    set qStatus = tStatement.%Prepare(query)
    if qStatus'=1 {WRITE "%Prepare failed:" DO $System.Status.DisplayError(qStatus) QUIT

Last answer 9 days ago Last comment 6 days ago
0   1 1
88

views

0

rating

Hi All,

I would like to download odbc drivers for Cache database to be able to install it on our SQL server.

I am trying to create a linked server to Cache database.

I couldn't find a link for the drivers, there was one post with FTP reference to download but it doesn't seem to work.

I will be grateful for any help.

Thank you

Sap.

Last answer 4 April 2019 Last comment 9 days ago
0   0 1
88

views

0

rating

Hi Dev Community,

My team is currently working on a project where we need to post pdf documents to a 3rd party REST API.

The API specifies a field in the JSON request message to contain the 'physical content' of the file as an array of bytes, example of the JSON request as follows - data truncated for readability purposes:

{
    "CaptureSource":2,
    "RecipientID":"ID34",
    "Document": {
        "Guid":"5D847A4E9CC1485382DC4A5F5DC80D6C",
        "EventDate":"2019-01-14T13:23:46",
        "FileExtension":"pdf",
        "FileContent":"JVBERi0xLjQNCiXi48/TDQoxIDAgb2JqDQogIDw8DQogICA......"

      },
    "ActionRequired":false,

Last answer 10 days ago
0   1 2
0

comments

124

views

0

rating

Hello,

When i click on the menu to  run the  Data import wizard  from MP, i receive following CSP error

<UNDEFINED>zOnPageHEAD+229^%cspapp.exp.utilsqleximwizardcontent.1 *schemaname : CSP Error

 

It is happening for all the namespaces. Looks like some permission issue.  Same issue with Data Export wizard. Help to resolve this will be appreciated.

I am using

Cache for Windows (x86-64) 2017.2.2 (Build 865_0_18763U)

Thanks,

Jimmy Christian.

 

Last answer 10 days ago Last comment 10 days ago
0   0 1
29

views

0

rating

Hello All,

There are few tools for SQL optimization available and even query builder has Show Plan to give us an estimation of the resources needed to execute.

 

For Methods - Is there anything similar ??

I would like to see a similar approach as to the time taken for method to execute.

Is Studio Debugger only option ??

Last answer 10 days ago
0   0 3
0

comments

38

views

0

rating

I have a query that I would like to  have refreshing at certain intervals lets say every 30 seconds with out refreshing the page content using the META TAGS

refreshes the whole page but I have a jquery function that will run at those intervals that I can use the problem is getting the jquery to call my COS function or is the way to do it with pure COS

Last answer 11 days ago Last comment 10 days ago
0   0 2
48

views

0

rating

First, my $ZVERSION:

Cache for OpenVMS/ALPHA V7.x (Alpha) 2010.1.6 (Build 952_2 + Adhoc 17754) 3-JAN-2018 14:32:54.07

Second, my issue:

I believe my current villain is “incremental compiling.” I was able to compare early compile output with later compile output:

Compilation started on 04/10/2019 10:46:32 with qualifiers 'cuk'
Compiling class UnitTests.Task3496 incremental compile detected
Compiling routine UnitTests.Task3496.2
Compilation finished successfully in 0.800s.

... several compiles later...

Compilation started on 04/10/2019 13:35:33 with qualifiers 'cuk'
Compiling class UnitTests.Task3496
Compiling routine UnitTests.Task3496.1
Compilation finished successfully in 0.999s.

The problem that I am having today is that the %STACK is showing my code executing code that has been commented out

0   0 0
0

answers

0

comments

25

views

0

rating

I have a lot of string properties, which need custom but similar Getters and Setters.

Currently I'm generating Getter and Setter in class generation code but that expands class definition.

Is there a way to specify custom datatype which would generate custom getters and setters?

Last answer 13 days ago Last comment 12 days ago
0   0 2
91

views

0

rating

I'm attempting to use the .NET Entity Framework provider that is provided by InterSystems (see: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=GBMP_eframe).  In our environment, the "Support Delimited Identifiers" option is turned off and we are not allowed to turn it on without significant testing effort.  When this setting is off, the SQL that is generated by the Entity Framework provider is not considered valid and therefore the provider doesn't work (it DOES work, however, when this setting is turned ON).

Do you know of any way to work around this issue? Again, we don't have the option of turning the "Support Delimited Identifiers" option ON unfortunately.

Last answer 4 April 2019 Last comment 13 days ago
0   0 1
35

views

0

rating

Hi,
I am facing issue during LDAP lookup like whenever I used product group parameter in AD explorer to search data from application I am getting empty result. If I set product group parameter as null then based on distinguished name result is generated in application. So if anyone knows about how LDAP works and how parameters are set in AD explorer then please let me know.

Thanks in advance.

0   0 0
0

answers

0

comments

13

views

0

rating

Hello everyone,

 

I'm trying to migrate the IDE for programming in COS, we normally use the Studio, but we want to use a more modern IDE. Our team has knowledge with Visual Studio plataform, but we couldn't configurate the compiler and terminal, I installed the extension InterSystems ObjectScript and tried to configurate to connect with my local machine, unfortunately the connection don't sucessed.

Someone has material for how i can connect and compile? Some material i saw show how to use the compiler, but not how can i do the configuration.

 

Best regards,
Flávio. 

Last answer 3 April 2019 Last comment 8 April 2019
0   0 3
125

views

0

rating

I am trying to get the time difference between two time stamps one is recorded earlier to the one happening current but the problem is sql expect string while I have the other stored in a variable and if I do the following I get errors any help please

 

&sql(SELECT {fn TIMESTAMPDIFF(SQL_TSI_HOUR,$ZDT($H,3,1,3),tx)})

 

please note that tx is a variable holding the time formatted the same way as the one being compared to

Last answer 8 April 2019
0   0 1
0

comments

48

views

0

rating