Record group problem [message #428992] |
Sat, 31 October 2009 12:15 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
maxis
Messages: 17 Registered: September 2008
|
Junior Member |
|
|
I try to make sql statement, from two form text item for record group that only generate where clause, it execute
good but results in no datafound
statment for record group
sql_S varchar2(500):=(case when :SEARCH_BLK.searchcol is not null and :SEARCH_BLK.search is not null then
>>>> 'SELECT DISTINCT ID AS ID1,ID ,DESCRIPTION,STATUS FROM TBLACCOUNT '
|| ' where ' ||:SEARCH_BLK.searchcol||'like '
||'''%'||:SEARCH_BLK.search||'%'''
||'ORDER BY ID1'
else
'SELECT DISTINCT ID AS ID1,ID ,DESCRIPTION,STATUS FROM TBLACCOUNT ORDER BY ID1'
end );
table contain values
SQL> select id,description,status from tblaccount where id like '%001%';
ID
---------------
DESCRIPTION
--------------------------------------------------------------------------------
STATUS
--------------------------------------------------------------------------------
001
Assets
Group
00101
Fixed Assets
Group
00102
Current Assets
Group
0010101
Free Hold Assets
Group
0010101001
Land and building
Detail
0010102
Leased Hold Assets
Group
0010102001
Machinery
Group
0010201
Current Assets
Group
0010201001
Stocks
Detail
0010201002
Debitors
Detail
0010201003
Current Portion of lease
Detail
0010201004
Prepaid Expenses
Detail
0010201005
Cash
Detail
0030101001
Cummulative Debentures
Detail
0030201001
Creditors
Detail
0040201001
Income From Sale Of Land
Detail
0050201001
Lose From Sale Of Land
Detail
17 rows selected.
SQL>
Please correct me where i am wrong [EDITED by DJM: split overly long lines - it won't format]
[Updated on: Wed, 18 November 2009 23:19] by Moderator Report message to a moderator
|
|
|
|
Re: Record group problem [message #429045 is a reply to message #428992] |
Sun, 01 November 2009 11:27 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
maxis
Messages: 17 Registered: September 2008
|
Junior Member |
|
|
ohhh.. i it would be strange. Result from text item and put into sqlplus.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
SQL> SELECT DISTINCT ID AS ID1,ID ,DESCRIPTION,STATUS FROM TBLACCOUNT where TBLACCOUNT.ID like '%
001%' ORDER BY ID1;
ID1 ID
--------------- ---------------
DESCRIPTION
--------------------------------------------------------------------------------
STATUS
--------------------------------------------------------------------------------
001 001
Assets
Group
00101 00101
Fixed Assets
Group
ID1 ID
--------------- ---------------
DESCRIPTION
--------------------------------------------------------------------------------
STATUS
--------------------------------------------------------------------------------
0010101 0010101
Free Hold Assets
Group
0010101001 0010101001
Land and building
ID1 ID
--------------- ---------------
DESCRIPTION
--------------------------------------------------------------------------------
STATUS
--------------------------------------------------------------------------------
Detail
0010102 0010102
Leased Hold Assets
Group
0010102001 0010102001
ID1 ID
|
|
|
|
Re: Record group problem [message #429176 is a reply to message #428992] |
Mon, 02 November 2009 07:46 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
cookiemonster
Messages: 13963 Registered: September 2008 Location: Rainy Manchester
|
Senior Member |
|
|
Are you sure you are copying and pasting the queries correctly?
Because your very first query appears to be missing a space before the like.
|
|
|
|
Re: Record group problem [message #429319 is a reply to message #429208] |
Tue, 03 November 2009 03:53 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
![](/forum/images/custom_avatars/72104.gif) |
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
CLEAR_BLOCK doesn't accept that kind of an argument (i.e. block name) - only commit mode.
I didn't quite get the point: are you saying that invalid CLEAR_BLOCK caused SELECT statement to return nothing? Is the problem solved now?
|
|
|