Yeh-Hey ! Can some-one iron out remaining bugs, I could really make use of this ! Mark. PS XS makes my head hurt.
-----Original Message----- From: Mike Battersby [mailto:[EMAIL PROTECTED]] Sent: 09 July 2002 10:48 To: [EMAIL PROTECTED] Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: DBD::Ingres and 'long varchar' Dear DBI Developers, Attached (assuming it survives the list software) is a first attempt at supporting the "long varchar" data type in DBD::Ingres. It is a unified diff against DBD::Ingres 0.34. Please note firstly that it is NOT production ready and contains at least two memory leaks currently. It allows you to write arbitrary length long varchar table fields (at least up to the size of an int on your platform). It supports literal strings of up to 2000 chars inline, but for longer strings you must use bind variables of type DBI::SQL_LONGVARCHAR. E.g., $sth = $dbh->prepare("INSERT INTO mytab VALUES (?)"); $sth->bind_param(1, "z" x 50000, DBI::SQL_LONGVARCHAR); $sth->execute; Trying to do this on a regular varchar field may cause all hell to break loose. For reading it implements the behaviour for LongReadLen and LongTruncOk out of the DBI module documentation, in particular: LongReadLen = n && LongTruncOk = 1 reads the first n or all chars LongReadLen = n && LongTruncOk = 0 reads all chars if field shorter than or equal to n raises error if field longer than n LongReadLen = 0 returns undef (NULL) for all long varchar reads Since I'm not really a DBI expert and am largely winging it here, I'd appreciate if someone with more of a DBI clue could look it over. In particular, I need to safemalloc 2 statement-handle scope structures in dbd_describe() but I don't know the correct/safe place to free them again. In the code these are clearly marked with XXX comments. Also, I've really only guessed at the correct values for long varchar in type_info_all based on some doc reading and what regular varchar contains. If the attachment does not work you can fetch the diff from: http://ariel.ucs.unimelb.edu.au/~mib/DBD-Ingres-0.34-longvarchar.diff Hope to get some feedback soon. Quite frankly, this all goes to show what you can achieve with a need, example code, some late nights and the manual handy. - Mike ********************************************************************** This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. **********************************************************************
