Error: Unable to cast object of type System.Int32 to type System.String
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.
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.
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?