SCM

[#1010787] Inserting an array does not work in a prepared statement

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-04-06 07:27
Priority:
3
State:
Open
Submitted by:
Raoul Cadei (raoulc72)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.8
Category:
Group:
Resolution:
None
Summary:
Inserting an array does not work in a prepared statement

Detailed description
I'm presently having troubles trying to insert a Double[] and an Int64[] into a table.

Table fields are declered in the following way:

temp_values DOUBLE PRECISION ARRAY [8192] NOT NULL,
time_values BIGINT ARRAY [8192] NOT NULL,

and the code that is trying to do the insert is the following:

............
command3.Parameters.Add(new NpgsqlParameter("PARAM6", NpgsqlDbType.Array | NpgsqlDbType.Double));
command3.Parameters.Add(new NpgsqlParameter("PARAM7", NpgsqlDbType.Array | NpgsqlDbType.Bigint));
............
command3.Prepare();

............

command3.Parameters[6].Value = new Double[] {1.2d, 1.3d};
command3.Parameters[7].Value = new Int64[] { 1, 3 };

............


When the line

command3.ExecuteNonQuery();

is executed, application stop working and I can see in PostgreSQL logs the message:

ERROR: array value must start with "{" or dimension information


All the information reported in this bug are available also in this thread: http://pgfoundry.org/forum/forum.php?thread_id=2546&forum_id=519

Regards

Followup

Message
Date: 2010-06-24 05:01
Sender: Francisco Figueiredo jr.


Fixed in cvs. Please give it a try and let us know of any problem you may get.

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge