You need to sign in to do that
Don't have an account?
Roberto Luengo
Data loader error : Unmatched closing ')', but there are no extra )!
Hello community,
I have an error that is driving me crazy here.
I am doing a data upload from SQL Server to Salesforce, it has been working great with other SQLs but it is returning an error with the latest one I am implementing... Please advise?
SQL (reduced to the minimum expression, keep in mind the last select is to return the fields I have mapped to avoid an error)
DECLARE @StartDate datetime = DATEDIFF(dd, 0,DATEADD(month, -5, GETDATE())) + convert(datetime, '00:00:00');
DECLARE @EndDate datetime = DATEDIFF(dd, 0,DATEADD(day, -1, GETDATE())) + convert(datetime, '23:59:59');
DECLARE @CountryCodes varchar(max)=null;
DECLARE @AccountTypes varchar(max)='property';
if object_id('tempdb..#CountryCodes') is not null drop table #CountryCodes
select CountryCode = convert(varchar(5), data)
into #CountryCodes
from dbo.Split(@CountryCodes, ',') a
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@AccountTypes, ',') a
where nullif(data, '') is not null
select '201705INT66942' as PerfDataID, 'test' as test
from dbo.Split('abc', ',')
Error returned
2017-06-21 01:45:37,892 ERROR [propertyMonthlyPerformanceData] action.AbstractAction handleException (AbstractAction.java:222) - Exception occured during loading
com.salesforce.dataloader.exception.DataAccessObjectInitializationException: Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:115)
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:99)
at com.salesforce.dataloader.action.AbstractAction.execute(AbstractAction.java:123)
at com.salesforce.dataloader.controller.Controller.executeAction(Controller.java:121)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:149)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
Caused by: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at com.salesforce.dataloader.dao.database.DatabaseContext.replaceSqlParams(DatabaseContext.java:134)
at com.salesforce.dataloader.dao.database.DatabaseReader.setupQuery(DatabaseReader.java:123)
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:111)
... 6 more
2017-06-21 01:45:37,892 ERROR [propertyMonthlyPerformanceData] progress.NihilistProgressAdapter doneError (NihilistProgressAdapter.java:58) - Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
I have an error that is driving me crazy here.
I am doing a data upload from SQL Server to Salesforce, it has been working great with other SQLs but it is returning an error with the latest one I am implementing... Please advise?
SQL (reduced to the minimum expression, keep in mind the last select is to return the fields I have mapped to avoid an error)
DECLARE @StartDate datetime = DATEDIFF(dd, 0,DATEADD(month, -5, GETDATE())) + convert(datetime, '00:00:00');
DECLARE @EndDate datetime = DATEDIFF(dd, 0,DATEADD(day, -1, GETDATE())) + convert(datetime, '23:59:59');
DECLARE @CountryCodes varchar(max)=null;
DECLARE @AccountTypes varchar(max)='property';
if object_id('tempdb..#CountryCodes') is not null drop table #CountryCodes
select CountryCode = convert(varchar(5), data)
into #CountryCodes
from dbo.Split(@CountryCodes, ',') a
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@AccountTypes, ',') a
where nullif(data, '') is not null
select '201705INT66942' as PerfDataID, 'test' as test
from dbo.Split('abc', ',')
Error returned
2017-06-21 01:45:37,892 ERROR [propertyMonthlyPerformanceData] action.AbstractAction handleException (AbstractAction.java:222) - Exception occured during loading
com.salesforce.dataloader.exception.DataAccessObjectInitializationException: Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:115)
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:99)
at com.salesforce.dataloader.action.AbstractAction.execute(AbstractAction.java:123)
at com.salesforce.dataloader.controller.Controller.executeAction(Controller.java:121)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:149)
at com.salesforce.dataloader.process.ProcessRunner.run(ProcessRunner.java:100)
at com.salesforce.dataloader.process.ProcessRunner.main(ProcessRunner.java:253)
Caused by: java.util.regex.PatternSyntaxException: Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
at java.util.regex.Pattern.error(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.util.regex.Pattern.<init>(Unknown Source)
at java.util.regex.Pattern.compile(Unknown Source)
at java.lang.String.replaceFirst(Unknown Source)
at com.salesforce.dataloader.dao.database.DatabaseContext.replaceSqlParams(DatabaseContext.java:134)
at com.salesforce.dataloader.dao.database.DatabaseReader.setupQuery(DatabaseReader.java:123)
at com.salesforce.dataloader.dao.database.DatabaseReader.open(DatabaseReader.java:111)
... 6 more
2017-06-21 01:45:37,892 ERROR [propertyMonthlyPerformanceData] progress.NihilistProgressAdapter doneError (NihilistProgressAdapter.java:58) - Unmatched closing ')' near index 17
@CountryCodes, ',')
where nullif(data, '') is not null
if object_id('tempdb..#AccountTypes') is not null drop table #AccountTypes
select AccountType = convert(varchar(50), data)
into #AccountTypes
from dbo.Split(@
^
I use Sublime Text editor, you can get it here
https://www.sublimetext.com/3
It is useful when building formulae, validation rules etc with lots of nesting as it highlights the open and closing brackets as you move your insertion point through the text.
E.g. I'm on line 6 in this screenshot and you can see the brackets on lines 5 and 9 underlined: (the /*1*/ numbering was manually added by me):
Hope this helps.
Mark this as solved if it's resolved.
Thanks,
Nagedra