Can XML Update more than One Table in one call?

Hello,
I had a quick question. I have a client who is using both Oracle and SQL. They have an app developed in C sharp with XML whichs runs against SQL and want to port to Oracle.
In SQL one XML statment can update multiple Tables. Can we do that in XML in Oracle? I know, we can't do that using PL/SQL.
Subhash

Anupama,
Thanks for offering your help. I have attached the sample code. It works fione on SQL. I need to make sure it works on Oracle as well.
Subhash
ALTER PROCEDURE dbo.spx_PutPackage
@XMLText text
AS
DECLARE @hDoc int,
@Package_Tbl_Id Int,
@Package_Type_Id Int,
@Binder_Id Int,
@Package_Name Varchar(256),
@Package_Status_Type_Id Int,
@Package_Approval_SeqNo Int,
@Package_Current_Issue Int
BEGIN
--******************************** DELETE ********************************
EXEC sp_xml_preparedocument @hDoc OUTPUT, @XMLText
DECLARE xml_cursor
CURSOR FOR
SELECT Package_Tbl_Id,Package_Type_Id,Binder_Id
FROM openxml(@hDoc,'/ROOT/Package[@Package_Status="D"]')
With Package
OPEN xml_cursor
FETCH NEXT FROM xml_cursor INTO @Package_Tbl_Id,@Package_Type_Id,@Binder_Id
WHILE @@fetch_status = 0
BEGIN
DELETE Package WHERE Package_tbl_Id = @Package_Tbl_Id
--If this package is an addendum, a trigger decrements the Current_Addendum_Number
--when the addendum table is deleted as part of the cascade delete.
FETCH NEXT FROM xml_cursor INTO @Package_Tbl_Id,@Package_Type_Id,@Binder_Id
End
Close xml_cursor
DEALLOCATE xml_cursor
--******************************** INSERT ********************************
DECLARE xml_cursor
CURSOR FOR
SELECT
Package_Tbl_Id,
Package_Type_Id,
Binder_Id,
Package_Name,
Package_Status_Type_Id,
Package_Approval_SeqNo,
Package_Current_Issue
FROM openxml(@hDoc,'/ROOT/Package[@Package_Status="I"]')
With Package
OPEN xml_cursor
FETCH NEXT FROM xml_cursor INTO
@Package_Tbl_Id,
@Package_Type_Id,
@Binder_Id,
@Package_Name,
@Package_Status_Type_Id,
@Package_Approval_SeqNo,
@Package_Current_Issue
WHILE @@fetch_status = 0
BEGIN
INSERT INTO Package (Package_Tbl_Id, Package_Type_Id, Binder_Id, Package_Name,
Package_Status_Type_Id, Package_Approval_SeqNo, Package_Current_Issue)
VALUES(@Package_Tbl_Id,
@Package_Type_Id, @Binder_Id, @Package_Name, @Package_Status_Type_Id,
@Package_Approval_SeqNo, @Package_Current_Issue)
FETCH NEXT FROM xml_cursor INTO
@Package_Tbl_Id,
@Package_Type_Id,
@Binder_Id,
@Package_Name,
@Package_Status_Type_Id,
@Package_Approval_SeqNo,
@Package_Current_Issue
End
Close xml_cursor
DEALLOCATE xml_cursor
--******************************** UPDATE ********************************
DECLARE xml_cursor
CURSOR FOR
SELECT
Package_Tbl_Id,
Package_Type_Id,
Binder_Id,
Package_Name,
Package_Status_Type_Id,
Package_Approval_SeqNo,
Package_Current_Issue
FROM openxml(@hDoc,'/ROOT/Package[@Package_Status="U"]')
With Package
OPEN xml_cursor
FETCH NEXT FROM xml_cursor INTO
@Package_Tbl_Id,
@Package_Type_Id,
@Binder_Id,
@Package_Name,
@Package_Status_Type_Id,
@Package_Approval_SeqNo,
@Package_Current_Issue
WHILE @@fetch_status = 0
BEGIN
Update Package
SET
Package_Type_Id = @Package_Type_Id,
Binder_Id = @Binder_Id,
Package_Name = @Package_Name,
Package_Status_Type_Id = @Package_Status_Type_Id,
Package_Approval_SeqNo = @Package_Approval_SeqNo,
Package_Current_Issue = @Package_Current_Issue
WHERE Package_tbl_Id = @Package_tbl_Id
FETCH NEXT FROM xml_cursor INTO
@Package_Tbl_Id,
@Package_Type_Id,
@Binder_Id,
@Package_Name,
@Package_Status_Type_Id,
@Package_Approval_SeqNo,
@Package_Current_Issue
End
Close xml_cursor
DEALLOCATE xml_cursor
EXEC sp_xml_removedocument @hDoc
exec spx_putattachment @XMLText
End
SET QUOTED_IDENTIFIER ON

