I know that such error can be caused by incorrect character set applied to some table, but in my case it's a bit different:
I have some procedure with select, create temporary table and cursor...
The actual problem is that if I do DROP/CREATE procedure from JetBrain's DataGrip and CALL it - error appears. But in case I do DROP/CREATE of SAME procedure without any modification from other software, for example I've used DBForge - CALL works just as expected! What can cause such behavior? I've used DataGrip for years now and this is the first time after which I start to worry about recreating procedures on production database.
Additional information: the error is caused by FETCH of Username column in cursor loop body. In case of commenting that part - everything works. So there is a problem FETCHING Username to my local variable DECLARE Username VARCHAR(300);. Sizes of variables are same.

  • That looks like Cyrillic ТОО. For "question marks" and other issues, see stackoverflow.com/questions/38363566/…
    – Rick James
    Oct 20, 2020 at 3:49
  • @RickJames yes, that was Russian text mixed with English there. But anyway: probably the compiled procedure should not crash in case it(CREATE) was run in various clients: so in any client the result probably should be the same. That's why I've opened the case in JetBrains.
    – 0x49D1
    Oct 20, 2020 at 5:43

1 Answer 1


A bit strange case, but I'll leave the answer we've came up to ourselves:

Fixed after I've used NVARCHAR (or VARCHAR CHARACTER SET UTF8;), not VARCHAR for variable declaration and for temporary table's creation scheme. The problem appeared ONLY when we used temp table in the script. For regular tables our VARCHAR with default DB collation/charset worked OK. I still don't know why DBForge ignored it and calling procedure created in it caused no problems (but there really were problems: "?" instead of UTF8 characters).

UPDATE: added issue on DataGrips tracker, because I think that failing to execute the procedure is not the correct behavior in such case: https://youtrack.jetbrains.com/issue/DBE-11789

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.