Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Need help to solve the problem.
Hello,
I have 2 tables like this:
TAB1 TAB2 --------------------------- --------------------------------- YYMM CHAR(6) YYMMDD CHAR(8) DAY1 CHAR(1) DAY2 CHAR(1) DAY3 CHAR(1) DAY4 CHAR(1) DAY5 CHAR(1) ::::::::: DAY29 CHAR(1)
And I want to create a trigger :
CREATE TRIGGER INS_TAB1 AFTER INSERT ON TAB1 FOR EACH ROW
DECLARE
CursorID integer; select_stmt varchar2(100); Processed integer; BEGIN CursorID := dbms_sql.open_cursor; select_stmt := 'SELECT YYMMDD FROM TAB2 WHERE YYMMDD = :x'; FOR i IN 1..31 LOOP dbms_sql.parse(CursorID,select_stmt,dbms_sql.v7); dbms_sql.bind_variable( CursorID , ':x' , :NEW.DAYi );
===> Here is my trouble,how to get the :new.day1~31
Processed := dbms_sql.execute(CursorID); IF dbms_sql.fetch_rows(CursorID) = 0 THEN /* Trigger script */ END IF; END LOOP;
If you have any idea,please tell me and I'll appreciate it . Thank you in advance.
Violin.
violin.hsiao_at_mail.pouchen.com.tw
Received on Fri Jun 11 1999 - 20:17:52 CDT
![]() |
![]() |