Merge data Using Array records. Possible?

Hi,
I have a package with an array of emp%rowtype declared.
I now want to use merge. I.e if the elements of array is found in table, upate it else insert.
I am geeting compling errors table does not exist.
Can merge be used this way?
Please guide..
CREATE OR REPLACE PACKAGE UPD_emp_ALl AS
TYPE Varry_emp IS TABLE OF emp%ROWTYPE;
PROCEDURE UPD_emp(emp_rec in Varry_emp);
end UPD_emp_all;
CREATE OR REPLACE PACKAGE BODY UPD_emp_All AS
PROCEDURE UPD_emp(emp_rec in Varry_emp) is
BEGIN
MERGE INTO emp T
Using emp_rec V
ON (T.emp_id= V.emp_id and
     T.emp_dept=V.emp_dept)
WHEN MATCHED THEN
UPDATE set
T.col1 = v.col1,
T.col2= v.col2,
so on...
WHEN NOT MATCHED THEN
     Insert (T.col1,T.col2,T.col3,...)
     vALUES (V.col1,V.col2,V.col3,...);
END UPD_emp;
END UPD_emp_All;
/

Thanks Avinash.
Even if i declare a variable of same type as emp_rec,
inseide my procedure, how do i assign my new_array with values of the ones that has been passed through a parameter?
Plz help..
I get an ARRAY as a parameter in the procedure.
Need to use it to merge with a Table.
CREATE OR REPLACE PACKAGE UPD_Pemp_all AS
TYPE Varry_emp IS TABLE OF emp%ROWTYPE;
PROCEDURE UPD_emp(emp_rec in Varry_emp);
end UPD_PATCH;
CREATE OR REPLACE PACKAGE BODY UPD_emp_ALL AS
PROCEDURE UPD_emp(emp_rec in Varry_emp) is
BEGIN
FORALL I IN emp_rec.first..emp_rec.last
MERGE INTO emp T
Using dual V (also tried using select * from Table(emp_rec))
ON (T.emp_id= emp_rec(i).emp_id and
one more cond)
WHEN MATCHED THEN
UPDATE set
t.cols=emp_rec(i).cols
WHEN NOT MATCHED THEN
Insert (stuff here)
END UPD_PASTATUS;
END UPD_PATCH;
The FOR ALL is not working, thows erros cannot bind etc.. I am Using Oracle 10g Rel2
Thanks for any help.

