Re: Assign Null Value (284 Views)
Reply
Occasional Advisor
thomas_eee
Posts: 14
Registered: ‎11-15-2011
Message 1 of 7 (332 Views)

Assign Null Value

I have a database->database connector and one of the target fields in a mapping requires to be set to NULL by the mapping. If I put in the mapping script the code "RetVal=NULL", there is a funny effect that this field is set to NULL but all following fields in the mapping which were filled not directly by a 1:1 source field mapping but also using a mapping script are now empty, too. If the first field is not filled using RetVal=NULL, the following fields are filled correctly (also when using a mapping script)

 

Is there a documented and recommended way to set a target field to NULL?

 

(Connect IT 9.51)

 

 

HP Expert
Priya_B
Posts: 534
Registered: ‎10-25-2012
Message 2 of 7 (305 Views)

Re: Assign Null Value

Hello Thomas, 

 

Depends on where you have set the script to give a null value.  ?? COuld you send us snapshots for the same ?

HP Support - If this post or any post helps you resolve an issue, please be sure to mark it as an acceptable solution.
Like a post, Please click Kudos to show appreciation !
Occasional Advisor
thomas_eee
Posts: 14
Registered: ‎11-15-2011
Message 3 of 7 (298 Views)

Re: Assign Null Value

Please see attachment...

HP Expert
Priya_B
Posts: 534
Registered: ‎10-25-2012
Message 4 of 7 (284 Views)

Re: Assign Null Value

Hello Thomas, 

Check the Programmers REf guide. 

 

 

 

You could use the  Function PifSetNullVal(strPath As String) As Long    Description. This function enables you to populate a node in the target document with the value 'NULL'. If the node does not exist, the function will create it.Input parameters

  • strPath: This parameter contains the full name of the node concerned by the operation. If this parameter is omitted or empty, the current node is selected. 

 

HP Support - If this post or any post helps you resolve an issue, please be sure to mark it as an acceptable solution.
Like a post, Please click Kudos to show appreciation !
Occasional Advisor
thomas_eee
Posts: 14
Registered: ‎11-15-2011
Message 5 of 7 (270 Views)

Re: Assign Null Value

If I use this function, then the field (type double) is filled with 0 (zero), not with the NULL value.

HP Expert
Priya_B
Posts: 534
Registered: ‎10-25-2012
Message 6 of 7 (265 Views)

Re: Assign Null Value

Thomas, 

 

Could  you send me a snapshot of what you implemented? 

HP Support - If this post or any post helps you resolve an issue, please be sure to mark it as an acceptable solution.
Like a post, Please click Kudos to show appreciation !
HP Expert
Jason_Dowd
Posts: 486
Registered: ‎11-04-2010
Message 7 of 7 (261 Views)

Re: Assign Null Value

You could try using:
RetVal = Chr(0)

 

in the mapping. 0 is the null character, so this should set that successfully.

Jason Dowd
HP Software Support

If this post has helped you resolve the issue, please flag it as solved.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.