Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: substring in a database trigger
Hi Koen,
You actually can use substr as long as you alias this expression
cursor ... is
select substr(name,1,3) new_string
etc...
The same applies for all other functions and expressions.
Hth,
Sybrand Bakker, Oracle DBA
Koen Van Vaerenberg wrote:
> hello ,
> does anybody knows how to use a substring in a database trigger ?
>
> CURSOR C_TRXTYPE IS
> SELECT name -- you can't use substr here
> FROM <table_name>
> WHERE cust_trx_type_id = :new.cust_trx_type_id ;
>
> OPEN C_TRXTYPE ;
> FETCH C_TRXTYPE INTO v_trx_type ;
> CLOSE C_TRXTYPE ;
>
> IF V_TRX_TYPE IS NOT NULL THEN
>
> v_trx_type_bis := substr(v_trx_type,1,3) ; -- this doesn't work
> either
>
> END IF ;
>
> This trigger gives a ' value_error' - code...
>
> Thanks in advance
>
> Koen
>
> kds_at_athylon.be
Received on Mon Jan 18 1999 - 12:49:15 CST
![]() |
![]() |