Consultor Eletrônico



Kbase P84427: How to concatenate string fields and store the value into another string field in SDO?
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   15/06/2004
Status: Unverified

GOAL:

How to concatenate string fields and store the value into another string field in SDO?

FACT(s) (Environment):

Progress 9.1x

FIX:

The following examples uses AssignDBRow internal procedure in SDO to concatenate sports2000.customer.Name and sports2000.customer.EmailAddress into sports2000.customer.comments.

PROCEDURE AssignDBRow:
/*------------------------------------------------------------------------------
Purpose: Super Override
Parameters:
Notes:
------------------------------------------------------------------------------*/

DEFINE INPUT PARAMETER phRowObjUpd AS HANDLE NO-UNDO.

DEFINE VARIABLE hRowObjUpd AS HANDLE NO-UNDO.
DEFINE VARIABLE hRowMod AS HANDLE NO-UNDO.
DEFINE VARIABLE hRowObjFld AS HANDLE NO-UNDO.
DEFINE VARIABLE cChangedFlds AS CHARACTER NO-UNDO.

/* Code placed here will execute PRIOR to standard behavior. */
{get RowObjUpd hRowObjUpd}. /* This is the "before" rec w/ changed fields. */


hRowMod = hRowObjUpd:BUFFER-FIELD('RowMod':U).

IF hRowMod:BUFFER-VALUE = "" /*update mode*/ THEN
DO:
ASSIGN hRowObjFld = hRowObjUpd:BUFFER-FIELD('ChangedFields':U)
cChangedFlds = hRowObjFld:BUFFER-VALUE.

cChangedFlds = cChangedFlds + "," + "Comments".

phRowObjUpd:BUFFER-FIELD('Comments':U):BUFFER-VALUE =
phRowObjUpd:BUFFER-FIELD('name':U):BUFFER-VALUE + " " +
phRowObjUpd:BUFFER-FIELD('emailAddress':U):BUFFER-VALUE .

hRowObjFld:BUFFER-VALUE = cChangedFlds.

END.

RUN SUPER( INPUT phRowObjUpd).

/* Code placed here will execute AFTER standard behavior. */

END PROCEDURE.