locate and replace problem

"aa aa" <[email protected]>
Newsgroups gmane.comp.db.maxdb
Message-ID <[email protected]>
Hello,

I need help. In my trigger is not function LOCATE and REPLACE.Locate always
return 0. If I change :OLD.Name and NEW.Name to string like for example
'Mike', it's run.

Thanx David

CREATE TABLE admin.sipuser
(
    Id               Fixed (11,0)           NOT NULL  DEFAULT SERIAL (1),
    Name             Varchar (80)  ASCII    NOT NULL  UNIQUE,

    PRIMARY KEY (Id)
)

CREATE TABLE admin.extension
(
    Id           Fixed (11,0)          NOT NULL    DEFAULT SERIAL (1),
       SipUser_id   Fixed (11,0),
    AppData      Varchar (80) ASCII    NOT NULL    DEFAULT ' ',
    PRIMARY KEY (Id)
)
//
ALTER TABLE admin.extension
    FOREIGN KEY fk_sipuser_id (SipUser_id) REFERENCES admin.sipuser (Id) ON
DELETE CASCADE

CREATE TRIGGER sipuser_update FOR sipuser AFTER UPDATE EXECUTE
(
 UPDATE admin.extension
   SET AppData = REPLACE (AppData, :OLD.Name, :NEW.Name)
   WHERE SipUser_id = :OLD.Id AND LOCATE (:OLD.Name, AppData) <> 0;
)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.