Good practice question

there is a procedure p(i in number, o out number) that checks some data and finishes this way if some criteria are met:
procedure p(i in number, o out number) is
select count(*) into v_counter
from ... ;
if v_counter > 0 then
  o := 123;
  return;
end if;
exception
  when others then
  o := 99999;
end;is this a good practice to finish this way (ie. return) or some other ways would be better in terms of "good practice" (like raising custom exception and handling it in exception block where out variable could be set up)?
I would appreciate your suggestions about good practices in scenario above.
thank you

943276 wrote:
there is a procedure p(i in number, o out number) that checks some data and finishes this way if some criteria are met:
..snipped..
is this a good practice to finish this way (ie. return) or some other ways would be better in terms of "good practice" (like raising custom exception and handling it in exception block where out variable could be set up)?I would call using out params as exception/error codes wrong. Never mind good or acceptable practise. It is just plain wrong. As wrong in PL/SQL as it would be wrong in Java, C#, Pascal or another language that implements exceptions.
Why? Because in such a language an exception is raised to indicate an error condition - an exception to the norm has occurred. If code suppresses the exception, that code is now saying that there is no error condition. It explicitly tells the caller that processing was successful and no exceptions to the norm have occurred.
Returning the error code as an out parameter is not acceptable - as the "contract" in such a language, between the caller and that code, states that errors are handled as exceptions. That is how the language is designed to be used. That is how the run-time of the language works.
Violating this fundamental concept in such a language makes absolutely no sense.

