Can you show full request: URL, and some example json?
Looks like your URL is incorrect.
- Log in to post comments
Can you show full request: URL, and some example json?
Looks like your URL is incorrect.
I got the same error, with %SQLQuery and embedded SQL (&sql), and in 2017.2 too.
Looks like some error, and you should say about it to the WRC.
SQLCODE=-3 : Closing quote (') missing
SELECT TOP 3 JSON_OBJECT('lit':'Employee from','t':%TABLENAME,'name':Name,'num':SSN) FROM Sample.EmployeeWhile it works perfectly with %SQL.Statement, and through Management Portal
Or just from the documentation page, here.
The bold part is what is causing the error.
And where error?
And version just 2017, is not enough. Is it 2017.1 or 2017.2?
Look at the documentation
| csession instname "[label[+offset]]^routine" |
Specifies the name of a COS program to run in user mode. In addition to the specified formats, you can pass parameter lists consisting of string and/or numeric literals, as well as omitted (void) parameters, as follows: where, for example, parameter-list is specified in the form "string literal",,-+-000123.45600E+07, and omitted parameters are passed to the target as $Data(parameter)=0. Whitespace and shell meta characters must be quoted in an operating-system dependent form. |
So, you can just call your code in routine or class with csession.
If you need another way, you can create any text file, with a list of commands, like if you would use them in csession manually. Where the last command should be HALT. While it is a code for csession, you can't use any multi line blocks and spaces at the beginning of the line. And run it:
csession CACHE -UUSER < somecode.txt
If you need authorization in csession before executing code, just put login and password as a plain text in first two rows.
You can just use quotes
w outputObj."test_test"
Or, maybe it is already deprecated if it has appeared in 2010.1. I don't have this version, maybe some body who have can search in it.
You should read the article in documentation more carefully. You should use some labels, in your case you missed SYSTEM
In this case, it should work properly
%ZSTART
SYSTEM
S ^TRACE="ZSTART"
S Path="C:\VARATHA\TestCreate.txt"
O Path:"WNS":2
E U 0 W "File Not Open",!
U Path W "TEST",!
C Path
Q Could you please share content of this Routine?
From Class documentation, you can see
so, you have two methods Write and WriteLine
But anyway even with Write method you can use $c(13) to put line end
Looks like, you have configured some security settings. And you forgot to give permissions to the new class for user.
To keep your logging data even if transaction rolled back, you should have this changes journaled. Because transaction rollback works by the journal. If it happened to be journaled, it will be rolled back anyway.
And you should remember even you disabled journaling for some database, while system journaling working well. Every change which was made during a transaction will be journaled anyway.
So, how to switch off journaling, for this particular data.
DO DISABLE^%NOJRN
and return journaling back after saving in method %OnAfterSave
DO ENABLE^%NOJRN
Look at the article in the documentation named "Customizing Start and Stop Behavior with ^%ZSTART and ^%ZSTOP Routines"
You can write routine %ZSTART.mac in %SYS namespace with some code which will be run during system start, or for every user. Also possible to run some code when server is going to stop, and before finalizing user process.
This possibility is not alone, it is also possible to have more than one or two databases for one namespace.
There is also mapping, for globals class packages and routines.
One of the reasons to use it is to split different parts of applications. For instance:
With mapping, you have more flexibilities, like split your code in different databases. If you deliver your code to the customer but gave permission to extend some functionality. In this case, you can put customer's code to another database. Or you can split data to get better performance. If you would have so much count of writing to your database, you can split this data and place this database files to different hardware discs, you may get better writing speed. Or even some part of data in a namespace can be stored on another server and connected through ECP.
So, I can say that even could be more reasons to split data in databases. And always it depends on a project and needs.
You should read this article in the documentation about mapping to get more information about it.
And which Caché version are you using?
%VID appeared since 2011.1.
I fixed formatting in your post a little bit just to look it more clear and prettier.
But noticed WHERE% VID instead of WHERE %VID, and AND% VID instead of AND %VID . And decided that it was an formatter error, which I used, but looks like it was in original SQL as well.
So, can you add error message? For me, the first query should work, while next one will not work, because %VID will not exist.
CSP on, can be used either in Directory or Location directive. But you should remember the difference between them. Directory point to the physical path, while Location works with URL. As well as also possible to use DirectoryMatch and LocationMatch, which supports regex.
But with CSP on, all requests will be sent directly to CSPgateway and then to Caché. And if something not working you should check CSPGateway, sometimes it needs to be restarted, usually all parts (depends on configuration, and plus CSPnsd), after some changes in list of CSP Applications
Why do you think that it may help you? Do you know how much data in your database?
As 5.0 is so old I even not remember how to check the actual size of data in the Database. But I think you can do the integrity check, and in this report, you will have this information in last rows.
And then if you will have less than 10-20% of free space, I think it will not be needed for you. And with this report, you can see how big all globals in this database, and if some useless globals may be unexpectedly exists or have unexpected size. If so, you should check your code, why it could happen and remove it, so you can increase free space, which can be used then for grown useful globals.
If you will have so much free space, which you want to free, you can use ^GBLOCKCOPY, to copy all or only useful globals to the new database.
Open regedit.exe, go to this path
HKEY_CURRENT_USER\Software\InterSystems\Cache Studio\Documents
When you can find folders by name of server and namespace. And by project name.
You can just remove this project's folder, and start studio again.

Please provide some more details. Such as codepage of your output texts, version of cache (unicode?), font in terminal, is it cterm or not.
Codepage for your text, I suppose that you use CP866. Nowadays I would recommend converting to Unicode.

As far as I know .abf file format, it is just backup for MSSQL Databases. So, It is not possible and will not possible in any way. And all this conversion will not be such easy. And you should understand that Cubes, that not about data before you should migrate all the data, and create new cubes in Caché with knowledge about, how it was in MS SQL.
Do not forget to mark the answer as accepted, if you this so.
So, now it's time to choose one of the answers as accepted.
Just one file should be changed for it, and it is less than an hour of work.
I think it even works without any COS code, just like any other system functions. And they have more than just only IsMthd.
Check if method %New exists with this function
$system.CLS.IsMthd(ClassName, "%New")
Look at my project, where I have almost the same idea. Sending static files for the web application from a folder or from XData element if present.