Announcing the Saviynt Knowledge Exchange unifying the Saviynt forums, documentation, training,
and more in a single search tool across platforms. Read the announcement here.

Column count doesn't match value count at row 1 error for DB Connector

Rajesh_IAM
Regular Contributor
Regular Contributor

Hi Team,

Its a DB connector.

I was trying to import accounts from target (DB based application) to Saviynt and getting error as "Column count doesn't match value count at row 1". Even I verified that all the columns in select are mentioned in mapping.

Attached is the import text file.

Could you please check and help me to resolve this import issue. 

14 REPLIES 14

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Rajesh_IAM

Column count doesn't match value count at row 1 - This error means that all columns are not being passed as expected. Are you sure that all mapped columns having mentioned in select statement and have data?
Please try removing the square brackets and rephrasing the XML Query referencing the below sample,

<dataMapping>
	<sql-query description="This is the Source Database Query">
		<![CDATA[SELECT CAST (ComputerID as CHAR) as entID, [Computer Name] as entitlementvalue, OS as cp3,1 as status, [Asset Type] as entitlementtype, 'Dev_Asset' as applicationname, 'Dev_Asset' as endpointname FROM ASSETS WHERE LTRIM([Computer Name]) LIKE 'ABQ-P%']]>
	</sql-query>
	<mapper description="BigFix Asset Import" deleteentitlementowner="true" entnotpresentaction="noaction" createentitlementtype="true">
		<mapfield saviyntproperty="securitysystems.systemname" sourceproperty="applicationname" type="character"/>
		<mapfield saviyntproperty="endpoints.endpointname" sourceproperty="endpointname" type="character"/>
		<mapfield saviyntproperty="entitlementtypes.entitlementname" sourceproperty="entitlementtype" type="character"/>
		<mapfield saviyntproperty="entitlementvalues.entitlement_value" sourceproperty="entitlementvalue" type="character"/>
		<mapfield saviyntproperty="entitlementvalues.entitlementID" sourceproperty="entID" type="character"/>
		<mapfield saviyntproperty="entitlementvalues.customproperty3" sourceproperty="cp3" type="character"/>
		<mapfield saviyntproperty="entitlementvalues.status" sourceproperty="status" type="number"/>
	</mapper>
</dataMapping>

for ref:- https://docs.saviyntcloud.com/bundle/Database-v23x/page/Content/Configuring-the-Integration-for-Impo... 

Thanks

If you find the above response useful, Kindly Mark it as "Accept As Solution".

Rajesh_IAM
Regular Contributor
Regular Contributor

@sudeshjaiswal  
Thank you for your response.

Yes, all the mapped columns are mentioned in select statement and also verified that one column(notesFullName) has null value for few users.
Even I tried with removing square brackets in select statement.

Rajesh_IAM
Regular Contributor
Regular Contributor

@sudeshjaiswal  Still facing same issue. Column count doesn't match value count at row 1

sudeshjaiswal
Saviynt Employee
Saviynt Employee

Hello @Rajesh_IAM,

Can you please share the XML Query?

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".

@sudeshjaiswal  Please find the attached file.

Can you try below?

