Best practices of Oracle procedure

Hi all! I'm a SQL Server DBA, and I learn Oracle I intend to become an Oracle DBA for many reasons.

I need the opinion of experts on something here. To give you a time frame: it is very common to use stored procedures in SQL Server to return result sets, rather than SQL ad hoc because it is handier and safer (and sometimes better performance).

Can say the same for Oracle procedures, or is it totally different? I cringe at the idea of having to include ad hoc SQL in application layer instead of calling a procedure that runs the code that is stored inside the Oracle.

Experts, how do you manage this? Do you have the actual SQL code in your applications? Is it true that Oracle procedures can return result sets with the sliders?

Thank you for putting up with my novice questions. :)

Justin

Ok.

To run the above procedure, you must use->

exec Budget.usp_SpendingVsBudgetDetail(to_date('2009-04-01','YYYY-MM-DD'),to_date('2009-04-30','YYYY-MM-DD'));

At the SQL prompt.

Kind regards.

LOULOU.

An extra single quote was deleted...

Published by: Satyaki_De on April 13, 2009 09:47

Tags: Database

Similar Questions

  • Recommendations or best practices configuration Oracle HTTP Server Oracle Webcenter 11g Portal

    Hello everyone.

    I'm looking for recommendations or best practices configuration Oracle HTTP Server Oracle Webcenter 11 g Portal

    I appreciate if you could give me some references and/or experiences.

    Thank you very much in advance.

    Best regards.

    Configurations may vary depends on place on your needs, in general you can see Configuration high availability for the Web - 11 g Release 1 (11.1.1) layer components

    Use the configuration WebTier documents to the address above if it is sufficient for your needs.

  • Best practices for enforcement procedures

    Hi all

    I need to run a process on demand application (from Javascript code).

    To do this, I spend the process parameters using elements of applications. (I mean I put points of application using Javascript).

    In order to make it work, I have to change the Protection of the State of Session "Unrestricted".

    Is this the right way to go for security best practices or is there a better way?

    Thank you.

    Max

    Hi Max,.

    Thanks for explaining, I see now. You must check in the process that the passed ID is still valid for the currently connected user, I would definitely use the global temporary variables for this apex_application.g_x.

    Also, make sure that the attributes of the object are what you expect or if ensure that they do not cause a SQL injection (support) or a situation of Cross-site Scripting (properly escaped). You can use a regular expression to clean up if necessary attribute data, an expression I used the other day;

    regexp_replace (apex_application.g_x01, "[^ #0-9 a - fA - F]'," ")

    Which restricts the entry of color hexadecimal encoding format, i.e. ' #7f7f7f '.

    Hope this helps

    Kind regards

  • Streaming Mode of performing my procedure and best practices

    Hi guys

    I want to make sure I did the right thing

    OK, I've created a thinapp application I created a .dat and .exe for my application. Now, I want people access thinapped app which is in the folder shared.

    What is the correct procedure? I want to say create the dat file and the .exe and after he put on a share, and after create shortcuts on desktop computers (pointing to my .exe file) if people have access to the app thinapp?

    is that all?

    now, what are best practices for this procedure continuously?

    Thank you very much

    Yes, that's really all. Nice and simple, isn't? You can use the ThinReg utility to create shortcuts (as administrator, run thinreg/a"
    "" "server\share\path\to\virt\apps\*.exe"). "

  • Oracle on NetApp - white paper best practices?

    I thought I saw a nice whitepaper "best practices" that Oracle published to operate the RDBMS on NetApp.

    But I can't seem to find now. Does anyone have a link?

    (I access Metalink if it is there, but my search didn't find it).

    Thank you!

    The doc I have comes actually from NetApp, not Oracle. It is titled: NetApp Best Practice Guidelines for Oracle

    You can find a copy here: http://media.netapp.com/documents/tr-3633.pdf

    See you soon,.
    Brian

  • Best practices for placing < meta > tags of the document HEAD

    Good afternoon

    We use the ability of Oracle UCM to dynamically generate pages based on page templates, model region and data files of contributor contributors can edit and publish. We have a specific need to include meta tags in the head section of each page that are customized for the data present in each contributor data file. Including meta tags in the model of the region that relates to a section of our site Web do not work, because it does not include a < head > section. Otherwise, I can't put metatags in the page template, since the data contained in each meta tag are specific to the metadata surrounding each contributor of the data file.

    My question is this: is there a best practice, or Oracle-taking method in charge of this task? I believe he remains the path to get there, as is a very common need for meta tags for search engines and social media sites.

    Thank you very much for your time,

    Josh

    I believe that the following should be useful:

    wcmElement

    ssGetDocInfo

    Jonathan

    http://jonathanhult.com

  • Linux and oracle database installation best practices windows

    can anyone recommend the guide of best practices for the installation/design of windows/Linux oracle database servers.

    Microsoft, sql Server, provide a number of useful resources on the evolution of the default parameters that can die of hunger the operating system of resources, where to and where not to store the data in files/logs etc etc, but I've yet to find a similar guide for Oracle. Research on best practices during the installation/initial design in order to avoid the risk of recovery/redundancy later on any line, reliability, availability, performance. Guidance most welcome.

    See following note metalink on system requirements for the different versions:

    (Doc ID 169706.1) - database Oracle (RDBMS) Unix AIX, HP - UX, Linux, Mac OS X, Solaris, Tru64 Unix OS Installation and Configuration requirements checklist (8.0.5 to 11.2)

    Online Oracle Database Documentation 11g Release 2 (11.2)

    -Som

  • Best practices for retrieving a single value from the Oracle Table

    I'm using Oracle Database 11 g Release 11.2.0.3.0.

    I would like to know the best practice to do something like that in a PL/SQL block:

    DECLARE
        v_student_id    student.student_id%TYPE;
    BEGIN
        SELECT  student_id
        INTO    v_student_id
        FROM    student
        WHERE   last_name = 'Smith'
        AND     ROWNUM = 1;
    END;

    Of course, the problem here is that when there is no success, the NO_DATA_FOUND exception is thrown, which interrupts the execution.  So, what happens if I want to continue despite the exception?

    Yes, I could create a block nested with EXCEPTION section, etc, but it seems awkward for what seems to be a very simple task.

    I've also seen this handled like this:

    DECLARE
        v_student_id    student.student_id%TYPE;
        CURSOR c_student_id IS
            SELECT  student_id
            FROM    student
            WHERE   last_name = 'Smith'
            AND     ROWNUM = 1;
    BEGIN
        OPEN c_student_id;
        FETCH c_student_id INTO v_student_id;
        IF c_student_id%NOTFOUND THEN
            DBMS_OUTPUT.PUT_LINE('not found');
        ELSE
            (do stuff)
        END IF;
        CLOSE c_student_id;   
    END;

    But it still seems to kill an Ant with a hammer.

    What is the best way?

    Thanks for any help you can give.

    Wayne

    201cbc0d-57b2-483a-89f5-cd8043d0c04b wrote:

    What happens if I want to continue despite the exception?

    It depends on what you want to do.

    You expect only 0 or 1 rank. SELECT INTO waiting for exactly 1 row. In this case, SELECT INTO may not be the best solution.

    What exactly do you do if you return 0 rows?

    If you want to set a variable with a NULL value and continue the treatment, Frank's response looks good, or else use the modular Billy approach.

    If you want to "do things" when you get a line and 'status quo' when you don't get a line, then you can consider a loop FOR:

    declare
      l_empno scott.emp.empno%type := 7789;
      l_ename scott.emp.ename%type;
    begin
      for rec in (
        select ename from scott.emp
        where empno = l_empno
        and rownum = 1
      ) loop
    l_ename := rec.ename;
        dbms_output.put_line('<' || l_ename || '>');
      end loop;
    end;
    /
    

    Note that when no line is found, there is no output at all.

    Post edited by: StewAshton - Oops! I forgot to put the result in l_ename...

  • Oracle BPM 11g - a book, resource on best practices?

    Hello all, I need start an application with Oracle 11g BPM, for this I need to read best practices to run this kind of implementation, integration ADF 11 g / BPM 11 g, is there a book or resource online to talk about this?, please if you know all the resources, please comment.

    Hi Carlos,

    You've probably seen these but my top 3 books of 11g Oracle BPM would be:

    1 getting Started with Oracle BPM Suite 11 GR 1 material - A Hands on Tutorial - what is very well written and I think is the best for new people to start.  I love that it covers the entire suite in depth.  The instructions are clear and well written, but get a bit dated (it was written for the PS3 and we're currently on PS6).  This also covers the basics of the integration of the ADF you're looking for.

    2 oracle BPM Suite 11 g: Advanced Topics BPMN - Mark Nelson has been one of the authors on this.  Anything by mark, I will read.  This book fills in some areas that are difficult to learn yourself.

    3 oracle Business Process Management Suite 11 g Handbook - a little misread in some places, but has more information and best practices in some areas.

    Hope this helps,

    Dan

  • Best practices Oracle 11 G database machine

    We currently have a production on 10g database which us will be upgrading to 11g 2 on the database device. On this database, we have a staging area, a data warehouse and an Operational Data Store. (all to separate the schema). My question is what is the best practices in the implementation of our new Oracle database environment?
    Should separate us the area of transit, Data Warehouse and the Operational Data Store in their own individual database? What are the advantages and disadvantages of doing this?
    I'm looking for expertise on what to do?

    Thank you
    PAM

    Reference to Oracle data warehouse architecture is below...
    http://www.Oracle.com/us/solutions/Datawarehousing/058925.PDF

    See you soon
    David

  • Best practices on the steps of the Post after 11.2.0.2.4 installation of ORACLE RAC

    I finished 11.2.0.2 RAC installation and it patched to 11.2.0.2.4. The database is also created.

    Nodes are Linux redhat and ASM storage.

    There the good article or links regarding best practices post not after installation?

    Thanks in advance.

    Hello

    I also want to know what kind of analysis scripts, I can use for the installer as cron tasks to monitor or detect any failure or problems?

    To control the Cluster (OS level):
    I suggest you use a tool powerful "CHM" already accompanying the product grid Infrastructure.

    How do you set up? Nothing... Just use.

    Cluster Health Monitor (CHM) FAQ [ID 1328466.1]

    See this example:
    http://levipereira.WordPress.com/2011/07/19/monitoring-the-cluster-in-real-time-with-chm-cluster-health-monitor/

    To monitor the database:
    With the HELP OF ADVISORS of PERFORMANCE TUNING AND FUNCTIONS of MANAGEABILITY: AWR and ASH and ADDM Sql Tuning Advisor. [276103.1 ID]

    The purpose of this article is to illustrate how to use the new features of 10g management to diagnose
    and resolve performance issues in the Oracle database.
    Oracle10g features powerful tools to help the DBA to identify and resolve performance issues
    without the hassle of complex statistical data analysis and comprehensive reports.

    Hope this helps,
    Levi Pereira

    Published by: Levi Pereira on November 3, 2011 23:40

  • Best practices for securing the Oracle e-Business

    Is there anything in addition to best practices for securing the Oracle e-Business
    Suite 11i that consideration for the safety of the Oracle E-Business Suite?

    Try:

    http://repo.solutionbeacon.NET/Collab07BestPracticesWP.PDF

    http://www.Integrigy.com/Oracle-security-blog/archive/2007/07/27/11i-updated-security-best-practices

  • BEST PRACTICES FOR PL/SQL

    Hi all
    I'm looking for advice on best practices to create c# applications that have Oracle as backend.
    I noticed this insertion, update, and delete procedures are not so dynamic because they are static:

    Insertion procedure:
     Create or replace procedure insertion (param1 in varchar2 default '', 
    param2 in number default 0, param3 in float default 0,
     table_to_insert in varchar2, Some_error out varchar2) is
    begin
    if (table_to_insert='table1_spec') then
    insert into table1 (val1,val2,val3) values (param1, param2,param3);
    elsif (ect) then
    .
    .
    .
    end;
    /
    Updated and delete procedures also have the same behavior, I wonder if you use a cursor to do more dynamic values return and the use of native dynamic SQL could not help the developers and I have to have something more dynamic.
    Kind regards

    Published by: user650358 on June 9, 2011 08:37

    user650358 wrote:

    I'm looking for advice on best practices to create c# applications that have Oracle as backend.

    What John said. (even if I would have been more blunt and used the expression "+ approach silly +" several times) {noformat} ;-) {noformat}

    The most flexible approach is to abstract the complexities of SQL, the relational database and the physical implementation of it, of the code c# developer.

    No need to know the database design, the joints, the structures table, SQL and others. Instead the abstract layer takes care of that - where this layer is a suite of packages of PL/SQL procedures and functions.

    As the c# developer would use the Win32 API for creating threads, or the use of Sockets of Win, it now uses the layer of abstraction of PL/SQL in a similar way.

    You want to add an invoice? No need to know the name of the table, the structure of the table and SQL - c# code calls simply the CreateInvoice()PL/SQL procedure.

    This code performs the validation. Business rules and logic. The SQL.

    More, the underlying database model can change, the new rules of business introduced and so on - and the call from c# to CreateInvoice() will remain the same and the c# code not affected by these changes in dorsal.

    Oh yes - it does not using PL/SQL code to extract data from line in the PL/SQL variables and then push these data in turn to the c# client code.

    It means that a procedure or a function like GetCustomertInvoices() returns a ref cursor to the appellant to consume. (the SQL to create the slider is abstract - not the actual slider itself because it is correct the only way to access the data in row SQL)

  • Best practices for call code plsql and methods of application module

    In my application I am experience problems with the connection pool, I seem to use a lot of connections in my application when only a few users are using the system. As part of our application, we need to call procedures of database for the business logic.
    Our support beans, calls the methods of the module of the application calling to turn a database procedure. For example, in the bean to support, we have code as follows to call the method of module of the application.

    Component Module to generate new review/test.
    CIGAppModuleImpl appMod = (CIGAppModuleImpl) Configuration.createRootApplicationModule ("ky.gov.exam.model.CIGAppModule", "CIGAppModuleLocal");
    String testId = appMod.createTest (username, examId, centerId) m:System.NET.SocketAddress.ToString ();

    AdfFacesContext.getCurrentInstance () .getPageFlowScope () .put ("tid", testId);

    Close call
    System.out.println ("delete Calling releaseRootApplicationModule");
    Configuration.releaseRootApplicationModule (appMod, true);
    System.out.println ("Completed releaseRootApplicationModule delete");
    Return returnResult;

    In the method of application module, we have the following code.

    System.out.println ("CIGAppModuleImpl: call the database and use the value of the iterator");
    CallableStatement cs = null;
    try {}
    CS = getDBTransaction () .createCallableStatement ("start?: = macilap.user_admin.new_test_init(?,?,?);") end; ", 0) ;
    cs.registerOutParameter (1, Types.NUMERIC);
    cs.setString (2, p_userId);
    cs.setString (3, p_examId);
    cs.setString (4, p_centerId);
    cs.executeUpdate ();
    returnResult = cs.getInt (1);
    System.out.println ("CIGAppModuleImpl.createTest: return result is" + returnResult);

    } catch (SQLException to) {}
    throw new Aexception.getLocalizedMessage (se);
    }
    {Finally
    If (cs! = null) {}
    try {}
    CS. Close();
    }
    catch (SQLException s) {}
    throw new Aexception.getLocalizedMessage (s);
    }
    }
    }

    I read in one of the presentations of Steve Muench (Oracle Fusion Applications Team' best practices) that the call of the method createRootApplicationModule is a bad idea and call the method via the link interface.
    I guess that the call of the createRootApplicationModule uses a lot more resources and connections to database as the call to the method via the link interface such as

    BindingContainer links = getBindings();
    OperationBinding ob = bindings.getOperationBinding("customMethod");
    Object result = ob.execute)

    Is this the case? Also use getDBTransaction () .createCallableStatement the best average of calls to database procedures. Would it not be better to expose plsql packages such as Web services and then call from the applicationModule. Is it more effective?

    Concerning

    Orlando

    He must show them.
    But to work around the problem, try this - drag method of the data control to your page and the fall as a button.
    Then go to the source of the JSPX view and remove the button from there - if it comes to the display of the source - the link must remain in your pagedef.

  • Best practices Upgrade Path - Server 3 to 5?

    Hello

    I am trying a migration and upgrade of a server in the Profile Manager. I currently run an older mac mini Server 10.9.5 and Server 3 with a vast installation of Profile Manager. I recently successfully migrated the server itself out of the old mac mini on a Xserve end 2009 of cloning the drive. Still of double controls everything, but it seems that the transition between the mini and the Xserve was successful and everything works as it should (just with improved performance).

    My main question is now that I want to get this software-wise at day and pass to the Server 5 and 10.11. I see a lot of documentation (still officially Apple) best practices for the upgrade of the Server 3 to 4 and Yosemite, but can't find much on the Server 5 and El captain, a fortiori from 3 to 5. I understand that I'll probably have to buy.app even once and that's fine... but should I be this staging with 10.9 to 10.10 and Server 4... Make sure that all is well... and the jump off 10.11 and Server 5... Or is it 'safe' (or ok) to jump 3 to 5 Server (and 10.9.5 to 10.11.x)? Obviously, the AppStore is pleased to make the jump from 10.9 to 10.11, but once again, looking for best practices here.

    I will of course ensure that all backups are up-to-date and make another clone just before any which way that take... but I was wondering if someone has made the leap from 3-5... and had things (like the Profile Manager) still work correctly on the other side?

    Thanks for any info and/or management.

    In your post I keep the Mini running Server 3, El Capitan and Server 5 install the Xserve and walk through setting up Server 5 by hand. Things that need to be 'migrated' as Open directory must be handled by exporting the mini and reimport on Xserve.

    According to my experience, OS X Server facilities that were "migrated" always seem to end up with esoteric problems that are difficult to correct, and it's easier to adopt the procedure above that to lose one day try.

    YMMV

    C.

