From: easyTree <eas...@ds...> - 2004-03-14 10:48:21
|
Hi all ;) I've recently discovered firebird and the .net provider (wow! :) and am r= unning a couple of tests to familiarise myself with it, in the form of th= e database version of 'hello world!' - customers/orders/orderdetails/prod= ucts. I'm using the embedded version of firebird 1.5 and .net provider 1.6.1524= .24952 (according to the SDK help file) and a demo version of EMS IBManag= er to define the database. The relevant DDL statements to give context to my question are tagged-on = at the end. I've got a 'new customer' form in a c# windows forms app. The form has a = command which passes its parameters to a stored procedure. The parameter = matches the stored procedure in size/type - ie VARCHAR (255). Ok. at last, to the question.. :) I've noticed that I'm able to assign a string of length 765 or less to th= e parameter which then somehow makes it through the stored procedure's 25= 5 character limit and into the database table. How is this possible? Sure= ly the table (not to mention the SP) should only allow 255 unicode charac= ters to be stored, despite the fact that it may have a limit of 765 bytes= ? Any pointers would be appreciated. -- CREATE TABLE CUSTOMERS ( CUSTOMER_ID INTEGER NOT NULL, NAME VARCHAR (255) CHARACTER SET UNICODE_FSS NOT NULL COLLATE UNICOD= E_FSS); CREATE PROCEDURE NEWCUSTOMER ( CUST_NAME VARCHAR (255)) RETURNS ( NEW_ID INTEGER, SUCCESS INTEGER) AS BEGIN /* Procedure body */ SUCCESS =3D 1; NEW_ID =3D GEN_ID(CUSTOMERS_CUSTOMER_ID_GEN, 1); INSERT INTO CUSTOMERS (CUSTOMER_ID, NAME) VALUES (:NEW_ID, :CUST_NAME); WHEN ANY DO SUCCESS =3D 0; END |