|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
[ delete please ]
I wrote the following trigger to alter the inserted data:
BEFORE INSERT ON PROPERTY REFERENCING NEW AS nr FOR EACH ROW BEGIN IF ( LENGTH ( RTRIM ( :nr.PROPERTY_DESCRIPTION ) ) < 0 ) THEN TRANSLATE ( :nr.PROPERTY_DESCRIPTION, ' ', '0'); END IF; END; / the same syntax works fine in sqlldr to replace blanks with 0's but trigger code fails. Errors for TRIGGER INSERT_PROPERTY: LINE/COL ERROR -------- ----------------------------------------------------------------- 3/12 PL/SQL: Statement ignored 3/12 PLS-00221: 'TRANSLATE' is not a procedure or is undefined |
|
#2
|
|||
|
|||
|
First: I don't think your IF statement will ever return true, because I cannot image a situation where the length of an String would be lower then zero (or did you mean > 0)
Second, I guess you need to write: Code:
:nr.PROPERTY_DESCRIPTION = TRANSLATE ( :nr.PROPERTY_DESCRIPTION, ' ', '0') |
|
#3
|
|||
|
|||
|
Quote:
Yes I figured that out, the problem was with asignment |
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > ORACLE TRIGGER question |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|