Error in code - PLSQL function

Hi all

I get an error for the following code.

create or replace function get_emp_row

(

Number of p_empid

) RETURN % rowtype as employees

employees x % rowtype;

Start

Select * x to employees where employee_id = p_empid;

end;

Return x;

end get_emp_row;

Here is my error

Error (9): PLS-00103: encountered the symbol "end-of-file" when awaits one of the following numbers: (begin case declare exit end exception for goto rise back loop mod null pragma select update while < ID > < a between double quote delimited identifiers of > < a variable binding > < < continue the current closing delete fetch locking insert opening rollback to savepoint sql set run commit forall fusion pipe purge)

Below is my table structure

100AA(null)(null)(null)22 JUNE 14
200Queen254000(null)MAY 22, 14
300Raja266000(null)22 APRIL 14
400PM278000(null)18 MARCH 14
500cm2810000(null)(null)
600Bishop231000(null)(null)
700pilot21500(null)(null)
800Dembélé2015000(null)(null)
900Adkins1915500(null)(null)
950Roshan1818000ANALYST(null)
850NAV1719000MANAGER(null)
750NAV1616500MANAGER(null)

Could you good people check you and let me know where I'm missing. Thanks in advance

Remove the end after the select statement, and you should be fine.

Tags: Database

Similar Questions

  • error in calculation PLSQL function

    Hi friends,

    I have the plsql function below that throw error.

    The function below is written in Apex, if kindly let me know how to solve this error

    The following query checks the existing value and null assigns a value to the select statement. otherwise will assign it to the variable. I don't get how to set dynamically using the select statement

    Function:

    BEGIN
    IF
    : P1_VARIABLE_NAME IS NULL THEN: P1_VARIABLE_NAME: = select... from... (which returns a string)
    ON THE OTHER
    : P1_VARIABLE_NAME
    END
    END

    Error:

    Met the "SELECT" symbol when awaits one of the following numbers: (- + case mod new avg not null current County exists prior min max sql stddev sum variance execute forall time timestamp interval date fusion pipe)

    Hi Pradeep,

    Have you used the suggestion in the post above?
    (Do not use the PL/SQL only the suggested above query block)
    Did you put a semicolon after the query?
    And you always use the PL/SQL code?

    Could you post details of calculation?

    Kind regards
    Kiran

  • ERR-9131 error in the body of PLSQL function for default code point, the point =

    Hi all


    I am filling a field element of text in two different ways, but on the same page:

    1 - the page is called to change the values inside-> value of the element comes from field of database

    2 - the page is called to insert new values-> value of the element comes from a calculated function that returns a default value

    Point features:

    Source->

    always replace any existing value in session state

    database column

    -> Default

    -----------------------------------------------------------------------------------------------------------------------------
    default value
    ------------------------------------------------------------------------------------------------------------------------------
    DECLARE
    NUMBER OF THE LINHA;
    gene number;
    i_emp varchar2 (32000);
    v_sql2 varchar2 (32000);
    BEGIN
    i_emp: =: P62_EMP_COD;

    IF: P62_RDD_LIN IS NULL THEN
    LINHA: = 1;
    ON THE OTHER
    LINHA: =: P62_RDD_LIN;
    END IF;

    v_sql2: =' select '. i_emp |'. Grh_1_utils. GRHFU_RUB_DEFAULT ('|: P62_ENT_COD |', 'R' ' |: P62_REM_COD |', 1, 1000000, to_date null, "D", ("' |: P62_DAT_INI |")) (', "DD/MM/YYYY"),' | LINHA |') the double ';

    EXECUTE IMMEDIATE v_sql2 INTO gene;
    COMMIT;

    return deciphered;
    end;
    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

    default value - body of the PL/SQL function




    The error I get is:



    ORA-00936: lack of expression

    ERR-9131 error in PLSQL function for default code point body, item = ITEM_TO_POPULATE



    Something is wrong with my function or is a different, better way to do this?


    Cordially Pedro.

    Hello

    You can do some tests?
    (1) try to make this code first (to make sure that the P62_EMP_COD is not null when running):

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT('||:P62_ENT_COD||',''R'','||:P62_REM_COD||', 1 , 1000000,''D'',null,to_date('''||:P62_DAT_INI||''',''DD/MM/YYYY''),'||LINHA||') from dual';
    
    EXECUTE IMMEDIATE v_sql2 INTO defeito;
    COMMIT;
    
    return defeito;
    end;
    

    (2) then you can try to change your source, by changing 'replacement always of value that exists in the session state' "only when null.

    (3) enter your variable dynamic SQL code and check it out:

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT('||:P62_ENT_COD||',''R'','||:P62_REM_COD||', 1 , 1000000,''D'',null,to_date('''||:P62_DAT_INI||''',''DD/MM/YYYY''),'||LINHA||') from dual';
    return v_sql2;
    EXECUTE IMMEDIATE v_sql2 INTO defeito;
    COMMIT;
    
    return defeito;
    end;
    

    (4) prevent your run immediate code of SQL Injections using the link:

    DECLARE
    LINHA NUMBER;
    defeito number;
    i_emp varchar2(32000);
    v_sql2 varchar2(32000);
    BEGIN
    i_emp := :P62_EMP_COD;
    
    IF :P62_RDD_LIN IS NULL THEN
    LINHA:=1;
    ELSE
    LINHA := :P62_RDD_LIN;
    END IF;
    
    v_sql2:='select '||i_emp||'.Grh_1_utils.GRHFU_RUB_DEFAULT(:1,''R'',:2, 1 , 1000000,''D'',null,to_date(:3,''DD/MM/YYYY''),:4) from dual';
    
    EXECUTE IMMEDIATE v_sql2 INTO defeito USING :P62_ENT_COD, :P62_REM_COD, :P62_DAT_INI, LINHA;
    COMMIT;
    
    return defeito;
    end;
    

    Best regards, Kostya Proskudin

  • receive the following error code when searching for a piece of music I did several times without a music problem but have recently updated Firefax: Fatal error: Call to undefined function AmazonData() in/home/boss/public_html/mc on line 13

    I am in the page web http://www.songarea.com/ and after searching a piece of music, I get the following error message:
    "Fatal error: Call to undefined function AmazonData() in/home/boss/public_html/mc on line 13.
    I did this several times before without a problem, but have recently updated Firefox with the Skype add-on and wonder if the two things are related.

    URL of affected sites

    http://www.songarea.com/

    Hi John,.

    It is an error message from the web server providing this site. Specifically, it is something wrong with their PHP code.

    It is not browser specific and would go into another browser besides Firefox.

    You will need to contact the webmaster of this site to report this problem. A quick test does not show this problem, but you do not specify what search query, you tried:

    http://www.songarea.com/music-codes/test.html

  • C410a all in OnePrinter: what is error Situation Code 12522209

    The charge of computer software was successful. When you set up the printer, error Situation Code 12522209 came and still can not print or use other functions of the printer. What does the acronym for the Code number.

    Winfro

    Hey @winfro,

    Welcome to the Forums of HP Support!

    I see that you see an error code associated with your Photosmart Premium Fax e-all-in-one printer. I can help you with that, but I'll need some information first. Please let me know where you see this code. Once I know that I will be better able to help you.

  • Loading of the DLL string using the Code Library function node

    I experience now with the element of Code Library function node... what I wanted to do are, for example, I have compiled a. DLL file... which has a function that returns the pointer to string... function looks like:

    / * This function returns a pointer to the character string * /.

    char * pchar (int n)

    {

    char * str [] = {"error", "String1" and "Word2", "3"};

    Return ((n! = 1) & (n! = 2) & (n! = 3))? Str [0]: str [n];

    }

    but when I load into LabView DLL, a part of the chain on the screens to Panel frontal trash... any ideas why?

    p.s. when I do even with integer values... say my job is like int x = 5; Return x; and then I load in LabView to the digital indicator... it works great!

    So any ideas?

    thanx

    Cyrax says:

    I experience now with the element of Code Library function node... what I wanted to do are, for example, I have compiled a. DLL file... which has a function that returns the pointer to string... function looks like:

    / * This function returns a pointer to the character string * /.

    char * pchar (int n)

    {

    char * str [] = {"error", "String1" and "Word2", "3"};

    Return ((n! = 1) & (n! = 2) & (n! = 3))? Str [0]: str [n];

    }

    but when I load into LabView DLL, a part of the chain on the screens to Panel frontal trash... any ideas why?

    p.s. when I do even with integer values... say my job is like int x = 5; Return x; and then I load in LabView to the digital indicator... it works great!

    So any ideas?

    thanx

    You cannot return a pointer to the data stored on the stack. At the time when the function returns, the stack is reset to the State before the call to the function and in a multithreaded as LabVIEW environment probably long reused for other things when LabVIEW gets around to actually copy the returned pointer data.

    Since it is a read-only variable, you could create a permanent memory for string storage by declaring your variable static. This will create a memory area allocated globally for the string data (and also cause a compile error when you try to write in this area somewhere in your code, which is a good thing).

  • Windows Update has failed. "Error found: Code 8007001F Windows Update encountered an unknown error." _

    RALink - network - 802.11n/b/g Wireless LAN USB 2.0 Mini adapter 379ko

    Windows Update has failed. "Error found: Code 8007001F Windows Update encountered an unknown error."

    I bought a wifi USB adapter and it is a driver windows 7 available on the manufacturer's website. RALink

    http://eng.ralinktech.com.tw/support.php?s=1

    My computer is a HP P6110f desktop computer. It came with a Vista 64 OS which I've upgraded to a Windows 7 Home Premium.

    I tried to install all kinds of different ways but were not able to make it work.

    Disconnect all other devices driver/software uninstalled and reinstalled all plugging adapter in each computer startup I tried port USB with adapter connected and also connect after windows load discharged from all applications running, including firewall and anti-virus

    Can you please help me solve this problem? I consider myself quite computer but I'm completely puzzled here.

    http://social.answers.Microsoft.com/forums/en-us/category/Windows7
    Windows 7 discussion groups

    They may be able to help in obtaining the wifi USB adapter to work.

    8007001F (a device attached to the system is not functioning) TaurArian [MVP] 2005-2010-implementation to date of Services

  • PLSQL function to return the result of the query

    Dear all,

    Oracle Database SE1 11.2.0.1

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Is this possible?

    Madhu.149 wrote:

    I need to create a plsql function which should accept SQL as a parameter, execute it and return the result set.

    Be careful - results games indicate a set of data stored in memory. This is not what are sliders. This isn't how Oracle should be used.

    Imagine that you implement such a result set function - which, on average, requires 1 MB of memory (private server) to store the results of the SQL query. A 100 users mean a 100 MB of memory required server. This is not suitable. Not at all. Never.

    The correct back 'thing' is a handle to SQL cursor (called a ref cursor in this case). A SQL cursor is a "program" - that the appellant runs via the fetch command and generates one or more lines accordingly. Appellant repeatedly runs this slider through calls to fetch until this slider found and returns all rows affected (using consistent readings).

    If you want an abstraction interface that the client can call via PL/SQL code in the database, so this crafting optimal SQL interface, creates the SQL cursor and returns the handle of the cursor (via the ref cursor data type) to the client.

  • This plsql function is considered ok?

    This plsql function is considered ok?  The reason that I ask is that the results are different when called within a packet vs appeal during a procedure.  I don't know if this is a bug or if it is illegal.

    CREATE OR REPLACE package body test as
    
    function test return varchar2 is
    begin
    htp.prn('ABCDEF');
    return 'xyz';
    end;
    
    
    end;
    
    
    

    When this function is called inside a package, the string 'ABCDEF' will appear out of sequence.   I think it's because of the in-Lining, 11 g the function at compile time.

    Whereas, when the function is called during a procedure the string 'ABCDEF' appears in the browser html properly.

    The service is technically do stuff how to output data from htp.prn, then Oracle can judged illegal.  I have a very good reason for wanting this feature, so before you take a different approach, I wanted to ask around.

    The question is how the statements are executed by the PL/SQL engine.

    Consider the statement:

    HTP.p (' test1 ' |)  FuncTest() ' | 'test2');

    To run it, all nested 'objects' must be resolved and executed first. Think of the execution path inside-to-outside.

    If FuncTest() is executed first. He puts a string into the buffer of HTP. The result of the function is concatenated and created a unique string literal. This literal is now the parameter in the call to htp.p (). Who then adds, after FuncTest(), a string to the buffer of HTP.

    I disagree with your statement that it behaves differently in the procedures as packages. I created 3 test cases for the foregoing. Anonymous block (run immediately the text code execution). Individual objects (separate procedure and function). Single object (procedure and function wrapped in a box).

    Each product, as expected, the same result.* how the engine of PL/SQL treats the path of execution of instructions, does not change because the statement is in a packed and not a stand-alone procedure.

    * 11.2.0.2 using SST 11 g Server (Apache v2 and v2 mod_plsql).

  • error: implicit declaration of function 'GetActiveProcessorCount' is not valid in C99. Make sure that you include the prototype for the function.

    I get the following error:

    error: implicit declaration of function 'GetActiveProcessorCount' is not valid in C99. Make sure that you include the prototype for the function.

    I've included windows.h

    which includes winbase.h

    Winbase.h contains the prototype for the function in the above error message.

    If I disable 'Require the function prototypes' and 'Building with the C99 extensions', I get the following error:

    error: Undefined symbol "_GetActiveProcessorCount" referenced in "c:\Users\Public\Documents\National Instruments\CVI\HDLC\cvibuild. HDLC_RandD\Debug\HDLC_RandD.obj ".

    I work in the ICB 2013 SP2.

    Why I get this error.

    This function is only valid in Windows 7 and later versions. Because the ICB 2013 still supports Windows XP, this feature is excluded by default from Windows headers that are provided with CVI. If you do not need to worry about the versions of Windows prior to Windows 7, however, you can include it yourself, by adding the following macro in the dialog box options generation CVI (be sure to include for all configurations):

  • KB978601 and kb979309 update failed: error 800b0100 code

    Windows Update says that I need these two updates of security, but it cannot install them. I can install all other updates but these two. It just says 'update failed' and gives me the error 800b0100 code. Anyone know if it is a general problem or if it's just my computer?

    Windows Update says that I need these two updates of security, but it cannot install them. I can install all other updates but these two. It just says 'update failed' and gives me the error 800b0100 code. Anyone know if it is a general problem or if it's just my computer?

    A general problem? N ° If it is Vista or Windows 7, see: Windows Update, error 800b0100

    If the system is running Windows 2000, Windows XP, or Windows Server 2003, see: error message when you try to use Microsoft Update or Windows Update Web sites to install updates: '0x800B0100'

    You may find that you can download save manually, and then install the updatesKB978601 KB979309 first, then then and who can fix the error. You can download the two updates from the Microsoft Download Center. Don't forget to download the update for specific version of Windows and the architecture that the system is running. EX: If it is Vista 32 bit, then take the 32-bit version of Vista. If it's Windows 7, 64-bit, then download and save the 64-bit version.

    MowGreen Services update - consumer safety

  • I get this error message: Code 80070663

    I get this error message: Code 80070663 and it seems that there is no solution for it to what tells me the support. Please give me a process step by step in order to fix this problem please!

    Step by step this path below that can help you to correct the error.

    Click on the "Start" button, type "Windows Explorer" in the search box.
    Click on the "Windows Explorer" in the "Programs" menu
    Navigate to the path "c:/users/Allusers/Microsoft/Office/data", find "opa12.dat" file and rename it to "opa12old.dat".
    When you restart Windows Office and open a file, it prompts you to turn on the Windows desktop, then activate it online.
    Reinstall the updates from the Windows desktop, and then restart the computer.

    This solution of error on this site:
     http://www.regmender.com/how-to-fix-Windows-Update-error-80070663.html
    Hope it can help you. Good luck.

  • Having a problem with the update of the window. He said that windows could not search for new updates. It's the found error 80245003 code

    Having a problem with the update of the window. He said that windows could not search for new updates. It's the found error 80245003 code

    Take a look at this article as it addresses this error code. Mike - Engineer Support Microsoft Answers
    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Update error 80072EFE code

    error 80072EFE code when you try to update and nod32 messages popping up saying that it blocks web sites.

    Hi hermenegildogildoshine,

    1. did you of recent changes on the computer?

    2 do you have installed on the computer ESET security software?

    The error 80072EFE occur perhaps caused by one of the following problems:

    (a) applications or processes that interfere with Internet communications

    (b) problems of resource on your computer

    (c) a strong activity on the Internet

    (d) recoverable database errors

    See the below Microsoft article and try the steps mentioned, check if it works.

    You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates

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

    The error of nod32, you would receive if ESET security software blocks Web sites.

    I suggest that you check in the ESET security software to unblock websites.

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • This is the first time the following: failed: 1 update or the errors found Code 80070643. I followed through the Fix code he doctor. This morning the automatic update has not as well.

    This is the first time the following: failed: 1 update or the errors found Code 80070643. I followed through the Fix code he doctor. This morning the automatic update 4/16 showed failure: update for Microsoft Office PowerPoint 2007 (KB 24664594)

    Hi William,.

    First try the following article: http://support.microsoft.com/kb/971058.

    If this does not work, try this link: http://support.microsoft.com/kb/923100.

    While I'm not quite certain that the first will succeed, the second is a common and often recommended solution that has helped a lot with this error code.

    I hope this helps.

    Good luck!