Similar Messages

  • Mass data+use bulk itu00B4s possible ?

    hi guys,
    I have in my backend system about 200.000 register.
    I use bulk (get_detail) to bring all data using a single get_detail , instead of use get_list and after get the keys headers execute details for each key (200000 times) .
    The approach is correct ? what the best solution ? can I use mass + use bulk ?
    I need help about huge data transfer to CDS. thanks

    You can use Mass GetList and Bulk Get Detail together.
    If you are working with SP04 of Gateway1.1 to SAP Netweaver Mobile 7.10. Then you can check the code in following data objcets.
    1. Goto SDOE_WB transaction
    2. Select MAS_SRVASG data object from SWCV :: MAS_SMARTPHONE_SERVICE , 1.4 of  SAP.
    3. Select the backend adapter "MAS_SRVASG_BA" and view the Get List & Get Details BAPI wrappers which uses both these functionalities.
    In Short:
    Get List with Mass Data: This should provide set of record keys. [Using Mass Get List|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/50fa3a06-8bcb-2c10-1daf-c604a4880361]
    Get Detail with Bulk: This should have root node details as TABLES parameter. DOE will invoke the BAPI wrapper by providing number of keys in this TABLES parameter. BAPI wrapper should return the values for all these keys by populating all other tables and the root node information also. Check question 8 from following link:
    [Question about Use Bulk Detail|http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/10de86e2-41d0-2c10-7e96-e9337967f7fe]
    Regards,
    Siva.
    Edited by: Siva Satya Prasad Yerra on May 9, 2011 12:44 PM

  • "Merging data" error when syncing iPhone 5s Calendar to MacBook Pro Calendar, using Mountain Lion

    Since a failed attempt to sync data via iCloud (resulting in duplicate entries in Calendar and Contacts, missing data, and other oddities), whenever I try to sync the Calendars via iTunes, I repeatedly get the error message, "iTunes could not sync calendars to the iPhone <name> because an error occurred while merging data." The Contacts sync fine, and the backup runs smoothly. The only discussions I can find in Apple Support are dated 2009 with older systems (I'm using Mountain Lion 10.8.5, iTunes 11.1.5, iOS 7.1.1, but the problem occurred with iOS 7.0 and possibly 6.0 as well). Repairing permissions had no effect. I can't use the option to copy the Mac Calendar to the iPhone because new data are entered into the iPhone. Would appreciate guidance. I'm trying to avoid iCloud but if I have to go there to fix this, guidance for that would also be welcome.

    I have iPhone 5 with iOS 6.1.4 and iMac with Mavericks 10.9.3 and iTunes 11.2.1.
    I also got this error when I tried to sync iPhone with iMac (after a year when Apple disabled local USB cabel sync in Mavericks - thanks Apple for re-enabling it!).
    I tried a number of things to no avail. Finally I tried three things - and hurraaa, can sync now! Unfortunatelly I didn't test sync among these three steps - so don't know which one fixed it - up to you to try. My guess is that it was the 3rd step, actually
    Step 1: On my iPhone I opened Calendar and tap "Calendars" (top left). I have 7 items on the list (2 email accounts, Calendar, Home, Work, Reminders, Birthdays). Most of the calendar entries were in my Home calendar, only a few were in Work or Birthdays. I moved all of them to Home. I also checked whether there aren't any items without content.
    Step 2: On the list of Calendars I had one custom item (Birthday in my local language). This item had only one entry in it. I deleted both the single entry and the custom item as a whole - so I left the default categories only.
    Step 3: At the top of the list of Calendars there is an item "All from My Mac". I tapped this and thus enabled all of my calendar categories. Now the sync worked like a charm!
    I actually noticed that when I synced, iTunes automatically checked all items under "Sync Calendars - Selected Calendars". Even if I manually deselected all except the "Home" calendar, as soon as I started to sync, iTunes checked all items automatically. This led me to thinking that if I check "All from My Mac" item in my iPhone it might work.
    Good luck with your sync issue, hope you'll solve it.

  • Partitioning is possible with data(1 lakh records) or with out data

    partitioning is possible with data(1 lakh records) or with out data...if with data, its compulsory to stop database..and its not possible to stop, but i want to partitioning my table for increase the performance...what can i do please help me.

    "lahk" is not an internationally recognised term. Please use terminology that is recognised internationally.
    You could create a table with partitioning, copy your data into it, then drop the original table and rename the new one to the old name (bear in mind any indexes on it), though this isn't ideal if you have primary/foreign keys etc.
    Also, ensure you are licenced to use Partitioning. It is installed as part of the database as standard, but you have to have additional licence to actually use it in production.

  • Sum GETPIVOTDATA with multiple data item references using Array formula and cell references

    I'm trying to build a single formula referencing a shared pivot table. I would prefer not to create additional pivot tables etc.
    My criteria is basically the sum of multiple items in the pivot table. I am able to add multiple fields by typing item names in manually (see below Claims 1/2/3 etc) however I would also like to add a date range array in, but instead of typing them
    in I'd like to use cell values that can change dynamically, depending on previous options selected.
    My current formula is:
    {=SUM(IFERROR(GETPIVOTDATA("Count",'Settlement Pivots'!$A$1,"Loss Fin Year",$B6,"Scheme","Old Scheme","Month",{[Cell Range/Indirect Here...]},"Team2",{"Claims 1","Claims 2","Claims
    3","Claims 4","Claims 5","Major Claims","Claims Services"},"Scope","Settlement"),0))}
    Is this possible?
    Cheers

    Hi,
    Thank you for posting in the MSDN Forum.
    This forum is for developers disscussing issuses about VBA, VSTO and apps for Office. Since the issue is more relate to the end-user, I suggest you getting more effective response from
    Excel IT pro forum.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us.
    Thanks for your understanding.
    Best regards
    Fei
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • I want to be able to use airplay to stream audio to another iOS device, and then use that audio stream to be used when recording video instead of the built in microphone / microphone input. Is this possible?

    I want to be able to use airplay to stream audio to another iOS device, and then use that audio stream to be used when recording video instead of the built in microphone / microphone input. Is this possible?

    A third-party app probably cannot obtain a stream from another app. To the best of my knowledge, such a capability is not provided in the software development kit, apps being "sandboxed" from each other and so allowed to communicate only in very specific and limited ways.
    I'm not completely sure what you mean by "limitations on video capture". An iPhone, to the best of my knowledge, can natively record video only through it's built-in camera, and audio while doing video recording only through the built-in microphone or mic/headphone jack. There might be a video recording app that would allow audio input from an external device connected to the dock connector, but I'm not sure.
    Regards.

  • Recording from DAT using SB Conn

    Long time ago I have recorded DAT tapes using my Denon DTR 2000. I used digital recording from CD for that.Now I am considering using SB Connect for burning CD's (DAT?is such an old stuff?don't want to loose my recordings). Anyone has tried anything like that? Any problem with SCMS?

    BES,
    Which input on the back of the card did you use? The Line-in is the stereo input. Ensure that you have the cable fully inserted on both ends. Also check with another source such as a CD player or personal radio. This will tell you if the tape player may be sending only the left, or if the input jack is failing.
    Daniel

  • Is it possible to read digital data using an external clock (PCI-6259 M)?

    I’m using a NI PCI-6259 M Series card and trying to write my program in VC++6.0 using the functions in the DAQmx driver.
    Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?
    Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present.
    Example 1
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxCfgChangeDetectionTiming(m_ReadTrimTask,"Dev1/port2/line6","Dev1/port2/line6",DAQmx_Val_FiniteSamps, 10);
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);
    Example 2
    // Create tasks
    Status = DAQmxCreateTask("", &m_ReadTrimTask);
    // Set up read task
    status = DAQmxCreateDIChan(m_ReadTrimTask, "Dev1/port2/line0", "", DAQmx_Val_ChanPerLine);
    status = DAQmxSetSampTimingType(m_ReadTrimTask, DAQmx_Val_SampClk);
    status = DAQmxSetSampClkRate(m_ReadTrimTask, 1000.0);
    status = DAQmxSetSampClkActiveEdge(m_ReadTrimTask, DAQmx_Val_Falling);
    status = DAQmxSetSampClkSrc(m_ReadTrimTask, " Dev1/port2/line6");
    // Read data
    int32 sampsPerChanRead, numBytesPerSamp;
    status = DAQmxReadDigitalLines(m_ReadTrimTask, 10, 10.0, DAQmx_Val_GroupByChannel, result, 10, &sampsPerChanRead, &numBytesPerSamp ,NULL);

    Hello Magnus,
    Thank you for contacting National Instruments.
    "Question1: Not all functions listed in the NI-DAQmx C Reference Help seems to be supported by my NI-card, where can I find information about which of the functions that are supported?"
    The best place to look for this information would be the M Series Help Manual. There you can find the features of your PCI-6259 and what operations it supports.
    "Question2: I want to read data from a device that clock out data on the falling edge of a clock signal. The clock signal and the data signal are routed to two DIO terminals on the NI-card. The question is if it is possible to read data using the clock as a sample clock? See two code examples below that doesn’t work. In both cases 10 samples are read at once, even if the external clock is not present."
    Look at the "ContReadDigChan-ExtClk_Fn.c" example project which ships with the NI-DAQ driver. This is located at: C:\Program Files\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Digital\Read Values\Cont Read Dig Chan-Ext Clk.
    You will have to make some minor modifications to convert this to a finite acquisition, but that is simply a matter of changing the "sampleMode" parameter of the DAQmxCfgSampClkTiming() function. You will also have to route your clock signal to a PFI line and specify which line in your code.
    I hope this helps.
    Sean C.
    Applications Engineering
    National Instruments

  • How to perform merge operation using Data services designer?

    I am new here and new to Data Services Desinger as well.
    And currently, I want to do a merge operation using query transform or table comparison transform. But sadly, neither one of them is giving me what I want.
    So, wonder if you could help clarify if either one of them could achieve MERGE operation between and source and target tables?
    if positive, then how?
    PS:
    by MERGE, i mean, if data exists in target table, then only do update, else, do insert. same with the standard MERGE operation of oracle.
    If you need any more info, let me know!
    Thanks in advance.

    You can do this.
    You don't need the Tabe_Comparison transform actually.
    Just query the data you need and output the flow from your query to your target table.
    Then, you'll have to check the "Auto correct load" option: this will insert new lines and updates old ones. One checked, you can ckeck the "Auto correct load" checkbox.
    By default, BODS will know a line already exists based uppon the primary key columns of your target table. If you want to change the columns used to determine if a line should be inserted or updated, use the "Use input key" checkbox (and define some PK column in your query).
    Hope this helps
    Guillaume

  • How to upload data for me01 using lsmw recording method

    *dear expert please tell me the complete procedure for how to upload data in me01 transaction using lsmw recording method.
    Moderator Message: Duplicate post locked.
    Edited by: Vinod Kumar on May 8, 2011 7:56 PM

    Hi,
    To be honest I don't understand your question. When You execute LSMW and create project, then all steps are shown in a very clear way with good description. With which one you have problems?
    Best regards
    Marcin Cholewczuk

  • How  to transfer data using Lsmw with Recording...

    hi,
    Please let me know .How to use Lsmw to transfer data using recording.
    Thanks,
    Lawrence.

    Hi Lawrence,
    please go thru this link for LSMW data transfer techniques in PM, MM and SD modules.
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/90d90895-68dd-2a10-f096-bf8cf2e2f65b
    If u want to know in detail go thru this link
    http://help.sap.com/saphelp_nw04s/helpdata/en/87/f3ae74e68111d1b3ff006094b944c8/frameset.htm
    Hope this will be useful to u..
    Thanks
    Vijayasree

  • Merging data without set text framing - creating continuous, flowing/wrapping records

    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.

    OysterBoy84 wrote:
    Hi.
    Has anyone figured out a way to merge data without confining each record to set text frame size, hence creating a continuous flow or wrapping of records?
    I need to put in an image, followed by a text description, so I can't merge all the text into one text box.
    I can fit frame to text, then align with set gap, but this is way to time consuming and ineffective when creating a doc of several 100 pages.
    Searching Google for "indesign script combine all stories" without quotes turns up a number of links. There's a link to InDesign Secrets that describes a free script that may solve your problem.
    HTH
    Regards,
    Peter
    Peter Gold
    KnowHow ProServices

  • Is it possible to retrieve data using RFC alone with out using BAPI ?

    Hi ,
    Is it possible to connect SAP to Non-SAP systems to retrieve data using RFC alone with out using BAPI ?
    thanks
    Rama

    Hello Nelson,
    Could you please explain how this can be done. Because my understanding is that only BAPI can be used to connect Non SAP and SAP system not RFC function module.
    Regards
    Farzan

  • HT4203 I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this.  Thanks.

    I have turned off the Data use on the I-phone 4s but am told by AT&T that data is still being used for applications.  How is this possible. Can someone help me understand this. 

    I assume you are including the STIX font as part of your epub files?     
    Perhaps the folks who do this blog might be able to help -- they have done some work with font embedding:
    http://www.pigsgourdsandwikis.com/2011/04/embedding-fonts-in-epub-ipad-iphone-an d.html

  • HT4910 sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    sold my ipad today. the concern is how to access all info stored in cloud and if possible eventualy merge data into new andriod tablet. Thanks all of you who respond.

    >
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7003,127.0.0.1:7103,127.0.0.1:7104
    MatchExpression /app1
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    <IfModule mod_weblogic.c>
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    MatchExpression /app2
    </IfModule>
    <Location /weblogic>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    PathTrim /weblogic
    </Location>
    >
    This configuration is weird little bit. There is MatchExpression /app1 and MatchExpression /app2 and at the same time two <Location /weblogic> sections. Are you sure you understand what that configuration stands for?
    Try something like this ...
    <Location /app1>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007,127.0.0.1:7103,127.0.0.1:7104
    DebugConfigInfo ON
    </Location>
    <Location /app2>
    SetHandler weblogic-handler
    WebLogicCluster 127.0.0.1:7003,127.0.0.1:7005,127.0.0.1:7007
    DebugConfigInfo ON
    </Location>
    where /app1 and /app2 are contexts of your weblogic applications.
    http://download.oracle.com/docs/cd/E11035_01/wls100/plugins/apache.html
    http://httpd.apache.org/docs/2.0/mod/core.html#location

Maybe you are looking for

  • Turning a linked list into a for loop

    Im stupid and cannot figure out how to make this lp list1 = new lp(0,new lp(1, new lp(2, new lp(3, new lp(4, new lp(5, new lp(6, new lp(7, new lp(8, new lp(9, null)))))))))); into a for loop, i know its simple, i finished my first linked list assignm

  • Help with Aperture 3 printing to Epson R1800 please

    No I haven't got the wrong forum, I think I will get the best answer here. I am a fully paid up member of the Lightroom 2 club and like to use both as I am sure others here do. I cannot get a good print from Aperture 3, there is always a slight magen

  • TS3212 Downloading iTunes 10.7

    I am using a Mac and I downloaded the latest version of iTunes, and iTunes keeps telling me I need to download 10.6 or later? And it will not allow me to back up my phone. I have restarted my computer, and I get the same message. Help!

  • Send idoc when bp created and receive idoc from external

    I am sap abap developer and  am new to CRM technical side. *****my requirement is : when we create business partner and save it then i need to send that as an idoc to 3rd party theru ESP system. I planned to create BP using BAPI BUPAFS_FS_CREATE_FRM_

  • Time Machine does not start after external hard drive is connected

    Time Machine does not start after external hard drive is connected