SCM

[#1010781] Npgsql doesn't support pass parameters by name

View Trackers | Bugs | Download .csv | Monitor

Date:
2010-03-19 09:38
Priority:
3
State:
Open
Submitted by:
Alexander Koval (sacha)
Assigned to:
Nobody (None)
Npgsql Version:
2.0.8
Category:
Group:
Resolution:
None
Summary:
Npgsql doesn't support pass parameters by name

Detailed description
Table

CREATE TABLE "Image"
(
"Name" character varying(50),
"Description" character varying(250),
"ImageID" serial NOT NULL,
CONSTRAINT pk_image PRIMARY KEY ("ImageID")
)

I have the next function

CREATE OR REPLACE FUNCTION "ImageInsert"(pname character varying, pdescription character varying)
RETURNS "Image" AS
$BODY$

DECLARE
res "Image"%ROWTYPE;
pImageID "Image"."ImageID"%type;

BEGIN
pImageID:= nextval('"Image_ImageID_seq"');
insert into "Image"("ImageID", "Name", "Description") values(pImageID, pName, pDescription);

select * into res from "Image" where "ImageID" = pImageID;
return res;

END;
$BODY$
LANGUAGE 'plpgsql'

Then I do these actions

NpgsqlCommand cmd1 = CreateNpgsqlCommand();
cmd1.CreateParameter("pname","image name1");
cmd1.CreateParameter("pdescription","image description1");

NpgsqlCommand cmd2 = CreateNpgsqlCommand();
cmd2.CreateParameter("pdescription","image description2");
cmd2.CreateParameter("pname","image name2");

Let's look at the data

select * from "Image"

Surprise!
"image name1";"image description1";1;
"image description2";"image name 2";2;




Followup

No Followups Have Been Posted

Attached Files:

Changes:

No Changes Have Been Made to This Item

Powered By FusionForge