Tags for procedure
Macro vs Procedure - SQL SECURITY
Does CREATE MACRO have an equivalent of CREATE PROCEDURE's SQL SECURITY clause? Or should the database of the user executing the macro always always have SELECT/UPDATE access, as needed, to the tables used in the MACRO?
macro procedure
User defined exception from procedure
Hi, I have a stored procedure which is checking counts from four tables. I need to raise exception if the counts are not matich with a predefined value. Can anyone help me on how to achieve this? I am using Terdata 14 version.
procedure exception
Creating and populating a parameterized table inside a stored procedure
I am trying to create a table and populate it inside a stored procedure but I get E(3807): table does not exist. I used the following query:  create procedure stp_agg (in par1 varchar (20),in par2 int) begin     create table tbl_spt     as     (select subscriber_id from existing_tbl) with no data;
create table procedure
Stored Proc In Teradata For Calculated Field
Team, Could you please help in writing a stored proc for the below requirement. I need to add integer to a data column by excluding weekends & custom holidays. Example :- OE_Date ( Date ) + Days ( Integer ) = Calculated_Date Column ( Date )
Procedure dynamic result set column names
When I call the procedure below in SQL Assistant, the data is returned ok, but without column headers...  Is there any way to include the column headers (e.g., in this case, 'DatabaseName','TableName',etc)?   replace PROCEDURE abc() dynamic result sets 1 begin      DECLARE SqlStr VARCHAR(100);
procedure resultset dynamic
GET DIAGNOSTICS v_Variable_Name = ROW_COUNT giving wrong output
Hi, ROW_COUNT is returning wrong number. i have a table having around 100K rows. In a procedure i'm updating all the rows and returning number of rows affected. I'm using following query to get number of affected rows.   GET DIAGNOSTICS v_Variable_Name = ROW_COUNT;  
teradata database procedure DIAGNOSTICS row_count rowcount
How to find the Invalid Procedures?
Is there any way to find whether the procedure is valid, without recompiling it? I came across a Proc, which i tried to Recompile, it just fails with missing column on one of the underlying table. I dont want to recompile all procs, just to find whether they are valid are not. 
procedure invalid
Use While loop in Stored Procedure in Teradata
Hi, I'm new to TeraData. Following is the script i am using to create to While loop in Stored Procedure. But TeraData Studio is giving me Syntax Error: can we use loop in Stored Procedure or is there any other way to do that. Kindly suggest. CREATE PROCEDURE proc (         IN i INTEGER,
teradata sql stored procedure while loop error
How to handle exceptions 'Call failed' in procedure?
Hi, All I have a main procedure which is used to invoke other sub-procedures. I've added the 'DECLARE EXIT HANDLER FOR SQLEXCEPTION' in the main procedure. But when any exception raised in sub-procedure, the HANDLER in main procedure doesn't work. So how can I catch exceptions generated in all sup-procedures?
procedure exception
Storing result set as a variable in a procedure
Hi,   I am trying to pass a result set of a query into a procedure. I  only need one column from a table but the column will have multiple rows. I have tried within the procedure to have : SELECT columnname INTO :variable from dbc.tablename where columnname2 = 'value';
Result Set procedure Result Set in Procedure