<dataMapping>
<sql-query description="This is the DB Query" uniquecolumnsascommaseparated="employeeNumber" >
<![CDATA[SELECT c,co,givenName,sn,displayName,sAMAccountName,mail,employeeNumber,abbGEIDLocalID,l,st,notesFullName,distinguishedName,msDScloudExtensionAttribute20,abbEmploymentStatus,abbGEIDFirstName,abbGEIDLastName,abbHostingCompanyLegalName,Manager,Manager_givenName,Manager_sn,Manager_displayName,Manager_sAMAccountName,Manager_mail,Manager_employeeNumber,Manager_abbGEIDLocalID,Manager_EmployeeID_SSO_ID,Update_Date,'Corp' as securitysystem,'Corp' as endpointname FROM corp_test_db_From_Saviynt]]>
</sql-query>
<mapper description="This is the mapping field for Saviynt Field name" accountnotinfileaction="Inactive" ifusernotexists="noaction">
<mapfield saviyntproperty="accounts.name" sourceproperty="employeeNumber" type="character"></mapfield>
<mapfield saviyntproperty="accounts.accountid" sourceproperty="sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty3" sourceproperty="mail" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty1" sourceproperty="givenName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty2" sourceproperty="sn" type="character"></mapfield>
<mapfield saviyntproperty="accounts.status" sourceproperty="abbEmploymentStatus" type="number"></mapfield>
<mapfield saviyntproperty="accounts.customproperty5" sourceproperty="abbHostingCompanyLegalName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty6" sourceproperty="co" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty7" sourceproperty="distinguishedName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty12" sourceproperty="Manager_sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty13" sourceproperty="Manager_mail" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty14" sourceproperty="c" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty15" sourceproperty="abbGEIDLocalID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty16" sourceproperty="l" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty17" sourceproperty="st" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty18" sourceproperty="notesFullName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty19" sourceproperty="msDScloudExtensionAttribute20" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty20" sourceproperty="abbGEIDFirstName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty21" sourceproperty="abbGEIDLastName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty22" sourceproperty="Manager_displayName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty23" sourceproperty="Manager_sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty24" sourceproperty="Manager_employeeNumber" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty25" sourceproperty="Manager_abbGEIDLocalID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty26" sourceproperty="Manager_EmployeeID_SSO_ID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty9" sourceproperty="Manager_givenName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty10" sourceproperty="Manager_sn" type="character"></mapfield>
<mapfield saviyntproperty="accounts.displayname" sourceproperty="displayName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty11" sourceproperty="Manager" type="character"></mapfield>
<mapfield saviyntproperty="accounts.created_on" sourceproperty="Update_Date" type="date"></mapfield>
<mapfield saviyntproperty="securitysystems.systemname" sourceproperty="securitysystem" type="character"></mapfield>
<mapfield saviyntproperty="endpoints.endpointname" sourceproperty="endpointname" type="character"></mapfield>
</mapper>
</dataMapping>

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Can you please share the logs during the import?

Also what are the data types for each column from your select statement on the application from where you are pulling the data.

I believe one of the column mapping is not happening properly because of which you are receving this error.


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Share sample output 


Regards,
Rushikesh Vartak
If you find the response useful, kindly consider selecting Accept As Solution and clicking on the kudos button.

@rushikeshvartak  Please find the sample output

@Rajesh_IAM  I see some of the column values are coming as numbers not sure on source side it is number or varchar but since you are mapping to varchar column in saviynt I suggest to do casting like this and in mapping make sure you have used data type as character

cast(employeeNumber as VARCHAR) as employeeNumber

Do the same thing for following columns

abbGEIDLocalID

abbEmploymentStatus

Manager_employeeNumber

Manager_abbGEIDLocalID

Manager_EmployeeID_SSO_ID

 

Try below 

