LONGCHAR, CHAR, and CLOB

Posted by Ken Ward on 03-Aug-2017 14:34

A little while ago I posted this question: https://community.progress.com/community_groups/openedge_development/f/19/p/34051/105431#105431

and that worked fine, but now I'm having another problem.

It's common for me to make a helper procedure to facilitate adding lines to the log.

Obviously this procedure takes an INPUT PARAMETER that represents the line to be added.

It normally looks like this:


PROCEDURE LogCCMsg :

DEF INPUT PARAM ip-msg AS CHAR NO-UNDO.

IF NOT AVAIL tt-pay THEN
  MESSAGE "[LogCCMsg]" SKIP
          ip-msg
          VIEW-AS ALERT-BOX.
ELSE
  tt-pay.proc_log = tt-pay.proc_log + ip-msg + CHR(10).


END PROCEDURE.


When I'm just dealing with CHAR fields, this is just fine, but tt-pay.proc_log is a CLOB field as suggested in the earlier question, so I get this error:


** Incompatible data types in expression or assignment. (223)
**  Could not understand line 3341. (196)

I've tried varying the type of the parameter, but it doesn't like anything I try.

also, the code that calls this just looks like this: RUN LogCCMsg("--DECLINED--"). Nothing fancy there.

Any Help would be appreciated!

-Ken

Posted by Brian K. Maher on 03-Aug-2017 14:46

Assuming the CLOB field won’t ever exceed 32K...
 
tt-pay.proc_log = STRING(tt-pay.proc_log) + ip-msg + CHR(10).
 
Otherwise:
 
def var tempvar as longchar.
tempvar = tt-pay.proc_log.
tt-pay.proc_log = tempvar + ip-msg + CHR(10).

All Replies

Posted by Brian K. Maher on 03-Aug-2017 14:46

Assuming the CLOB field won’t ever exceed 32K...
 
tt-pay.proc_log = STRING(tt-pay.proc_log) + ip-msg + CHR(10).
 
Otherwise:
 
def var tempvar as longchar.
tempvar = tt-pay.proc_log.
tt-pay.proc_log = tempvar + ip-msg + CHR(10).

Posted by Ken Ward on 03-Aug-2017 15:48

Thanks, it worked great.

I'm a little perturbed that you need to do such a simple work-around when Progress could just do something akin to boxing to resolve it.

Posted by Peter Judge on 03-Aug-2017 15:54

It sounds like a bug to me , in all honesty.

Posted by Brian K. Maher on 04-Aug-2017 05:08

Ken,
 
After a good nights sleep I have to agree with Peter.  Can you open a support case so we can log a bug for this?
 
Thanks, Brian

Posted by Ken Ward on 04-Aug-2017 09:09

I don't think I'm able to log a support issue. It's requiring information I don't have access to.

Posted by Brian K. Maher on 04-Aug-2017 09:14

Do you (or your compan y) have an active maintenance contract?

Posted by Ken Ward on 04-Aug-2017 10:32

I presume so. I'd have to get the info from them.

This thread is closed