Can a stored procedure be called thru a view ?

Analytics
Enthusiast

Can a stored procedure be called thru a view ?

Hi,

In Teradata , Can we call a stored procedure thru a view ( this is possible in oracle ) ?

And pointers would be highly appreciated.

Regards,
Madhavi

5 REPLIES
Enthusiast

Re: Can a stored procedure be called thru a view ?

No, but you can call a UDF

Re: Can a stored procedure be called thru a view ?

On a similar note, I have two questions:
a. can stored procs be called from a macro? -- see below
I want to use the macro like to pass the parm to the stored procs
b. can macros execute other macros?
again using it as a "driver" to ensure that the correct macros are executed.

example of a.
REPLACE MACRO my_db.my_macro (table_parm VARCHAR(30) ) AS
(
CALL SP_1(':table_parm') ;
CALL SP_2(':table_parm') ;
CALL SP_3(':table_parm') ;
CALL SP_4(':table_parm') ;
CALL SP_5(':table_parm') ;

);

then execute using
EXEC my_macro ('customer') ;
Enthusiast

Re: Can a stored procedure be called thru a view ?

macros can call stored procedures as well as execute other macros ...

however you cannot execute a macro from a stored proc as of v2r6

Re: Can a stored procedure be called thru a view ?

when I try to execute code like the example I posted, I get Error 5497: CALL can not be submitted in multi statement request.
If I eliminate all but one CALL stmt, it works, as suggested by the Error msg, but that doesn't help me at all. Any suggestions?
rgs
Enthusiast

Re: Can a stored procedure be called thru a view ?

A procedure can call other procedures. So you can have a macro call a procedure and that procedure can call other procedures. Keep in mind that everything executed by a macro is one request.

Why not just call the procedure directly? Why have it go through a macro first?