Intersystems Cache script character limit - intersystems-cache

what's the character limit (number of characters) which send command has and how can I change it?
If I run a long command , it's not getting send completely and an "S" is appended to the end of the string (and string is cut off)
so is there a way to change/see how many characters we can send?
script:
send: Set tSql="SELECT count(*) AS cc FROM table WHERE id IN
('1111111111','1111111112','1111111113','1111111114','1111111115','1111111116','1111111117','1111111118','1111111119','1111111120','1111111121','1111111122','1111111123','1111111124','1111111125','1111111126','1111111127','1111111128','1111111129','1111111130','1111111131','1111111132','1111111133')"
here's what I get in cache terminal:
Set tSql="SELECT count(*) AS cc FROM table WHERE id IN
('1111111111','1111111112','1111111113','1111111114','1111111115','1111111116','1111111117','1111111118','1111111119','1111111120','1111111121','1111111122','1111111123','1111111124','1111111125','1111111126','1111111127','1111111128','1111111129','1111111130','111S
As you see there's an S appended to the commmand which finally will result into syntax error

The cleaner approach would be to create a class with methods, containing the implementations of whatever you want to achieve and then calling it via:
send: Do ##class*Package.Class).Method(Arguments)
and passing required parameters.

Not sure how it limited, but I can say that, you can split any of your long data by multiple send. And it will looks like below
send: Set tSql="SELECT count(*) AS cc FROM table WHERE id IN
send: ('1111111111','1111111112','1111111113','1111111114','1111111115',
send: '1111111116','1111111117','1111111118','1111111119','1111111120',
send: '1111111121','1111111122','1111111123','1111111124','1111111125',
send: '1111111126','1111111127','1111111128','1111111129','1111111130',
send: '1111111131','1111111132','1111111133')"

Related

IMAP: Return several headers in one command

I am new to IMAP commands, but I know that in IMAP you can use this command to get header of a message:
fetch Message_Id (RFC822.HEADER)
or
fetch Message_Id:* (body[header.fields (from to subject date)])
where Message_Id is the message id like: 1, 2, 3 ...
so i need a command that gets the headers of all messages in a selected folder with only one command, that I receive a list of headers, something like this:
fetch * (RFC822.HEADER)
or
fetch *:* (body[header.fields (from to subject date)])
is that possible? is there such a command?
: is for a range. So 1:3 means messages from 1 to 3.
* does not mean "every message", it means "the last message", whatever that may be.
So, the range you want is simply 1:*, from message 1 until the last message.

How to Send multiple request concurrently/Sequentially in postman with different set of values for each request?

For example, below is the JSON request data to "add a device" in the DB.
For example, I want to add 10000 devices with different IMEI number and different phone number to the server for testing purpose. So, how to send the request at once.
I'm ready to create 10000 devices data with different values manually.
Now I can able to send one by one only.But how to send all the request at once?
{
"device_name":"34793812453274392",
"imei_num":"36xxxxxxxxxxxx5",
"phone_num":"8666606451",
"device_city":"Chennai",
"device_state":"Tamil Nadu",
}
As I'm new to POSTMAN, required detailed info. Thanks in advance.
The thing that should work is :
you prepare your input JSon body with variables. ie, from your example :
{ "device_name":{{device_name}}, "imei_num":{{imei_num}}, "phone_num":{{phone_num}}, "device_city":{{device_city}}, "device_state":{{device_state}}, }
the {{}} is for variables
You create a CSV file with the corresponding headers (one for each variable of your input JSON) and all the values you need:
example:
line 1 : device_name, imei_num, phone_num, device_city, device_state
line 2 : "34793812453274392", "36xxxxxxxxxxxx5", "8666606451", "Chennai", "Tamil Nadu"
... and so on ...
line 10000 : ...
Then, in the Postman runner (see here ), you select the data file (Data / Select file) with CSV type (you should have an option to check the content, but be careful as you'll have a lots of rows, it may take a long time, I suggest you try first with a small CSV file)
You just set ONE iteration (otherwise you'll play x times 10000 requests).
It will parse your file and, for each data line, it will send your request with replacing the body's variables by the corresponding data associated to the corresponding header. Header names must have the same label as your variables.
Launching the runner will launch your 10000 requests sequentially
If you prefer, you can use JSON input file as data file, see here
Don't hesitate to have a look at postman documentation, it's pretty complete.
There is an option called Runner at the top left corner of your Postman application. You can select the collection you need to run with number of iterations and delay time between each request. But the thing is you cannot alter the values inside the JSON request. Thanks
Put all the data into a JSON Array
and then do them all as one post. Currently you only have one set of data you're posting in.
Just create a json body with all the data you need to enter and post them into the same API endpoint.

Gammu and PostgreSQL send 8bit sms

I'm working with Gammu and PostgreSQL to send sms from my computer.
I have success sending a normal text sms.
But i have some problem now when trying to send 8bit (Binary) message to my devices. Here's my simple query to inject message to gammu 'outbox' table.
INSERT INTO outbox (
"DestinationNumber",
"Text",
"TextDecoded",
"Coding",
"UDH",
"CreatorID") VALUES (
'202555xxxx',
'02616A03776C66JF010000198C000403E800013003F200013003F30002323003F400023230',
'',
'8bit',
'06050407d50000',
'ConfigurationSMS');
as you can see 02616A03776C66JF010000198C000403E800013003F200013003F30002323003F400023230 is my SMS text encoded using hex values. The value is correct while in outbox table.
But when the message has been sent and i'm look on my inbox table, the Text value change to this 02616A03776C66BF0100000D8C000203E800013103F2000131FD00 00007400650073007400
Does anyone know why Gammu send different text? and how to prevent the changes occur? Thanks.
As mentioned before, there is invalid char in the HEX encoded string.
But I think Gammu should complain on such error, so I'll work on fixing that upstream, see https://github.com/gammu/gammu/issues/185 for progress.

DocuSign REST API Creating a Non-Numeric RecipientId Causes Invalid Recipient ID Error When Adding Tabs

I was able to add a recipient to an envelope with a recipientId that was the HASH of the recipient's email address (50a5ae9b6d8889c1fda3f140621b448b). However, I was not able to add tabs to that recipient. I was able to edit the recipient name and email address, so the system seems to be able to recognize the recipientId. It appears to be a problem with the recipientId in the URL since adding tabs is the only REST API call that uses the recipientId in the URL.
After more testing, I found that there is a limit of 32 characters to the length of the recipientId but you can still edit the recipient and assign a recipientId that is not valid (alphanumeric and/or greater than 32 characters).
I'm seeing different results, and seeing the system act as expected here. First off, if I try to add a 32 digit number for the recipientId such as
12345678901234567890123456789012
I'm able to add the recipient just fine, then subsequently modify their tabs. Next, if I try an alpha numeric string, such as (notice the z at the end)
1234567890123456789012345678901z
The system generates an error stating INVALID_RECIPIENT_ID - A recipient ID is missing or invalid. I also get this error if I try a completely numeric number that is greater than 32 digits in length.
Please re-test and confirm your results, as this appears to be functioning as designed.

sendmailR: Submit encoded message to local SMTP server

I need your help in order to send email message that includes text in Greek, from within R, using the function sendmail {sendmailR}.
I tried using the function iconv, like that but it didn't work
subject <- iconv("text in greek", to = "CP1253")
sendmail(from, to, subject, msg, control=list(smtpServer="blabla"))
The mail arrives immediately but the greek characters are unreadable. Any ideas?
EDIT
Another question that came up:
The second argument to accepts one recipient. What if want to send it to more than one? (I think 'll try sapply ing the sendmail function to a vector of recipients) - Ok, that worked. However, I'm not completely satisfied because each one of the recipients has no way to know who else has received the message.
Mail client won't be able to understand any encoding without Content-Type: charset=..., so you must add it:
msg<-iconv("text in greek", to = "utf8");
sendmail(from, to, subject, msg,
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=UTF-8; format=flowed")
);
that is for UTF8 (which I believe should be used), for CP1253:
msg<-iconv("text in greek", to = "CP1253");
sendmail(from, to, subject, msg,
control=list(smtpServer="blabla"),
headers=list("Content-Type"="text/plain; charset=CP1253; format=flowed")
);
multisend by hidden copies can also be done with header magick, still I think sapply loop is a better idea -- then the user will see that the mail was send directly to her/himself.