General doubt in the procedure

Hello all;


I learn PL/SQL procedures.

i don't understand what I marked red following below.


> > This code from web > >


CREATE OR REPLACE PROCEDURE employer_details

IS

CURSOR emp_cur IS

SELECT first_name, last_name, salary FROM emp_tbl;

SheikYerbouti emp_cur% rowtype;

BEGIN

FOR SheikYerbouti in sales_cur

LOOP

dbms_output.put_line(emp_cur.first_name ||) ' ' || emp_cur.last_name | ' ' || emp_cur.salary);

END LOOP;

END;

/

REF_LINK: http://plsql-tutorial.com/plsql-procedures.htm

My questions are:

sales_cur indicates what?

When using the loop can we use variable_name to start the loop?


I mean I'm trying to run above the code for my personal data according to my emp table.

If I'm not above doubt slot I can't finish my auto - practical.


SQL > desc emp;

Name                                      Null?    Type

----------------------------------------- -------- ----------------------------

EID                                                      NUMBER

ENAME VARCHAR2 (15)

VARCHAR2 (10) EQUAL

ESALARY VARCHAR2 (15)

ECITY VARCHAR2 (15)

EPERK                                                NUMBER

NUMBER OF ECONTACT_NO

Thanks in advance!

Reading is one thing. Try another. Try to run the code in the comic book. (Maybe you can try apex.oracle.com)

You will discover that this does not compile for several reasons.

One is

emp_cur.first_name: this must refer to the current line of the cursor loop, which is SheikYerbouti, so it should be emp_rec.first_name.

Second is

sales_cur is not declared, it is rather called emp_cur.

Below is the modified code so that it works in my diagram

CREATE OR REPLACE PROCEDURE employer_details

IS

CURSOR emp_cur IS

SELECT ename FROM emp;

SheikYerbouti emp_cur % rowtype;

BEGIN

FOR in emp_cur LOOP

dbms_output.put_line (emp_rec.ename);

END LOOP;

END;

you run it this way

Start

employer_details;

end;

In my case output is

KING

Blake

Clark

Jones

Scott

Ford

....

Tags: Database

