help me errors about form [message #514850] |
Wed, 06 July 2011 22:05 |
|
I hava a program follow:
Declare
c_Where Varchar2(32767) := Null;
Cursor Cur_Xml_Ngay(c_codition varchar2) Is
Select Column_Value
From Table(Sys.Get_Dir_List('/home/oracle/xml/*.xml'))
Where 1 = 1 || c_codition;
Begin
If :Blk_Cv11_Control.Txt_Tu_Ngay is not null Then
c_Where:=c_Where||' And To_Date(Substr(Column_Value, Instr(Column_Value,'
||'''-'''||', -1) + 1, Length(Column_Value) - 4 - Instr(Column_Value, '
||'''-'''||', -1)),'||'''rrrr/mm/dd:hh:mi:ss'''
||') >= to_date(:Blk_Cv11_Control.Txt_Tu_Ngay,'||'''dd/mm/rrrr'''||')';
End If;
Go_Block('blk_cv12_xml');
Clear_Block;
For v_Xml In Cur_Xml_Ngay(c_where) Loop
:Blk_Cv12_Xml.Txt_Ten_File_Xml := Substr(v_Xml.Column_Value, Instr(v_Xml.Column_Value, '/', -1) + 1,
Length(v_Xml.Column_Value) - 4 - Instr(v_Xml.Column_Value, '/', -1));
:Blk_Cv12_Xml.Txt_Duong_Dan := v_Xml.Column_Value;
Next_Record;
Exit When Cur_Xml_Ngay%Notfound;
End Loop;
First_Record;
End;
When i run program on fomrs
|
|
|
Re: help me errors about form [message #514859 is a reply to message #514850] |
Thu, 07 July 2011 00:08 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
Can't tell for sure, but INVALID NUMBER might be result of ' And To_Date(Substr(Column_Value, Instr(Column_Value,'
||'''-'''||', -1) + 1, Length(Column_Value) - 4 - Instr(Column_Value, '
||'''-'''||', -1)),'||'''rrrr/mm/dd:hh:mi:ss'''
||') >= to_date(:Blk_Cv11_Control.Txt_Tu_Ngay,'||'''dd/mm/rrrr'''||')' part of your code. Try to display it (MESSAGE built-in, or put its value into an item large enough) and see whether it evaluates to a valid condition. Post it here, if that's not a problem.
Also, in the future, try to format your code. True - you enclosed it into [code] tags, but it is unformatted and difficult to follow.
|
|
|
|
Re: help me errors about form [message #514891 is a reply to message #514859] |
Thu, 07 July 2011 03:48 |
|
Declare
c_Where Varchar2(32767) := Null;
Cursor Cur_Xml_Ngay(c_Dieu_Kien Varchar2) Is
Select Column_Value From Table(Sys.Get_Dir_List('/home/oracle/xml/*.xml')) Where 1 = 1 || c_Dieu_Kien;
Begin
------------------
If :Blk_Cv11_Control.Txt_Tu_Ngay Is Not Null Then
c_Where := c_Where || ' And To_Date(Substr(Column_Value, Instr(Column_Value,' || '''-''' ||
', -1) + 1, Length(Column_Value) - 4 - Instr(Column_Value, ' || '''-''' || ', -1)),' || '''rrrr/mm/dd:hh:mi:ss''' ||
') >=to_date(' || Chr(39) || To_Char(:Blk_Cv11_Control.Txt_Tu_Ngay, 'dd/mm/rrrr') || Chr(39) || ',' || '''dd/mm/rrrr''' || ')';
End If;
Go_Block('blk_cv12_xml');
Clear_Block;
For v_Xml In Cur_Xml_Ngay(c_Where) Loop
:Blk_Cv12_Xml.Txt_Ten_File_Xml := Substr(v_Xml.Column_Value, Instr(v_Xml.Column_Value, '/', -1) + 1,
Length(v_Xml.Column_Value) - 4 - Instr(v_Xml.Column_Value, '/', -1));
:Blk_Cv12_Xml.Txt_Duong_Dan := v_Xml.Column_Value;
Next_Record;
Exit When Cur_Xml_Ngay%Notfound;
End Loop;
First_Record;
---------------------------
End;
what has cursor errors?
-----------------
The "curor"
|
|
|
|
Re: help me errors about form [message #514899 is a reply to message #514896] |
Thu, 07 July 2011 04:01 |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Select Column_Value From Table(Sys.Get_Dir_List('/home/oracle/xml/*.xml')) Where 1 = 1 || c_Dieu_Kien;
You can't append bits to the where clause of explicit cursors like that.
You need to use execute immediate or a ref cursor.
|
|
|
|
|
|