Skip to main content
Question

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

  • May 24, 2020
  • 8 replies
  • 13 views

joergschaber
Forum|alt.badge.img+2

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

8 replies

sahil_kumar
Forum|alt.badge.img
  • Participating Frequently
  • May 25, 2020

@joergschaber please upgrade to higher version. This was fixed at version 8.0.0-3.


mosheg
Forum|alt.badge.img+2
  • Participating Frequently
  • May 25, 2020

As mentioned in the past there was a Jira VER-49781
Fixed at version 8.0.0-3
Can you check if the problem occurs on 8.0.0-3 or higher?
It is advised to open a support case to address the issue.


joergschaber
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • May 25, 2020

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


sahil_kumar
Forum|alt.badge.img
  • Participating Frequently
  • May 25, 2020

You can download latest vertica versions from www.vertica.com/download/vertica.


joergschaber
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • May 25, 2020

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


sahil_kumar
Forum|alt.badge.img
  • Participating Frequently
  • May 26, 2020

Thanks :)


abhaya2608
  • New Participant
  • May 20, 2021

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


joergschaber
Forum|alt.badge.img+2
  • Author
  • Participating Frequently
  • December 2, 2021

I am using Vertica Analytic Database v10.0.1-6 with corresponding ADONET Driver and also face this issues.