Similar Messages

  • Can I update more than one iPad and iPhone from the same MacBook pro?

    Can I update more than one iPad and iPhone to ios 5 from the same MacBook pro? Our family has one MacBook pro and several iphones and ipads.  No one wants to lose their iTunes music or contact list or calendars.

    Yes, but you will want to think it through before you do it.
    The computer will become the "master" device, holding the definitive collection of music, photos, contacts, etc., and each iPad or iPhone will get a copy of what's on the computer. So if  everyone has different collections of music or photos that you all want to keep separate from each other, you'll want to set up different accounts on the MacBook Pro. To do that, go into "System Preferences" and click "Users", then click the "+" to create a new account for each person who needs their own set of files.
    That way you can each log in to your own MacBook account before you sync your iPhone or iPad, and everyone has their own copy of iTunes and their own iPhoto. If you happen to plug in an iPhone while logged into someone else's account, you just click "don't sync" (the 1st time only, it will remember after that). Sharing the same files becomes tricky, so this is only the best method if you want to keep things 100% separate.
    On the other hand, if you all have your music and photos mishmashed together on the MacBook anyway or just don't care about keeping things separate, just go ahead and sync your iPhones and iPads without setting up new accounts. But in this case, you should create playlists and photo albums in iTunes and iPhoto. Then plug in an iPhone, click on it's icon in iTunes, and change the settings for Music, Photos, etc to only sync the playlists that you want on that device. Repeat for each one. They'll all remember their own settings, and continue to sync with their designated playlists or albums.
    What you cannot do is use more than one computer with a single iPhone. That will wipe out the music and photos that were on it already, replacing them with the ones on the second computer.

  • How can i join more than 20 tables which contains more than 5 lacks records

    how can i join more than 20 tables which contains more than 5 lacks records

    If you're trying to join 20 tables I would check:
    - Are all the joins necessary. It's easy sometimes to just join to another table because you're unsure as to whether it's required.
    - What sort of application is it? 20 joins seems a lot to me. Are you trying to achieve too much with one query? Is it possible to break the problem down?
    - If it is necessary to join so many tables then force the use of hash joins in the query, especially if you're processing a lot of data and want the best throughput. If you want a quicker response, this will not be a appropriate.

  • Can I authorize more than five computers on one iTunes account?

    Can I authorize more than five computers on one iTunes account?  I have several PC's being used as HTPC's and I'd like to use iTunes on all of them.  My three iPhones and three PC's have taken up all of my authorizations.  If I need to create a second iTunes account, can it be linked to my existing account?

    Todd, some suggested reading, none of which looks to me as requiring authorization as an iTunes device for Apple TV:
    Over view
    AirPlay Mirroring
    Troubleshooting

  • How can I sync more than 100 ibooks at one time.  The new IOS killed my legal collection of 4000 books and now I cant sync.

    How can I sync more than 100 ibooks at one time.  The new IOS killed my legal collection of 4000 books and now I cant sync.
    <Edited by Host>

    How can I sync more than 100 ibooks at one time.  The new IOS killed my legal collection of 4000 books and now I cant sync.
    <Edited by Host>

  • How can i update more than one table at a time?

    i would like to update more than one table at a time. In Java Studio creator2 how can i do table updation?

    Hi,
    Please go through the below thread might be of help to you.
    http://forum.sun.com/jive/thread.jspa?forumID=123&threadID=51839
    RK

  • HT204380 Can you have more than two people on one facetime call at a time?

    Can you have more than two ipad/iphones on one facetime call at a time?

    Sure, you have have more than one person using each device
    But, only two devices can connect using Facetime.

  • How Can I Update More Than One Ipod on the Same Computer?

    I've had my 30G Ipod since April 2006. For Christmas 2006, I bought my sister a 2G Ipod. I cannot figure out how to put songs on her Ipod as we both share the same computer and Itunes Library. I've already asked Ipod Corporate for help via their FAQ section regarding more than one Ipod operating with the same computer, but their advice (which told me to create a playlist small enough for her Ipod and checked as a shared playlist) did not work for me. I'd really appreciate any help with my problem. Owning an Ipod but being unable to listen to it, as I'm sure many people would agree, is quite annoying.

    There are basically two ways of using multiple iPods on a computer and these involve:
    a) Sharing a single iTunes library and user account.
    b) Creating multiple user accounts and having separate libraries.
    Sharing a Library
    If you want to share the one library, you can set either or all of the iPods so that they only get updated with only certain playlists (you can update from more than one if you wish):
    Loading songs onto iPod automatically - Windows
    Choosing the update option "Sync Music - Selected playlists" allows you to create a playlist specifically for the iPod and drag the tracks you want into it. If you tire of the list and want to change it, you just add or remove the songs you don't want. The ones you take out out remain in the library to be used some other time if you choose. You can read more about playlists at these links:
    iTunes: Creating playlists of your favorite songs
    How to create a Smart Playlist with iTunes
    However since you seem to have a problem with that method you can choose to update any or all of the iPods manually and just drag whatever content you want to them: Managing content manually on iPod
    Separate User Accounts
    Another option is to create a separate User account for each person on your PC or Mac. Different accounts by definition would give you completely separate libraries. Each account has it's own iTunes folder, Library and iTunes Music folder and you load it with CDs etc just as you did with your original one. The iPod can be set to update however the owner chooses, sync all, manual or sync specific playlists
    If you are unfamiliar with setting up Windows user accounts you can read more here: Using Windows XP User Accounts

  • How can I sync more than 10 devices to one apple id for itunes

    We have a lot of apple devices in our family, more than 10.  We all want to share apps and music outside of our house, but I don't know how to do it.  I have iTunes Match, but once again - only 10.

    Each person should get their own Apple ID so they can individually sync and maintain their personal files and other data. If you have but one computer to share, then each user should have a separate user account on the computer.
    Although your computer can handle more than one user account, iDevices are intended for a single user, not multiple users sharing the same account or Apple ID.

  • Can I send more than 1 picutres at one time?

    For instance, I have taken 2 pictures in camera roll, can I send them off in 1 email? Or I need to send it one by one separately?
    Thanks.

    At the present time the phone limits you to one picture per email. Send a reguest to apple's feedback page and let them know. (http://www.apple.com/feedback/iphone.html)

  • Can i fire more than two quiries in one program

    hi
    i have write some java code for searching recors fron ttable
    but i want the query will contains all the possiblities
    what i have written is nit working well

    what i have written is nit working wellThis is also true for your post here.
    What are you talking about?

  • How to update more than one table using EO

    Hi frnds,
    Can someone provide me a doc/link which explain in detail how we can we update more than one PL/SQL tables using entity objects(on which VOs are based).
    Till date I have been doing this using PL/SQL procedures but now my requirement is to achieve it thru EO.Someone suggested me use VL to achieve plz help
    Thanks & Regards,

    Hi,
    That would be very nice of you,plz send me the docs and also send me similar docs that would be beneficial for a beginner like me.
    My id is [email protected]
    Thnx for your time.

  • Can I install more than one PCI1409 in a PC

    I have to capture two RGB sources for identical treatment. Can I install more than on PCI1409 in one PC ? Is there a limitation of the number of cards ?

    You can install multiple cards in a single computer. The main limitation is bandwidth of the PCI bus. I am not sure exactly what that limit is, but I don't think you would have any problem acquiring two RGB signals at normal rates.
    If you have to process the images as you acquire them, you could run out of processing power, though.
    Bruce
    Bruce Ammons
    Ammons Engineering

  • How can I authorize more than 5 computers?

    With the purchase of new laptop, I have reached the limit of 5 authorized computers. However, only 2 are in use; the other 3 have been passed on to fellow employees. Their hard drives were completely erased, so there is no risk of anyone else using the authorized itunes accounts. How can I get additional authorizations?

    You can't get more than five at any one time. But if you've reached five authorizations for that account, there will be a button in your iTunes Store account information that will allow you to deauthorize all systems associated with that account. Log into your iTunes Store account and you should see it. You can then reauthorize the computers you're using now.
    Next time don't forget to deauthorize the systems before you let them out of your hands. You can only do the mass-deauthorization once per year.
    Regards.

  • WVC54GCA Monitoring Camera software (more than 9 cameras at one time)

    Can you view more than 9 cameras at one time using a WVC54GCA cameras? Current software only allows for a max of 9 cameras
    Is there any other software out there?
    Thanks
    Mario
    Solved!
    Go to Solution.

    With the Linksys Camera Utility you have a Limitation of viewing of only 9 cameras at a time. If you wish to view more then 9 camera then you can try to download the Camera viewing software which will do that work for you. In this case you need to Google around and you will find a Camera software which will solve your purpose.

Maybe you are looking for

  • Require fields at time of booking (not before)

    I have a requirement to require certain fields before a sales order can be booked. However, my client does not want the fields required in order to just save an entered order. Does anyone have any ideas of how to accomplish this without customizing t

  • Incoming Invoice Create from data without posting the GR details

    Hi Experts, I am trying to create a MM invoice (MIRO) using the BAPI BAPI_INCOMINGINVOICE_CREATE and I do not want to post GR details in this invoice. But I have not been able to see the face of success yet. Following are the parameters that I pass t

  • Mac noob needs monitor help! how do I...

    I was given a 2003 imac as a gift. I've always had PCs but was thrilled to have my first mac to play around with. The bad news is that about half the time the monitor doesn't work!!! I turn the computer on and the screen comes on for a split second a

  • Sending RFC to WS with HTTPS

    hello I have a scenario RFC to WS synchronic with HTTPS. when connection to the WS I am recieving an error (see below) it looks like a problem in the MUST UNDERSTAND parameter. does any one know this problem and know how to solve it? Exception Data :

  • Apple script menu bar

    I am wondering how to get rid of the little applescript menu bar item in itunes. Thanks for the help!