Sys_refcursor not fetching any data although query returns value

hi!!!
I am using sys_refcursor to return columns,and using below procedure to do so.Although data is there in table_1 and table_2.
PROCEDURE test_pro(abc_date N DATE,
cur_get_data OUT sys_refcursor
OPEN cur_get_data
for
select A.col1,B.col2
from table_1 A
where A.dis_date=abc_date
left outer join
table_2 B
on
A.dis_date=B.dis_date;
IF cur_get_data%rowcount=0
then
     raise e_error;
END if;
EXCEPTION
     when e_error
     then
          ------no_data_found;
     when others
     then
--------(giving SQL error with error code);
END      test_pro;
while running below sql in sql window of pl/sql developer fetching
data
select A.col1,B.col2
from table_1 A
where A.dis_date=abc_date
left outer join
table_2 B
on
A.dis_date=B.dis_date;
but while testing the test_pro in test window of pl/sql developer it is
not fetching any data and raising e_error each time
is there any problem arising using IF cur_get_data%rowcount=0 as each time it is going to exception block..
so can somebody please put some ideas what cud be the possible reason for this??

Welcome to the forum!
Unfortunatley you posted to the wrong forum. This question belongs in the SQL and PL/SQL forum.
PL/SQL
>
sys_refcursor not fetching any data although query returns value
but while testing the test_pro in test window of pl/sql developer it is
not fetching any data and raising e_error each time
is there any problem arising using IF cur_get_data%rowcount=0 as each time it is going to exception block..
>
A cursor doesn't fetch data - your code has to do that. The code you posted doesn't have any FETCH statements so no data will be fetched.
There is no problem using 'IF cur_get_data%rowcount=0' but it will always be 0 in your code because you are not fetching any data.
I'm guessing that you are trying to determine if there are any rows for the query. That isn't going to work since a cursor doesn't fetch rows.
You just have to return the cursor to the caller and the caller will have to perform at least one fetch to see if there are any rows.
If the above answers your question the just mark the question ANSWERED. Otherwise, since you have posted in the wrong forum
1. repost the question in the SQL and PL/SQL forum
2. Edit this post to add a link to the new thread in the other forum
3. Mark this question ANSWERED so people will follow up in the other forum.
Thanks.

Similar Messages

  • SQL 2012 - SSIS Error -The step did not generate any output. The return value was unknown. The process exit code was -1073741819. The step failed.

    Hi guys 
     Trying to run this package on SQL 2012 agent  and getting below error . No more details I could find so far.
    The step did not generate any output.  The return value was unknown.  The process exit code was -1073741819.  The step failed.
    About Package - Its connecting to different version (2000,2005,2008,2008R2,2012) servers and putting Jobs information into one Database table.  
    Any workaround or fix ?
    Thanks
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    New package or one that used to work? Connecting how? How does it poll?
    On the surface it is an error from a memory space of the binary/non-managed code, so nothing can be really concluded based on what you decided to share with us.
    Arthur My Blog
    So Same package is working fine from my local machine which has SQL 2008 R2 and SQL 2012 installed. I am trying to push the package on server which has sql server 2012 Installed . 
    I don't see any error .
    I ran package manually from server using SQL Data tools and ran successfully...
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

  • Invoice History Report not fetching any data without parameters

    Hi
    As per user guide, you can run the Invoice History Report without giving supplier parameter. "If you want to submit the report for one supplier, enter the supplier. Leave this parameter blank to submit the report for all suppliers."
    But when we run the Invoice History Report, if we don't give any supplier, no data is coming in the report. If we give a supplier, data for that supplier is fetched by the report.
    Has anyone faced this issue, is there any solution for this?
    We are on the Oracle Apps 12.1.1 and the version on the report RDF is 120.11.12010000.5
    Thanks!

    Hi,
    could you copy the MDX here ?
    Would you be able to use ST01 / ST05 to trace further details ?
    You can also go into the registry :
    HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\SAP\BW MDX Query Driver
    set the Trace to Yes
    then use the path:
    HKEY_LOCAL_MACHINE\SOFTWARE\Business Objects\Suite 12.0\SAP
    set the "TraceDir" to the path for the logfiles
    Ingo

  • Sql developer could not fetch any data while running queries?

    I have  downloaded  SQL Developer , install jdk1.5.0_22  from the website. Then I run sqldeveloper.exe browse the jdk folder. After that i established the connection but it continuously showing loading..No tables No procedures are loaded . what should i do?

    Be careful... SQL Developer requires a JDK or the server JRE (which I believe only comes in 64-bit, so go with the JDK if you are on a 32-bit OS).
    Prior to 4.0, the SetJavaHome line in your install directory's sqldeveloper.conf (or sqldeveloper-Darwin.conf on the Mac) must be set, but in 4.0 and above that changes to product.conf under your OS's user settings.  For Windows 7, that would be in...
    C:\Users\<your-userid>\AppData\Roaming\sqldeveloper\1.0.0.0.0\product.conf
    Hope this helps.  If not, assuming Windows, run sqldeveloper.exe in the bin directory from a command line console so you can see any standard error output in the console, or do a Ctrl-Break to get a full thread dump of what's happening in the JVM.

  • DTP is not fetching any data eventhough data is there in psa

    Hi All,
    I need to load data from existing data source(2lis_03_bf) to new data target, data is available in data source for last 1 year, as my client is retail, and also huge data i tried to load data with filter on BUDAT, for 1 month, but dtp says data is not avialble, i cant run whole data in asingle shot.
    i created new dtp and tried with other selections , even then its showing no data available, i tried with full and delta update in dtp but no luck.
    Kindly suggest me.
    Regards,
    Yunus

    Hi Yunus,
    I believe that your DTP was Delta DTP & i think you might have already loaded the data into the Datatarget. So when you try to run the Delta DTP, it is possible that there is no new Data.
    (Or) If you have not loaded the PSA requests to your Datatarget, delete the already created DTP.. Then create a new FULL DTP, activate it & try loading.
    (Or) create different DTP's with different selections with no overlapping in the selections. Make sure that the selections you are giving are having data in PSA.
    Hope it helps!
    Regards,
    Pavan

  • Ad Hoc Query - While executing - System could not read any data

    Hello Techies,
    When I am excuting my Ad hoc query - for one personnel number for which Infotype 28 subtype 0001 has been maintained
    But system is throwing this error -
    System could not read any data
    Message no. AQ_AD_HOC226
    Diagnosis
    There is no data available for the specified selections.
    System response
    The results list in the lower part of the screen still displays the last list to be created.
    Please let me know why does it happening ?
    Thanks
    Jaydeep

    It was an date selection issue - as while executing the Ad hoc query - the reporting date is today -
    changed to all

  • MDM Change tracker iView not fetching the data?

    Hello Experts,
    we have MDM Change tracker application deployed and assigned to some role in portal. However, the problem is fields like "Table" etc are blank. I am not able to fetch any data in it. I have activated change tracking for the required table in MDM backend as well.
    I was following this blog: /people/balas.gorla/blog/2006/09/08/change-tracking-in-mdm
    It is mentioned that some DB setting have to be done and some query to be written. I am confused, I have an iView in portal so do I still need to write the query? Or what is that I am missing?
    Please help.
    Ameya

    Hi Ameya,
    The SQL query written in the mentioned blog is just to recheck the data.
    Please recheck the settings using these documents:
    http://help.sap.com/saphelp_mdm550/helpdata/en/45/c7b20339ee570ae10000000a114a6b/content.htm
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/807861ac-f941-2c10-8f8d-c57f9d421b99?quicklink=index&overridelayout=true
    http://help.sap.com/saphelp_nwmdm71/helpdata/en/49/a42bc834de1b93e10000000a42189b/content.htm
    Also on resetting change tracker:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10cbe10c-0654-2c10-3d8b-ff99dadc402e?quicklink=index&overridelayout=true
    The error can also occur if Database userid used has expired.
    Hope this helps!
    Thanks,
    Ravi

  • ReportViewer control used with a remote report does not display any data.

    Hi there,
    I have this .rdl report that runs just fine on our reporting server (I can see that when I try to run the report by accessing its URL in a browser). However, when I run it in my Windows-based application, I do not see any data. My report has two input parameters
    and it needs to impersonate the caller's identity because the database uses Windows Authentication.
    Here is the code I use:
    var reportViewer = new ReportViewer();
    // Set Processing Mode
    reportViewer.ProcessingMode = ProcessingMode.Remote;
    // Set report server and report path
    reportViewer.ServerReport.ReportServerUrl = new Uri("http://MySsrsServer/reportserver");
    reportViewer.ServerReport.ReportPath = "/Reports/MyReport";
    // set the credentials
    reportViewer.ServerReport.ReportServerCredentials.ImpersonationUser = WindowsIdentity.GetCurrent();
    // create report parameters and set them in the report
    var param1 = new ReportParameter("First_Param", "Some string");
    var param2 = new ReportParameter("Second_Param", "Some other string");
    reportViewer.ServerReport.SetParameters(new ReportParameter[] { param1, param2 });
    using (var reportForm = new ReportForm(reportViewer))
    reportForm.ShowDialog();
    The ReportForm is just a regular Form that has a member of type ReportViewer. In the class' constructor, I assign the member:
    public ReportForm(ReportViewer reportViewer)
    InitializeComponent();
    try
    this.reportViewer = reportViewer;
    reportViewer.SetDisplayMode(DisplayMode.PrintLayout);
    reportViewer.Dock = DockStyle.Fill;
    reportViewer.ZoomMode = ZoomMode.Percent;
    reportViewer.ZoomPercent = 100;
    reportViewer.RefreshReport();
    catch (Exception exception)
    MessageBox.Show(exception.Message);
    Using database level tracing, we were able to confirm that the two Stored Procedures used by the report are called and they return correct and valid records. However, in the form nothing shows up:
    Any suggestions?
    TIA,
    Ed

    Good to know CR doesn't like joins of Stored Procedures to something else.
    But in my testcase, I finally dropped the link between the ttx file and the stored procedure. Doing so, I was able to run the report from the designer with the stored procedure as datasource instead of the ttx file. At that moment, I still had missing data in my report, while the resultset of the stored procedure returns me all the correct data !
    In the mean time, I changed the layout a bit, especially the text fields containing name, address, country and postal code and city of the customer, by just adding some spaces between those seperate databasefields. In fact, there is one text box with all those database fields concatenated one to the other.
    And by just adding some spaces in between, my report works fine again ?!
    Strange, strange, strange,....

  • Report is not fetching the data from Aggregate..

    Hi All,
    I am  facing the problem  in aggregates..
    For example when i  am running the report using Tcode RSRT2, the BW report is not fetching the data from Aggregates.. instead going into the aggregate it is scanning whole cube Data....
    FYI.. Checked the characteristcis is exactely matching with aggregates..
    and also it is giving the  message as:
    <b>Characteristic 0G_CWWPTY is compressed but is not in the aggregate/query</b>
    Can some body explain me about this error message.. pls let me know solution asap..
    Thankyou in advance.
    With regards,
    Hari

    Hi
    Deactivate the aggregates and then rebuild the indexes and then activate the aggregates again.
    GTR

  • Cursor with in clause in not fetching any rows (happens rarely)

    Hi Experts,
    Applications: Oracle Apps 11.5.10.2
    Data base version: 11.2.0.1.0
    we are running concurrent programs (scheduled every day),
    we obsereved one of cursor is not fetching any records (happens rarely);
    please refer the cursor below.
    CURSOR LCU_GET_ADJ_JN_CAT_DET IS WITH LCU_GET_ROWS_DETAILS AS(
          SELECT <columns1, columns1_1, columns1_2>
            FROM (SELECT <columns2> from table1 <conditions>            
                   GROUP BY <columns>
                  UNION ALL
                  SELECT <columns3> from table2 <conditions>
                  GROUP BY <columns>)
           WHERE (columns1_1 <> 0 OR columns1_2 <> 0)
           GROUP BY <columns>)
          SELECT *
            FROM (SELECT ROW_DET.* FROM LCU_GET_ROWS_DETAILS ROW_DET),
                 (SELECT COUNT(1) TOTAL_RECORDS,
                         SUM(columns1_1) TOTAL_CLOSING_DEBIT,
                         SUM(columns1_2) TOTAL_CLOSING_CREDIT
                    FROM LCU_GET_ROWS_DETAILS ROW_SUM)
           ORDER BY <columns>;

    Please enable trace/debug and check the log files then.
    How To Get Level 12 Trace And FND Debug File For Concurrent Programs (Doc ID 726039.1)
    How to enable and retrieve FND debug log messages (Doc ID 433199.1)
    Thanks,
    Hussein

  • Managed System Configuration ! The table does not contain any data !

    Hi,
    In Sol Man Setup , Managed System Configuration, in phase 6 - Create Logical Componets -
    There is no Product Version and Product Instance Available.
    The message is :  " The table does not contain any data "
    How can correct this problem ?
    Thanks

    Hi,
    while creating new Logical Component via SMSY , you need to specify Product first.
    e.g. if you managed system is ERP 6.0 , select Product as SAP ERP
    once you select Product , it automatically fetches information for product Version and Main Instance depending upon Product field input.
    Please check and let us know if issue still persits.
    Thanks,
    Rupali

  • ACS Report - User_Usage_Logon - not returing any data and the report never finishes

    Hi,
    i'm trying to run the User Usage report, but not getting any data output.
    i tried to open the report in the report builder to check the query,, but the query is in XML format and i'm not able to figure out the actual query that pulls out the data.
    i need help on the below :
    1. way to check , if the ACS database , does actually have any data.
    2. to pull out the actual query from the  XML data.
    thanks,
    Sameer

    Hi,
    As we only have one report experienced this timeout issue. Given this situation, we can try the following steps to narrow down the issue:
    1.Run the report directly through SSRS report manager URL to test if we still get this issue.
    2.If yes, increase the timeout limitation for this single report.
    3.As for further investigation, we can enable SSRS verbose logging by referring to the following steps:
    Enabling verbose log in Reporting Services Instance :
    To enable the verbose logging for the Reporting Services instance you have to follow below steps.
    Go to location
    C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\ReportServer\bin
    Find the ReportingServicesService.exe.config
    file, make a copy first, and then open it in editor and change the below configuration.
    <system.diagnostics>
        <switches>
          <add name="DefaultTraceSwitch" value="4" />
        </switches>
      </system.diagnostics>
      <RStrace>
        <add name="FileName" value="ReportServerService_" />
        <add name="FileSizeLimitMb" value="32" />
        <add name="KeepFilesForDays" value="14" />
        <add name="Prefix" value="appdomain, tid, time" />
        <add name="TraceListeners" value="file" />
        <add name="TraceFileMode" value="unique" />
        <add name="HttpTraceFileName" value="ReportServerService_HTTP_" />
        <add name="HttpTraceSwitches" value="date,time, clientip,username,serverip,serverport,host,method,uristem,uriquery,protocolstatus,bytesreceived,timetaken,protocolversion,useragent,cookiereceived,cookiesent,referrer"
    />
        <add name="Components" value="all:4,reportrendering:4,http:4" />
      </RStrace>
    You have to restart the Reporting Services from Reporting Services configuration manager.
    4.After enable the verbose logging, reproduce this issue again by running the report, record the timestamp when we start the report, when the error popped up.
    5.Then check SSRS log files at the following path, in the file which contain the issue time, check if there is any error message.
    C:\Program Files\Microsoft SQL Server\MSRS11.MSSQLSERVER\Reporting Services\LogFiles
    Regards,
    Yan Li
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected].

  • Do not get any data from 0CA_IS_TS_1 and 0CA_IS_TS_2 data source

    Hi all,
    We are trying to populate cubes(0CATS_C01) and (0CATS_C02) for which data sources are 0CA_IS_TS_1 and 0CA_IS_TS_2 respectively. We activated business content for these data sources. When we run these data sources in RSA3 we do not get any data even though we have data in the repective tables. We applied SAP Note :1586467, which says (Note 1586467 - Extractor 0CA_TS_IS_1 returns no data), Can you please help me out in knowing if we are missing some thing?
    Thank you,
    Bob.

    Hi,
    To use this DataSource you must have implemented Support Package SAPKH46C32, or have made the relevant corrections in SAP Note 509592.
    Pl check you have required data as mentioned below
    When transferring time sheet data to the Business Information Warehouse (BW), you must note the connection between the following data sources:
    ·        CA_TS_IS_1 (Time Sheet Data (Approved))
    Documents are written in the SAP R/3 system for Time Sheets with status 30 (approved). The documents log the changes that have been made to data records.
    Therefore, the SAP R/3 system can perform a delta update for this data source. The system only transfers newly approved data records and changes that have been made to existing data records. At the same time, the SAP R/3 system notes the date of the last delta transfer.
    ·        CA_TS_IS_2 (Time Sheet Data (Released for approval))
    The SAP R/3 system does not write documents for Time Sheet data with status 20 (released for approval). This means that changes made to these data records are not logged.
    Therefore, the SAP R/3 system always performs a complete transfer of data records that have been released for approval. The number of data records that need to be transferred usually remains constant because in the period between two transfers not only new data records are added but other data records are also approved. Therefore, system performance is not restricted.
    Thanks and regards

  • Dba scheduler jobs not shown any data in dataguard

    Hi All,
    If I query the following sql statement (select * from dba_scheduler_jobs) in primary database we can able to see the data, But I have tried the same sql statement in dataguard not retrived any data. Hence can you please help me out regarding this.
    DB version: 11.2.0.3
    OS version: 5. 10 solaris
    Note: dba_jobs view are fine in both the databases.
    Regards
    RK

    You should load the data into a third, background sheet that the user cannot see[Sheet3]. Then parse the [Sheet3] rows for data, copy the rows with data to [sheet1] and the rows without data to [sheet2]
    Something like this for each row:
        Sheets(3).Select
        Range("A2").Select
        Range(Selection, Selection.End(xlToRight)).Select
        If Application.Worksheetfunction.CountA(Selection)> 0 Then
         'copy/paste into sheet 1
        else
           'copy/paste into sheet2
         End If regards,
    Robb Salzmann

  • XL Reporter not getting any data

    <b>Hi</b>
    When I am using XL Composer and generating report using it, I am getting data what the fields I have dragged. Not getting any data when generating same report in organizer from composer except the Title field names. Before I got but now I am not getting.
    <b>STEPS Taken</b>  
                     XL Reporter Composer Tool bar
                     Generate
                     Generate(Window)(Name: given Sample & checked Generate report    then ok)
    And having another problem when generating sample reports I am getting data and when editing that report are preparing new with some fields, I am not getting any data.
    <b>Example:</b>   I have made Edit of Bank Book and placed extra field Document No,   saved the report and generated I am not getting any data except titled fields.
         In new report I have taken BP Code and sales Employee I am not getting any data.
    Please Can any one help me,   It is urgent.
    Thanks in Advance.
    <i><b>Urs
    Sindhu</b></i>

    If you did not select any "total" field (quantities, totals, etc), XL Reporter will show data only at report composer. It will not work at final XL Report itself.
    This is a normal behaviour of XL Reporter, unfortunetaly.
    If you are trying to create a simple list of records, I suggest to use Query Generator, combined to PLD in order to get a formatted report.

