PDA

View Full Version : How do I use parameters?



kettle_anonymous
04-18-2006, 10:49 PM
->>QUERY A

DECLARE @D1 AS DATETIME, @D2 AS DATETIME
SET @D1 = '?' Note: ? should be replaced with a date. 01/01/2000
SET @D2 = '?' Note: ? should be replaced with a date. 02/01/2000

SELECT A.BR, A.DEALNO, A.SEQ, @D1 AS DATEFR, @D2 AS DATETO, A.CCY, A.VDATE, A.MDATE,
A.PRODTYPE, A.CCYAMT,
ADB = ( ABS(A.CCYAMT) *

-----------------------

As you can see, I placed ?s so that they will be replaced by the parameters.

My transformation looks like this...

Add Constants -> DB Input (Using Query A) -> Dummy

Add Constants contains
Field Name: Date1 Value: 01/01/2000 (January)
Field Name: Date2 Value: 02/01/2000 (February)

both fields are type of DATE

The problem is I cannot preview the data. It says, null pointer exception.

jbleuel
04-19-2006, 02:20 AM
I think I found the problem and assume you use the 'Table Input' step.

The preview button in this step returns null pointer exception when parameters are used (I open a Bug for this).

Circumvention: Mark the step in the graphical view and do a preview here - this works.

BTW: I think the select statement makes sense when you use the @D1 parameter in the where clause...

Thanks for your feedback!

Cheers,
Jens