Quantcast
Channel: SCN : All Content - Data Services and Data Quality
Viewing all articles
Browse latest Browse all 4013

Custom Function returning null when set to varchar

$
0
0

Hello all,

 

I saw a post regarding using a VBScript to send attachments through BODS. I have been honing and refining the method described by Arun Sasi, and have found a way to automate it by saving a flat file as a .vbs. The current method is to use a mapping with a select distinct on a large string to save to the file, but I wanted to simplify it as much as possible. I am on the last leg of that journey, but have hit a snag making a custom function. Currently, I am declaring some local variables in a script, like so:

Attachment declarations.jpg

 

I know the irony of the email body and subject.

 

Then, I made a custom Function to create the information for generating the script, which looks like this:

CF for emails.jpg

The Return PV is set to Varchar of size 2048. I have gone through this quite a number of times and cannot figure out why this is all returning a Null value. I have a long list of troubleshooting steps, but the one that makes me believe it has to do with the custom function, is that copying the $LV_Email_Attachment string declaration into the script shown prior to the CF yields the correct results. Also, the 'set' string appears in blue, but this is due to how poorly strings are handled in BODS when concatenated, it is NOT using a set command within BODS. Everything Validates and runs correctly, save for the null $LV_Email_Attachment. The goal, just to reiterate, is to be able to return the varchar string named $LV_Email_Attachment (at least back to the script I called the function from). Can anyone lend a helping hand and tell me where I messed up?


Viewing all articles
Browse latest Browse all 4013

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>