Service Desk Practitioners Forum
cancel

embedding line end characters in sd_event fields

SOLVED
Go to solution
William Seeley_
Outstanding Contributor.

embedding line end characters in sd_event fields

I'm trying to use sd_event to update a Text255 field and would like to be able to force linefeeds in the final text. I'm calling sd_event from a perl script and so far I've tried passing it "\n", "0\x0C", and "0\x0A", delimited with extra quotes embedded in the -v "VAR=VAL" definitions. When sd_event sees these it chokes, apparently thinking the field has terminated without a quote. Is there some meta-character I can use that sd_event will pass on to Oracle as a legitimate line-end character?

Thanks,
Bill
3 REPLIES
MarkvL
Acclaimed Contributor.
Solution

Re: embedding line end characters in sd_event fields

Hi Bill,

It works from the command line with \n if this does not work from a perl script perhaps you could use a DB rule to update the call and insert the carriage return.

Mark
HP Support
If you find that this or any post resolves your issue, please be sure to mark it as an accepted solution.
William Seeley_
Outstanding Contributor.

Re: embedding line end characters in sd_event fields

Mark,

This might work if I can find a symbolic value for an end of line (EOL) character recognized by the DB rule handler. Here's what I've done so far:

Added a DB rule for the field with an action of type "Update Data" with a "Set Value" for the field I'm trying to format. This is then set using the "Function" radio button and the "Substitute for" function. I then need to supply three values:

Value : [field I want to edit]
String : ~ (the EOL sent by the perl script)
With : ?

For the last value I've tried \n and 0x0C, but these literal values end up being substituted for the tilde (~). How can I specify a metacharacter for carriage return to the DB rule handler?

Bill
William Seeley_
Outstanding Contributor.

Re: embedding line end characters in sd_event fields

Mark,

It turns out that this was a bug in my perl code. Your comment that you were able to do it from the command line, led me to take a closer look at my code and I found that I had improperly escaped the \n's.

Thanks!
Bill