Skip to Content
author's profile photo Former Member
Former Member

sql stored procedure parameters declarations

I am trying to understand the following procedure.

CREATE PROCEDURE ProcWithResultView(OUT EMPLOYEE_TAB EMPLOYEE)
LANGUAGE SQLSCRIPT READS SQL DATA WITH RESULT ProcView AS
EMPLOYEE_TAB = CE_COLUMN_TABLE(“EMPLOYEE”);
END;

SELECT * FROM ProcView;

------
Question: what is this: (OUT EMPLOYEE_TAB EMPLOYEE)

OUT means is it output parameter?

What does it mean by EMPLOYEE_TAB

What is employee?

I know there is a table called employee, how does the procedure understands.

I am familiar with creating SP's on SQL server.
there i must define the datatypes for each parameter i use within the sp.

Here how does it know there is a table called employee?

If you don't provide teh datatype, what will the engine assumes, is is like a variant datatype?

Thanks a lot for the helpful info.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jun 15, 2012 at 04:30 AM

    Hi,

    (Question: what is this: (OUT EMPLOYEE_TAB EMPLOYEE)

    OUT means is it output parameter?

    What does it mean by EMPLOYEE_TAB)

    Yes Out is output parameter.... and EMPLOYEE_TAB is nothing but output parameter name...

    SP parameters are IN,OUT,INOUT .

    result output stroed in (EMPLOYEE_TAB)

    Regards,

    Valluvan

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2012 at 04:31 AM

    Hi,

    Question: what is this: (OUT EMPLOYEE_TAB EMPLOYEE)

    OUT means is it output parameter?

    yes OUT means output of the procedure.. Just like your export parameter in your function module.

    What does it mean by EMPLOYEE_TAB

    EMPLOYEE_TAB is the variable of type table type or table EMPLOYEE.

    What is employee?

    This is Table Types or tables present in the catalog, in ABAP we call it as structure or tables. Look at your procedure in catalog section, you will find EMPLOYEE in the table types or tables tab .

    I would recommend to go through the SQL guide and SQL reference guide present in the SAP HELP sections.

    I know there is a table called employee, how does the procedure understands.

    I am familiar with creating SP's on SQL server.


    there i must define the datatypes for each parameter i use within the sp.

    Here how does it know there is a table called employee?

    If you have not specified the catalog before stored procedure, then it is the default catalog. Alternately, you can specify full qualified name instead of just EMPLOYEE like SYSTEM.EMPLOYEE

    As I specified above, its the table type in your catalog or the table in the default catalog.

    If you don't provide teh datatype, what will the engine assumes, is is like a variant datatype?

    You need to provide the data type, engine does not assumes anything.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 15, 2012 at 07:20 AM

    Hi Kumar

    For your first question

    Question: what is this: (OUT EMPLOYEE_TAB EMPLOYEE)

    OUT means is it output parameter?

    What does it mean by EMPLOYEE_TAB

    What is employee?

    As the phrase says it is an OUTPUT parameter,EMPLOYEE is a table end EMPLOYEE_TAB is table type,you are saying that your employee table is of type EMPLOYEE_TAB, we can't insert data into table types we can use them as data types.So your Employee table is of type EMPLOYEE_TAB

    it will serach for the table in your schema,if it is not able to find it will throw an error.

    I believe you are going through the developer guides,it would be more helpful,let us know if you still need anything.

    Thanks

    Santosh Varada

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.