mardi 4 août 2015

Verification of Result in ESQL

Here's the situation: I run a query that gives me one or many rows as a result in an array.

Like:

SET db = PASSTHRU('SELECT GUID,CONTROLNBR FROM TRANSACTION WHERE GUID > ? AND CONTROLNBR > ?' values(maxGuid,maxControlNbr);

That works fine but I want to verify the following:

Any result that has duplicate CONTROLNBR's must have the same GUID

So if my result set has something like this:

1: CONTROLNBR: 5, GUID: 123abc

  1. CONTROLNBR: 5, GUID: 123abc

this is entirely valid, however this I need to return an error on:

  1. CONTROLNBR: 5, GUID: 123abc

  2. CONTROLNBR: 5, GUID: abc123

I'm not sure the best way to test the result like this in ESQL/SQL.

Thanks

Aucun commentaire:

Enregistrer un commentaire