Question : Teradata SQL Macro not returning results

I'm developing a SQL Macro within the Teradata DMBS that I will be hooking up to a Crystal Report to be used to create an automated letter process.  Because of some missing data from our data warehouse, there are certain data fields I will need a user to manually enter, so I'm having them passed as parameter values in the stored procedure so that they will be passed into the crystal report.  However, most of the fields will automatically be filled based on the account number the user enters when prompted for the account number parameter.

When the stored proc runs, it is returning blank resuts.  Does anyone have any idea why it can't return results when a valid account number is entered?  I've attached the code for the stored proc to this question.

Thank you!
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
REPLACE MACRO workdb.s_rpt_wisconsin_manual
(acct_num INTEGER, 
registration DECIMAL(18,4),
trade_in_credit DECIMAL(18,4),
negative_equity DECIMAL(18,4),
amount_down DECIMAL(18,4),
cash_sale_price DECIMAL(18,4),
trade_year CHAR(4),
trade_make CHAR(20),
trade_model CHAR(20),
trade_vin CHAR(20)
)  AS (
 
select          c.first_name,
                c.lst_name,
                c.st_addr_1,
                c.st_addr_2,
                c.city,
                c.state,
                c.zip_cde,
                (b.loan_id*1) AS loan_id,               
                a.contract_date,
                a.vehicle_year,
                a.vehicle_make,
                a.vehicle_model,
                a.apr,
                a.finance_charge,
                a.amount_financed,
                a.total_of_payments,
                b.down_payment,
                a.num_payments,
                a.payment_amount,
                a.first_payment_dte,
                a.num_payments_2,
                a.payment_amount_2,
                (a.cash_price+a.sales_tax) AS cash_price,
                a.cash_down,
                (a.net_trade_amount*-1) AS  net_trade_amount,
                a.trade_in_year,
                a.trade_in_make,
                a.trade_in_model,
                a.other_fee,
                a.warranty_price,
                (a.cash_down-b.cash_down)as Trade_In_Credit,
                a.trade_payoff_amt,                     
                  EXTRACT(DAY FROM a.first_payment_dte) AS day_due,
                 a.vin_number
                                        
from            cnt_ver a,
                loi b,
                cst_mst c
                                        
where           a.work_id = b.work_id                   
AND             b.loan_id = c.loan_num  
/* passing account number in to stored proc as parameter; used to pull remaining account information in select statement. */    
AND             b.loan_id = :acct_num;

Answer : Teradata SQL Macro not returning results

Have you verified there is data in the table that meets your requirements?
Random Solutions  
 
programming4us programming4us