<dataMapping>
<sql-query description="This is the DB Query" uniquecolumnsascommaseparated="employeeNumber" >
<![CDATA[SELECT c as c, co as co, givenName as givenName, sn as sn, displayName as displayName, sAMAccountName as sAMAccountName, mail as mail, cast(employeeNumber as VARCHAR) as employeeNumber, cast(abbGEIDLocalID as VARCHAR)as abbGEIDLocalID, l as l, st as st, notesFullName as notesFullName, distinguishedName as distinguishedName, msDScloudExtensionAttribute20 as msDScloudExtensionAttribute20, cast(abbEmploymentStatus as VARCHAR) as abbEmploymentStatus, abbGEIDFirstName as abbGEIDFirstName, abbGEIDLastName as abbGEIDLastName, abbHostingCompanyLegalName as abbHostingCompanyLegalName, Manager as Manager, Manager_givenName as Manager_givenName, Manager_sn as Manager_sn, Manager_displayName as Manager_displayName, Manager_sAMAccountName as Manager_sAMAccountName, Manager_mail as Manager_mail, cast(Manager_employeeNumber as VARCHAR) as Manager_employeeNumber, cast(Manager_abbGEIDLocalID as VARCHAR) as Manager_abbGEIDLocalID, cast(Manager_EmployeeID_SSO_ID as VARCHAR) as Manager_EmployeeID_SSO_ID,Update_Date as Update_Date,'Corp' as securitysystem,'Corp' as endpointname FROM corp_test_db_From_Saviynt]]>
</sql-query>
<mapper description="This is the mapping field for Saviynt Field name" accountnotinfileaction="Inactive" ifusernotexists="noaction">
<mapfield saviyntproperty="accounts.name" sourceproperty="employeeNumber" type="character"></mapfield>
<mapfield saviyntproperty="accounts.accountid" sourceproperty="sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty3" sourceproperty="mail" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty1" sourceproperty="givenName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty2" sourceproperty="sn" type="character"></mapfield>
<mapfield saviyntproperty="accounts.status" sourceproperty="abbEmploymentStatus" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty5" sourceproperty="abbHostingCompanyLegalName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty6" sourceproperty="co" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty7" sourceproperty="distinguishedName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty12" sourceproperty="Manager_sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty13" sourceproperty="Manager_mail" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty14" sourceproperty="c" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty15" sourceproperty="abbGEIDLocalID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty16" sourceproperty="l" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty17" sourceproperty="st" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty18" sourceproperty="notesFullName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty19" sourceproperty="msDScloudExtensionAttribute20" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty20" sourceproperty="abbGEIDFirstName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty21" sourceproperty="abbGEIDLastName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty22" sourceproperty="Manager_displayName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty23" sourceproperty="Manager_sAMAccountName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty24" sourceproperty="Manager_employeeNumber" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty25" sourceproperty="Manager_abbGEIDLocalID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty26" sourceproperty="Manager_EmployeeID_SSO_ID" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty9" sourceproperty="Manager_givenName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty10" sourceproperty="Manager_sn" type="character"></mapfield>
<mapfield saviyntproperty="accounts.displayname" sourceproperty="displayName" type="character"></mapfield>
<mapfield saviyntproperty="accounts.customproperty11" sourceproperty="Manager" type="character"></mapfield>
<mapfield saviyntproperty="accounts.created_on" sourceproperty="Update_Date" type="date"></mapfield>
<mapfield saviyntproperty="securitysystems.systemname" sourceproperty="securitysystem" type="character"></mapfield>
<mapfield saviyntproperty="endpoints.endpointname" sourceproperty="endpointname" type="character"></mapfield>
</mapper>
</dataMapping>


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

Rajesh_IAM
Regular Contributor
Regular Contributor

@sk  Thank you for your response.
I have tried with provided XML data, but still getting same error. Post that I have tried this account import for one user (using where condition in select statement) and got success. Then again tried for  another user, now import failed. As of now, we have 3 test users records in DB. Out of 3, 2 users import is failing and for only one users, import got success.
I am not sure why its working for one user and not working for other users. 

@Rajesh_IAM : Would you be able to share the data of success vs failed records? Also logs for both runs?


Regards,
Saathvik
If this reply answered your question, please Accept As Solution and give Kudos to help others facing similar issue.

I believe the issue is in your mapping only.  Please try to run import with limited mapping , this way you can narrow down which field is causing the issue.

Thanks

Thanks,
Devang Gandhi
If this reply answered your question, please Accept As Solution and give Kudos to help others who may have a similar problem.

Hello @Rajesh_IAM,

Only Removing the square bracket won't work, as I have shared the sample above with you to create the alias as shown in the example. Please do that and try again.

Thanks,

If you find the above response useful, Kindly Mark it as "Accept As Solution".