How to test a procedure in plsql developer

Hi all,
Can anyone please tell me how should I test a procedure and find the dbms_output. Thanks.
Sara Dee

My procedure is complied with warnings. FYI: Compiler warnings differ from compiler errors. You can also disable the warnings, sometimes they're quite annoying.
"While compiling stored PL/SQL units, the PL/SQL compiler generates warnings for conditions that are not serious enough to cause errors and prevent compilation—for example, using a deprecated PL/SQL feature."
http://docs.oracle.com/cd/E11882_01/appdev.112/e25519/errors.htm#LNPLS00711
But when I test the procedure, what should I include in the dbms_output.put_line?Whatever it is you want/need to know.
It could be the actual value of a parameter or variable you want to check, for example.
Or in an IF-THEN-ELSE construction, you can see through which part the code actually runs.
Another word is 'code instrumentation'.
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:936291700346739708
http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:54174245781686
http://tkyte.blogspot.nl/2005/06/instrumentation.html

Similar Messages

  • How to test Stored Procedure

    I am a MS SQL developer shifting to Oracle PL/SQL...
    I am able to write Stored procedure without problem but don't know how to test it.... Testing is a problem...
    As of now i am asking front end guys to test it, mainly these Stored Procedure are select , insert , update....
    Please help....

    The SQL Developer homepagehas links to demos and tutorials that cover PL/SQL editing and debugging and UnitTesting.
    Sue

  • How to test a procedure which returns a recordset from pl/sql

    hello,
    Is it possible to test a procedure which returns a recordset from pl/sql?
    Everything I try results in errors like PLS-00382: expression is of wrong type, when I try to open the result cursor
    or PLS-00221: tc is not a procedure or is undefined.
    I created the following procedure:
    CREATE OR REPLACE PACKAGE test AS
    TYPE cursorType is REF CURSOR;
    PROCEDURE test_cursor( tc IN OUT cursorType,
    v_err OUT varchar2,
    v_msg OUT varchar2);
    END;
    CREATE OR REPLACE
    PACKAGE BODY test AS
    PROCEDURE test_cursor
    (tc IN OUT cursorType,
    v_err OUT varchar2,
    v_msg OUT varchar2)
    AS
    BEGIN
    open tc for
    SELECT '1' "number" FROM dual
    union
    select '2' "number" from dual;
    v_msg := 'no errors';
    v_err := 0;
    EXCEPTION
    WHEN NO_DATA_FOUND
    THEN
    v_msg := 'no data found';
    v_err := SQLCODE;
    WHEN OTHERS
    THEN
    v_msg := SQLERRM;
    v_err := SQLCODE;
    END;
    END;
    I try to get the output from pl/sql with something like this:
    DECLARE
    TC PROVGRON.TEST.cursorType;
    V_ERR VARCHAR2(200);
    V_MSG VARCHAR2(200);
    BEGIN
    V_ERR := NULL;
    V_MSG := NULL;
    PROVGRON.TEST.TEST_CURSOR ( TC, V_ERR, V_MSG );
    DBMS_OUTPUT.Put_Line('V_ERR = ' || V_ERR);
    DBMS_OUTPUT.Put_Line('V_MSG = ' || V_MSG);
    -- in tc I was hoping to hava a cursor??
    FOR i IN tc
    LOOP
    DBMS_OUTPUT.PUT_LINE (i.number);
    END LOOP;
    END;
    Without the for loop (or open tc) the pl/sql will output:
    V_ERR = 0
    V_MSG = no errors
    PL/SQL procedure successfully completed.
    With anything I try with the cursor I get errors?
    What am I doing wrong?

    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch5.htm#sthref1122

  • How to debug a procedure in SQL Developer

    i am a plsql writer .... i use SQL Developer to connect to oracle on windows platform ... iam using oracle
    version 10g some time i need to debug a procedure or i want to run a procedure in debug mode
    please tell me how to do this SQL Developer

    There's great help inside sqldev, just follow the Help Contents - Concepts and usage - Running and debugging...
    Have fun,
    K.

  • I'm Back! testing a procedure thru PL/SQL Block

    Hello all!
    Do you know how to test a procedure? please check mine, its gave me error of the following:--see bottom for my test pls/sql code:
    ORA-06550: line 4, column 1:
    PLS-00306: wrong number or types of arguments in call to 'MEMBER_CK_SP'
    ORA-06550: line 4, column 1:
    PL/SQL: Statement ignored
    2. lv_name varchar2(20);
    3. begin
    4. member_ck_sp('rat55','kile',lv_name);
    5. end;
    6. /
    CREATE OR REPLACE PROCEDURE member_ck_sp
    (p_id IN VARCHAR2,
    p_pw IN OUT VARCHAR2,
    p_cook OUT NUMBER,
    p_check OUT VARCHAR2)
    IS
    BEGIN
    SELECT firstname||' '||lastname, cookie
    INTO p_pw, p_cook
    FROM bb_shopper
    WHERE username = p_id
    AND password = p_pw;
    EXCEPTION
    WHEN NO_DATA_FOUND THEN
    p_check := 'INVALID';
    END;
    ---below is the test of the procedure--
    declare
    lv_name varchar2(20);
    begin
    member_ck_sp('rat55','kile',lv_name);
    end;
    /

    Hello Justin,
    I am new to Oracle and I was looking for an answer for a similar problem that I was facing and landed on to this link. I hope you will guide me thru this.
    I am writing a procedure to insert data to a table. My procedure works fine but I am not able to get the Exceptions run.
    I was trying to supress the error ORA-06550 thru PRAGMA EXCEPTION_INIT so that if less or wrong parameters are passed to the procedure then instead of an Oracle I would provide my own error statement.
    I have coded something like this:
    create or replace PROCEDURE emp_insert (....+parameters+....)
    inv_data EXCEPTION;
    PRAGMA EXCEPTION_INIT(inv_data, -06550);
    begin
    EXCEPTION
    When inv_data then
    dbms_output.put_line('xxxxxxx')
    END emp_insert;
    But even after this I am getting the Oracle error statments when I pass wrong parameters:
    EXECUTE emp_insert('ABC',NULL)
    Error report:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'EMP_INSERT'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    06550. 00000 - "line %s, column %s:\n%s"
    *Cause:    Usually a PL/SQL compilation error.
    *Action:
    Am I handling the exception correctly?
    If not, is there any other way to supress this error.
    I would really appreciate your help on this.
    Thanks,
    Nitin

  • How run Procedure in SQL Developer?

    I need run procedure in SQL Developer with parameter : 2009
    create or replace PROCEDURE "update_table" (ff_year in varchar2) AS
    CURSOR c_update IS
    select DISTINCT P.mafew name, u.frew nameone, t.greddf, .........
    I click green button RUN and have new window Run PL/SQL. Where in this script I need to print 2009?
    DECLARE
    FF_YEAR VARCHAR2(200);
    BEGIN
    FF_YEAR := NULL;
    update_table(
    FF_YEAR => FF_YEAR
    END;

    Hi,
    user10886774 wrote:
    Thanks all!
    I can run the procedure like 1 or 2 example? Is it right?
    1 like Run Script
    EXEC "UPDATE_TABLE" ('2009');
    2 click RUN on UPDATE_TABLE procedure
    DECLARE
    FF_YEAR VARCHAR2(200);
    BEGIN
    FF_YEAR := '2009';
    UPDATE_TABLE(
    FF_YEAR => FF_YEAR
    END;
    What is the name of the procedure?
    Is it update_tabe (all small letters)? If so, you must reference it as "update_table" (all small letters, inside double-quotes).
    Is it UPDATE_TABLE (all capital letters)? If so, you have the choice of referencing it as "UPDATE_TABLE" (all capital letters, inside double-quotes) or as update_table, or Update_Table, or UPDATE_TABLE, or uPdAtE_taBle, or ... (any kind of letters, without quotes).
    How about commit after?How about it?
    What is the question?
    If you want to commit, say COMMIT or click on the COMMIT icon.

  • How will u transport Xi scenario from development to testing?

    How will u transport Xi scenario from development to testing?

    Hi,
    There are mainly two ways for transportation in XI:
    1. Transporting XI Objects:
    http://help.sap.com/saphelp_nw04/helpdata/en/93/a3a74046033913e10000000a155106/frameset.htm
    2. How To…Transport XI Content Using CMS:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f85ff411-0d01-0010-0096-ba14e5db6306
    The second method is more useful.
    Note: Please close the thread once it is answered.
    Regards,
    Subhasha

  • How to test and startup form/report 6i developer

    Hi all:
    I'm a newer in form/report 6i developer. I've installed form/report 6i developer but I don't know how to test if it is sucessful or not. Can you guy tell me how to test it please?
    thanks in advance.
    NOTE: My OS is rhel 3

    Thankyou for taking the time to respond and for providing such detailed articles on adobe dps development, it is much appreciated.
    I had completely missed that article and was struggling to find anything useful from googling!
    Dave

  • How to create, deploy and test JSP program in Netweaver developer studio?

    Hi Experts,
       I am trying to integrate a JSP program with SAP function module (RFC) via XI using Java proxy. I am using Netweaver Developer studio for Java programming.
      Can somebody send me the steps or user guide on how to create, deploy and test JSP program in Netweaver developer studio?
      I will be greatful to you.
    Please help!
    Thanks
    Gopal

    Hi Gopal,
    Which version of NetWeaver are you using?
    Here the links for --
    SAP NetWeaver CE 7.1
    [Developing JSP Pages|http://help.sap.com/saphelp_nwce10/helpdata/en/f7/f7bc3d8af79633e10000000a11405a/frameset.htm]
    [Deploying Applications|http://help.sap.com/saphelp_nwce10/helpdata/en/3c/52413e7bcd561ee10000000a114084/frameset.htm]
    NetWeaver 7.0 (2004s) and 2004
    [Developing JSP Pages|http://help.sap.com/saphelp_nw70/helpdata/en/f7/f7bc3d8af79633e10000000a11405a/frameset.htm]
    [Deploying EARs|http://help.sap.com/saphelp_nw70/helpdata/en/f0/122abf61d4974eaea6b5d9c314cff1/frameset.htm]
    Testing is very straightforward - just access the web application by its alias,
    e.g. http://<host>:<post>/<context-root>/myJSP.jsp
    HTH!
    \-- Vladimir

  • Need help in regarding Oracle PLSQL developer interview questions

    Hi all,
    I am totally new in this field regarding plsql. I have just finished training in oracle plsql and in oracle financials. But for starting career i am looking jobs as:Oracle plsql developer. Can somebody help me what type of questions people going to ask? I am not confident yet, i have made my resume but for submitting resume i just want to be aware for the interview questions. Can somebody help me in telling me good questions and answers as to what to prepare?
    Thanks in advance.

    1.
    Do you have experience in Oracle 10g? If so, what are your favorite new features? (shows depth of experience and how well they are keeping up with technology)
    2.
    Partitioning (Practical Scenarios)
    1.
    Have you ever worked with partitioned tables? Example:
    2.
    What types of partitioning?
    3.
    What types of indexing, global or local? Why did you choose global or local?
    4.
    What do you see in SQL that is accessing partitioned tables that enables Oracle to take advantage of partitioning?
    5.
    What is partition pruning?
    3.
    PL/SQL Bulk Features
    1.
    Have you ever used PL/SQL bulk features? Which ones? Can you provide an example?
    2.
    What makes bulk processing faster?
    3.
    What PL/SQL data constructs are required to use bulk features?
    4.
    Oracle Collections
    1.
    What are the three types of collections?
    2.
    When would you use a varray versus a nested table?
    5.
    Global Temporary Tables
    1.
    Have you ever used Global Temporary Tables? Example:
    2.
    How does Oracle treat Global Temporary Tables differently than regular tables, making them faster?
    6.
    Autonomous Transactions
    1.
    What is an autonomous transaction? Example:
    7.
    SQL Tuning
    1.
    Someone comes to you with a SQL statement that is running slow, what are some potential problems that can be identified just by looking at the SQL statement?
    2.
    What are the steps you follow in the database to tune SQL?
    8.
    Locking Techniques
    1.
    Types of Locks
    1.
    Optimistic
    2.
    Pessimistic
    3.
    Lock Escalation
    9.
    Autonomous transactions, where to use examples if any
    10.
    Difference between Truncate and Delete Statement
    11.
    PL/SQL tables, index by tables, VARRAY, associate arrays, differences and when to use
    12.
    Performance tuning related, Using Explain plan, SQL* Plus auto trace, and using tkprof
    13.
    Different types of joins oracle uses ( Hash join, Merge Join, Nested loop join)
    14.
    Oracle SQL ANSI syntax ( JOIN USING, JOIN ON, LEFT OUTER JOIN,RIGHT OUTER JOIN etc..)
    15.
    dbms_profiler package uses
    16.
    Unit testing approach, if you know and worked on out PLSQL frame work for automatic testing, its big advantageous
    17.
    Oracle approach for read consistency, what is SCN, dirty reads, phantom reads etc..
    18.
    Standards ( Coding standards, naming standards etc.) , There are guidelines and naming standards for variables, package, procedure, function names, database object names etc…( Be prepared what standards you followed in previous projects )
    19.
    Snapshot too old error, fetch out of sequence error when it comes, should be able to explain.
    20.
    Oracle block, what it contains. Row chaining, row migration concepts
    21.
    Version control software’s (experience in clearcase and clearquest is big advantage). If you have not used these, know about the importance of these and be prepared to explain which ones you used in previous projects, and how the PL/SQL code used to deploy.
    22.
    Oracle server architecture, know about oracle memory structures, background processes overview

  • Need advise on SQL,plsql developer career and future

    Hi all,
    I need all your advise in making an important decisions of my career path.I work in the IT field and have about total 4-5 years of work experience involving development and testing in a product based organization.
    Presently-i have got chance since last 4-5 months to work with writing PLSQL code,SQL etc on a part basis. I am very much interested to continue my career path as a PLSQL developer.
    But, unfortunately -in the total of my work experience-in the past 2-3 years-i worked with a internally developed DB query language(similar to SQL) and then from last few months with plsql. But this chance to work with PLSQL has been for less time and limited scope after which i will have to work on something different.
    Ii want to fully take on my career in SQL,PLSQL as Database Developer.
    Please advise me if my thinking seems logical and good and if I could do it. I have planned on applying for relevant SQL,PLSQL profile jobs.
    Now, My serious worry and concern is I feel that since i have worked very less with PLSQL-so am low in confidence that I feel i wont be able to answer ,or tell or not knowledgeable enough to be able to clear the technical interviews for SQL,plsql development profile which would need at least some years of experience.
    I have started studying and practsing PLSQL,sql by myself for from internet. So, can you all please advise me on how could i prepare myself for hard core technical interviews of SQL,PLSQL knowledge for about 2-3 years expertise.
    I know its not much possible to be competent so much in the subject by just studying and practicing.Its easy as saying to study and get it by myself-but i want to try and will put my best for it.
    Please help me with your inputs,all interview questions,hard ones-suggestions,links,any study materials, real time problems which i can try solving of SQL, PLSQL development.
    Thanks All

    Hi,
    A very good starting point is (in my opinion): [Steven Feuerstein PL/SQL Obsession|http://www.toadworld.com/Knowledge/DatabaseKnowledge/StevenFeuersteinsPLSQLObsession/tabid/153/Default.aspx]. Also the official site [PL/SQL Technology Center|http://www.oracle.com/technology/tech/pl_sql/index.html]
    Regards,

  • Oracle PLSQL developer guidance needed

    Hi,
    I am working as a PLSQL developer since last 3 years ,have a oracle certification on it. My current profile also includes
    dba activities related to development and test databases.
    Wanted to ask if i continue further in plsql would doing a oracle dba certification be helpful for my career.
    Also that after a couple of years in plsql what would be my profile and if i went for a dba profile now then what would be my profile.
    Seniors please guide.
    Thanks.

    A-K wrote:
    Hi,
    I am working as a PLSQL developer since last 3 years ,have a oracle certification on it. My current profile also includes
    dba activities related to development and test databases.
    Wanted to ask if i continue further in plsql would doing a oracle dba certification be helpful for my career.
    Also that after a couple of years in plsql what would be my profile and if i went for a dba profile now then what would be my profile.
    Seniors please guide.
    Thanks.bigdelboy is not a senior, merely a bigdelboy ... thoug I suppose as he was talking about ICL4130's today his age may be showing a little.
    As you have a PL/SQL I assume (possibly incorrectly) it is a PL/SQL OCA certification. In that case you should ensure you get a PL/SQL OCP first to demonstrate a high level of competence in that area.
    After that you may feel that a DBA certifcatiion may be helpful it towards some of the 'DBA' takes you are doing. 'DBA' covers a whole load of things, so its difficult to say how relevant the OCA would be for you. But a different way of looking at it is that self studying for a DBA probably wouldn't do much harm and you would learn cosething is the self study. But having said that you might want to review other things to look at:
    (1) Make sure you have done the 2 day dba course (and sit the exam also. You would get a cert but you might get a useful exam pass and it might be relevant to what you are doing).
    (2) Make sure there isn't something else you should be doing instead. The SQL OCE would be one thought. Or perhaps something completely different like UML. Or maybe some of the SOA stuff. Or maybe things that are not certifable like SQL statement tuning, or database security things, or Business intelligence .....
    The things I've mentioned are not directly career moved focused, so in that sense I probably havan't answered your question.
    Rgds - bigdelboy.

  • Not able to connect db using developers(plsql developer,sql developer)

    Hi,
    I used to work on plsql developer, but since from few days i am not able to connect to it, so i have installed sql developer still i am not able to connect to database.
    I can connect to the database using sql*plus. dont know what happend suddenly i have not changed any settings.
    I am getting the error when connecting sql developer: Status : Failure -Test failed: IO Error: The Network Adapter could not establish the connection
    when connecting through plsql developer getting the error: ora-12545 connect failed because target host or object does not exist
    Please help.
    Thanks,
    Vinod

    Wrong forum - please repost in the SQL Developer forum, edit this post to include the link to the SQL Developer thread and then mark this as ANSWERED.
    SQL Developer
    >
    when connecting through plsql developer getting the error: ora-12545 connect failed because target host or object does not exist
    >
    In you post on the other forum include your 4 digit Oracle version and the version of SQL Developer that you are using.
    Also provide the step by step details of how you are trying to create the new connection.
    The error message is telling you that you are using a server or host name that does not exist.

  • Junior PLSQL Developer please help

    hello,
    i am working as PLSQL DEVELOPER
    i have written one procedure for my client, that will insert all the transactions that are done on particular day into a table.my peocedure is completed sucessfully but
    Here my problem is , my procedure should execute everyday
    at 7PM .i don't know how to execute that procedure everyday at 7PM.
    please give suggestions on this urgent
    regards
    vamsi

    You can obviously schedule a job in database using Database Scheduler but you should have a appropriate privilege to do so.
    Best thing is ask your DBA and they will schedule for you. You just have to proivde, what time you want to execute and what you want to execute and they will take care.
    SYS.DBMS_SCHEDULER.CREATE_JOB
    job_name => 'your_job_name'
    ,start_date => TO_TIMESTAMP_TZ('2007/05/21 14:08:13.335383 -04:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
    ,repeat_interval => 'FREQ=DAILY;BYHOUR=7;BYMINUTE=00'
    ,end_date => NULL
    ,job_class => 'DEFAULT_JOB_CLASS'
    ,job_type => 'PLSQL_BLOCK'
    ,job_action => 'begin YOUR_JOB_NAME ; end;'
    ,comments => 'ANYCOMMENT'
    );

  • How to test a simple PL SQL function from another PL SQL script

    Hi,
    I have created a function. Now i need to test that whether it is returning the correct values or not.
    For that, i have written anothe pl sql script and trying to call this function. Im passing all the IN parameters in that function. I assume here that OUT parameters will provide me the result. Im trying to display the OUT parameter one by one to see my result.
    I'm using toad as sql client here connected with oracle.
    pl sql script:-
    DECLARE
    BEGIN
         DBMS_OUTPUT.PUT_LINE('$$$$$$$ VINOD KUMAR NAIR $$$$$$$');
         FETCH_ORDER_PRODUCT_DATA(320171302, 1006, 6999,
    ODNumber OUT VARCHAR2, Line_Number OUT VARCHAR2,
    ServiceID OUT VARCHAR2, BilltoNumber OUT VARCHAR2,
    AnnualPrice OUT NUMBER, CoverageCode OUT VARCHAR2)
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ODNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | Line_Number );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | ServiceID );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | BilltoNumber );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | AnnualPrice );
    DBMS_OUTPUT.PUT_LINE('HERE IS THE RESULT ' | CoverageCode );
    END;
    Function:-
    Program Name : SPOT_Order_Product_Data_For_CFS.sql
    Description : Function to Validate parameters from CFS
    By : Vinod Kumar
    Date : 08/19/2011
    Modification History
    By When TAR Description
    CREATE OR REPLACE FUNCTION FETCH_ORDER_PRODUCT_DATA(orderNumber IN VARCHAR2, customerNumber IN VARCHAR2,
    productLine IN VARCHAR2, ODNumber OUT VARCHAR2,
    Line_Number OUT VARCHAR2, ServiceID OUT VARCHAR2,
    BilltoNumber OUT VARCHAR2, AnnualPrice OUT NUMBER,
    CoverageCode OUT VARCHAR2)
    RETURN VARCHAR2 IS
    lv_err_msg VARCHAR2(100) := '';
    lv_bucket_id VARCHAR2(14);
    lv_bill_number VARCHAR2(30);
    lv_anual_price NUMBER;
    lv_coverage_code VARCHAR2(8);
    lv_quote_num NUMBER(10) := NULL;
    lv_line_num NUMBER(5) := 0;
    lv_customer_number VARCHAR2(30) := customerNumber;
    lv_product_id VARCHAR2(14) := productLine;
    lv_count_quote NUMBER := 0;
    lv_quote_status VARCHAR2(5);
    lv_quote_version NUMBER(2):=0;
    BEGIN
    IF INSTR(orderNumber, '-') = 0 THEN
    lv_quote_num := orderNumber;
    ELSE
    lv_quote_num := SPT_Delimiter(orderNumber, 1, '-');
    lv_line_num := SPT_Delimiter(orderNumber, 2, '-');
    END IF;
    --Check status of the quote COM, APP
    SELECT COUNT(*) INTO lv_count_quote FROM sot_order_header WHERE ORDER_NUMBER=lv_quote_num
    AND ORDER_STATUS IN ('APP', 'COM') AND CUSTOMER_NUMBER = lv_customer_number;
    IF lv_count_quote = 0 THEN
    lv_err_msg := 'Invalid Order number';
    RETURN lv_err_msg;
    END IF;
    -- Fetch the latest version on SPOT quote
    SELECT MAX(VERSION_NUMBER) INTO lv_quote_version FROM SPT_QUOTE_HEADER WHERE QUOTE_NUMBER = lv_quote_num
    AND CUSTOMER_NUMBER = lv_customer_number;
    -- If quote is valid fetch the data in OUT parameters
    IF lv_line_num = 0 THEN
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.LINE_NUMBER, b.BUCKET_ID,
    b.ANNUAL_REF_RATE_USD, b.COVERAGE_CODE
    INTO lv_bill_number,lv_line_num,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
    lv_err_msg := 'Multiple PIDs existing in the SPOT order, please provide the SPOT order + line number as input data';
    RETURN lv_err_msg;
    END;
    ELSE
    BEGIN
    SELECT a.CUSTOMER_BILLTO_NUMBER,
    b.BUCKET_ID, b.ANNUAL_REF_RATE_USD,
    b.COVERAGE_CODE
    INTO lv_bill_number,lv_bucket_id,lv_anual_price,lv_coverage_code
    FROM SPT_QUOTE_HEADER a, SPT_QUOTE_LINE b
    WHERE a.QUOTE_NUMBER = lv_quote_num
    AND a.CUSTOMER_NUMBER = lv_customer_number
    AND a.VERSION_NUMBER = lv_quote_version
    AND a.QUOTE_NUMBER = b.QUOTE_NUMBER
    AND a.VERSION_NUMBER = b.VERSION_NUMBER
    AND b.PRODUCT_ID = lv_product_id
    AND b.LINE_NUMBER = lv_line_num;
    ODNumber := lv_quote_num;
    BilltoNumber := lv_bill_number;
    Line_Number := lv_line_num;
    ServiceID := lv_bucket_id;
    AnnualPrice := lv_anual_price;
    CoverageCode := lv_coverage_code;
    RETURN '';
    EXCEPTION WHEN OTHERS THEN
              lv_err_msg := 'Multiple SPOT lines exist with same parameter';
              RETURN lv_err_msg;
    END;
    END IF;
    EXCEPTION
    WHEN OTHERS THEN
    lv_err_msg := '@@@ EXCEPTION THROWN @@@ '|| SUBSTR(SQLERRM,1,120);
    RETURN lv_err_msg ;
    END;
    Don't look at the function, it might have errors but my primary concern is how to test this function. Once I start doing its testing then only i can understand any bugs(if any).
    My pl sql is not so good. Im still learning. I don't understand IN and OUT parameters are.
    I just know that IN parameters r those whick we pass in to the function wen we call it and OUT parameters are those through which we get the result.
    Thanks in advance
    Vinod Kumar Nair

    20100511 wrote:
    I wondered how I could test the output of the function from within TOAD?I usually create the following function in my developer schema:
    create or replace function BoolToChar( b boolean ) return varchar2 is
    begin
      if b then
        return( 'TRUE' );
      else
        return( 'FALSE' );
      end if;
    end;To test a function like yours, the following will do in SQL*Plus/TOAD/etc:
    begin
      DBMS_OUTPUT.put_line(
        BoolToChar( XCCC_PO_APPROVALLIST_S1.does_cpa_exist(1017934)  )
    end;
    I'm probably doing 101 things wrong here, but thought I'd ask anyway and risk being shouted at.Shout at? You reckon? I thought people risked being beaten with a lead pipe, or pelted with beer cans and stale pretzels - which makes being shouted at a really safe and viable alternative. {noformat};-){noformat}

Maybe you are looking for

  • Why i need to create a new Aodboe iD for illustrator cs6

    is that mean my licens incorrcet ?

  • Content Server Sharing

    Hello, I have installed Content Server 6.40 successfully on Win 2K3 Both URL are showing Running status, But repository shows defined status after some time if i unlock it again after 2-3 hr it will come to defined status. Also  category which i have

  • Read Excel from sap server HDD

    I want to read xls from path wich I see by FM RZL_READ_DIR_LOCAL (server space) and how to read xls format to itab from this path? ALSM_EXCEL_TO_INTERNAL_TABLE work only on local HDD (not server space)

  • Contact not loaded in Messenger Express' Composer

    Hi, My iMS version is as follows: - iPlanet Messaging Server 5.2 HotFix 1.09 (built Jan 7 2003) libimta.dll 5.2 HotFix 1.09 (built 15:05:46, Jan 7 2003) Microsoft Windows 2000 version 5.0 Service Pack 4 (Build 2195) And I recently encountered problem

  • How to stop allocating partial ST quantities for deliveries

    Hello SAP Gurus, For some material we repeatedly get pick slip for partial quantities (UOM- ST (item)) even though we only sell by the full ST unit. This only happens on our bottles (UOM- bottle). When we have a pending "Process order" the quantity o