From: Marco B. <mar...@ai...> - 2004-02-07 15:15:25
|
Hi Carlos, thank you for your response. Maybe I'm doing something wrong... here's my pieces of code. Field "compleanno" is a timestamp value and is null. On the web page the = sample code returns "17/11/1858 0.00.00". - Table ---------------------------- CREATE TABLE "Persona" ( "Id" INTEGER NOT NULL, "Nome" VARCHAR(50), "Compleanno" DATE, "Salario" DECIMAL(15,2), "Nuovo" INTEGER, "id_famiglia" INTEGER, ISTANTE TIMESTAMP ); - Stored procedure ------------------ CREATE PROCEDURE "sdhPersona" ("_Id" INTEGER) RETURNS ("Compleanno" DATE) AS BEGIN SELECT "Compleanno" FROM "Persona" WHERE "Id" =3D :"_Id" INTO :"Compleanno"; SUSPEND; END -------------------------------------- #region sample code FbTransaction myTransaction; FbConnection myConnection =3D new FbConnection("User=3DSYSDBA;Password=3Dmasterkey;Database=3Dframework;Dat= aSource=3Dl ocalhost;Port=3D3050;Dialect=3D3;Charset=3DNONE;Role=3D;Connection lifetime=3D15;Packet Size=3D8192;"); myConnection.Open(); myTransaction =3D myConnection.BeginTransaction(); FbCommand myCommand =3D new FbCommand("EXECUTE PROCEDURE \"sdhPersona\" = (?)", myConnection, myTransaction); myCommand.CommandType =3D CommandType.StoredProcedure; myCommand.Parameters.Add("_id", FbType.Integer).Direction =3D ParameterDirection.Input;=20 myCommand.Parameters[0].Value =3D 2; myCommand.Parameters.Add("Compleanno", FbType.TimeStamp).Direction =3D ParameterDirection.Output;=20 myCommand.ExecuteNonQuery(); myTransaction.Commit(); Response.Write( myCommand.Parameters[1].Value ); myConnection.Close(); #endregion -------------------------------------- Thank you for your support! Marco Brambilla > -----Original Message----- > From: fir...@li...=20 > [mailto:fir...@li...] On=20 > Behalf Of Carlos Guzm=E1n =C1lvarez > Sent: Saturday, February 07, 2004 3:24 PM > To: Fir...@li... > Subject: Re: [Firebird-net-provider] NULL values in output parameters >=20 > Hello: >=20 > > I'm using it on a ASP.NET project and I call a stored=20 > procedure that=20 > > return values into output parameters. When a field value in=20 > my table=20 > > is null the stored procedure returns NULL as parameter value. Using=20 > > the FB .NET provider the output parameter returned has always the=20 > > default value (e.g.: 0 for integer). Is it possible to=20 > return NULL value from database? >=20 > Huummmm .... can you send sample test case ? ( remember that=20 > numeric values in C# cannot be null. ) >=20 >=20 >=20 >=20 >=20 >=20 >=20 > -- > Best regards >=20 > Carlos Guzm=E1n =C1lvarez > Vigo-Spain >=20 >=20 > ------------------------------------------------------- > The SF.Net email is sponsored by EclipseCon 2004 > Premiere Conference on Open Tools Development and Integration > See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. > http://www.eclipsecon.org/osdn > _______________________________________________ > Firebird-net-provider mailing list > Fir...@li... > https://lists.sourceforge.net/lists/listinfo/firebird-net-provider >=20 |