New post

Find

Question
· Apr 22, 2020

SQL Statement Highlighting

Hey Community,

my Caché Version: 2013.1 and can't update now.

is it possible to highlight SQL Statements like in embedded SQL with all the features from SQL Statements?

Actually I use SQL Statements with a simple string like:

set myquery = "SELECT TOP 5 Name,DOB AS bdate,FavoriteColors FROM Sample.Person"

But when the queries are more complex it will be very cluttered and unstructured.

It would be nicer if I could set line breaks (I know here could I use indexed variables) and have highlighting like in an embedded SQL:

 

&sql(
 SELECT TOP 5 Name,DOB AS bdate,FavoriteColors 
 FROM Sample.Person
)

 

Best regards!

2 Comments
Discussion (2)0
Log in or sign up to continue
Question
· Apr 17, 2020

Mirror manually change Primary to secundary

Hi,

I want to know if there is a way to manually change Primary to secondary  and vice versa?

I need this becasue we backup the two VMs (primary and secondary) and my idea is to make a script to when the primary VM is going to backup with Veeam change to "backup" on the mirror.

 

Thanks!!!

2 Comments
Discussion (2)0
Log in or sign up to continue
Question
· Apr 16, 2020

Serialize JSON from SQL Row

Hey Community,

my Caché Version is 2013.1 and I can't update now.

I want to serialize a SQL Answer row into an Array filled with objects and then convert it to json.

Actually I use the following, which is very error prone when I have to do that often:

set list = ##class(%Library.ListOfDataTypes).%New()

       &sql(
            declare queryONLWK01 cursor for 
            select F0103, F0104
            into :articlenumber,  :amount
            from GL.ONLWK01
            where F0001 = :BET and F0002 = :DEB and F0003 = :MIT
       )
        &sql(open queryONLWK01)
        &sql(fetch queryONLWK01)
        while (SQLCODE = 0) {
            
            
            set articleObject = ##class(%ZEN.proxyObject).%New()
            
            set articleObject.articlenumber = articlenumber
            set articleObject.amount = amount
            
                do list.insert(articleObject)
        } 
    }

I want to have the answer DIRECTLY in a list filled with objects from the select command like that:

&sql(declare queryONLWK01 cursor for
select F0103 as Articlenumber, F0104             
into myList        
from GL.ONLWK01
where F0001 = :BET and F0002 = :DEB and F0003 = :MIT)

myList = [{"Articlenumber": "15058455","F0104": "1"},{"Articlenumber": "95058458","F0104": "2"}]

set x = ##class(%ZEN.Auxiliary.jsonArrayProvider).%WriteJSONStreamFromObject(.json,myList)

 

Is it possible to get the answer I want direct into myList or a JsonString ?

 

Best regards

7 Comments
Discussion (7)0
Log in or sign up to continue
Question
· Apr 13, 2020

Start production from Command line

Hi,

There is a way to start and stop production from command line ?

I know you can configure auto-start on the web interface but I need to start specific production on a shell script.

 

Thanks!

4 Comments
Discussion (4)2
Log in or sign up to continue
InterSystems Official
· Apr 12, 2020

InterSystems joins the open source ObjectScript for VS Code effort

I’m excited to announce that InterSystems will be joining the open source community for InterSystems ObjectScript extension to Visual Studio Code. Early this year I posted that we were on a journey to redefine the future of our IDE strategy, and what came out of that is Visual Studio Code is the IDE that can support that future.

3 Comments
Discussion (3)3
Log in or sign up to continue