Maybe you are looking for

  • Abnormal temperature CPU on Satellite L650 - 13 M

    Hello I have a Satellite L650 with an i5 430 m (with ATI 5650) around the age of 2 months and when I occasionally play NBA 2 K 11 I get these very high CPU temperatureswith HWmonitor. They go up to 89-90 ° C when Im in the game and the drop-down list

  • HP 15-f009wm: how to downgrade a laptop HP PC15-f009wm for w7, send a cd rom/DD rom drive missing error.

    How can I down the HP laptop 15-f009wm for w7 w8. when im trying to send a windows that require a cdrom / dd driber missing rom. Insert the location of the pilot and next to continue, cancel, or abort. I can't go over this step at the beginning.

  • I have benn blocked on my Hotmail account

    I have incredible problems trying to recover my Hotmail internet account. I have twice entered my details in Windows Live Solutions and given PIN to access the forum. The first time I got to a site where I could see my information and was able to ans

  • AIM warnings on other locations...

    During working hours, I use Pidgin on my desktop as my client for AIM, Google Talk, etc.  Randomly during the day, I receive the following message is displayed: System AOL Msg: Your screen name (alanh3141) signed from another location. This nickname

  • upgrade processor m3100 acer (acer f690gvm butterfly.)

    I have an acer M3100 (very old computer, I bought it in 2007-8); He ha its dual core processor amd athlon 64 4000 +(2,1ghz) xduals card mother acer f690gvm; I want to upgrade the processor, I'm quite sure that I put in a 6000 +, but can I also use th