Similar Questions

  • General question about the procedures and functions

    Hello!

    I know, I can define and use a function within a procedure. But can I set up and use a procedure inside a procedure?

    Thank you!

    Hello

    But can I define and use a procedure inside a procedure?
    

    HMMM... was it so difficult to test this?

    CREATE OR REPLACE PROCEDURE xy_main
    AS
    PROCEDURE xy_sub IS
    BEGIN
    NULL;
    END;
    BEGIN
    xy_sub;
    END;
    

    Or you actually meant the procedure inside a function
    It's also not difficult :)

    CREATE OR REPLACE FUNCTION func_xy_main RETURN NUMBER
    IS
    PROCEDURE xy_sub IS
    BEGIN
    NULL;
    END;
    BEGIN
    xy_sub;
    RETURN(1);
    END;
    

    See you soon!
    Bobin

  • Doubt of the procedure

    Hi all

    I use oracle 10g.
    I had a procedure named as 's_stored' in the s_test schema.

    and a procedure more I create in a different schema, in this procedure, I call the old procedure that exist in the other schema.

    When I compile the second schema
    I get an error message like:

    PLS-mush * 's_test.s_stored' * 00201: identify reportable.

    What should do?

    Thank you.

    user944 wrote:
    I did it in two patterns as:
    * GRANT DBA to schema name*.

    You can give him like that

    GRANT EXECUTE ON second_schema_name TO procedure_name;

    and it must be executed in the first schema.

    Concerning
    Arun

  • Error "the procedure entry point SMapLS_IP_EBP_12 be found in KERNEL32.dll dynamic link library" when you try to play Red Alert: Command & Conquer

    Original title: the procedure entry point SMapLS_IP_EBP_12 could not be found in KERNEL32.dll dynamic link library.

    Ive been trying to install Red Alert: Command and Conquer on my new pc windows 7 and of course he will not play to come with all can't play because its running windows 6.1 and it's a single program of windows 95. then I went through all troubleshooting and change everything to make sure that it works and it actually installed, but when I went to play this message appears and im like why does this happen to me!

    The procedure entry point SMapLS_IP_EBP_12 be found in KERNEL32.dll dynamic link library.

    It of the message, can someone help me?

    Hi BigAl3000,

    Please note that Command & Conquer: Red Alert 3 is the only version compatible with Windows 7.

    Red Alert 2 and red alert are not compatible with Windows 7.

    See Windows 7 compatibility for Command & Conquer: Red Alert for more information.

    To troubleshoot program compatibility issues in Windows 7, try the following methods:

     

    Method 1: Open the program compatibility problems

     

    Most programs written for Windows Vista are also running Windows 7, but some older programs might run poorly or not at all. If an older program does not work, use the program compatibility issues to simulate the behavior of earlier versions of Windows.

    Method 2: Contact the program vendor or the hardware manufacturer

     

    Contact the program vendor for advice on how to solve the problem. In general, the software vendor's Web site provides a support section that you can use, for example, to search for an error message that you receive from the program.

    Hope this information helps.

    Gokul - Microsoft Support

    [If this post was helpful, please click the button "Vote as helpful" (green triangle). If it can help solve your problem, click on the button 'Propose as answer' or 'mark as answer '. [By proposing / marking a post as answer or useful you help others find the answer more quickly.]

  • the procedure entry point ntalpcsendwaitreceiveport could not located in ntdll.dll error whiel opening programs

    original title: ntdll.dll
    When I run no matter what program to progdvb ouvertede find this problom
    the procedure entry point ntalpcsendwaitreceiveport could not be located in the dynamic link library ntdll.dll

    Hello

    Follow these methods.

    Method 1: Follow these steps:

    Step 1: Start the computer in safe mode and check if the problem persists.

    A description of the options to start in Windows XP Mode

    http://support.Microsoft.com/kb/315222

    Step 2: Perform a clean boot to see if there is a conflict of software like the clean boot helps eliminate software conflicts.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Note: After completing the steps in the clean boot troubleshooting, follow the section How to configure Windows to use a Normal startup state of the link to return the computer to a Normal startupmode.

    After the clean boot used to resolve the problem, you can follow these steps to configure Windows XP to start normally.

    (a) click Start and then click Run.

    (b) type msconfig and click OK.

    (c) the System Configuration Utility dialog box appears.

    (d) click the general tab, click Normal Startup - load all services and device drivers and then click OK.

    (e) when you are prompted, click on restart to restart the computer.

    Method 2: Scan the file system (CFS) auditor to repair corrupted files.

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

  • System error "the procedure entry point _SetAsyncTraceParams at (@)" 16 is not found in the library of dynamic links ATRACE. "." DLL.

    Original title: no access to system restore

    After a massive search, I can't solve this problem! Please indicate why this is happening and how to solve it.  Thank you for your support.

    This is the error message pop up that I got trying to activiate (Rstrui.exe) system restore "the procedure entry point _SetAsyncTraceParams at (@) 16 be found in ATRACE dynamic link library. DLL. notice the @ in support should replace 'at' since the seizure of this character created a link to MFL and was confusing to read!

    Hi intelegend,

    1. Did you the latest changes on the computer?
    2. You have security software installed on the computer?

    Method 1

    I suggest that scan you SFC on the computer that would be a corrupt system file search.

    The analysis may take some time, so be patient. Windows allows to fix corrupt or missing files it finds. If the information of the installation CD is required to fix the problem, you may be asked to insert your Windows XP installation CD.

    Description of Windows XP and Windows Server 2003 System File Checker (Sfc.exe)

    http://support.Microsoft.com/kb/310747

    Method 2

    If the previous step fails, then it is possible that some third-party programs installed on the computer is causing the problem.

    I suggest that you configure the computer in a clean boot state and check if it helps.

    To help resolve the error and other messages, you can start Windows XP by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    See section to learn more about how to clean boot.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    (a) click Start, type msconfig in the search box and press ENTER.

    (b) If you are prompted for an administrator password or for confirmation, type your password or click on continue.

    (c) under the general tab, click the Normal startup option, and then click OK.

    (d) when you are prompted to restart the computer, click on restart.

    Method 3

    If the steps above do not then refer to the article below and check if it helps.

    Steps of troubleshooting for problems when you try to use the System Restore tool in Windows XP

    http://support.Microsoft.com/kb/302796

  • .exe error] is not found the procedure entry point AddAtomW Entry Point not found in dynamic bindings KERNEL32 library. DLL when I try to run any program. I have

    Original title: [ProgramName] .exe Entry Point not found

    I get this message: the point procedure entry AddAtomW could not be found in dynamic bindings KERNEL32 library. DLL when I try to run any program. I don't know what to do. Help please!

    Hello

    1. did you of recent changes on the computer?

    Method 1:
     
    It is possible that some third-party programs installed on the computer is causing the problem.
    I suggest that you put the computer in a clean boot state and check if it helps.
    To help resolve the error and other messages, you can start Windows Vista or Windows 7 by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.
     
    See the link below to learn more about how to clean boot.
    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353
     
    Reset the computer to start as usual
    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:
    (a) click Start, type msconfig in the search box and press ENTER.
    (b) If you are prompted for an administrator password or for confirmation, type your password or click on continue.
    (c) under the general tab, click the Normal startup option, and then click OK.
    (d) when you are prompted to restart the computer, click on restart.

    Method 2:

    Put your boot system helps determine if third-party applications or startup items are causing the problem. If so, you need to maybe contact the manufacturer of the program for updates or uninstall and reinstall the program.

    See the following article in the Microsoft KB for more information on how to solve a problem by performing a clean boot in Windows Vista or Windows 7:

    How to troubleshoot a problem by performing a clean boot in Windows Vista or in Windows 7
    http://support.Microsoft.com/kb/929135

    Note: after a repair, be sure to set the computer to start as usual as mentioned in step 7 in the above article.

  • What the devil? Error: The procedure entry point? detac3@ListData@@QAEPAUData@1@XZ couldnot be found in QtCore4.dll dynamic link library.

    I hope I'm in the good topic section. My computer feezes. I restart or turn off & that is what happens.                                                                                       Error: The procedure entry point?  detac3@listData@@QAEPAUData@1@XZ not found in the QtCore4.dll dynamic link library.                                      He also does this whenever I turn on my computer, even if it does not freeze. I was told that I have to use my CD to get into windows XP, but I have no idea where I put it. What now? Oh, I'm computer illiterate, so stupid it upwards!

    Hi Budge3263,

    1. Did you the latest changes on the computer?
    2. You have security software installed on the computer?

    QtCore4.dll is part of the development environment for a number of applications, including Photoshop Elements.

    It is possible that some third-party programs installed on the computer is causing the problem.

    I suggest that you put the computer in a clean boot state and check if it helps.

    To help resolve the error and other messages, you can start Windows XP by using a minimal set of drivers and startup programs. This type of boot is known as a "clean boot". A clean boot helps eliminate software conflicts.

    See section to learn more about how to clean boot.

    How to configure Windows XP to start in a "clean boot" State

    http://support.Microsoft.com/kb/310353

    Reset the computer to start as usual

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:

    (a) click Start, type msconfig in the search box and press ENTER.

    (b) If you are prompted for an administrator password or for confirmation, type your password or click on continue.

    (c) under the general tab, click the Normal startup option, and then click OK.

    (d) when you are prompted to restart the computer, click on restart.

  • Problem with update of a column by using the procedure of database and refreshing or put in value programmatically

    Dear all,

    I am a beginner in the ADF and am under Jdeveloper Studio Edition Version 12.2.1.0.0.

    I have a page that consists of two taskflows.

    First workflow has a fragment which is to have a table based on view object salespersons (not editable)

    Second task flow contains a form of ADF from the same view object Salespersons.

    As the user selecting a line in the table of the same record is displayed as no problem.

    Now, I have added two buttons Activate and Deactivate that is to change the status of the sales.

    I tried to use two ways an updated using the procedure of database and then put in value by programming and I have different questions with two of them:

    Now, here's the code of the Java bean for activation:

    Option A - the problem with this is the value of the column in the list (the first task rate displayed) is not synchronized

    and Activate and Deactivate buttons are not disabled and active properly.

    {} public void confirmActivation (DialogEvent dialogEvent)

    If (dialogEvent.getOutcome () == DialogEvent.Outcome.yes) {}

    DBSequence vId;

    vId = dcId.getValue ((DBSequence));

    Links BindingContainer = getBindings();

    OperationBinding operationBinding;

    operationBinding = bindings.getOperationBinding ("changeSalespersonsStatus") (OperationBinding);

    operationBinding.getParamsMap () .put ("pId", vId.getValue ());

    operationBinding.getParamsMap () .put ("pStatus", "A");

    Object result = operationBinding.execute ();

    dcStatus.setValue ("A");

    } else {}

    return;

    }

    }

    Option B - the problem with this is that the value of input for status text appears in the Active form for all records in form regardless of its database.

    {} public void confirmActivation (DialogEvent dialogEvent)

    If (dialogEvent.getOutcome () == DialogEvent.Outcome.yes) {}

    -no doubt this two lines are not needed here

    DBSequence vId;

    vId = dcId.getValue ((DBSequence));

    dcStatus.setValue ("A");

    BindingContainer links = getBindings();

    OperationBinding operationBinding;

    the operationBinding = bindings.getOperationBinding("Commit") (OperationBinding);

    Object result = operationBinding.execute ();

    } else {}

    return;

    }

    }

    Here's the code from the Fragment of shape for used buttons.

    "< af:button text = 'Activate' id ="bActivate' icon="/icons/activate.png ' iconPosition = 'top '.

    partialTriggers = "Bcreer bSaveInsert bCancelInsert dDeactivate dActivate".

    Binding = "#{pageFlowScope.salespersonsForm.buttonActivate} '"

    Disabled = ' #{bindings. " Status.inputValue! {= ' n '} ">"

    < af:showPopupBehavior popupId = "pActivate" / >

    < / af:button >

    "< af:button text = 'Disable' id = 'bDeactivate' icon="/icons/deactivate.png ' iconPosition = 'top '.

    partialTriggers = "Bcreer bSaveInsert bCancelInsert dDeactivate dActivate".

    Binding = "#{pageFlowScope.salespersonsForm.buttonDeactivate} '"

    Disabled = ' #{bindings. " Status.inputValue! {= 'A'} ">"

    < af:showPopupBehavior popupId = "pDeactivate" / >

    < / af:button >

    Here's matching Popups for each of the buttons Activate and Deactivate.

    < childCreation = "deferred" autoCancel af:popup = "disabled" id = "pActivate" >

    < af:dialog id = "dActivate" type = "YesNo" title = 'Status of salespersons' closeIconVisible = 'false '.

    affirmativeTextAndAccessKey = "& amp; Yes"cancelTextAndAccessKey ="& amp; (Cancel)

    noTextAndAccessKey = "& amp; No '.

    dialogListener = "#{pageFlowScope.salespersonsForm.confirmActivation}" >

    < f: facet = 'buttonBar' name / >

    < af:outputLabel value = "Are you sure you want to enable the seller?" id = "ol1" / >

    < / af:dialog >

    < / af:popup >

    < childCreation = "deferred" autoCancel af:popup = "disabled" id = "pDeactivate" >

    < af:dialog id = "dDeactivate" type = "YesNo" title = 'Status of salespersons' closeIconVisible = 'false '.

    affirmativeTextAndAccessKey = "& amp; Yes"cancelTextAndAccessKey ="& amp; (Cancel)

    noTextAndAccessKey = "& amp; No '.

    dialogListener = "#{pageFlowScope.salespersonsForm.confirmDeactivation}" >

    < f: facet = 'buttonBar' name / >

    < af:outputLabel value = "Are you sure you want to disable the seller?" id = "ol2" / >

    < / af:dialog >

    < / af:popup >

    Thanks in advance.

    Best regards

    Arif Khadas

    If you bind components to a range of flow page bean. You must complete that it saves the State of the component longer than the life of the component.

    To change the value of the GET value of the component of the link layer and change it.

    In this way the changes are captured by the framework and you should see them.

    Timo

  • Using the procedure to display the table of multiple data

    Hi, I need help for the procedure in oracle

    I want to create the procedure to display the table of multiples with sample plan

    with a parameter imployee_id to display an employee_id, name, function, start_date, end_date

    IAM using this query to select more than one table

    SELECT e.employee_id, e.first_name, j.job_title, h.start_date, h.end_date

    E EMPLOYEES

    JOIN j jobs

    ON j.job_id = e.job_id

    JOIN the job_history:

    ON h.employee_id = e.employee_id

    WHERE e.employee_id = 200;

    Thanks for the help

    Blu and Billy showed you the 'real' solution. You can display the data returned by a cursor ref in SQL Developer, too:

    http://www.thatjeffsmith.com/archive/2011/12/SQL-Developer-tip-viewing-refcursor-output/

    Yet as a duty for a beginner is generally do not have the expected solution. Usually, teachers want to see you using a LOOP and dbms_output. something like

    DECLARE

    Xy CURSOR IS

    SELECT whatever

    As much as;

    BEGIN

    FOR r IN xy LOOP

    dbms_output.put_line (r.col1 |' # ' | r.col2);

    END LOOP;

    END;

    Of course this suggestion will inaugurate a discussion abusing DBMS output but I keep my position that it is authorized to use it for learning the basics.

  • Refcursor in the procedure

    Hi all

    There will be no effect in performance if we declare refcurosr with suspicion NOCOPY parameter in a Stored procedure procedure/package?

    AFAIK variable refcursor who will make reference to the calling environment will hold just pointer not data and so avoid a NOCOPY effect.

    Thank you!!

    DS says:

    One of my senior team members asked me to NOCOPY in all existing procedures where refcursor is returned as a parameter in my output project.

    I told him that this will not add any performance improvement and has no effect.

    I did it, because I was forced to do so.

    Want to just check and take the advice from here in this forum.

    I still have the document (in e-mails and in the procedure itself at the top) all these changes so that the future code-reviewers know EXACTLY why this change has been made and who authorized it. Probably you are asking your "senior" you say the reasons to support the change that they requested; You should document those as well.

    Sounds like your "senior" team member is not so superior after all. You can use this as a topic of discussion in your dev group.

    See the doc of the PL/SQL language.

    http://docs.Oracle.com/CD/B28359_01/AppDev.111/b28370/tuning.htm#i48500

    Calls to PL/SQL Tuning subprogramme with NOCOPY hint

    By default, OUT and IN OUT parameters are passed by value. The values of a IN OUT settings are copied before the delivery of the subprogramme. During the execution of the subprogramme, temporary variables to maintain the output parameter values. If the subprogram exits normally, these values are copied to the actual parameters. If the subprogram exits with an unhandled exception, the original settings are unchanged.

    When the parameters represent structures of large data such as collections, records and instances of object types, this reproduction slows down execution and uses memory. In particular, this overload applies to each call to a method of the object: temporary copies are made of all attributes, so that any changes made by the method are only apply if the method ends normally.

    To avoid this overload, you can specify the NOCOPY trick, which allows the PL/SQL compiler to pass OUT and IN OUT parameters by reference. If the subprogram exits normally, the action is the same as usual. If the subprogramme leaves at the beginning with an exception, the values of OUT and IN OUT parameters (or the attributes of the object) can still change. To use this technique, check that the subroutine handles all exceptions.

    Note the reference to the "large data structures. As you already know a REFCURSOR isn't a large data structure, so will not use NOCOPY.

    The most important side effect is that, as noted in the last paragraph above, the characteristics of the 'exit' are modified if you use NOCOPY.

    Point out that the last clause in your "senior": ENSURE THAT THE subprogram MANAGES all THE EXCEPTIONS.

    Normally (i.e. without using NOCOPY) a REFCURSOR lucifera is a parameter OUT will NOT have a value if the procedure stops with an exception if the caller is unable to use it eventually. Maybe this isn't the case if you use NOCOPY.

    Generally however, the use of NOCOPY would simply be an amendment unnecessary, but harmless.

  • NEED HELP WITH THE PROCEDURE

    Hi, earlier I had a doubt using the function or procedure function or procedure? Thanks to all who helped. but I found a way to use task2e with procedure. I would like to insert the issue.

    Cumulative 2nd task spends point procedure
    You create a stored procedure called spRollupExpenseItem. This procedure updates
    the corresponding line in the BudgetItem table given a report of expenses and the expense category number
    number. The procedure contains three input parameters, the value of ERNo, the value of ECNO.
    and the amount of cumulative, as well as a single parameter of Boolean result.
    This is the logic of the procedure.
    · If the corresponding ExpenseReport line (ERStatus) status is DENIED or
    MEANWHILE, an application error is triggered. The output parameter is set to False.
    · Otherwise, the corresponding BudgetItem line is updated. The actual amount (BIActual) in the
    line corresponding BudgetItem are incremented by the input of the cumulative amount parameter.
    o the output parameter is set to True after running the update
    operation.


    good task2e can be used using procedure by housing 'OUT' in parameters.here is the code

    CREATE OR REPLACE PROCEDURE spRollupExpenseIetm
    (P_ERNO IN FULL, P_ECNO ENTIRE, WHOLE ROLLUP_AMOUNT, BOOLEAN P_OUTPUT) IS

    ERSTATUS_ERROR EXCEPTION;
    V_ERSTATUS EXPENSEREPORT. TYPE % ERSTATUS;
    BEGIN
    SELECT ERSTATUS FROM V_ERSTATUS
    OF EXPENSEREPORT
    WHERE ERNO = P_ERNO;

    IF (V_ERSTATUS = 'PENDING' OR 'DENIED' = V_ERSTATUS) THEN
    P_OUTPUT: = FALSE;
    RAISE ERSTATUS_ERROR;
    ON THE OTHER
    UPDATE BUDGETITEM
    SET BIACTUAL = BIACTUAL + ROLLUP_AMOUNT
    WHERE ECNO = P_ECNO;
    P_OUTPUT: = TRUE;
    END IF;
    EXCEPTION
    WHEN ERSTATUS_ERROR THEN
    RAISE_APPLICATION_ERROR (-20564, ' ERROR: ERSTATUS is either pending or DENIED ');
    END spRollupExpenseIetm;




    his compiled without errors. My next question is

    2f task create Rollup fees trigger
    You create a trigger called TR_RollupExpAmt. This trigger fires after the power to the
    approved expenses amount (ExpApprAmt) or the deletion of a row in the table ExpenseItem. The
    following points explain the logic of this trigger:
    · If updating the ExpApprAmt column, the cumulative amount should be the difference
    of the New.ExpApprAmt under the Old.ExpApprAmt.
    · If the deletion of a row of the table of ExpenseItem, the cumulative amount should be the
    the Old.ExpApprAmt negative.
    · To run the update rollup, you must call the spRollupExpenseItem procedure
    described in the 2nd special.
    · If the output of the spRollupExpenseItem procedure parameter is true, insert a line
    in the table (Log_Table) exception log.
    o the ExcText (message explaining the error) value should indicate the
    operation (update or delete) and the cumulative amount.
    o If the output of the spRollupExpenseItem procedure parameter is false,
    do nothing.


    to do this I found on the internet http://it.toolbox.com/blogs/oracle-guide/learn-plsql-procedures-and-functions-13030 where he explained in the example he adds the output in the "my_first_proc" procedure parameter
    p_an_out_parameter DATE

    Then, he calls this procedure like this
    () my_first_proc
    p_name = > v_employee,
    p_an_in_out_parameter = > v_number,
    p_an_out_parameter = > T_DATE);

    IAM so intend to do the same by task2f task2e call and check the P_OUTPUT value. If iam wrong please let me know.

    and iam confused with task2f is
    If updating the ExpApprAmt column, the cumulative amount should be the difference
    of the New.ExpApprAmt under the Old.ExpApprAmt.
    · If the deletion of a row of the table of ExpenseItem, the cumulative amount should be the
    the Old.ExpApprAmt negative.

    How do I know if it is updated or deleted?
    I hace an idea but don't know if its valid or does not check EXPAMT to null as
    if(:New.) EXPAMT = NULL)
    ........
    can I do that. I know confectioners question sorry to make u read the whole story.

    Hello

    Whenever you write code, you should lower lines to see the where to begin blocks BEGIN and end, what are multiline statements and things like that.
    Whenever you post the text on this site, type these 7 characters:

    {code}

    (small letters only, inside curly braces) before and after sections of formatted text.
    After exactly what is causing the error message. The line of the error message numbers are too high; have you not after a few empty lines?

    Section causing errors seems to be:

    ...
        IF (UPDATING) THEN
            UPDATE EXPENSEITEM
                SET EXPAPPRAMT = :NEW.EXPAPPRAMT - :OLD.EXPAPPRAMT    -- No semicolon here
                WHERE ECNO = :NEW.ECNO;
            spRollupExpenseIetm(V_ERNO, V_ECO, ROLLUP_AMOUNT, P_POUTPUT);
            IF(V_OUTPUT = TRUE) THEN
                insert into log_table
                    (excno, exctrigger, exctable, exckeyvalue, excdate, exctext)
                    values
                    (LOG_SEQ.NEXTVAL,
                    'TR_ROLLUPEXPAMT',
                    'EXPENSEITEM',
                    V_ECNO,
                    v_timestamp,
                    'ERROR WHILE UPDATING, ROLLUP AMOUNT = ' || ROLLUP_AMOUNT    -- Is this what you want?
                    );
            END IF;
        END IF;
    

    You had a semicolon in the middle of the UPDATE statement.
    I see no 14 lines obvoius error later. The first error risk fi END does not correctly interpret.

    I also changed the end of the INSERT statement.

    Don't forget to put a colon in the record names: NEWS and: OLD.

    Published by: Frank Kulash, 28 January 2010 06:42

  • by passing the array of objects to the procedure

    Hi, I wrote a procedure to accept the array of input objects. It has worked well.

    This is the only setting of entry in my Interior.

    But now, I tried to add a off set the parameter of type varchar2 to my procedure to send a return value, but it gives me an error

    PLS-00410: fields in duplicate in the FOLDER list, TABLE or argument are not allowed.

    Please suggest cant I pass all other arguments when using an array of record or an object as a parameter?

    This is my code
    CREATE OR REPLACE TYPE PREF_OBJ_TYPE as object (
    
     PREF_CD  varchar2(20),
     USR_ID   VARCHAR2(20),
     PROD_CD  VARCHAR2(50),
     DFLT_PREF_VAL_TX VARCHAR2(250),
     USR_PREF_VAL_TX VARCHAR2(250),
     CRE_USR_ID VARCHAR2(20),
     UPDT_USR_ID VARCHAR2(20) );
    /
    
    
    
    
    CREATE OR REPLACE TYPE PREF_ARRAY is table of PREF_OBJ_TYPE;
    
    CREATE OR REPLACE procedure MMM(in_pref PREF_ARRAY,v_err out varchar2 )
    is
    
    v_prod_dim_nb NUMBER;
    v_usr_dim_nb  NUMBER;
    v_count NUMBER;
    v_err varchar2(50);
     
    
    begin
    
    for i in  in_pref.first.. in_pref.last
    
    LOOP
    
    /* Derive the product and user dim numbers */
    
    select prod_dim_nb into  v_prod_dim_nb from prod_dim where prod_cd=in_pref(i).prod_cd ;
    select usr_dim_nb into v_usr_dim_nb from usr_xref where usr_id=in_pref(i).usr_id and sys_id='ACCESS';
    
    
    /* check if the record already exist in usr_prod_pref corresponding to that  user,prod,pref */
    
    select count(1) into v_count from usr_prod_pref_test where prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    if v_count=0 then 
    
    BEGIN
    
    INSERT INTO USR_PROD_PREF_TEST values(v_usr_dim_nb,in_pref(i).pref_cd,v_prod_dim_nb,in_pref(i).DFLT_PREF_VAL_TX,in_pref(i).usr_PREF_VAL_TX,'Active',NULL,
    in_pref(i).cre_usr_id,sysdate,in_pref(i).updt_usr_id,NULL);
    
    
    
    END;
    
    else 
    
    
    
    update USR_PROD_PREF_TEST set USR_PREF_VAL_TX=in_pref(i).USR_PREF_VAL_TX,DFLT_PREF_VAL_TX=in_pref(i).DFLT_PREF_VAL_TX,UPDT_USR_ID=in_pref(i).updt_usr_id,updt_dt=sysdate,cre_usr_id=in_pref(i).cre_usr_id where 
    prod_dim_nb=v_prod_dim_nb and usr_dim_nb=v_usr_dim_nb and pref_cd=in_pref(i).pref_cd;
    
    
    end if;
    
    
    end loop;
    
    commit;
    
    v_err:='abc';
    
    end;
    /
    Published by: raj_fresher on October 9, 2009 06:56

    Why the 6001 number is assigned to the error code? Oracle generates error code right... Why the procedure does not use this number move like to help put
    r_v_errod_cde and r_v_error_msg?

    I don't know who wrote at the beginning of this procedure, but no doubt he wanted to use some 'custom error handling?
    Furthermore, I don't see anything happening with R_V_ERROR_CODE and R_V_ERROR_MSG, or did you leave this part out of your snippet?
    This way of using a WHEN of OTHER (not followed by a RAISE) is considered to be a 'bad practice' / a bug.

  • doubts about the metadata

    Hello

    (1) metadata are stored in the system tablespace only? If metadata is also stored in the spaces of storage independent of the system, then what is the diff between the metadata in the system tablespace and an independent the system tablespace.

    (2) how to export metadata for all the whole base?

    (3) in what scenarios we export the metadata structure? and how can we copy or upgrade the structure of a database of metadata metadata from database B data.

    concerning

    hungry_dba wrote:
    Laura thanks,

    This means transportable tablespace will bring tabledata and exp/imp with lines = no will to put the metadata I mean strcuture and when connect us the data files and import metadata database target will be even a source database.

    transportable_tablespace will import tablespace and you copy both data files, so all of the information in the tables will be imported as well.
    exp/imp with lines only = no will import only metadata (only structure, no data).
    Any connections datafiles that I did not understand what you mean.

    >

    a doubt more please

    users of the database are stored in the default tablesapce that we give when creating the user, the above procedure, it will come to the target database also we import metadata and connect the data file using option transportable tablespace, what happens if the users default tablespace is system on top of procedure we cannot transfer system tablespace?

    For the first default users tablespace must never be system. Never - it will make problems you sooner or later.

    >

    Laura thanks for the suggestion, I really appreciate. There are may other procedures to clone the database and what you say is really kool by rman, but I wanted to clarify my doubts on this procedure... coz I'm looking to upgrade the Database 9i and 10g with a maximum power of 20 minutes downtime.

    OK, but why you are not simply migrating the database? Why you need exp/imp? Moving to a different server/platform as well?
    What exact 9i version do you have? And to which 10g, you are planning to upgrade?

    I have a shell of doubt more ways to database 10g... 10g software more database created in this right?

    Hmm, where did you read this "shell of 10g?

  • What is the procedure for upgrading Thunderbird ESR 17.0.7 at 31.6 on Mac OSX 10.10.2?

    What is the procedure for upgrading from Thunderbird ESR 17.0.7 at 31.6 (last public version) on Mac OSX 10.10.2?

    Is it as simple as install new version and then run to see all local folders and my email and its folders from IMAP to my company as before the upgrade?

    Thank you

    Create a full backup of your Thunderbird profiles folder.
    Uninstall the old version of ESR.
    Download the latest version from https://www.mozilla.org/en-US/thunderbird/all.html and install it.

Maybe you are looking for