Results 1 to 6 of 6
  1. #1
    Join Date
    Aug 2012
    Posts
    33

    Unanswered: Create function PL/SQL

    Hello

    I am learning create function in PL/SQL but it this learn is very slow

    I have code:

    Code:
    CREATE OR REPLACE FUNCTION NamePerson (idPerson int) RETURN VARCHAR2(20) IS
    namePerson VARCHAR2(20);
    BEGIN
    SELECT name INTO namePerson WHERE id_person=idPerson;
    RETURN name;
    END;
    /
    In table PERSON exist field name and id_person ( PK and is int type ).

    Function created with compile errors. Command SHOW ERRORS FUNCTION NamePerson showing:

    Encountered the symbol "(" when expecting one of the following . @ ; is authid as clusters order using external character deterministic parallel_enable pipelined agregate result_cache.


  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    CREATE OR REPLACE FUNCTION NamePerson (idPerson int) RETURN VARCHAR2 IS
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    Aug 2012
    Posts
    33
    Thanks, I commited an mistake because I used many script and each include other instruction.

    Greet!

  4. #4
    Join Date
    Sep 2012
    Posts
    4
    hi I have some different Doubt regarding the architecture of ORACLE 11gR1

    who writes the undo segments ???

    undo segment is the part of the ORACLE 11g architecture....
    when ever we fire a DML statement the undo segment store the orignal block before the statement was fired . But the Question is
    "Who writes to the Undo Segment ? How it comes into picture even though it is not shown in architecture?Where does undo reside?"

  5. #5
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    other mistakes
    Code:
    CREATE OR REPLACE FUNCTION NamePerson (idPerson in number) RETURN VARCHAR2 IS 
    namePerson emp.name%type; 
    BEGIN 
    SELECT name INTO namePerson from emp WHERE id_person=idPerson; 
    RETURN nameperson; 
    END;
    /
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

  6. #6
    Join Date
    Jun 2004
    Location
    Liverpool, NY USA
    Posts
    2,509
    Quote Originally Posted by AbhiS View Post
    hi I have some different Doubt regarding the architecture of ORACLE 11gR1

    who writes the undo segments ???

    undo segment is the part of the ORACLE 11g architecture....
    when ever we fire a DML statement the undo segment store the orignal block before the statement was fired . But the Question is
    "Who writes to the Undo Segment ? How it comes into picture even though it is not shown in architecture?Where does undo reside?"
    Please start a new thread. Do not hijack an existing one.
    Bill
    You do not need a parachute to skydive. You only need a parachute to skydive twice.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •