cancel
Showing results for 
Search instead for 
Did you mean: 

How to test a null value transaction parameter to a foreign key column

Former Member
0 Kudos

HI All,

Another doubt using xMII.

The transaction T has some parameters. Those parameters are values to be used for update a line in a database. Some columns are foreign keys and some of them can be nulll.

I create this transaction T calling a SQL action and now I would like to test it.

Using the Transaction -> Transaction Properties menu I must give a number to the properties that are FK in my table. But I can not set it to NULL!

How to test it?

One way could be in "Configure Links" test if the values is 0 (once PK used starting in 1) and then change it for "null" to set [Param.n]. But it seems a lot work for a so common need.

Is there an easy way?

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

NULL support for databases is quite different, so you'll have to sort that out on your own because "" is not the same as null

If a web page is involved then it looks like you have 3 places to deal with this issue: javascript, transaction logic, sql syntax

Perhaps a valid combination of the 3 makes the most sense.

If 0 is the null equivalent for your transaction property, then perhaps you could use the CASE syntax in your SQL Query: (CASE WHEN XX > 0 THEN XX ELSE null END)

(XX is the Param.x with square brackets that the forum doesn't display)

Former Member
0 Kudos

Hi,

I was afraid that was the answer hehehe

Thank you

Nuno Cunha

Answers (0)