Function issue-Data is getting highly duplicated PLSQL

Hi
Edited by: user_7000011 on Apr 8, 2009 12:00 PM

Excellent; mark your unanswered question as answered, and you expect that to help you get an answer?
Why do you loop twice, instead of having a single select that gets all your information in one fell swoop?
Why the need for such a complicated nested table type? What is the requirement that's caused you to do it that way?
You haven't provided any sample input data, or table information. Ideally, we'd need a test case that is simple and demonstrates your problem.

Similar Messages

  • Has anyone else had a problem with data? after updating my phone to the new update, i have all this data, and keep getting notifications that my data is getting high. i never had this problem before.

    has anyone else had a problem with data? after updating my phone to the new update, i have all this data, and keep getting notifications that my data is getting high. i never had this problem before.

    fair enough.  No need for any unnecessary posts either.  You issue had been addressed ad nauseum already in this forum had you bothered to search this forum (as forum etiquette would dictate) before posting.
    In any case, I hope that your problem was solved.

  • REPALCE() function issue. String getting truncated.

    Hi,
    I am using ORACLE DATABASE 11g. I am facing a very strange problem. I have a string in an variable when i print that sting i can see that the string is correct but after applying a replace function on to it when i print the string the string is incomplete.
    Details are as follows :- In the code i am getting some DDL statement (alter table ) , this is the difference between the 2 compared tables. Then I want to place ';' at the last of each line and keyword 'BEGIN' at start and 'END;' at the last. I tried to do this with replace() function but the output string is shot than needed. Please follow the code :-
         dbms_output.put_line('V_TAB_DIFF_ALTER:=' || V_TAB_DIFF_ALTER); -- Print the original string. Variable datatype used varchar2(32767)/CLOB
         dbms_output.put_line('SOURCE Size := '||Length(V_TAB_DIFF_ALTER)); -- Size of the original string.
          V_TAB_DIFF_ALTER_REP :=V_TAB_DIFF_ALTER; -- Placed the sting in new variable.
          V_TAB_DIFF_ALTER_REP := 'BEGIN '||replace(V_TAB_DIFF_ALTER_REP,CHR(10),';') || ' END;'; -- Used the replace function and concatenate string.
         -- EXECUTE IMMEDIATE V_TAB_DIFF_ALTER_REP;
    dbms_output.put_line('After replace := '||V_TAB_DIFF_ALTER_REP); -- Now again printing the sting but this time its not proper.The output is as follows :-
    V_TAB_DIFF_ALTER:=ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("BENEFICIARY_ACCOUNT_ID" VARCHAR2(32))
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("HAS_OFFSET_ACCOUNT" CHAR(1) DEFAULT 'N')
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("MARKET_ENTITY" VARCHAR2(40))
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_PREVIOUS_STATUS" VARCHAR2(50))
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVIOUS_STATUS" VARCHAR2(50))
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_COUNTER" NUMBER)
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_DATE" DATE)
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("STMT_CYCLE_DAY" NUMBER)
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVENT_EXCESS_FLAG" CHAR(1))
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_START_DATE" DATE)
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_EXPIRY_DATE" DATE)
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_SANCTIONED_AMT" NUMBER)
    SOURCE Size := 1830  -- Length of original string.
    After replace := BEGIN ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("BENEFICIARY_ACCOUNT_ID" VARCHAR2(32));
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("HAS_OFFSET_ACCOUNT" CHAR(1) DEFAULT 'N');
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("MARKET_ENTITY" VARCHAR2(40));
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_PREVIOUS_STATUS" VARCHAR2(50));
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVIOUS_STATUS" VARCHAR2(50));
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_COUNTER" NUMBER);
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("FUTURE_AS_OF_DATE" DATE);
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("STMT_CYCLE_DAY" NUMBER);
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("PREVENT_EXCESS_FLAG" CHAR(1));
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_START_DATE" DATE);
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_EXPIRY_DATE" DATE);
      ALTER TABLE "NGPR2ST"."FLX_DD_ACCOUNTS_B" ADD ("TEMP_EXCESS_SANCTIONE                ------ Here the remaining string is missing.
    NEW Var. Length  :- 1862 -- Length of the new string but still the printed string is not the perfect one. It only prints 1830 characters, rest are not printed.
    {code}
    Here you can see that the sting in after replace in actually short and will give error when trying to execute. As you can also see that length of new string is more i.e. 1862 but its reading and writing only 1830 characters => which is the actual size of original string.
    Variable datatypes used varchar2(32767) and CLOB. Faced issues in both the cases.
    Its very obvious that when i am trying to replace a few things then I can add a bit more to it. Why is it only reading or writing only the 1830 character string not the whole 1862 string ??? How can i get the size as 1862 but not the whole string ??
    Let me know any solution on this ...
    Thanks in advance.
    Edited by: VIRU on Nov 17, 2011 10:24 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    Thanks William for your reply.
    I have tried with increasing the buffer size by
    exec dnms_output.enable(40000000);but still no improvements.
    I was able to successful print long strings than this one but when it comes to format it with replace i am facing this scenario.
    Let me know if you have any idea.

  • I'm in Canada and I have American friends, can I iMessage those friends without having my data bill get high? Can I iMessage them without wifi?

    Help!!

    Exchanging iMessages is similar to exchanging email. The same is required and applies with both.
    You need an internet connection via an avaialble wi-fi network, or via your cell phone carrier's cellular network.
    You can exchange iMessages when connected to your cell phone carrier's cellular network which will count against your data allowance. Text only isn't much data, photos will be more, and video even more. 

  • Ore.pull and ore.get function issue

    I have a code where i specify which table to pull in to a data frame during run time.
    Wrapper = function(table_name){
      data = ore.pull(table_name)
    table_name is a string variable.
    but instead of pulling the table the string value is passed to variable data.
    What is the work around if i want it to pull the table with name given in table_name variable?
    I tried ore.get function
    Wrapper = function(table_name){
      data = ore.get(table_name,schema_name)
    instead of getting a data frame i'm getting a value variable.
    Please help me out.
    Regards,
    Prasun

    Hi Prasun,
    You first need to get the ore.frame object, and then pull the data to the client.
    Wrapper = function (table_name) {
      ref <- ore.get(table_name)
      data <- ore.pull(ref)
      data
    Mark

  • Insert of data getting missed/duplicated while using Cursor

    Hi all,
    Greeting !!
    I got a strange issue with cursor usage in a SP . Below is the cursor detail.
    Basicially the SP pulls around 2,25,000 records to a temp table(#TMP_ADJ) from there cursor picks and inserts to a physical table(B_SHEET) with some conditions.
    Recently we are facing issues in records getting inserted to B_SHEET , the strange part is if this SP is called in a specific period of time i.e every day this job runs at 2 PM GMT and we encountered some of the records getting missed to insert in to B_SHEET
    table and some time the record is getting duplicated. Around 200-300 records are getting missed.
    we retriggered i.e ran the SP again but this time it was fine, so we confrim that there is no issue with data.
    Later we postponed the same job to get triggered at 3 PM GMT post which we dint encounter the problem.
    Tough this seems to be not a problem with cursor logic, but i need experts help to identify the exact issue what happens at when the job is triggered at 2 PM GMT.
    There has been no change recently done on the SP and the same SP was running fine for past 3-4years.
    1 . What are the checks that needs to be done that affects CURSOR.
     DBA has confirmed that CPU utilization / temp db memory are fine during the period of time. And no issues with Data since the second run of the same SP is fine.
    Thanks.

    If you want suggestions out of the blue, the only recommendation I can give is that you should make sure that the cursor declartion reads:
    DECLARE cur CURSOR STATIC LOCAL FOR
    The default cursor type is dynamic. Dynamic cursors are difficult to understand and rarely perform well.
    Apart from this specific advice, I can only give generic advice since you don't share the code.
    It is a common mistake to believe that just because a piece of code produces the expected result that the code is correct. However, the code may only work as intended because of happenstance. For instance a query may be non-deterministic and produces different
    results because of the query plan.
    Other reasons for "works most of the time, but fails some times" is poor error handling, where you fail to consider errors or handle them inappropriately. In a cursor loop, a common error is also to fail to initiate local variables in the beginning
    of the loop, so that they retain their values from the previous iteration.
    What I like to emphasise once more is that just because the code works most of the time does not mean that it is correct. The fact that it under some circumstances produces incorrect results, carries much more weight. There is at least one flaw in the code
    - you only need to spot it.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Why do I get data rate too high error after capture and save? (using AJA Kona)

    I record(capture) about an 70 min program with Adobe premiere CS5 once a week. About a year ago I got the error *data rate too high" when stopping "capture" when saving program to Video HD(2TB). The video recorded was OK but after about 15 min the audio was out of sync and garbled. I thought I had found the problem by defragging the video drive. I have not had any problems for about 50 weeks.. until this week-it happened again. I know the video drive(2TB) was defragged and only half full. I was able to recover the program since I back up the program on a DVD but had to go through a lot of problems massaging it since I send the program to a local ABC broadcast station in 16/9 SD and the DVD is rescored in 4/3 .
    I have the CS5 program on a separate 2.5 GB drive. I am running Win7pro and have a RAID series of Intel Xeon ES410 processors.
    Any help as to why I get this "Data Rate too High" when saving program would be appreciated.
    Thanks much!

    I have three Mitsubishi broadcast quality cameras (two HD -waiting on money for switcher and 3rd HDcamera). They feed to their camera control untints and then to a switcher and then into video computer and the C5S. I probably am not answering your question. I can access the computers from my home(I also have a CG computer). Is there some way I can tell you from the C5S program which the info you need? I have it ready to record for next week.
    I know how to manipulate various functions but I do not know all the ins and outs of the Premiere settings-an IT man set those up for me two years and he is no longer available.
    Thanks

  • Issue dates of only parent publications are getting reflected in a subscriptions order.

    Dear All,
    Could you please help me with a development pertaining to Issue dates of only parent publications are getting reflected in a subscriptions order.
    Synopsis:
    An offer has been created by me using combination of two publications namely A and B.
    The Combination has been defined by creating a mix type (JDMPS0) by keeping A as a parent publication and B as a child publication.
    When a subscriptions order gets created for this combo offer, the order delivers the issues of both the Publications as per their respective issue dates. The deliveries of the same can be observed in table (JVVLFZUO)
    The Issue crops up when I wish to terminate this order over the issue dates of the child publication. This is because issue dates of only parent publications are getting reflected in a subscriptions order (JK03).
    Could you please suggest a development where in I'll be able to view issue dates of all publications.
    Regards,
    Himanshu

    Hi,
    Please sit with your PP Consultant.
    Muzamil

  • Which SQL function to use to get previous month's data?

    Hi
    The reporting need: Display of two month's payroll run results....current and previous (based on the parameter passed) in Oracle Discoverer.
    Data source: A table in which run result values are stored. Of course to be linked to number of other tables.
    Can somebody guide me on which SQL function to use to get the data for previous month?
    Secondly, as Discoverer does not support parameters, I cannot put parameter in the query itself. I'll be applying parameter later while generating my report.
    Please advice.
    Thanks and regards,
    Aparna

    It's not very clear in my head... but you can try :
    SQL> select * from test;
    ENAM        SAL DT
    TOTO       1000 30/05/06
    TOTO       1001 20/04/06
    TOTO       1002 11/03/06
    TATA       2000 30/05/06
    TATA       1500 20/04/06
    TUTU       3500 30/05/06
    6 rows selected.
    SQL> select ename, dt, sal currmonth,
                case when trunc(lag(dt,1,dt) over (partition by ename order by dt),'MM') = trunc(add_months(dt,-1),'MM')
                     then lag(sal,1,sal) over (partition by ename order by dt)
                     else null end prevmonth
         from   test
    SQL> /
    ENAM DT        CURRMONTH  PREVMONTH
    TATA 20/04/06       1500
    TATA 30/05/06       2000       1500
    TOTO 11/03/06       1002
    TOTO 20/04/06       1001       1002
    TOTO 30/05/06       1000       1001
    TUTU 30/05/06       3500
    6 rows selected.
    SQL>
    SQL> Nicolas.
    Just an additional question : do the previous month is current month-1, or is there hole in month suite (e.g. the previous month can be current month-2) ?
    Message was edited by:
    N. Gasparotto

  • What is the table name for getting Last Receipt  & issue date of material?

    Hi Friends,
    What is the table name for getting Last Receipt  & issue date of material?
    *Case 1:*
    Here, I am running report in May 2008. But, if there is no goods receipt for the respective material since last 13th March 2007.
    Then in this case Last goods receipt date should be 13th March 2007.
    Please guide me.
    Regards
    Siva

    I checked MSEG table. But, I didn't find any field for date.
    Can you tell me field name.
    Regards
    Siva

  • Photoshop Elements diagog box is frozen and I can't get it to close.  Do I delete and up date to a high version?  I've been getting along fine until yesterday - not sure what happened

    Photoshop Elements 3 dialog box with picture and patent numbers - not sure how to get it fixed.  It's in an infinite loop - have rebooted to no avail.  Should I update to a higher version after deleting this version?

    Tried the resetting options, but can't even get to preferences - nothing 
    will open.  May have to find my Version 3 CD, or delete Photoshop 3 and get 
    a higher version.
    In a message dated 1/4/2015 11:35:36 P.M. Eastern Standard Time, 
    [email protected] writes:
    Photoshop  Elements diagog box is frozen and I can't get it to close.  Do I
    delete and up date to a high version?  I've been getting along fine  until
    yesterday - not sure what happened
    created by RKelly_ (https://forums.adobe.com/people/R_Kelly)  in 
    Photoshop Elements - View the full  discussion
    (https://forums.adobe.com/message/7065312#7065312)

  • Incorrect goods issue date

    Hi All,
    When we run availabilty check, the goods issue date falls on non-working days. We have used Enhancement APOSC002 in APO system to populate shipping calender.
    Any suggestions please.
    Thanks,
    Krishna

    > I have maintained goods issue date in delivery and am creating an invoice for the same delivery, when an idoc is getting triggered am not getting goods issue date in invoice idoc the qualifier would be 035..has anyone come across this issue, all the help will be highly appreciated and rewarded..
    Maybe, you can use custom function exit to transfer date to Idoc? Have you looked at this note:  [Note 127178 - Questions about user exits in IDoc INVOIC01 (FI)|https://service.sap.com/sap/support/notes/127178]
    Regards,
    Jakub

  • Maintenance Order TECO date must not be befor the Permit Issue Date

    Hi Friends,
    I have a genuine requirement like " Maintenance Order TECO date must not be befor the Permit Issue Date ".
    The requirement is System shall issue a message if TECO date is before the Permit issue date.
    Guys pls help me onthis.
    Thanks & Regards,
    krishna

    Krishna,
    What you can do is use a User Exit: IWO10004 Maintenance order: Customer check for order completionand check that the reference date of completion, also you would need the approval date for the assigned permits in Order by using the table "IHSG" or a relevant function module to get the details of the Permit approval date. After you have the permit approval date, you can compare it with the reference date of  completion and if mismatched then generate the relevant error message.
    regards,
    Muhammad Usman Kahoot

  • Calculation of goods issue date in scheduling agreements with routes

    Hello together,
    i have a problem with the calculation of goods issue date in scheduling agreements when we use route, because the system ignore the days of transit.
    Example:
    We had customized the route 4711 with a transit time of 3 days. This route would be related to a scheduling agreement. But this setting has no influence to the calculation of the goods issue date for the schedules. The same happens with loading date and so on.
    Can anyone give me a tip, which setting is additional necessary?
    Regards
    Andreas Walter

    Hi,
    check the following settings
    1, Route determination Path : IMG>sales and distribution>Basic function>Routes>Route determination
    2, Activate the route Determination for your sales document type in following path :IMG>sales and distribution>Basic function>Routes>Route Schedule Determination-->Schedule with route schedule for sales document type
    3, Maintain Delivery scheduling and transportation scheduling in the following path:IMG>sales and distribution>Basic function>Delivery scheduling and transportation scheduling>Maintain Duration
    Regards
    Senya

  • Data not getting uploaded in the AQ table.

    Hi All
    We have one issue with the AQ tables.
    The scenario is like we first send data from Oracle to SOA and then to a third party tool.
    For this we first populate data in one custom payload table and then in to one custom AQ table.
    Now the data is getting updated in the paylaod table and XML is getting generated, but it is not getting interfaced to the third party tool.
    Reason : Data is not getting populated in the custom AQ table from where SOA picks the data and interfaces it ti the third party tool.
    Error is a custom one :
    While equeing the data using the below statement
    l_chr_corrid := p_in_event.getvalueforparameter ('CORRID');
    since the CORRID Id is null it gives us the message :Correlation ID has not been set for the payload.
    Part of the code for setting WF parameters :
    l_chr_corrid_val := l_chr_event_name || '.order';
    wf_event.addparametertolist (p_name => l_chr_corrid_name,
    p_value => l_chr_corrid_val,
    p_parameterlist => l_param_list
    l_local_event.setcorrelationid (l_chr_corrid_val);
    l_chr_rule_ret := wf_rule.default_rule (p_in_subscription_guid, l_local_event); -- Returns success
    This is quite urgent , hence kindly help us find a sollution to this issue.
    Thanks in advance
    Trupti

    Looks like you havent populated the correlation id. To make sure this is unique use the conversationID, or GUI, etc.
    Not sure what version you are on. If 10g look at this note (obviously chnage from file to AQ, concept the same):
    http://middleware1.wordpress.com/category/adapters/page/2/
    If 11g you should be able to see the property when you edit the invoke activity, there is a tab called properties.
    cheers
    James

Maybe you are looking for

  • WRT54G v6, Weird Problem

    My new WRT54G router was working fine for a couple weeks, both wired and wireless performance, on one desktop(wired) and two laptops(wireless). Recently I've been having a strange problem with the wireless; it connects with an excellent signal, and I

  • Problem with jsr168 war uploads and WSRP

    Hi, I have tried using the JSR168 .war Import Utility to upload a jsr168 portlet in .war file format. This portlet works in Jetspeed2. The utility is generating an EAR file and deploying it without problems and it is then the intension that you acces

  • Slow and erratic speeds

    I have recently moved to BT Broadband (Option 3) after several years of rock solid 24mbit speeds from another provider. I live very close to the exchange and have always synced at maximum or close to maximum speed. ADSL2+ isn't yet available at my ex

  • Icm/authfile parameter not set

    Dear  All , when i changed the instance profile for icm/authfile parameter , the standard value  D:\usr\sap\ECC\SYS\global\security\data\icmauth.txt but the problem i'm facing is that i could not find this file (icmauth.txt) in O.S level . please adv

  • Netweaver Developer Studio for ABAP based on Eclipse

    Hi together, on TechEd in Las Vegas I saw a quick presentation about developing ABAP in Eclipse. It looked very promissing. Unfortunately I haven't found the Netweaver Developer Studio for ABAP. Do you have any further information about the availabil