/*ALIAS>l_data*/

/*SQLStart>1049*/
create or alter procedure ADDCOMPDESCR (
    CDESCR varchar(250))
returns (
    CDID integer)
as
declare variable W_CDID integer;
Begin
  select CD_ID from CompDescr
  where  AClearStr(:CDescr) = AClearSTR(CD_STR)
  into   :W_CDID ;

  if( W_CDID is  null) then
    begin
      select max(CD_ID) from CompDescr
      into :W_CDID;
      if (W_CDID is null) then
      begin
        W_CDID = 0;
      end
      W_CDId = W_CDID+1;
      insert into CompDescr (CD_ID,CD_Str) Values(:W_CDID,:CDescr);
    end
  CDID = W_CDID;
  suspend;
end
/*SQLStop*/

/*SQLStart>1050*/
delete from system_strings where SYS_ID = 0;
/*SQLStop*/

/*SQLStart>1051*/
insert into system_strings (SYS_ID,SYS_STR) values (0,'1.5.56.1');
/*SQLStop*/