Similar Messages

  • Is VHDX for data drive considered good practice on a client PC?

    Hi!
    I don't like putting user's data files (documents, etc.) inside the user's Documents directory on C:. Instead I prefer having them on a D: disk, separate from the OS. On the other hand I don't want to create a fixed size partition as I consider it a waste
    of space, especially when everything is on a rather small SSD.
    Therefore, I consider creating a virtual hard disk (VHDX) on my C: drive and making it dynamically expanding. This would allow me to store data on that "separate" disk which is actually an expanding VHDX file on C:. One problem is that for some
    unknown reason Windows 8.1 is not able to auto-attach such disks on startup, but I have seen some workarounds to auto-mount them through tasks.
    My question is the following: Is it considered good practice to put all data files on such a dynamic VHDX instead on a separate partition? Reading the VHDX explanations it looks like this file format is very stable (even in case of power loss) and is widely
    used in virtual servers. Performance should be also very good. Therefore I don't see any reason to not use it for my data drive. Or are there any drawbacks?
    Thanks in advance for any help.
    Best regards,
    Anguel

    Hi,
    Since the VHDX is created on C which should be the system partition, I don’t think it is more safety than separate partition.
    Please consider that once the system corrupted and we have to format the C to reinstall the System, it may be difficult for us to recovery the date. But the separated partition will be easily stayed without changes.
    You can try to shrink the C volume in Disk management to create a new partition.
    Just my thought.  
    Kate Li
    TechNet Community Support

  • BPM Workspace Customization & User Interface: Best Practice Question

    Hi All,
    This is our first BPM Project in house and we are on Oracle BPM 11g.
    The business process involves request for approval for a permit from a public user and internal users need to approve/reject the same. Pretty simple and straightforward so far.
    But we are now having lots of questions wrt to user interface.
    1. Work Space Changes.
    If we develop this application completely in Oracle BPM, the outside user (general public) will also see the 'workspace' with its current interface. It would be impossible to handle user training on this interface for a simple Joe Bloe, who may not be computer savvy) So the requirement documents demand that the look and feel of the outside users should be totally different than what the workspace provides. They want this to be customized in such a way that iit would strip all of the default lay out (left navigation bar, and get rid of the upper section completely. with its list of tabs) and also to modify the task list that appears below).
    We have figured out how to achieve this (by modifying the workspace .jar files and recompiling the same), but is this a good approach? What happens if we are developing a brand new application on the BPM in our shop? This change will affect that application as well, as the workspace is shared and common to all the apps? I want some of you experts to let us know, your thoughts on this. If this is not a recommended practice, what would be best way to achieve what we want using Oracle BPM? (Where we want a simple intuitive user interface, without the default add ons that comes with the work space)...
    2. What would be the best method to create a user registration page (where a user creates his own login and password and maintains his account) for an application using the BPM ? Right now we are thinking this should be in either a ADF page/ JSP page or (worst case a PL SQL cartridge) that can be launched on the browser, which will be open and does not require any kind of authentication to access. Is this a good practice or recommended one? Or are we missing out on something within BPM application itself, that we are not aware of and that would let us do this?
    3. Also, if we go with an external ADF application for the 'public' user interface developement, then how can we (or can we) leverage the BPM's internal storage for the submitted data from the payload? I understand that it stores this information currently on the server 'soa infra' tables some where? Thru an external ADF app, can we write into these tables (Is this recommended or just sounds plain ridiculous)???
    Knowing answers to these questions will help us decide, if this is the right tool for the job at hand.
    Appreciate your time and xpertise.
    Thanks
    SR

    Hi All,
    This is our first BPM Project in house and we are on Oracle BPM 11g.
    The business process involves request for approval for a permit from a public user and internal users need to approve/reject the same. Pretty simple and straightforward so far.
    But we are now having lots of questions wrt to user interface.
    1. Work Space Changes.
    If we develop this application completely in Oracle BPM, the outside user (general public) will also see the 'workspace' with its current interface. It would be impossible to handle user training on this interface for a simple Joe Bloe, who may not be computer savvy) So the requirement documents demand that the look and feel of the outside users should be totally different than what the workspace provides. They want this to be customized in such a way that iit would strip all of the default lay out (left navigation bar, and get rid of the upper section completely. with its list of tabs) and also to modify the task list that appears below).
    We have figured out how to achieve this (by modifying the workspace .jar files and recompiling the same), but is this a good approach? What happens if we are developing a brand new application on the BPM in our shop? This change will affect that application as well, as the workspace is shared and common to all the apps? I want some of you experts to let us know, your thoughts on this. If this is not a recommended practice, what would be best way to achieve what we want using Oracle BPM? (Where we want a simple intuitive user interface, without the default add ons that comes with the work space)...
    2. What would be the best method to create a user registration page (where a user creates his own login and password and maintains his account) for an application using the BPM ? Right now we are thinking this should be in either a ADF page/ JSP page or (worst case a PL SQL cartridge) that can be launched on the browser, which will be open and does not require any kind of authentication to access. Is this a good practice or recommended one? Or are we missing out on something within BPM application itself, that we are not aware of and that would let us do this?
    3. Also, if we go with an external ADF application for the 'public' user interface developement, then how can we (or can we) leverage the BPM's internal storage for the submitted data from the payload? I understand that it stores this information currently on the server 'soa infra' tables some where? Thru an external ADF app, can we write into these tables (Is this recommended or just sounds plain ridiculous)???
    Knowing answers to these questions will help us decide, if this is the right tool for the job at hand.
    Appreciate your time and xpertise.
    Thanks
    SR

  • What is a good practice to handle LOV in jdev apps?

    Hi, experts,
    In jdev 11.1.2.3,
    In our projects, there are many LOVs which the value are stored in a common dictionary table, for example in table refcode:
    refcode(id, low_value,high_value,meaning,domain_no),
    Different LOVs will retrieve value pairs(low_value,meaning) , or (high_value,meaning) from refcode table by using domain_no as the filtering criteria.
    In the end user's UI, the code/number field values should be displayed by a meaning word from refcode,
    To accomplish this goal, I will create numberous associations between different tables with refcode,
    and create VOs to have refcode entity view as a secondary entity view.
    I feel some odd in doing so(because so many associations with the same refcode table),
    Is that a good practice to handle LOV this way ?
    Thanks.

    On Fusion Developer's Guide for Oracle Application Development Framework
    10.3 Defining a Base View Object for Use with Lookup Tables
    (http://docs.oracle.com/cd/E37975_01/web.111240/e16182/bclookups.htm#BABIBHIJ)
    10.3.3 How to Define the WHERE Clause of the Lookup View Object Using View Criteria
    There are valuable information and suggestions on implement lookup features, especially by using view criteria
    (the View Criteria and View accessor is one of important and great idea in ADF)
    I think, by using of view criteria, the derivative attribute to display fk information can be implemented in a convinent way without FK associations definition.

  • Best Practices Question: How to send error message to SSHR web page.

    Best Practices Question: How to send error message to SSHR web page from custom PL\SQL procedure called by SSHR workflow.
    For the Manager Self-Service application we’ve copied various workflows which were modified to meet business needs. Part of this exercise was creating custom PL\SQL Package Procedures that would gather details on the WF using them on custom notification sent by the WF.
    What I’m looking for is if/when the PL\SQL procedure errors, how does one send an failure message back and display it on the SS Page?
    Writing information into a log or table at the database level works for trouble-shooting, but we’re looking for something that will provide the end-user with an intelligent message that the workflow has failed.
    Thanks ahead of time for your responses.
    Rich

    We have implemented the same kind of requirement long back.
    We have defined our PL/SQL procedures with two OUT parameters
    1) Result Type (S:Success, E:Error)
    2) Result Message
    In the PL/SQL procedure we always use below construct when we want to raise any message
    hr_utility.set_message(APPL_NO, 'FND_MESSAGE_NAME');
    hr_utility.raise_error;
    In Exception block we write below( in successful case we just set the p_result_flag := 'S';)
    EXCEPTION
    WHEN APP_EXCEPTION.APPLICATION_EXCEPTION THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    WHEN OTHERS THEN
    p_result_flag := 'E';
    p_result_message := hr_utility.get_message;
    fnd_message.set_name('PER','FFU10_GENERAL_ORACLE_ERROR');
    fnd_message.set_token('2',substr(sqlerrm,1,200));
    fnd_msg_pub.add;
    p_result_message := fnd_msg_pub.get_detail;
    After executing the PL/SQL in java
    We have written some thing similar to
    orclStmt.execute();
    OAExceptionUtils.checkErrors (txn);
    String resultFlag = orclStmt.getString(provide the resultflag bind no);
    if ("E".equalsIgnoreCase(resultFlag)){
    String resultMessage = orclStmt.getString(provide the resultMessage bind no);
    orclStmt.close();
    throw new OAException(resultMessage, OAException.ERROR);
    It safely shows the message to the user with all the data in the page.
    We have been using this construct for a long time for all our projects. They are all working as expected.
    Regards,
    Peddi.

  • JTable: RFC on good practice (SQL queries from cell editor)

    I usually add/remove/edit JTable data from an external panel. But in this scenario, my client would like to be able to click on the first column of an empty row and enter a product number. Within the cell editor, I must make an SQL query to the database in order to determine if the product number is valid and if so, use part of the SQL data to populate other cells of the current row (like product description).
    My problem is that this just doesn't seem right! Isn't the cell editor executed on the only Swing thread? Also, if the product number is not valid, I correctly implement the stopCellEditing() method but for some reason, you can still navigate the table (click on any other cell or press the TAB key, etc)... weird!!
    Does anyone have a good practice on how to perform the SQL query in a better place and force a cell to be selected until you enter a valid number or press the CANCEL key?
    I was looking at implementing the TableModelListener's tableChanged(...) method but I'm not sure if that would be a better place either.
    I personally would edit outside of the table, but good practice seems hard when the requirement is to edit from a cell editor!!
    Any suggestion would be greatly appreciated!
    Thanks!

    maybe you could write an input verifier for the column that does the query and rejects invalid entries.
    maybe you could send the query off in a worker thread.
    as far as making the table so you can't select any cells, hmm. not sure.
    you could disable
    .setEnabled(false);the table until the query comes back, something like that.

  • Oracle Asset (Functional) Practice Questions for Interviews and Exam

    https://www.createspace.com/3495382
    http://www.amazon.com/Functional-Questions-Interviews-Certification-Examination/dp/1456311581/ref=sr_1_4?ie=UTF8&s=books&qid=1289178586&sr=8-4
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Oracle Asset (Functional) Practice Questions for Interviews and Certificati

    https://www.createspace.com/3495382
    List Price: $29.99
    Add to Cart
    Oracle Asset (Functional) Practice Questions for Interviews and Certification Examination (Release 11i and 12)
    Functional Consultant
    Authored by Erp Gold
    This book contains 150 Oracle Asset Practice Questions for functional consultants. Very useful for interviews and certification examinations.
    Publication Date:
    Oct 26 2010
    ISBN/EAN13:
    1456311581 / 9781456311582
    Page Count:
    94
    Binding Type:
    US Trade Paper
    Trim Size:
    6" x 9"
    Language:
    English
    Color:
    Black and White
    Related Categories:
    Computers / General

    Reported as spam!

  • Good inteview  Question?

    hi ,
      Plz give good int questions on bdc with answers...
    regards

    Hi Deepak,
    What is BDC- its use, and how to use it?
    It is Batch Data conversion used for transferring some data other than sap into sap ... this is also a work of an ABAPer.
    What is "UTS" Or may be it is "UST", something called Unit test?
    Use:  After developing any object we should write a test case proving that the object is working properly or not.  This is done by the ABAPer. This is UNIT TEST CASE.
    In BDC how can we handle Table Controls?
    When you do your recording you will have a tab for Next line or Insert. You have to capture that in your recording. If your transaction code doesn't have that in the recording then you have to set up a page down (=P+) and loop it based on the line entries u c on teh screen. 
    Suppose we are transfer data through BDC from leagacy to SAP and their is some duplicate data in legacy system but we don't want this in SAP system .So how can we check that this data is already exist? 
    In BDC you would have all your legacy data in an internal table. Use Delete Adjacent dulpicates syntax to delete duplicate entries.
    Can we use two transaction code in one BDC like XK01 & XD01 if yes how?
    Yes, we can do that by combining the two bdc program codes together.  Then you perform the program routine accordingly.  However, it will make your BDC program very long and complex.
    How can we handle errors in Function Module?
    Exceptions is used to handle errors.
    Can we use Session method & Call transaction both in one BDC if yes please give me example and scenerio where we use this?
    You start your dataload using Call Transaction and if any errors occur push all those errors in a session so that your dataload takes place uninterrupted and you can processs ur errors later.
    Hope this resolves your query.
    Reward all the helpful answers.
    Regards

  • Best practice question -- copy container, assemble it, build execution plan

    So, this is a design / best practice question:
    I usually copy containers as instructed by docs
    I then set the source system parameters
    I then generate needed parameters / assemble the copied container for ALL subject areas present in the container
    I then build an execution plan JUST FOR THE 4 SUBJECT AREAS and build the execution plan and set whatever is needed before running it.
    QUESTION - When i copy the container, should i delete all not needed subject areas out of it or is it best to do this when building the execution plan? I am basically trying to simplify the container for my own sake and have the container just have few subject areas rather than wait till i build the execution plan and then focus on few subject areas.
    Your thoughts / clarifications are appreciated.
    Regards,

    Hi,
    I would suggest that you leave the subject areas and then just don't include them in the execution plan. Otherwise you have the possibility of running into the situation where you need to include another subject area in the future and you will have to go through the hassle of recreating it in your SSC.
    Regards,
    Matt

  • SAP Adapter Best Practice Question for Deployment to Clustered Environment

    I have a best practices question on the iway Adapters around deployment into a clustered environment.
    According to the documentation, you are supposed to run the installer on both nodes in the cluster but configure on just the first node. See below:
    Install Oracle Application Adapters 11g Release 1 (11.1.1.3.0) on both machines.
    Configure a J2CA configuration as a database repository on the first machine.
    Perform the required changes to the ra.xml and weblogic-ra.xml files before deployment.
    This makes sense to me because once you deploy the adapter rar in the next step it the appropriate rar will get staged and deployed on both nodes in the cluster.
    What is the best practice for the 3rdParty adapter directory on the second node? The installer lays it down with the adapter rar and all. Since we only configure the adapter on node 1, the directory on node 2 will remain with the default installation files/values not the configured ones. Is it best practice to copy node 1's 3rdParty directory to node 2 once configured? If we leave node 2 with the default files/values, I suspect this will lead to confusion to someone later on who is troubleshooting because it will appear it was never configured correctly.
    What do folks typically do in this situation? Obviously everything works to leave it as is, but it seems strange to have the two nodes differ.

    What is the version of operating system. If you are any OS version lower than Windows 2012 then you need to add one more voter for quorum.
    Balmukund Lakhani
    Please mark solved if I've answered your question, vote for it as helpful to help other users find a solution quicker
    This posting is provided "AS IS" with no warranties, and confers no rights.
    My Blog |
    Team Blog | @Twitter
    | Facebook
    Author: SQL Server 2012 AlwaysOn -
    Paperback, Kindle

  • Is that a good practice to use syncronize methods for application scope cls

    Is that a good practice to use synchronize method in a application scope class, so I have a doubt, there a is class A, it has application scope and it contains a synchronized method add, so because of some network traffic or any unexpected exception client1 got stuck in the method, will that add method available for any other client...?
    Edited by: navaneeth.j on Dec 17, 2009 4:02 AM
    Edited by: navaneeth.j on Dec 17, 2009 4:04 AM

    If it needs synchronization, then it probably doesn't belong in the application scope. Either keep it as is, or reconsider the scope, or make it static.

  • SAP Adapter Best Practice Question for Migration of Channels

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

    I have a best practice question on the SAP adapter when migrating an OSB project from one environment (DEV) to another (QA).
    If my project includes an adapter channel that (e.g., Inbound SAP Proxy listening on a channel), how do I migrate that project to another environment if the channel in the target environment is different.
    I tried using the search and replace mechanism in the sbconsole, but it doesn't find the channel name in the jca and wsdl files.
    What is the recommended way to migrate from one environment to the other when the channel name changes?

  • Overloaded methods-yes or no & is this a good practice

    say i have two methods with the same name that take in the same parameters and have the same return type. the difference between the two is that one is static while the other is not. Also the methods contain different codes.
    are the methods going to function normally when i use em? also if they do function normally, is this essentially a good practice?
    if code is needed to answer this, please do mention it and i will think of a mini scenario where this can be applied and write a small piece of code for that.
    thanx. help will be appreciated.

    avi.cool wrote:
    duffymo wrote:
    each account has its own password that the user sets when the account is created-this password is declared as a state variable in the class file. One password per account? A bad model, IMO. My on-line banking software associates credentials with me, not my accounts. I see several accounts when I log in, and I don't have to log in individually for each one.
    besides that, theres also a bank password-this is declared and initialized as a static state variable in the class file. some of the operations require the bank password for access while others require account password.Static bank password? I'm very glad this is a throw-away student exercise, because you have no idea what you're doing.hahaaa, tru tru, its for a skool assignment for my first ever programming course. though not a throw away, i putting a lot of work into this :-) i m not actually trying to resolve any security issues here or strengthen account security. basically, I am only trying to exhibit a tiny bit of creativity while showing understanding of course contents. so nothing to stress on :-D i know not very creative but its all i got at this stage.
    i was trying to exhibit the use of overloaded methods in my program by having method to check the password that the user enters to access operations.
    now the ones that require account password, i was thinking of having the password check method as a non-static method since its associated with the object.
    while the ones that need bank password, i wanted to have as static method.
    i wanted both methods to have the same name.You've no idea what you're doing.
    how i solved it,
    i decided on having both methods as static methods. the one that checks account password, takes in two parameters, the account name(object name) and the string to be checkd. the one that checks bank password, takes in only one parameter- the string to be checked.Wrong.i would be really thankful if you could help me rectify my mistake and advice on how i should be doing this. is there a conceptual error? i am a bit confused now.
    Its exactly what I told you.. but now, you just have to come on here and post this :p
    and isn't this sort of like cheating? :P I mean this IS our exam you know... You're basically asking other for the arithmetic and logic lol.

  • What is good practice for playing multiple video's in a single swf?

    Hello,
    I have build in the past a video wall with video's inside. After building this i came across some problems.
    If you have too many video players loading at once it takes a lot of processing and the tweens in the
    page while loading the video's where not moving fluidly, but more in a stuttering way.
    After lot's of test i found a good working solution.  I imported the flv video's into flash en exported them on the timeline
    as a embedded swf.  Then i externally loaded these swf files and that performed much better.
    Is it even good practice to load multiple video instances at once? I used this time the LoaderMax of greensock but the video's
    only play after it's completely loaded. I would like to find a way to progressive play all video's at.
    Does someone has experience with this?
    Regards,
    Chris.

    How about an XML file which supplies the title for each movie and the location or source of the video to be played?  Simple version below.
    <?xml version="1.0" ?>
    - <playlist>
    <video src="Gfx/video/Alex1.f4v" title="John Deere 330" />
    <video src="Gfx/video/Benni1.f4v" title="Hitachi Z240F" />
    <video src="Gfx/video/Scotti1.f4v" title="Hitachi Z350F" />
    <video src="Gfx/video/Scotti2.f4v" title="Hitachi Z350F" />
    </playlist>
    JR

Maybe you are looking for

  • Declare global table in web dynpro

    Hi, How can I declare a global table in web dynpro?

  • Office 365 ProPlus Activation Issues

    Issue Resolved:  After adding all of the Office 365 URL's and Address Ranges to our internet filters exception list activation worked.  Hi Everyone I'm preparing for a deployment of Office 365 ProPlus using the Office Deployment Tool (ODT) and having

  • Jbo:datasource orderbyclause never resets during application

    My application uses a dynamic viewobject and I use a jbo:datasource to retrieve my information and print it in my jsp page. now when running my application the first set of the orderbyclause in jbo:datasource for instance String columnName = "first";

  • Connecting Problems

    Hey Guys yesterday i downloaded sql server managment 2008 r2. And could not connect to it. On my old Pc he gaved me automaticly the connecting info and it worked to connect fast on it. ANd when i started the programm yesterday, i didnt get any connec

  • Help on Closing Cockpit

    Hi, I have found the doc and info on the cockpit from this forum very helpful. I might need additional help as I am struck. How can we handle program and T-Code in Cockpit? How about the t-code with a variant. Cockpit is not letting to add it as prog