|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 5/10/2008 2:58:23 AM
Posts: 4,
Visits: 107
|
|
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
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 8/24/2008 2:47:14 PM
Posts: 425,
Visits: 398
|
|
|
No, but you can call a UDF
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/14/2008 1:50:04 PM
Posts: 4,
Visits: 10
|
|
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') ;
|
|
|
|
|
Supreme Being
      
Group: Forum Members
Last Login: 8/24/2008 2:47:14 PM
Posts: 425,
Visits: 398
|
|
macros can call stored procedures as well as execute other macros ...
however you cannot execute a macro from a stored proc as of v2r6
|
|
|
|
|
Forum Newbie
      
Group: Forum Members
Last Login: 3/14/2008 1:50:04 PM
Posts: 4,
Visits: 10
|
|
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?
|
|
|
|
|
Forum Guru
      
Group: Forum Members
Last Login: 9/4/2008 11:27:02 PM
Posts: 64,
Visits: 75
|
|
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?
|
|
|
|