Which is good way of writing?

Hi,
I want to know the difference between using the dynamic SQL
statements in a procedure. Also give which one is best way? Any
help and explanation or links are appreciated.
I have a procedure in these two ways...
First is
create or replace procedure p1 as
eno number;
begin
eno := 7844;
update emp set sal = 3456 where empno = eno;
end;
Second one is
create or replace procedure p1 as
eno number;
begin
eno := 7844;
execute immediate 'update emp set sal = 3456 where empno = :1'
using eno;
end;
thanks in advance,
khaleel

Hi,
Native Dynamic SQL allows developers to write much more compact
code, which is easier to read and maintain. This code executes
faster because it's embedded into the PL/SQL engine.It could
accept bind variables with a USING clause, thereby improving
code performance significantly by allowing you to reuse parsed
SQL statements from an SGA (System Global Area) pool.
Also the dynamic sql requires only one statement rather than
multiple statement.
Using dynamic sql is much faster than the normal sql statements.
Hope this will be of use to you.

Similar Messages

  • Which is good way of putting the procedures ?...

    Hi,
    Here I am thinking about one problem which is not clear to
    me, I have a package with 100 procedures, but no procedure is
    callig the ther procedure internally. Then what I am feeling is
    that, if three end users are connected to the database, and
    three queried for the same or the different procedures which are
    in that package. Then the entire pacaage is loaded into memory
    per each call of the end user? Or once it is loaded into the
    SGA , it will be available to all requests?
    The main thing is is is good to keep thot many procedures in a
    package when one is independent of other, or it is better to
    create each and every procedure individually?
    Please provide me any thing related links for these tuning
    concepts.
    regards,
    khaleel

    Where procedures/functions are commonly used together, as might be the case for performing a business function such as billing customers, it makes sense to put them in a single package. One it is loaded by one user calling a procedure within it, there is no additional overhead due to other users calling procedures - there is also an Oracle supplied package to enable you to "pin" commonly used packages in memory as soon as the database starts.

  • Any good way to find out which process is running on which CPU, how long it

    Hi All
    any good way to find out which process is running on which CPU, how long it took, how many threads it has forked, which thread went to which CPU, etc. .
    RPS
    Message was edited by:
    RajeshPS

    Hi All
    any good way to find out which process is running on
    which CPU, how long it took, how many threads it has
    forked, which thread went to which CPU, etc. .Because the scheduler moves threads from CPU to CPU all the time, that would be a lot of information to store. I don't know any easy way to gather it.
    Under Solaris 10, you could write a dtrace script that noted every time one of the processes thread was enqueued or dequeued on a cpu and post-process that.
    That's probably the best way.
    Darren

  • Safari and Others Hang. Is there a good way to diagnose which process is being a trouble maker?

    I have a peculiar problem that has been developing for some time now.
    Current Symptoms:
      Safari (Any Version 5.0-Current) will load but WebProcess.app Opens to 100%
               on one core of CPU (Non-Responsive) and no web-pages will load.
      VLC.app launches in the same fashion, one process pegs to 100%.
      iMovie.app hangs.  Not crashing, but failing to successfully launch.
      Apple Script saved as an application behaves in the same way.
    Attempted Diagnosis:
          I'm currently running OS 10.7.3 on a Early 2009 Mac Pro.
         I have tried:
      Deleted Preferences, and Saved Application States. Then realized the
    problem can't be in ~/Lib/Prefs. because it also is a problem on a clean user
    profile I created to check. So I also looked in /Sys/Lib/Prefs. with no Success.
      I have run disk permissions more times that I can count. 
                    This comes up with regularity but solves nothing:
      Group differs on “Library/Preferences/com.apple.alf.plist”; should be 80; group is 0.
      Repaired “Library/Preferences/com.apple.alf.plist”
      Permissions differ on “usr/lib/ruby”; should be lrwxr-xr-x ; they are drwxr-xr-x .
      Repaired “usr/lib/ruby”
      Reinstalled 10.7.3 from the Combo Updater from apples website.  No Help.
      I did find launching any affected App from the Unix Exe File in the .app
             bundles (So it launches in terminal)  will open them and allow them to
             runwithout issue (yea! temporary fix)! 
    Finally I booted with -x into Safe Mode.  There the problem vanished.  Hooray
            it's another piece of  software or an extension I have loaded (Could  be any over
            the past 6 months or so)!
    So, I rebooted and tried to launch Safari immediately. It worked!  Only after a
            minute or so, when the GUI and background Apps had finished
            loading, the problem returns.
    What I need help with:
    Is there any good way to tell what application is causing the problem or what
    these four apps have in common?  I have looked at Console Logs, Crash Reports,
    etc. etc. but admittedly am not sure what to look for.  I would be happy to post logs
    or reports or more detailed info, if it would help.
    Otherwise Thank-you to anyone who reads this and has any good ideas short
    of a fresh install. Cheers!

    Hi...
    Reinstalled 10.7.3 from the Combo Updater from apples website.
    The only way to reinstall the Mac OS X or repair the startup disk running v10.7.3 Lion, is to use Lion Recovery The combo update does not do that.
    How much free space on the startup disk? Not enough free space can account for the problems with your apps.
    Right or control click the MacintoshHD icon. Click Get Info. In the Get Info window you will see Capacity and Available. Make sure there's a minimum of 15% free disk space.
    and no web-pages will load.
    Try using OpenDNS as suggested here >  Safari 5.0.1 or later: Slow or partial webpage loading, or webpage cannot be found
    Use OpenDNS for better speed, more security, includes anti phishing filters, prevents browser redirects, and it's free.
    Open System Preferences / Preferences then select the Network tab. Click the Advanced tab then click the DNS tab.
    Click +
    Enter these addresses exactly as you see them here.
    208.67.222.222
    Click +
    208.67.220.220
    Then click OK.
    edited by:  cs

  • Does anyone know if apple's one-to-one program would be a good way to learn how to use logic pro or am I better off going to school to learn audio engineering or something?

    Of course going to school would be a good option, but I want to know if one-to-one is also a good way to learn how to use logic pro. Has anyone been through the one-to-one program for logic pro and can say that they learned how to use logic pro well because of it?

    For sure, one to one training, if given by a tutor who is capable, will hand you the means to build up self-confidence  and will therefore let you operate the hard/software in an intelligent manner, instead of going for the trial and error method which has its pro's and con's too. Once you've passed this beginners phase you will make your own decisions intelligently and then you will also start to get experience and learn even from your mistakes. Something like that in theory and the rest is up to you!
    Have a nice day

  • What's a good way to do a thread dump into a separate file

    What is a good way to do a thread dump automatically into a separate file.
    Example. I run a script to do the thread dump, but unfortunetly, it goes into my stdout log file with the rest of my weblogic errors.
    Any ideas? I want it in a separate file when I run my script?

    Do a Google search on "Drobo S" "benchmark."  I don't have a Drobo S, only the regular Drobo.  But here's a guy who tested one on Windows:
    http://mansurovs.com/drobo-s-review-usb-3-0-2nd-generation
    This one has it a bit faster:
    http://the-gadgeteer.com/2011/12/31/drobo-s-storage-array-review/
    Do read up on a few reviews of it, and be absolutely clear that interface speed (i.e. eSATA versus Firewire versus Thunderbolt) is NOT the same as the performance of the system.  The Drobo cannot keep up with any interfaces... at least the Drobo and the Drobo S cannot.
    I am not using the FS model which is a NAS.  I am using the plain old "Drobo" which is slower than the Drobo S, but that's not to say that the Drobo S is fast, because it is not.
    The Drobo in theory is really attractive: Dead simple to manage, can mix and match drive sizes, offers you some data protection, etc.  However do note that protected storage is not, in and of itself, a backup.  You need other backups besides just the data on the Drobo.  And, because it's so slow, it's really not a great fit for photo storage.  See this review from a guy who used to think the Drobo was great for that and then appended his review:
    http://www.stuckincustoms.com/drobo-review/
    To be as clear as possible, IMO the BEST backup strategy with something like Aperture (so long as your managed Aperture library is of a manageable size, like < 800 GB), is to get a few small portable Firewire 800 drives and keep vaults on each one.  They are great because they are easy to use, to have with you, are bus powered, and you WILL offsite them.

  • Is this a good way for loading and handling an xml file?

    I'm new to xml files, but it seems to me that a good way to handle them may be this:
    - create an xmltype table with a unique xmltype column
    - load the xml file in the xmltype column of the table
    - writing a procedure for scanning the whole column of the table by using the extractvalue built-in function for inserting the different nodes of the xml file (just loaded) in the final tables (to link correctly the father and son tags with foreign keys)
    Does it seem to you a good way to load the nodes of a xml file in a relation database?
    Thanks!

    Is this the 10gR2 Express Edition you mentioned over in How to load a XML file into a table or a different version?

  • Good way to start with the learning the 11g concepts

    Hi,
    I have a work experience on the BEA weblogic server 8.1 sp4 on which i have worked for about 2 year now. My current assignment requires working with the Installation/ Development and deployment in the Fusion middleware 11g server. Could some body please suggest me a good way to start with the learning the 11g concepts.
    I understand that all the documentations are available in the Oracle forum, but i want to understand where to start from.
    my core tasks in the assignment would be
    1. installation (OSB on top of WLS).
    2. development/configuration on OSB.
    3. Deployment and administrative tasks.
    regards,
    Prakhar

    Hi thanks for the update. I have been going through the links and found them very useful.
    I have few new doubts.
    In all the tutorials for getting started with the Fusion middleware, the examples which are given use the Oracle JDeveloper extensively. This IDE is used for implementing the BEPL and other important aspects. I found this very similar to the Workshop IDE initially bundled with the BEA-Weblogic 8.1. Is JDeveloper enhanced to accomodate the features of the Weblogic Workshop IDE?
    Also, i need some information regarding the Eclipse IDE which is bundled with the OSB installation. Are there any tutorials available which show how to use the Eclipse IDE with OSB.
    Also, can the Eclipse IDE be used to implement the same set of components which are being developed using the JDeveloper in the tutorials.
    My concern here is i want to know the best way to start with the training/development. I am already familiar with the Eclipse IDE and donot want to switch to the JDeveloped unless it is absolutely necessary. Can one of these IDE be used repeacebly in place of other.
    Please inform me if in case my wuestion is not clear.
    Regards,
    Prakhar

  • An INSERT EXEC statement cannot be nested.Please tel me some good way of formulation in following situation.

    Hi,
        The following query is showing error An INSERT EXEC statement cannot be nested
    CREATE PROCEDURE [dbo].[Procedur3]
    @para1 int
    AS
    BEGIN
    CREATE TABLE #tem
    select * from detialpar where did=@para1
    --this code is quite big and is called from many place so we kept it inside this SP , so that we can call the sp to get result.
    END
    CREATE PROCEDURE [dbo].[Procedur2]
    @para1 int
    @para2 datetime
    AS
    BEGIN
    CREATE TABLE #tem
    insert into #tem (value) exec [dbo].[Procedure3] @para1
    exec ('select * from abc
    left join #tem on id=temid
    where id =' + cast(@para1 as varchar) -- i do not want to change this big dynamic query, because it has many optonal code concatinated by using "if then else".
    END
    CREATE PROCEDURE [dbo].[Procedure1]
    @para1 int,
    @para2 datetime
    AS
    BEGIN
    delete from table1 where id=@para1
    insert into table1 ( col1,col2) exec Procedure2 @para1,@para2
    ……. There are many blocks in this SP where we are deleting and inserting with different SP .
    select Name,Amount from #Temp1
    END
    CREATE PROC Procedure
    AS
    BEGIN
    SET TRANSACTION ISOLATION LEVEL SNAPSHOT
    SET NOCOUNT ON
    LOOP "A" starts here which gests id from a table xyz @para1
    begin try
    begin trans
    exec [Procedure1] @para1
    LOOP "A" ents here
    COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
    IF @@trancount > 0 ROLLBACK TRANSACTION;
    END CATCH;
    END
    GO
    Please tel me some good way of solving the error.
    yours sincerly

    You can not do like above:
    Try the below:(Not tested), Below, we do not change the code, however, we placed your dynamic execution to different procedure.
    CREATE PROCEDURE [dbo].[Procedur3]
    @para1 int
    AS
    BEGIN
    CREATE TABLE #tem
    insert into #tem (value)
    select * from detialpar where did=@para1
    --this code is quite big and is called from many place so we kept it inside this SP , so that we can call the sp to get result.
    END
    CREATE PROCEDURE [dbo].[Procedur2]
    @para1 int
    @para2 datetime
    AS
    BEGIN
    CREATE TABLE #tem
    exec [dbo].[Procedure3] @para1
    END
    CREATE PROCEDURE [dbo].[Procedure1]
    @para1 int,
    @para2 datetime
    AS
    BEGIN
    delete from table1 where id=@para1
    insert into table1 ( col1,col2)
    exec ('select * from abc
    left join #tem on id=temid
    where id =' + cast(@para1 as varchar) -- i do not want to change this big dynamic query, because it has many optonal code concatinated by using "if then else".
    ……. There are many blocks in this SP where we are deleting and inserting
    with different SP .
    select Name,Amount from #Temp1
    END
    CREATE PROC Procedure
    AS
    BEGIN
    SET TRANSACTION ISOLATION LEVEL SNAPSHOT
    SET NOCOUNT ON
    LOOP "A" starts here which gests id from a table xyz @para1
    begin try
    begin trans
    exec [Procedure1] @para1
    LOOP "A" ents here
    COMMIT TRANSACTION;
    END TRY
    BEGIN CATCH
    IF @@trancount > 0 ROLLBACK TRANSACTION;
    END CATCH;
    END
    GO

  • Any good way to combine 32 boolean bits to a number?

    I have 32 boolean inputs, and want to combine these 32 boolean to an unsigned number. Is there any good way other than "joint number" or "logic shift & logic and"?
    input:
    32 boolean: boolean 0, boolean 1, ,,, boolean 31
    output:
    32-bit unsigned number: boolean 0 is bit 0, boolean 1 is bit 1,,,,, boolean 31 is bit 31.
    Thanks.

    Darin.K wrote:
    Ben is nudging you towards a mention in the Rube Goldberg thread, which I enjoy as much as the next guy.  Ravens had it right though, you just need a small tweak to get the Boolean Array from the DBL array.  Assuming any non-zero value is TRUE, you can simply do this:
    Bonus version for the FP math junkies.
    Telling someone there IS a bucket of Truth is not the same a pushing (or nudging) them in.
    The questions started to go down the path of ".... this is how I would have done it in C ...." so I was making sure they know where to find the functions in LV.
    Take care,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Good way to start with the WM programming?

    I follow "Community Contributions" and I'm testing every new WM what's out there. I know C and I would like to write the WM. How did you learn to write your first WM?
    What would you suggest to starting WM programmer? Reading Xlib (or others) reference manuals or just studying other WM's source code? Or something else?

    TTWM's code is a complete mess.  I don't know what kind of fool is responsible for that collection of kludges!
    I'll second the recommendation for TinyWM, but once you want to dig deeper I'd suggest looking at other non-reparenting window managers.  I don't know of any non-reparenting floating WMs other than TinyWM, so that may leave you with the tilers - many of which have been mentioned.
    Dwm is a good choice.  That is some finely polished code that has some bright people working for some time to perfect it.  But it has the downside for learning that it does implement many more "complex" features.  It can also be hard to follow the program logic sometimes as there are so many function calls - you have to scroll back and forth through the code while trying not to lose your place ... bring your breadcrumbs.
    In my own coding I try to minimize function calls - not for optimizing the code, as the compiler will handle this pretty well - but for making it more readable.  In every place where a series of actions will be executed in a linear order, I try to keep the commands presented in a linear order within the same function.  Along with this I avoid complicate macros or inline functions: if they'll be inlined anyways, there is no saving on resource use at run time, but only saving a few lines of code while sacrificing the ease of reading and understanding.
    Also, if you have not found it yet, I highly recommend Christophe Tronche's Xlib guide.  I can't say I ever just read through it from start to finish (yet), but when I google any Xlib related function if there are any entries on tronche.com that is the first one (and then often the only one) I look at.
    PS: there's nothing fancy about workspaces/desktops.  You just maintain a list of client windows on each desktop - or have "tags" associated with each client - then when the user changes desktops you just hide all windows that are not on that desktop/tag and show those that are.  Hiding can mean "unmapping" but I preferred an easier hack which I found the dwm authors also used: just move the window (XMoveWindow) off of the screen. Unmapping might even be problematic as it generates a set of events when unmapped and remapped.  This can be remedied and there may be good ways of doing this, but moving off screen works for me.
    Last edited by Trilby (2012-09-26 01:32:22)

  • Recording knob and slider movements from an external synth in a good way

    How do I record the knob and fader movements made on an external synth into Logic in a good way?
    I have managed to do it but Logic writes a new region over the top of the region containing my midi notes. When I stop recording the new region which contains the CC data disappears behind the region containing the midi notes.
    On top of this, once I've moved the regions around so I can select the one containing the CC data I can't see anything for it in the Hyper editor (though I know the changes have been recorded as it plays back.)
    Any guidance would be much appreciated.

    I often make a duplicate of my Midi track/Software Instrument track (assigned to the same Audio object - standard KC for this is shift+Return) beneath the original track and then record fader and knob movements on the duplicated track.
    In the Piano Roll->view->Hyper Editor select Modulation/Pitch bend or "Other" and choose a Midi Controller number frome the menue which opens, the selected Controller (e.g.#21) will be displayed underneath the Piano Roll and you can edit it with your pointer/pencil/Eraser tool.

  • When I use voice over to read an epub in my Ibooks app, which is in Dutch, sometimes he start reading a book with an English Female voice and some books he reads with the Dutch male voice (which is good). All my epubs are Dutch books. Can i fix this probl

    when I use voice over to read an epub in my Ibooks app, which is in Dutch, sometimes he start reading a book with an English Female voice and some books he reads with the Dutch male voice (which is good). All my epubs are Dutch books so the English voice sound terrible trying to pronounce Dutch. Can i fix this problem? Thanks, Tom

    It sounds like you may have multiple problems, but none of them are likely to be caused by malware.
    First, the internet-related issues may be related to adware or a network compromise. I tend to lean more towards the latter, based on your description of the problem. See:
    http://www.adwaremedic.com/kb/baddns.php
    http://www.adwaremedic.com/kb/hackedrouter.php
    If investigation shows that this is not a network-specific issue, then it's probably adware. See my Adware Removal Guide for help finding and removing it. Note that you mention AdBlock as if it should have prevented this, but it's important to understand that ad blockers do not protect you against adware in any way. Neither would any kind of anti-virus software, which often doesn't detect adware.
    As for the other issues, it sounds like you've got some serious corruption. I would be inclined to say it sounds like a failing drive, except it sounds like you just got it replaced. How did you get all your files back after the new drive was installed?
    (Fair disclosure: I may receive compensation from links to my sites, TheSafeMac.com and AdwareMedic.com, in the form of buttons allowing for donations. Donations are not required to use my site or software.)

  • Ok, so i bought a imac 27 about 4 months ago, and now they release a new one!  ****... So my question is, should I sell this one (which by the way is the i5 2.8 with 1 gb 5750 and 4gb ram) and buy the new imac 27 i5,or keep the one i have and buy more ram

    ok, so i bought a imac 27 about 4 months ago, and now they release a new one!  ****... So my question is, should I sell this one (which by the way is the i5 2.8 with 1 gb 5750 and 4gb ram) and buy the new imac 27 i5,or keep the one i have and buy more ram. I mostly use my computer for photoshop cs5 and illustrator cs5 for graphics out put as well as surfing the web and music.
         Please give me you thoughts on what I should do!!  Thanks  lot!

    The new iMac is about 25% or so faster than your current iMac(comparable model would be the 3.1ghz version). There are a couple of things that you will benefit from such as the dual Thunderbolt/Mini Display ports/ which may help with multitasking. The video card in the new iMac again the comparable model being the 3.1ghz is a lotttttttt better than the current one that you have. So thinking of the long run those few things may be beneficial for you to upgrade(but it depends on what is important to you).
    I had the 2.93ghz i7 version that I just bought in March this year and I turned around and sold it about a week before the new iMac's were announced. I got about $1600 for it, yeah I took a loss but to me it was worth it because my new iMac performs that much better. Now keep in mind I went from i7 to i7...3.4ghz i7 with the 2gb video card. Now I have dual thuderbolt/mini display ports. I have noticed significant gains in my video editing and also in my gaming. So to me it was definitely worth the upgrade!
    One last thing, I would not have sold my 2.93 i7 and then bought the 3.1ghz i5, the big reason is because HT(hyper threading), it's only on the i7 model(3.4ghz)... If you take a look at some of the bench marks on engadget, maclife, macrumors, macworld, ****Barefeats.com(they really get into benchmarking)*** you will see charts that will help you make a better decision.
    In closing I would say look into it, if you can get a good price out of your current iMac to put toward a new iMac then do it. Like others have mentioned to you, tech changes and Apple will change the tech in these machines next year or do a speed bump later this year or so. One last thing if you go from the 2.8 i5 up to the 3.4 i7, you would definitely see the difference (HT is a must especially for programs that utilize it. You can go to my youtube channel(mob1278) and take a look at my geekbench results.... my 2.93 i7 scored around 10500-11000(8gb ram)...my 3.4 i7 scores from 12700-13000 with 4gb ram....so yeah as you can see big difference. Basically the 3.4 i7 would perform similar or just under a 2.4ghz 8core 2010 Mac Pro which runs you about $3500 with no monitor.... it's your money spend it how you want....and Lion is only going to push it even more when it is released!

  • My AppStore id is my apple id n password which is good when purchasing. But when I am updating from update option it ask for a password. The user id I see there is not mine, it's different. How do I change that to my apple Id? Please help me resolve .....

    My AppStore id is my apple id n password which is good when purchasing. But when I am updating from update option it ask for a password. The user id I see there is not mine, it's different. How do I change that to my apple Id? Please help me resolve  this issue. I have tried resetting it but nothing... Either I'm doing something wrong or....

    I believe the issue is with the Apple ID that was used to purchase the App. If you download an App that was purchased under a different Appple ID then all updates will also be linked to the original purchaser's Apple ID. Your Apple ID is the the same ID as your iTunes, iCloud, etc. Some folks use different ID for the different Apple sites. No need for that One ID for all Apple Sites, and if someone else buys an App using their ID and they(you) download that App onto your device and that App requires an update it will ask for the purchasers Apple ID. This happens a lot when folks sell their iPad or give it to someone else and leave some purchased(free) Apps on the iOS device. You cannot change the original ID the App was purchased under. A suggestion would be if someone else has an App that you like but do not want to pay for use their ID or in the future have them gift the App to you.

Maybe you are looking for