Skip to content


Error: Unable to cast object of type System.Int32 to type System.String

Patty asked 6 years ago
Problem: Importing to SQL.  I have a restriction that increments a line number.  If the spreadsheet has duplicates, not all lines come in.  I have a map to bring in the duplicates.  I modify the spreadsheet to make them slightly different by appending a period to a description I have noted as a key.  I want to go to SQL to get the last line number and import the duplicates starting at the last line. 
Using Task “before document runs”.  SQL command.   [x] Update global variable.  GBL_LASTSEQ    set with value 0 in global setup. GBL_LASTREF set with value blanks in global setup.
select isnull(max(InvoiceLine) ,0)
from NORCO..Royalty_Weekly
where InvoiceNo = ‘GBL_LASTREF’
I was taught to put single quotes around a GBL variable if it is a string.  I tried with and without the single quotes and with double quotes.
Patty replied 6 years ago

If there was a way to run a map that found all the duplicates first then they could be fixed before the import to sql. Any ideas on doing that?

If you would like to submit an answer or comment, please sign in to the eOne portal.