Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Help on button Trigger for Query
Hi,
I have create create with the Developer Suite 10g a Form with 3
Section:
1) The First Section has a Data Block (BLOCK_HEADER) with this entries
used as filter in a Query:
After entering the data in the BLOCK_HEADER, I need to run a Query
with the button, in order to populate my grid with data, wich I apply
the filter.
In order to perform this I have created a trigger WHEN-BUTTON-PRESSED
with this code:
Declare
LC$Req Varchar2(256) ; AC$Req Varchar2(256); TD$Req Varchar2(256); TI$Req Varchar2(256); DT$Req Varchar2(256);
Begin
LC$Req := ''; AC$Req := ''; TD$Req := ''; TI$Req := ''; DT$Req := '';
If ((:BLOCK_HEADER.TEXT_ANA_TYPE is not null) AND
(:BLOCK_HEADER.TEXT_ANA_CODE is not null)) Then
AC$Req := ' D_MYTABLE WHERE ANA_TYPE = :BLOCK_HEADER.TEXT_ANA_TYPE AND
ANA_CODE = :BLOCK_HEADER.TEXT_ANA_CODE' ;
-- Set SQL Statement
LC$Req := RTRIM(AC$Req) || RTRIM(TD$Req) || RTRIM(TI$Req) || RTRIM(DT
$Req) ;
Go_Block('BLOCK_BALANCE');
Set_Block_Property( 'BLOCK_BALANCE', QUERY_DATA_SOURCE_NAME, LC
$Req ) ;
Execute_Query ;
Go_Block('BLOCK_HEADER');
End if;
Go_Block('BLOCK_HEADER');
End ;
I have verified that the SQL string applied with choices is for example
SELECT TYPE_CODE, DOC_CODE, DOC_DATE, ANA_TYPE, ANA_CODE, DOC_TOTAL, DOC_INS, DOC_PAID, DOC_NOPAID FROM MYTABLE WHERE ANA_TYPE = :BLOCK_HEADER.TEXT_ANA_TYPE AND ANA_CODE = :BLOCK_HEADER.TEXT_ANA_CODE AND TYPE_CODE = :BLOCK_HEADER.CODE_TYPE When I run the form and press the Query button, the error: ORA-01008: Not all variables bound
I have searched this error on the Net, but I am not able to correct the problem without help.
I am a newbie in Oracle programming and I hope in Your help.
Thank You and best Regards
Gaetano Received on Sun Feb 25 2007 - 09:16:19 CST