No worries.  My response was sent in jest. J

 

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Grooms, Frederick W
Sent: December-04-12 17:33
To: [email protected]
Subject: Re: 'field' != 'DB.field'

 

** 

I hate Outlook at times as I had double quotes in what I sent.

 

And actually I wanted the AND as I was specifically looking to exclude the case 
where the field from the API program was the empty string (double quotes) AND 
the database was a NULL.  With an OR the filter would skip logging to the audit 
trail a case of  setting the field from NULL to anything

 

     (  field  !=  DB.field  ) AND (NOT ((  field  = “”) OR (  DB.field  = 
$NULL$ )))   

     ( “X”  != $NULL$ ) AND (NOT ((  “X”  = “”) OR ( $NULL$  = $NULL$ )))   

     ( TRUE ) AND (NOT (( FALSE ) OR ( TRUE )))

     ( TRUE ) AND (NOT ( TRUE ))

 

You are correct that the API should use the NULL but you can’t always rely on 
other people to program the same way 

 

Fred

 

 

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Ben Chernys
Sent: Tuesday, December 04, 2012 10:12 AM
To: [email protected]
Subject: Re: 'field' != 'DB.field'

 

** 

Oops.  You’ve got a syntax and semantic error in your expression.  You need 
quotes and the last and should be an or.  A single value is hardly likely to be 
NULL and “”.

 

(  field  !=  DB.field  ) AND (NOT ((  field  = “”) OR (  DB.field  = $NULL$ )))

 

I know it’s just a typo J

 

The API program should not be inserting a zero length string but rather the 
“ARValueStruct” of type NULL.

 

I’m not sure what dev studio does with that expression though.  It may convert 
the “” to $NULL$.  

Meta-Update certainly considers them equivalent in expressions, assignments, 
and queries.

 

Cheers

Ben Chernys
Web:          <http://www.softwaretoolhouse.com/> www.softwaretoolhouse.com




-----Original Message-----
From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Grooms, Frederick W
Sent: December-04-12 16:55
To: [email protected]
Subject: Re: 'field' != 'DB.field'

 

Unless you are doing some other work the $NULL$ will look like    to a human 
(but not to a system)

 

field  !=  DB.field  should produce the following results:   

 

   Field                     DB.Field               Result of   Field  !=  
DB.field    

      NULL                  NULL                     TRUE   

      Empty string   NULL                     FALSE   

      SomeText        NULL                     FALSE   

 

As data is stored in the database the ARS system converts strings of 0 length 
(empty strings, aka    ) to NULL.  

 

Off the top of my head  

Since you want to treat    the same as NULL you may want to use a Run-If 
something like

 

(  field  !=  DB.field  ) AND (NOT ((  field  =    ) AND (  DB.field  = $NULL$ 
)))

 

 

Fred

 

-----Original Message-----

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Raj

Sent: Tuesday, December 04, 2012 9:42 AM

To: [email protected]

Subject: Re: 'field' != 'DB.field'

 

** Thanks Jiri, so from your reply.

Then I should see in my Audit log something like this(API pushing ""-zero 
length character):- "Value changed from  to "" " but I do not that, I only see 
"Value changed from  to ".

 

-----Original Message-----

From: Action Request System discussion list(ARSList) 
[mailto:[email protected]] On Behalf Of Jiri Pospisil

Sent: Tuesday, December 04, 2012 3:50 AM

To: [email protected]

Subject: Re: 'field' != 'DB.field'

 

**

Raj,

 

You mentioned API update and from the condition you suggested below, it looks 
like the update in fact sets the field value to zero length character, i.e.   . 

That in my experience is different from NULL value, which would explain why 
your filter is firing.

Also looking at your logic in the filter, to me it seems that the second set 
field will always result in saying value changes from  new value  to  new value 
 as I cannot see where the old value would come from.

 

Hope this helps

 

Jiri Pospisil

Remedy specialist

LCH Clearnet

 

 

 

_ARSlist: "Where the Answers Are" and have been for 20 years_ 


_______________________________________________________________________________
UNSUBSCRIBE or access ARSlist Archives at www.arslist.org
"Where the Answers Are, and have been for 20 years"

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to