If you can fix it by using %routeList instead of routeList you see a problem around variable scoping.
see this Summary on Local Variable Scoping
- Log in to post comments
If you can fix it by using %routeList instead of routeList you see a problem around variable scoping.
see this Summary on Local Variable Scoping
If you don't define an explicit MAXLEN it is just ignored during validation.
But you may run into problems with ODBC/JDBC when your VARCHAR or similar just has no maximum SIZE.
So you might instead store your super-long-string into a GlobalStream
But then you lose all string related operations. It's an option I personally dislike.
use %String(MAXLEN="")
Hi,
I had to prepare a suitable file
Previous case: Open Param "RU" /UNDEFINED ignores line terminators
USER>open file:("RU":1000000) USER>use file read x use 0 write $l(x) 164405USER>write $e(x,*-30,*) e></xs:complexType></xs:schema>USER>close file
With open Param "RS" /STREAM line terminators are honored
USER>open file:("RS":1000000) s l=0 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 4126 4126 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 18433 22559 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 61497 84056 USER>use file read x set l=l+$l(x) use 0 write $l(x)," ",l 80343 164399USER>write $e(x,*-30,*) e></xs:complexType></xs:schema>USER>close file
The difference in lenght results from skipped line terminators.
Hi,
I just tried this :
.png)
USER>set file="Eduard.txt"
USER>open file:("RU":1000000)
USER>use file read x#1000000
USER>write $length(x)
183237
USER>"RU":Reclen seams to do the trick
I used it in READ just as fallback. The content was as expect.
what's the problem ? <ctrl>e in studio expands it for you
There's still the option to place an enhancement request @WRC.
If granted, version 2019.2 more likely 2020.* or after may include it.
Until then you depend on own writing.
you may try what works in pure Caché
ZNamespace"%SYS" DO INT^SHUTDOWN
There is no option 'NO_JSON' or similar for strings.
so you have to do it by hand.
Assumption according to your description the basic table looks like this: (except for Name)
select ID, Name, Options from Whatever.Whatever
|
Then this might do the trick:
You manually mask out the critical characters first and mask it in after JSON Processing.
No help by the system just your own fate.
SELECT top 5 ID, REPLACE(REPLACE(REPLACE(
JSON_OBJECT('ID':ID,'Name': Name,'Options': $TRANSLATE(Options,'{}"','()^') )
,'"(','{')
,')"','}')
,'^','"')
FROM Whatever.Whatever
|
Not funny but working
You could as well compose your 'personalized' JSON result in a Classmethod and project it as SqlProcedure
for display in terminal:
depending on your needs
I'm really surprised by this discussion.
Especially having actual numbers. What should mean 6400 with just 15000 rows in total? Sorry, I oppose!
It's a matter of selectivity. If you can collect 2% of your records or more by a single value, then a BITMAP makes sense.
Even EXTENTTbitmap that filters Exists or Not falls into this rule. Though this isn't really property based.
1) YES, you can!
And it will not affect stability and usability. Though understanding COS is definitely an advantage in understanding what is going on. Similar to all other DBs: Understanding concepts and internals is always a benefit. Other DBs are just not as open to investigation and not as flexible doing the "undoable".
2a) Importing and running a Caché DB into IRIS works for 98% at least.
For the remaining 2%, ISC engineers are very open to assist you and solve the issue.
2b) Converting COS to anything else depends mostly on the COS code you have in hands. I know of no converter to do it for you.
As COS allows coding style that was used 40yrs back the range of styles is a very broad and unpredictable field without touching it.
#1 You depend on the quality of external documentation.
#2 You depend on inline documentation, comments, remarks in code. This can be excellent or just not existing,
#3 You depend on how tricky the code is designed and written.
At that point just knowing COS might not be enough and even experts could get their headache on what I call "dirty coding".
#4 ISC has experts also to read and understand old style and its side effects.
#5 You have this bright community to ask.
#6 You have excellent online training facilities to learn COS. I've done this with ~12 people over the last few years.
If they understand Objects, SQL, Java (or generic OO programming concepts) it's a matter of a few weeks to be inside COS.
And they have to be willing to break out and see something new with other limits and other possibilities other horizons.
HTH
quick hint:
use %String (MAXLEN="") ; to get your full names in.
The key issue in a DR scenario is network performance between the instances.
You will run most likely an Async Mirror to have a reasonable distance between production and DR site.
I wouldn't suppose enough bandwidth for a sync Mirror.
The other issue is the performance of the DR site. You require enough performance to process all the synchronization within a reasonably short delay. This is often underestimated, Production servers grow and leave their DR site behind.
Not specific to the cloud but not less important: How can you verify that the content of your DR site is really identic to your production.
For a heavy transactional operation, this can be a real tricky exercise.
And last not least if you don't train your team for a disaster situation and verify your instructions step by step at least once a year all your investment could be wasted money.
Especially this last point is skipped quite often as it means in most cases a lot of effort with no immediate ROI.
from Caché prompt:
and for Linux:
(don't have a Caché installation at hands) but CPIPE should do it
something fast for WINDOWS
from terminal and get a long printout.
If you just look for a specific line you could run the command using CPIPE and read it line by line until you get your info
details on CPIPE here: Execute Server Commands from Caché / Ensemble / IRIS
For Linux/Unix I don't have that at hands
I oppose:
- all text coloring, fonts sizes help to express the importance of text.
- text from right to left is only useful for Hebrew or Arabic writing: not my world
- special characters help a lot if you don't have them on your keyboard ¿isn't it ? my 2 ¢
- what's bad with smileys? ![]()
I do spell checking with Grammarly. the embedded only confused me.
Source could need an improvement to wrap the text in the window. The single line display is cumbersome.
If you want to do the check immedeatly at start of Enseble you can use Routine %ZSTART in Namespace %SYS
if it is at start of a production you can use Ens.Director class
To separate physical storage from applications you may do this inside Caché using ECP
As stated in the 2nd paragraph:
Unlike the standard .NET binding, the eXTreme APIs do not use TCP/IP to communicate with Caché.
Instead, they use a fast in-memory connection
So by definition, it can't be on a different server. It acts like COS but in the .NET based language of your choice.
Still another approach using your original "solution" in PHP following the idea of a Micro-Service.
Instead of a mimic of what PHP might do I use it directly for this purpose.
That way more sophisticated functionalities that can be used without recoding.
I extended your test to include doubled double quotes
*
and here the code:
GREAT !
all well-documented code!
no (dirty) Harry_Potter_Coding !
I was sure you know it
The Unix/Linux world often uses LF := $C(10) as line terminator
while in Win (and VMS) world CRLF := $C(C13,10) is a default.
So you depend on the source system providing the data.
Suggested approach: use LF as the (common) line terminator and just drop $C(13) or 
 from your input record by
$replace($translate(record,$c(13)),"
","")
Before any other processing.
OK, this handles double quotes. But only INSIDE a quoted string
-
HTH
you are right. I didn't think on empty parts and doubled double quotes ![]()
which I never met from CSV.
next level exercise
I discourage since years the use of $ZU(...) functions as they aren't documented since 2010.
I recently had to dig back to 2009 for just a weak hint what might happen.
It is even worse with all the internal stuff around %occ* and similar.
No docs. No guaranty of the life cycle. No (external) notice of eventual changes. Mostly as a deployed code.
If it is used inside a $system.* or part of a generated code that's OK. The responsibility is not at the user side.
Verifying those "specials" with every release change can be a very heavy exercise.
(just experiencing this on a system locked down to on an older version unable to migrate)
not being verbose in %occ* world I had this solution also allowing to change quoting
BTW.
It's an excellent test exercise for new COS programmers
I'll add it to my collection.
Thanks ![]()
Depending on where your output comes from you may try
SPOOL - the forgotten device
or
Execute Server Commands from Caché / Ensemble / IRIS
to get the output into a local variable or global