Maybe you are looking for

  • Pages: Print flyer A5 on A4 paper

    I have created a flyer A5 using pages and you now want to print. Because I used images completely to the edge of the flyer I want to print the flyer in the center of a piece of A4 so I can then cut the paper too far. However, whenever I print, it aut

  • Unable to connect to the servers of SnapChat. IOS 4.2.1. iPhone 3G. Error message: unable to connect to the server. Please try again later.

    Hello I can not connect to servers SnapChat IOS 4.2.1 iPhone 3G Error message: Unable to connect to the server. Please try again later Thank you for your time and understanding.

  • OFFLINE GMAIL SMTP

    Have had this problem for a while. My laptop (Gmail) SMTP server says that it is offline.  The same e-mail settings work on two desktop machines, two i-pads and an i-phone.  The it guy who helps out is also perplexed.  We solved the problem by puttin

  • HP w1907 monitor problems

    Just got this monitor 5 days ago.  Monitor HP w1907 LCD flat wide screen.  This morning when I got on the computer, I have a red line, one, down to the left at the end of the computer.  vertical.  from top to bottom.  right corresponding to the start

  • Satellite A660 - 11 M - drive HARD recovery is not possible

    Hello. I bought the satellite A660 - 11 M two months ago. A week before, he started to cause a problem that when turned on, boot HARD drive is not possible in the first place and boot priority option page is shown. Only after that I have reset a star