maya
.public
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
ot_rw_ecmportconf(integer, integer)
Parameters
Name
Type
Mode
_iddevice
integer
IN
idbus
integer
IN
Definition
DECLARE _idport integer; BEGIN SELECT p.idport INTO _idport FROM port p JOIN serialcfg s ON s.idport = p.idport WHERE p.iddevice = _iddevice AND s.alias_port = 0; IF _idport IS NULL THEN INSERT INTO port(idport,iddevice) SELECT nextval('sec_port'),_iddevice; INSERT INTO serialcfg(idport,eventincidence,transmission,parity,stopbits,numberbits,serialport_devicetype,updateinterval,bus,alias_port,stream,enabled,lastmodifiedbyuser) SELECT currval('sec_port'),null,null,null,null,null,1,null,idbus,0,7,true,null; RETURN currval('sec_port'); ELSE UPDATE serialcfg SET bus = idbus, serialport_devicetype = 1 WHERE idport = _idport; RETURN _idport; END IF; END;