Multiselect item in a SQL/Report received No data found msg
I am having a problem with retrieving rows from a table with a multiselect item.
I am using the INSTR function in my SELECT but it only works for one value not two values.
I am use an anonymous PL/SQL block in a report region:
Begin
V_Q:= 'select "ID","FIRMID","FIRM_NAME","ADDRESS1","ADDRESS2","CITY","COUNTY","STATE","ZIP",
decode("PHONE",null,null,''('' || SUBSTR("PHONE",1,3)|| '') '' || SUBSTR("PHONE",4,3)||''-''|| SUBSTR("PHONE",7,4)) as "PHONE",
decode("FAX",null,null,''('' || SUBSTR("FAX",1,3)|| '') '' || SUBSTR("FAX",4,3)||''-''|| SUBSTR("FAX",7,4) )as "FAX","EMAIL","ETHNICITY","GENDER"
from "FIRMS" "F"
where 1=1 ';
/********************* this is the code in which I am having a problem ***********/
If V('P1_COUNTY') is not null then
v_Q := v_Q || ' AND ' ||'INSTR('':''||v(''P1_COUNTY'')||'':'', '':''||"COUNTY"||'':'') > 0';
end if;
APEX_COLLECTION.DELETE_COLLECTION (
p_collection_name => v_collection_name );
:P1_Q := v_q;
APEX_COLLECTION.CREATE_COLLECTION_FROM_QUERY_B(
v_collection_name,
v_q );
End;
I am using APEX 2.2 with Oracle 9.2
I ran the same query in SQL*Plus and it worked. I received data for multiple selections (2).
Why did it work in SQL*plus and not in APEX?
Was this a reported bug in APEX 2.2? Was this corrected in APEX 3.0(.1)?
Can someone please help, I am completely perplexed!
Robert
Oops...
I found the error. INSTR works perfectly. The problem was that I used where clause referencing the COLLECTION which did not have the INSTR builtin function.
Sorry about that.
This is now closed.
Similar Messages
-
SQL Report return No Data Found
I have a page with a SQL Report that runs a very complex query. If the returns are that nothing is found, I want to run some JavaScript. How can I determine the count of the result set or the capture the exception? Or is there another way without rerunning the query?
ThanksIn Report Attributes tab, under Messages, you will see a section named "When No Data Found Message". In it, I added this javascript code. When no data was found, the javascript worked, and popped up a message box. You can replace the alert code below with a call to your javascript function.
<script language="javascript">
alert("no data found");
</script>
There is another way. In the Region Definition tab, there is a section called "Region Footer". In it, add this javascript:
<script language="javascript">
var i = #TOTAL_ROWS#;
alert(i);
</script>
When variable i is zero, then you know that no data was returned.
Hope this helps.
Ravi -
How To Use a Hidden Page Item within an SQL Report Query without Submitting
Hi,
Using: Oracle ApEx 3.0.1
I have an sql report region that contains a hidden page item as part of the "where clause". My problem is, based on a value entered by the user, I need to assign this value enetered to my hidden item, so that it can be used within the where condition of my sql but this would need to be done without actually submitting the form.
At the moment, I can set the value via an on-demand process but my SQL is still not returing any values as the hidden page item within the query is not set (as page has not been submitted).
Can anybody please assist as I am not sure how to do this and whether in actual fact, this is possible to do, without having submitted the page.
Thanks.
Tony.
Edited by: Tony F. on Nov 12, 2011 1:39 AMYou can set a session value using a dummy ajax call e.g:
Add the following to the 'Function and Global Variable Declaration' region
function f_set_item(pThis){
var get = new htmldb_Get(null,&APP_ID.,'APPLICATION_PROCESS=dummy',1);
get.add('P1_ID',pThis.value)
gReturn = get.get();
get = null;
}Where P1_ID is the session value to be set. Then call the function in the usual way e.g.
javascript:f_set_item(this);
I hope that helps
Shunt -
Highlight an item in a SQL-report
Hello,
I have a table in which items are stored with a column "name" and a column "correct".
I need to highlight an item (put backgroundcolor in red) in a SQL-report based on the fact if the value of the column "correct" of the item is False. I don't know how I can do this? Can anyone help?
Thanks in advance,
Bram.Hello Bram,
Something like:
select "DEMO_PRODUCT_INFO"."PRODUCT_ID" as "PRODUCT_ID",
CASE WHEN PRODUCT_AVAIL='N'
THEN '<span style="background:red">'||product_name||'</span>'
ELSE product_name
END "PRODUCT_NAME",
"DEMO_PRODUCT_INFO"."PRODUCT_AVAIL" as "PRODUCT_AVAIL"
from "DEMO_PRODUCT_INFO" "DEMO_PRODUCT_INFO"Greetings,
Roel
http://roelhartman.blogspot.com/
You can reward this reply by marking it as either Helpful or Correct ;-) -
SQL Report not showing data - available in SQL Workshop and SQL Developer
I am having an issue with developing a SQL Report in APEX 3.2.1. I run the code in both SQL developer and SQL Workshop and I get data pulled back (both against my development environment). When I run the same code in a SQL Report region, it returns no data available. Does anyone have any idea what would be causing this? Other regions on the page accessing different tables in the same schema return data without issue. Any help would be appreciated.
Thanks
FreddieCould you explain the last comment a bit more. Here is a bit more info just in case I touch on the info with it. The db schema is BPAMGR, the Workspace is BPAMGR. We use the same schema for all of our reporting. All of our tables are in the same schema. We don't use any tables outside of this schema. Our APEX workspace has been associated to only this schema. The tables are able to be queried by SQL Workshop in the same APEX instance that the report application is under.
Freddie -
Report shows "No data found" when validation fails
Hi folks,
I'm new to the OTN and have a short question regarding validations/report pagination.
We are using Apex 4.0.2.00.07.
I have a page containing a report with three columns.
First column is a checkbox (f30), the second one a date picker and the third one is a value field (f34).
I'm trying to build a validation for the value field (should only allow numeric values, but is varchar2) and used a validation with "Function Returning Boolean".
The PL/SQL code is:
DECLARE
vrow BINARY_INTEGER;
v_number FLOAT:=0;
BEGIN
FOR i IN 1 .. APEX_APPLICATION.g_f30.COUNT
LOOP
BEGIN
vrow := APEX_APPLICATION.g_f30 (i);
v_number := to_number(APEX_APPLICATION.g_f34(vrow));
RETURN TRUE;
EXCEPTION
WHEN OTHERS THEN
RETURN FALSE;
END;
END LOOP;
END;
The validation works fine, but every time I enter a non numeric value and the validation fails (error message is displayed correctly as notification) I get a "report error: ORA-01403: no data found" in the pagination area of the report.
Tried to disable pagination completely, but the error still displays when the validation fails.
Any help would be appreciated.
Thanks in advance and regards
SandroContent of the checkboxes is ok, debugging showed
1:7
2:8
(records 7 and 8 where ticked)
Debugging console also shows:
0.10900 0.00000 Processing point: Before Box Body
0.10900 0.00000 Region: Shareclassinformation
0.10900 0.00000 Item: P59_IS
0.10900 0.00000 Item: P59_NA
0.10900 0.00000 Item: P59_CO
0.10900 0.00000 Region: Attribute Selection
0.10900 0.00000 Item: P59_LO
0.10900 0.00000 Item: P59_ID
0.10900 0.00000 Item: P59_IDAH
0.10900 0.00000 Item: P59_IDAT
0.10900 0.00000 Item: P59_SHO
0.10900 0.00000 Item: P59_UTD
0.10900 0.00000 Item: P59_X NA
0.12500 0.00000 Region: Attributes
0.12500 0.23400 Item: P59_NOT
0.12500 0.00000 show report
0.12500 0.00000 determine column headings
0.12500 0.00000 parse query as: DB
0.35900 0.14100 binding: ":P59_LOV_AT"="P59_LOV_AT" value="64"
0.35900 0.00000 binding: ":P59_IDT"="P59_IDT" value="51"
0.50000 0.01500 print column headings
0.50000 0.00000 rows loop: 20 row(s)
*0.51500 0.01600 report error: ORA-01403: no data found*
0.51500 0.00000 Computation point: After Box Body
... -
Discoverer Report returning ' no data found '
Hi ...
i have an issue with one discoverer report .
Discoverer report name : EDI Price Exception Report.
when i ran the report in Discoverer Desktop edition It is returning 'No Data Found ' But i am taken the Query from admin edition and tried to ran in PL/SQL Developer/TOAD by setting Org_id condition
it's returning Data . the Desktop Edition of Discoverer for some specific date Range it's giving Data But from last month on wards it's not returning any Data.
in Discoverer Report Desktop it's not retuning the Data from November to till date
Oracle Applications 11i
Discoverer 4i
Oracle Data base :9i
OS : Windows.
Attached the Sql which i used to generate the Report :
I HAVE USED THE FOLLOWING :-for initialize the profile options
EXEC FND_GLOBAL.APPS_INITIALIZE (0,52163,660);
EXEC APPS.FND_CLIENT_INFO.SET_ORG_CONTEXT(2922);
SELECT A.CUST_PO_NUMBER,
A.ORDER_NUMBER,
A.ORDERED_DATE,
A.ORDER_TYPE,
-- C.CUSTOMER_ID,
C.CUSTOMER_NUMBER,
C.CUSTOMER_NAME,
B.LINE_NUMBER,
B.ORDERED_ITEM,
MSI.SEGMENT1 ACCO_ITEM, -- GRW 20060407
MSI.DESCRIPTION,
-- MSI.INVENTORY_ITEM_ID,
(SELECT MCI.CUSTOMER_ITEM_NUMBER
FROM MTL_CUSTOMER_ITEMS MCI,
MTL_CUSTOMER_ITEM_XREFS MCIX,
MTL_SYSTEM_ITEMS_B MSIB
-- MTL_PARAMETERS MP
WHERE MCI.CUSTOMER_ID = C.CUSTOMER_ID --1814924
AND MCI.CUSTOMER_ITEM_ID = MCIX.CUSTOMER_ITEM_ID
AND MCIX.INVENTORY_ITEM_ID = MSIB.INVENTORY_ITEM_ID
AND MSIB.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID --869899
AND MSIB.ORGANIZATION_ID = MTP.ORGANIZATION_ID --MP.ORGANIZATION_ID
AND MTP.ORGANIZATION_CODE = 'BRM'
AND MCI.CUSTOMER_ITEM_NUMBER = B.ORDERED_ITEM
AND NVL (mci.inactive_flag, 'N') <> 'Y'
AND NVL (mcix.inactive_flag, 'N') <> 'Y')
CUSTOMER_ITEM,
XXAB_ITEM_XREFS.GET_GBC_ITEM_NUM (B.ORDERED_ITEM) GBC_ITEM_NUMBER,
B.ORDERED_QUANTITY,
B.PRICE_LIST,
B.UNIT_SELLING_PRICE,
B.UNIT_LIST_PRICE,
TO_NUMBER (B.ATTRIBUTE7) CUST_SENT_PRICE,
apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
B.ordered_item,
B.header_id,
B.line_number,
B.unit_selling_price,
B.attribute7,
B.pricing_quantity_uom,
B.attribute4)
CUST_SENT_PRICE_CONVERTED,
ABS ( (B.UNIT_SELLING_PRICE
- apps.XXAB_CUST_SENT_PRICE_CONV_SO (C.customer_number,
B.ordered_item,
B.header_id,
B.line_number,
B.unit_selling_price,
B.attribute7,
B.pricing_quantity_uom,
B.attribute4)))
DIFFERENCE,
MTP.ORGANIZATION_CODE,
B.SHIP_TO_LOCATION
FROM OE_ORDER_HEADERS_V A,
OE_ORDER_LINES_V B,
RA_CUSTOMERS C,
MTL_PARAMETERS MTP,
MTL_SYSTEM_ITEMS_B MSI
WHERE A.HEADER_ID = B.HEADER_ID
AND A.SOLD_TO_ORG_ID = C.CUSTOMER_ID
-- Added by Gati on 19-Oct-2012, tkt - INC000000118962
AND ROUND (TO_NUMBER (apps.XXAB_CUST_SENT_PRICE_CONV_SO (
C.customer_number,
B.ordered_item,
B.header_id,
B.line_number,
B.unit_selling_price,
B.attribute7,
B.pricing_quantity_uom,
B.attribute4)),
2) <> B.UNIT_SELLING_PRICE
--AND ROUND(TO_NUMBER(B.ATTRIBUTE7), 2) <> B.UNIT_SELLING_PRICE
--AND a.ship_from_org_id = mtp.organization_id
AND B.SHIP_FROM_ORG_ID = MTP.ORGANIZATION_ID -- GRW 20060413
--AND a.ship_from_org_id = msi.organization_id
AND B.SHIP_FROM_ORG_ID = MSI.ORGANIZATION_ID -- GRW 20060413
AND B.INVENTORY_ITEM_ID = MSI.INVENTORY_ITEM_ID -- GRW 20060407
AND A.ORDER_SOURCE_ID = 6
AND A.ORG_ID = B.ORG_ID
AND TO_CHAR (A.ordered_date, 'DD-MON-YYYY') between '01-NOV-2013' and '03-NOV-2013'
and mtP.organization_code='BRM'
AND A.ORG_ID = (SELECT HOU.ORGANIZATION_ID
FROM HR_OPERATING_UNITS HOU
WHERE HOU.NAME = '50 ACCO Canada')
AND B.cancelled_flag <> 'Y'
AND B.flow_status_code <> 'CANCELLED'
AND B.ORDERED_ITEM <> 'INVALID_ITEM'
ORDER BY a.order_numberHi,
Assuming your initialization matches your discoverer login, it is pretty weird that you get no data.
I am not sure how you got the SQL but i suggest you trace the session to get the exact SQL ran by the discoverer.
You may find another condition or join that limits your data.
Also another thing that you should try is to initial the session by using all the parameters (including the security group as you have in your discoverer login):
begin
fnd_global.APPS_INITIALIZE(user_id =>, resp_id =>, resp_appl_id =>, security_group_id =>);
end -
Hide 'No data found' msg in report region when you 1st click search page
Hi,
(sorry if it's confusing but my APEX is in FRENCH and I tried to translate)
I created a search page in my application.
1- I have an HTML region, with a search box and I search button
2- I've got a report region (PL/SQL source) which sometimes returns no data, giving a 'No Data Found.' message.
When I click on the search page for the 1st time (on my navigation bar), I would like to HIDE the report region so I don't have the " No Data Found" message.
Only Once we click on the search button and there is no result, I want to have the message "No Data FOund"
How can I achieve this?
thanks
Roseline1. create a hidden element on your page (P1_HIDDEN_ELEMENT)
2. put your No Data Found message in a span tag
<span id="no_data_found">No Data Found</span>3. create an on load computation to set your P1_HIDDEN_ELEMENT to 'no_data_found' if it is NULL and to set it to ' ' if it is NOT NULL - type PL/SQL Function Body
BEGIN
IF :p1_hidden_element IS NULL
THEN
RETURN '<script>html_HideElement(''no_data_found'');</script>';
ELSIF :p1_hidden_element IS NOT NULL
THEN
RETURN ' ';
END IF;
END;4. Put this into the page footer:
&P1_HIDDEN_ELEMENT.The other solution would be to create a display region - pure HTML and to display that first. Once the search is started that region would remain hidden and only the report would show up.
Denes Kubicek
http://deneskubicek.blogspot.com/
http://www.opal-consulting.de/training
http://apex.oracle.com/pls/otn/f?p=31517:1
http://www.amazon.de/Oracle-APEX-XE-Praxis/dp/3826655494
------------------------------------------------------------------- -
Print link on report shows 'no data found' when LOV has not been used
Hi all,
I have a simple standard report that queries data based on the value in a Select List. This Select List allows users to pick a year for the report. The LOV has a default of TO_CHAR(SYSDATE,'YYYY').
If I open the page using the associated Tab everything wotks OK. However, if I open the page via a button on my home page, the prink links fails:
The page opens OK, the select list defaults OK and the report shows the correct data. However, if I click on the 'Download as CSV' or 'Print' links I get 'no data found'.
If I update the LOV to 2010 everything works. If I set it back to 2009 evenrything works. I just cant get it to work when I open the page.
I have tried adding computations to get this to work, but this does not seem to help.
Any ideas?
Thanks,
MartinHi,
It would depend on what has been added, if anything, to the redirect. The redirect should just function as though you had typed in a URL into the address bar and pressed Enter. The page doesn't get submitted, so any data entered onto the page itself is, unless it is already in session, lost. A button, however, should submit the page and Apex will store all values in the session. So, if the value you need for the LOV is from the previous page, then this is the preferred method - but, note, that the redirect can also store values provided the page item name and the value is included in the redirect's URL string
Andy -
Pick Slip report gives 'No Data Found' output
Hi All,
Problem Statement:
Iam unable to generate Pick release report, the shipping
lines status is "ready to release" and we have a available quantity for the shipment.
Step1 : Create a Order.
Step2 : Save and Book the Order.
Step3 : Pick Release the Order.
Step4 : Go To " View My Requests".
Step5 : Select the Request Id " Pick Slip Report "
Step6 : Click on Output.
Result " No Data Found.
Thanks in Advance
SYRHi SYR,
Pick Slip report gives you out put as NO DATA FOUND, is basically, bcos there has not been any picking of the item, reason may be,
1. Qty avaialble wont be reservable and transactable
Check in Inventory> On handqty > click availibility tab
And see whether the item is available to transact & reserve.
If you have enought qty thn you shld be able to pick release tht item.
2. Check which sub inventory are you using while pick release, is it the same as where the item is kept.
Try this out.
This may help.
Thanks
Manoj -
Cancelling a report when no data found
Hi All!
I have a report that prints directly to the printer. But if the report query fetches no data then a blank page is printed.
How should I raise a customized message and stop the report execution if there is no data found?
Thanks in advanceHello,
Another way is this: Put a report level summary in the data model that counts the rows in the query (use as the summary count source one of the columns of the main query).
Then create an after report trigger that looks something like this:
function AfterReport return boolean is
begin
if (:cs_count = 0) then
raise srw.program_abort;
end if;
return (TRUE);
end;This will cause the report to stop execution. It'll show an error like this in the report server log:
REP-1419: 'afterreport': PL/SQL program aborted.
You'll have to warn people about this particular error log entry as this may look like abnormal termination, when in fact it is a deliberate termination of the report. But at least you won't get a blank page.
Regards,
The Oracle Reports Team --skw -
Search report - error-no data found when printing to csv format
Hi all,
I have a search report,
I have 4 select list and two text field and two date field to search for the result.
I have even put the computation for the select list items in
on load - before header ie setting the items to default value.
Still when i try to print it in the csv format , and try to open the excel, it is saying "no data found" error
Please, Could any one give me a solution to solve this bug?
Note: Ordinary report is getting printted in the csv format.
Thanks in advance
bye
SrikaviHi Denes and Scott,
sorry, only when i select the values for all the 4 select list
csv is working. default values are not restored in the session.
How to restore the values in the session state after pressing the search button.
i have set the default values for the select list and the query is working fine
but when i see the session from the toolbar the default values are not present.
but when i see the debug from the toolbar the values are set properly.
@Denes
In your example the session is showing the values of the select list and check box
The same way i did, but in "session" values are not seen so again no data found is seen when printing csv .
Bye
Srikavi -
Financial Tax Register Report shows No Data Found
Hi All,
We are upgrading from 11.5.10 to 12.1.3, ofter upgrading to 12.1.3 when i running the Financial Tax Register Report it is showing No Data Found.
Please reply me ASAP.
Regards,
Raju.Hi,
For your references i posted the log file of financial tax register report.
E-Business Tax: Version : 12.0.0
Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
RXZXPFTR module: Financial Tax Register
Current system time is 15-FEB-2013 09:38:25
Publishing concurrent program ZX : RXZXPTEX.
Request 487766 submitted.
Start of log messages from FND_FILE
End of log messages from FND_FILE
Current system time is 15-FEB-2013 09:38:25
Request restarted at :15-FEB-2013 09:38:27
Publishing concurrent program ZX : RXZXPTEX.
Publishing request ID 487766.
Its a BIDI char set
Its not a BIDI language
FA_RX_SUBMIT_PURGE (PURGE API PROGRAM NAME =ZX_EXTRACT_PKG.PURGE) (ROWS PURGED =0)
Start of log messages from FND_FILE
End of log messages from FND_FILE
Executing request completion options...
Output file size:
36093
------------- 1) PRINT -------------
Printing output file.
Request ID : 487765
Number of copies : 0
Printer : noprint
Finished executing request completion options.
Concurrent request completed successfully
Current system time is 15-FEB-2013 09:38:28
--------------------------------------------------------------------------- -
Oracle report , when no data found in query then ptint zero in text how
hi ,
i have use oracle report in one query if no data found then i have return O but no row select is there
query is
select sum(nvl(a.pitm_matl_cost,0)),
decode(b.pm_assy_type,'B','B','Z')
from pumpitems a, pumpmast b
where a.pitm_proj_code like 'KAWASII' and
a.pitm_pump_type = b.pm_pump_type and
a.pitm_comp_type = b.pm_comp_type and
a.pitm_sr_no = b.pm_sr_no and
substr(a.pitm_matl_code,1,1) = 'X' and
pitm_itm_cal = 'N'
group by decode(b.pm_assy_type,'B','B','Z')
order by decode(b.pm_assy_type,'B','B','Z')
no data then it return no row select but
i have return 0 how is possible , in report i have check cf, and cs to total , and no data then print 0 in text box so.
sol1:
select count(*), sum(nvl(a.pitm_matl_cost,0)),
decode(b.pm_assy_type,'B','B','Z')
from pumpitems a, pumpmast b
where a.pitm_proj_code like 'KAWASII' and
a.pitm_pump_type = b.pm_pump_type and
a.pitm_comp_type = b.pm_comp_type and
a.pitm_sr_no = b.pm_sr_no and
substr(a.pitm_matl_code,1,1) = 'X' and
pitm_itm_cal = 'N'
/*and
substr(a.pitm_matl_code,1,1) != 'C' and
substr(a.pitm_matl_code,1,1) != 'F' and
substr(a.pitm_matl_code,1,1) != 'S'*/
group by decode(b.pm_assy_type,'B','B','Z')
order by decode(b.pm_assy_type,'B','B','Z')
count(*) is return 0 but it's notworking in this query why i dont no
another soluction than helpThis sounds like it's similar to another recent post
Re: How do I print some value when there is no record against field -
SQL statement - when no data found
I have this SQL statement as follows:
SELECT (Case When tar_customer_id <> 0 Then tar_customer_id Else 0 End) INTO l_balance_customerID FROM sh_ba_balance WHERE tar_customer_id = p.customer_id; However, when I tried run it, I have this error:
ORA-01403: no data foundHow do set l_balance_customerID as 0 when no data is found?[url http://forums.oracle.com/forums/thread.jspa?messageID=2754839�]duplicate thread
Maybe you are looking for
-
Hi, I need to display square root symbol in sql query. Thanks !!!
-
Hi Experts, I have created a custom pictogram to use in my workset map. I added it to etc/public/mimes/images/pictograms and recycled the portal. I then went to create a new iView the custom pictogram is NOT in this lovely unsorted list. Any guidan
-
IPad to Apple TV to Dual Projectors?
I have an odd shaped classroom and have 2 projectors that are connected to my classroom computer (which is a PC). I have an apple tv, and my projectors have HDMI, but I cannot for the life of me figure out how to get my apple tv to display on both pr
-
My HP s5610f PC has no video signal going to my monitor (connection to VGA jack). Can I connect the monitor to the DVI jack using a VGA to DVI adapter? Which model DVI is needed? My hope is that the DVI output has circuitry independent from the VGA
-
Hello all, At March 31, 2009 our Year End, we ran an aging report, the report did not match our GL. The report was out by (29.60)usd and no trace of that amount in the report. After running the report today it balances and we have found the USD curre