Re: substring in database trigger

From: Mario Zgela <mario_at_hnb.hr>
Date: 19 Jan 1999 20:07:58 GMT
Message-ID: <01be43e7$c9512fc0$25d998c2_at_HNB.hnb.hr>


Hi!

It's allowed to use SUBSTR function in any SQL query (I use O8, but it is the same in O7).
The problem in your example is not in SUBSTR function but in something else (e.g. v_trx_type_bis is a NUMBER variable or VARCHAR variable constrained to less than 3; also it is possible that v_trx_type is NUMBER or constrained to
less than NAME column).
If this is not the case, you sould use DBMS_OUTPUT database package to debugg the trigger.

Hope this will help,

Mario Zgela

Koen Van Vaerenberg <KoenVV73_at_mail.dma.be> wrote in article <01be4303$16e7b780$564290c3_at_ras-sabena>...
> 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 Tue Jan 19 1999 - 21:07:58 CET

Original text of this message