Subject Calling an UPDATE procedure
Author markus_6048
I want to start working with procedures. I wrote a first one for
updating the address table. I included all fields of the table. The
problem I have now is, that not all of the fields change all the time.
But as far as I understand the documentations, all input parameter
have to be passed over at the moment the application calls the
procedure. How do I have to call my procedure if only just one field
changed -> has to updated? Let's assume that we have to manage a
moovement: STREET, ZIP, TOWN change. All other fields remain
unchanged. How do I pass over just these three changed fields? Or do I
have to write my procedur differently?

I'd be very thankfull if somebody could help me.

Thanks in advance from Switzerland.
Markus

SET TERM ^ ;
ALTER PROCEDURE ADR_UPDATE
( ADR_ID INTEGER
,ADR_TITEL VARCHAR(35)
,ADR_NAME VARCHAR(35)
,ADR_NAME2 VARCHAR(35)
,ADR_FIRSTNAME VARCHAR(35)
,ADR_STRASSE VARCHAR(35)
,ADR_ZIP VARCHAR(10)
,ADR_TOWN VARCHAR(35)
,ADR_TEL1 VARCHAR(35)
,ADR_LANGUAGE INTEGER
,ADR_SEXCODE CHAR(1)
,ADR_NATIONALITY INTEGER
,ADR_UPD_USER VARCHAR(10)
)
RETURNS (ADR_RETURN INTEGER)
AS
BEGIN
UPDATE ADR
SET ADR_TITEL = :ADR_TITEL
,ADR_NAME = :ADR_NAME
,ADR_NAME2 = :ADR_NAME2
,ADR_FIRSTNAME = :ADR_FIRSTNAME
,ADR_STREET = :ADR_STREET
,ADR_ZIP = :ADR_ZIP
,ADR_TOWN = :ADR_TOWN
,ADR_TEL1 = :ADR_TEL1
,ADR_LANGUAGE = :ADR_LANGUAGE
,ADR_SEXCODE = :ADR_SEXCODE
,ADR_NATIONALITY = :ADR_NATIONALTITY
,ADR_UPD_DATUM = CURRENT_DATE
,ADR_UPD_USER = :ADR_UPD_USER
WHERE ADR_ID = :ADR_ID;
ADR_RETURN = SQLCODE;
EXIT;
END^
SET TERM ; ^