Base solution for your next web application
Open Closed

CreateLinkedUsersQuery function throw exception on Oracle #3147


User avatar
0
VuCA created

The error throw when function excuted detail like bellow

ERROR 2017-05-09 09:27:45,766 [23 ] nHandling.AbpApiExceptionFilterAttribute - An error occurred while executing the command definition. See the inner exception for details. System.Data.Entity.Core.EntityCommandExecutionException: An error occurred while executing the command definition. See the inner exception for details. ---> Oracle.ManagedDataAccess.Client.OracleException: ORA-12704: character set mismatch at OracleInternal.ServiceObjects.OracleCommandImpl.VerifyExecution(OracleConnectionImpl connectionImpl, Int32& cursorId, Boolean bThrowArrayBindRelatedErrors, OracleException& exceptionForArrayBindDML, Boolean& hasMoreRowsInDB, Boolean bFirstIterationDone) .....

I debuged and found the error occur when execute query but don't know how to fixed this.

SELECT 1 AS "C1", "Extent1"."UserId" AS "UserId", "Extent1"."TenantId" AS "TenantId", CASE WHEN ("Extent2"."Id" IS NULL) THEN '.' ELSE "Extent2"."TenancyName" END AS "C2", "Extent1"."UserName" AS "UserName", "Extent1"."LastLoginTime" AS "LastLoginTime" FROM "AbpUserAccounts" "Extent1" LEFT OUTER JOIN
( SELECT "Var_32"."Id" AS "Id", "Var_32"."CustomCssId" AS "CustomCssId", "Var_32"."LogoId" AS "LogoId", "Var_32"."LogoFileType" AS "LogoFileType", "Var_32"."EditionId" AS "EditionId", "Var_32"."Name" AS "Name", "Var_32"."TenancyName" AS "TenancyName", "Var_32"."ConnectionString" AS "ConnectionString", "Var_32"."IsActive" AS "IsActive", "Var_32"."IsDeleted" AS "IsDeleted", "Var_32"."DeleterUserId" AS "DeleterUserId", "Var_32"."DeletionTime" AS "DeletionTime", "Var_32"."LastModificationTime" AS "LastModificationTime", "Var_32"."LastModifierUserId" AS "LastModifierUserId", "Var_32"."CreationTime" AS "CreationTime", "Var_32"."CreatorUserId" AS "CreatorUserId" FROM "AbpTenants" "Var_32" WHERE ((( CAST( "Var_32"."IsDeleted" AS number(1,0))) = 0)) ) "Extent2" ON ("Extent1"."TenantId" = "Extent2"."Id") WHERE (( (( NOT (("Extent1"."TenantId" = 1) AND ((CASE WHEN ("Extent1"."TenantId" IS NULL) THEN 1 ELSE 0 END) = (CASE WHEN (1 IS NULL) THEN 1 ELSE 0 END)))) OR ("Extent1"."UserId" <> 2)) AND ("Extent1"."UserLinkId" IS NOT NULL) AND (("Extent1"."UserLinkId" = null) OR (("Extent1"."UserLinkId" IS NULL) AND (null IS NULL))));

Please help me get rid of this bug, thanks your very much!


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Can you try to remove your SQL query line by line and see which line causes the error ? After that, we can try to find a solution.

    Thanks.

  • User Avatar
    0
    VuCA created

    Hi,

    After many hours, I have figured out this line

    CASE WHEN ("Extent2"."Id" IS NULL) THEN '.' ELSE "Extent2"."TenancyName" END AS "C2",

    caused of this error.

    Please help me fixed it, thanks!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Sorry for wasting your time but this is an EF related problem I think and I don't have oracle installed :). Can you replace that line with this one

    CASE WHEN ("Extent2"."Id" IS NULL) THEN N'.' ELSE "Extent2"."TenancyName" END AS "C2",
    

    and see if it works ?

    If it works, you can apply the solution offered here I think <a class="postlink" href="http://stackoverflow.com/a/34665239">http://stackoverflow.com/a/34665239</a>.

    Thanks.

  • User Avatar
    0
    VuCA created

    Hi,

    Yep, it's EF and Oracle problem, so I fixed by change type using VARCHAR2 instead NVARCHAR2

    Thank you very much!

  • User Avatar
    0
    ismcagdas created
    Support Team

    Thanks @VuCA,

    That is a better solution I think :)