Maybe you are looking for

  • How to change the default color of the selected row

    hi all, I need to know how to change the default color(yellow) of the selected row in a table component.whether i need to change anything in the stylesheet.If so, where should i make the changes in the stylesheet. thanks and regards, rpk

  • Unable to use 3D functions in Photoshop CC

    I know my system meets the specs... This is the system info below... Any help would be awesome!  Thanks Adobe Photoshop Version: 14.2.1 (14.2.1 20140207.r.570 2014/02/07:23:00:00) x64 Operating System: Windows 7 64-bit Version: 6.1 Service Pack 1 Sys

  • Problem sending form with fmt:message key=" " / tag system and jsp code

    I have developt my new web page using jsp. I have done a booking form, please se below here. There are two pages, bookings.jsp and booking_sent.jsp. The page has 6 different languages so i have also used the <fmt:message key=" " /> tag system for eac

  • Help with Time Interval

    Hi, Appreciate all help on the following: Have a requirement to validate user messages that are received in a batch. Each message in a message has a start-time (date) and a end-time (date). Need to validate and ensure that there are no time overlaps

  • Why a table full scan when I've got the PK in the WHERE clause?

    There is a very complex query that I need to optimize in an Oracle 10gR2 environment. I am deconstructing it into layers to see what is causing the first bottleneck. The innermost portion is fine, with an explain plan cost of 54. With a typical value