Can we use Begin Tran and commit Tran

Hi,
Can we use Begin Tran and commit Tran in sql user defined fuctions?
Thanks,

That's also documented:
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_5009.htm#SQLRF01208
"Restrictions on User-Defined Functions User-defined functions are subject to the following restrictions:
* User-defined functions cannot be used in situations that require an unchanging definition. Thus, you cannot use user-defined functions:
o In a CHECK constraint clause of a CREATE TABLE or ALTER TABLE statement
o In a DEFAULT clause of a CREATE TABLE or ALTER TABLE statement
*In addition, when a function is called from within a query or DML statement, the function cannot*:
o Have OUT or IN OUT parameters
o *Commit or roll back the current transaction, create a savepoint or roll back to a savepoint, or alter the session or the system. DDL statements implicitly commit the current transaction, so a user-defined function cannot execute any DDL statements.*
o Write to the database, if the function is being called from a SELECT statement. However, a function called from a subquery in a DML statement can write to the database.
o Write to the same table that is being modified by the statement from which the function is called, if the function is called from a DML statement.
"

Similar Messages

  • Using BEGIN TRAN for a SELECT statement

    I have inherited a number of stored procedures that are using explicit transactions and structured error handling. 
    I have had to review the procs due to deadlocks occurring and have found that many of them are SELECT statements. 
    The syntax is like this:
    BEGIN TRAN
       BEGIN TRY
    SELECT ####
     END TRY
      BEGIN CATCH
      IF @@TRANCOUNT >0
    BEGIN
    ROLLBACK TRAN
    INSERT ErrorLog
    XXXXXX
    END CATCH
    IF @@TRANCOUNT > 0
    BEGIN
    COMMIT TRAN
    END
    It is very obvious that there is no purpose for explicit transactions in the select, but I am wondering if this could be a factor in the deadlocks.  From what I tested using BEGIN TRAN for a select still only uses a shared lock. 
    Is it possible that this is a factor in the deadlocks?
    David Dye My Blog

    There is no need of explicit transaction in select statement what exactly would you want to rollback, nothing. Although you might use error handling depending on complexity of select involved.
    Plus drawbacks is locks would be held for longer duration which MIGHT provide some help in deadlock
    Please mark this reply as answer if it solved your issue or vote as helpful if it helped so that other forum members can benefit from it
    My Technet Wiki Article
    MVP

  • How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?

    With Acrobat 6.0 I was able to copy a stamp in the same position (I mean "exactly" the same one) of different pages just by using the "copy/past" tool.
    Now I am using Acrobat XI and it seems like it is not possible anymore: I am copying a stamp and I am trying to past it in anoter page, but it appears in the center of the page (or wherever it wants to...).
    Does anyone have a solution?
    Thanks in advance.

    Thank you very much. I'll be waiting for you message.
    Messaggio originale----
    Da: [email protected]
    Data: 26/01/2015 17.56
    A: "Umberto Gangi"<[email protected]>
    Ogg:  How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        How can I use the "Copy and paste" tool in order get stamps in the same position in different pages (Acrobat XI for PC)?
        created by Gilad D (try67) in Creating, Editing &amp; Exporting PDFs - View the full discussion
    Well, I was in the same situation so I've developed a tool that allows one to do it. I will send you some additional information about it in a private message.
         If the reply above answers your question, please take a moment to mark this answer as correct by visiting: https://forums.adobe.com/message/7132586#7132586 and clicking ‘Correct’ below the answer
         Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    Please note that the Adobe Forums do not accept email attachments. If you want to embed an image in your message please visit the thread in the forum and click the camera icon: https://forums.adobe.com/message/7132586#7132586
         To unsubscribe from this thread, please visit the message page at , click "Following" at the top right, &amp; "Stop Following"
         Start a new discussion in Creating, Editing &amp; Exporting PDFs by email or at Adobe Community
      For more information about maintaining your forum email notifications please go to https://forums.adobe.com/thread/1516624.

  • 1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    1. I have an iPod which has purchases synced with I tunes with an apple ID. I now have an iPad with a new ID for cloud. I have cloud storage capacity of 5gb which came with the iPad. How can I use one ID and store my existing music in cloud?

    HI Frostyfrog
    CHeck out iTunes Match which has an annual fee of £21 or thereabouts. You can store a maximum of 25,000 songs there and they all become available on your other kit, iPhone, iPad and iPod. I know it works as I have over 23000 songs uploaded of which only a few we're bought through iTunes.
    it works by comparing your music to the whole iTunes music dadata base so you access the same tunes that you could get from iTunes. If you have obscure stuff, it uploads your own music to the cloud as a copy.
    I Find it incredible that on my iPhone with its 16gb memory I can view almost 200 gb of music (ie my 23000 songs) and play any of them. Anything I add to iTunes becomes available via the cloud fairly quickly from a few minutes or a little longer if adding a lot.
    The first time you use it it will take quite a while to match your music if you have a lot, but after that it is all automatic. Read the stuff on the apple site. Your PC needs to be at least running Vista. I recommend it and at less than 50p a week it's good value.
    Good luck

  • Can I use an iPad and a ipad2 with the same iTunes in my computer? I want to use both

    Can I use an iPad and a ipad2 with the same iTunes in my computer? I want to use both. Want to give one to wife.do I need to open a new iTunes account for her?

    bashepard wrote:
    Can I use an iPad and a ipad2 with the same iTunes in my computer? I want to use both.
    Yes, No problem at all.
    Want to give one to wife.do I need to open a new iTunes account for her?
    No - you can share the same iTunes account (my wife and I share the same account). But when you sync the iPads, just remember to select the correct content for her iPad and the correct content for your iPad.

  • Can i use this download and install on multiple computers?

    Can i use this download and install on multiple computers?

    I assume you're talking about the Lion installer?  If so, yes, you're allowed to use it on any machines authorized with your Apple ID (which I believe means a maximum of five machines).  This is, of course, meant for family use...  I'm not sure about business use, but I'd suspect you need one copy per machine at a business.  If you're in that situation, you may want to wait for the $69 Lion flash drive Apple will be releasing next month sometime, as that won't be tied to an Apple ID.  But check with Apple to be sure on that.

  • When I sync my iphone 4S using iTunes it only syncs 8.5GB of music, not the entore library as specified.  Is there a capcity default limit of the amount of storage that can be used for music and if so how do I change it?

    When I sync my iphone 4S using iTunes it only syncs 8.5GB of music, not the entore library as specified.  Is there a capcity default limit of the amount of storage that can be used for music and if so how do I change it?

    The only limit is that of the device. No restrictions on how much of it you can use for music. Is part of your music library unchecked?
    tt2

  • Can I use Adobe Premiere and Photoshop (with cloud license) on more thn one computer.

    Can I use Adobe Premiere and Photoshop (with cloud license) on more than one computer? WHen on the oroad I would like to use it n my laptop, while I installed on the desktop.

    Hi Kasiah,
    As per the EULA accepted while you launch Adobe applications you can download & install on 2 systems but can use on one at the same time.
    Source:http://www.adobe.com/in/products/creativecloud/faq.html
    Let me know if you have any questions on this.
    Cheers~!
    -Mandhir

  • I have a macbook pro with 10.6.8 on it but I need to do a clean re install and my CD is 10.4.6. Can I use the CD and then are my OS updates to 10.6.8 free?

    I have a macbook pro with 10.6.8 on it but I need to do a clean re install and my CD is 10.4.6. Can I use the CD and then are my OS updates to 10.6.8 free?
    Also can I use iMac OS install disks on a MacBookPro?

    You will have to buy Snow Leopard:
    You can purchase Snow Leopard through the Apple Store: Mac OS X 10.6 Snow Leopard - Apple Store (U.S.). The price is $19.99 plus tax. You will be sent physical media by mail after placing your order. You also should find it at your local Apple retailers.
    After you install Snow Leopard you will have to download and install the Mac OS X 10.6.8 Update Combo v1.1 to update Snow Leopard to 10.6.8 and give you access to the App Store. Access to the App Store enables you to download Mountain Lion if your computer meets the requirements.

  • How can i use this sript and loade another movie?

    Hi there, i used the following script to load a movie from the server;
    var request:URLRequest = new URLRequest("url string");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    How can i use this sript and loade another movie? Can someone help me please?
    [edited by moderator]

    Sir, I changed it from:
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Dir.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    to
    var request:URLRequest = new URLRequest("http://agusandelsur.gov.ph/downloads/pdrrmo/agusan_del_sur/StaJosefa/Movies/Warning.swf");
    var loader:Loader = new Loader()
    loader.load(request);
    addChild(loader);
    When i expord the movie i get the following error.....
    Scene 1, Layer 'Layer 3', Frame 1, Line 6    1151: A conflict exists with definition request in namespace internal.

  • Can I use a select and update statement in a single jsp file?

    I want to update the BUY table everytime I would add a SELL transaction.....I want to minus the stocks that I sold to those that Ive bought before.....
    note: I used a seperate table in BUY and SELL transaction
    After I Have added a transaction, I want to update the buy table. This is my problem, can I used both SELECT and UPDATE statement at the same time in a single jsp file for example like this:
    select * from test, test1;
    update test
    set total_shares=total_shares-Stotal;
    where stock_code=Scode AND name_broker=Sbroker;
    Can i have both of these statements in the same jsp file in oder to update the buy table?
    Or can anyone suggest how can process that update?THANKS!
    --------------------

    Can i have both of these statements in the same jsp file in oder to update the buy table?Yes. But wouldn't it have been easier just to try it?

  • Can I use Time Capsule and LaCie at the same time?

    Can I use Time Capsule and LaCie at the same time?

    stephaniefromarlington wrote:
    Before I answer your questions, let me first just say thank you so much for your amazing patience and helpfulness.  Whether or not we get to the bottom of this, I am very, very grateful to you. 
    We will get to the bottom of it, and you're quite welcome.  Don't feel you ought to know all this stuff -- none of us were born with it!
    By the way, in answer to your original question, yes, you can use the Time Capsule while backups are running. There's no conflict at all.
    1)  Estimated size of full backup:  205.94 GB
    2)  My LaCie has available:  11.04 GB of 359.95 GB
    That's part of the problem right there; 360 GB is a bit small to back up 206 GB.  Ordinarily, a Time Machine drive should be 2-3 times the size of the data it's backing-up, so Time Machine can keep a reasonable "depth" of old backups for you.
    It looks like Time Machine is trying to do a fairly large backup, and there just isn't enough room for it.
    But something doesn't quite add up.  Time Machine should have deleted all but your most recent backup, trying to make room for the new one.  But that would mean there should only be a bit less than 206 GB on the disk, not 360.
    A clue may be lurking in your logs.  Use the widget in #1 of Time Machine - Troubleshooting to display the backup messages from your logs.  Locate the backup in question, then copy and post all the messages here.

  • Can I use the mouse and the track pad at the same time?

    I'm not comfortable with the track pad yet - can I use a mouse and the track pad simultaneously?

    Yes, both can be used simultaneously.
    Regards,
    Captfred

  • Can I use bluetooth speakers and wired speakers together

    Can I use bluetooth speakers and wired speakers together?

    You should be able to listen to your music in iTunes through the Bluetooth speakers. If, after buying the speakers, you can't select them in iTunes, just go to System Preferences > Sound > Output, and choose the Bluetooth speakers

  • I received a ms publisher file what program can i use to open and edit

    i received a ms publisher file what program can i use to open and edit

    There is no program that can open Publisher files except Publisher. It doesn't matter whether you use Windows or a Mac, Publisher files must have Publisher.
    Publisher does not have a Mac version so you will need Windows (and Publisher)

