Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

[54000] ERROR: Cannot prepare statement - too many prepared statements

Hi,
at the risk to ask this question again, but I could not find a solution that suits me.
I'm using the Vertica.Data 7.2.3. nuget package to insert many data sets into my database. The code for a single row is basically something like:
string cols = string.Join(", ", keys.ToArray());
string values = string.Join(", ", data.Values.ToArray());
_command.CommandText = "INSERT INTO " + table + "(" + cols + ") SELECT " + values;
affectedRows = _command.ExecuteNonQuery();
This snippet runs fine for a couple of hundred rows, but then I get
[54000] ERROR: Cannot prepare statement - too many prepared statements
Where do I 'prepare statements' and how can I reset? It looks like I need to reset the 'prepared statement' buffer or soemthing like that.
I also tried a commit after each insert, but then I got a message that the statement was alread commited.
Thanks , Joerg

Best Answers

  • Accepted Answer

    Where can I find version 8.0.0-3? Cannot find it on nuget.org.

  • Accepted Answer

    Yes, that did the trick! Thanks for the quick reply. Best forum ever.

Answers

  • Thanks :)

  • Hi,
    I am using "Vertica Analytic Database v9.3.1-17" still facing this issue. Have you got any solution for this ?

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.