cancel
Showing results for 
Search instead for 
Did you mean: 

sql stored procedure parameters declarations

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

valluvan_navalan
Explorer
0 Kudos

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

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

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.