Maybe you are looking for

  • Apple Mail, Photo Browser, Attachments and Yosemite

    OK, Help.  Anytime I want to insert a photo from my iPhoto Library into Apple Mail via Photo Browser in  Yosemite Mail, it crashes. My preferred method - Via add attachments - Finder/Pictures/Iphoto library doesn't work anymore. It now says Open iPho

  • My iPod isn't reseting and isn't being read by my computer

    I'm not sure whats wrong. I've had some trouble before but all i've ever had to do was reset it and its not working. Its been acting up for a long time and I REALLY don't want to reset it, I have over 1500 songs. I've tried everything and have attemp

  • Portal Activity Reporting and SAP Business Warehouse

    Hi, Does anyone out there know if SAP has or plans in the near future to deliver Portal Activity Reporting content via SAP Business Warehouse? I would have thought BW would have been the ideal solution to enable some "out of the box" Portal Content i

  • Call upon even better support for Unicode

    Hello Following some messages I have posted regarding problems I encountered while developing a non-English web application, I would like to call upon an even better support for Unicode. Before I describe my call, I want to say that I consider Berkel

  • N97 update/conectivity problems

    I have a branded (3) mobile N97 and i had a hard time getting the pc suite and SWupdater to find it, i reinstalled the most up to date vers and still nothing. aprently it a driver issue so i uninstalled anything that says noika on it  incl conectivit