Re: [firebird-support] Perl, Firebird, and empty Where clause
On 19 July 2012 23:23, Paul Vinkenoog p...@vinkenoog.nl wrote: ** Hello Daniel, I'm trying to have an existing perl program, that is using the DBI system for theoretical database interoperability, to use Firebird. I've discovered that, as a standard, this program executes statements such as, select * from table where pkey='' Without changing the perl script, is there a way I can have Firebird actually return the table using the above SQL? No. You would have to intercept the SQL at some point and change it. If you want the whole table, leave out the WHERE clause and if that isn't possible, use a tautology, e.g. ...where 1=1 (or append or 1=1 to the existing clause). Good luck, Paul Vinkenoog you could replace the table with a selectable stored proc that has pkey as an input param, then have the proc return whatever you want [Non-text portions of this message have been removed]
[firebird-support] Perl, Firebird, and empty Where clause
I'm trying to have an existing perl program, that is using the DBI system for theoretical database interoperability, to use Firebird. I've discovered that, as a standard, this program executes statements such as, select * from table where pkey='' That apparently works with Mysql - doing such a select with a specified empty where clause will return the full table. Firebird - probably more correctly - does a comparison for empty/null and returns...nothing. Without changing the perl script, is there a way I can have Firebird actually return the table using the above SQL? -- Daniel
Re: [firebird-support] Perl, Firebird, and empty Where clause
I'm trying to have an existing perl program, that is using the DBI system for theoretical database interoperability, to use Firebird. I've discovered that, as a standard, this program executes statements such as, select * from table where pkey='' That apparently works with Mysql - doing such a select with a specified empty where clause will return the full table. Firebird - probably more correctly - does a comparison for empty/null and returns...nothing. Without changing the perl script, is there a way I can have Firebird actually return the table using the above SQL? I suppose that you could change the field to NOT NULL DEFAULT ''. Then would a comparison with empty string work. Josef ++ Visit http://www.firebirdsql.org and click the Resources item on the main (top) menu. Try Knowledgebase and FAQ links ! Also search the knowledgebases at http://www.ibphoenix.com ++ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/firebird-support/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/firebird-support/join (Yahoo! ID required) * To change settings via email: firebird-support-dig...@yahoogroups.com firebird-support-fullfeatu...@yahoogroups.com * To unsubscribe from this group, send an email to: firebird-support-unsubscr...@yahoogroups.com * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Re: [firebird-support] Perl, Firebird, and empty Where clause
Hello Daniel, I'm trying to have an existing perl program, that is using the DBI system for theoretical database interoperability, to use Firebird. I've discovered that, as a standard, this program executes statements such as, select * from table where pkey='' That apparently works with Mysql - doing such a select with a specified empty where clause will return the full table. I can assure you that not even MySQL would do something as outrageous as that *. At least not current versions. It must be something in an application layer or library (DBI?). This kind of behaviour sometimes makes sense in the backend of a user interface, where the user may fill in filter terms. If he leaves a field open, the program assumes that any value for that field is OK (as opposed to only the empty string). * (unless, of course, every record in the table has pkey=''. But that doesn't seem likely, since pkey is probably the primary key.) BTW, where pkey='' is not an empty where clause. It's a perfectly valid search condition - provided that pkey is a text field. Firebird - probably more correctly - You can leave out the 'probably'. There is only one correct behaviour here. does a comparison for empty/null and returns...nothing. Firebird will look for '' (empty string) in this case, *not* for null, which is something different. If there are records where pkey = '', it will return them. Otherwise, it will return an empty result set. Without changing the perl script, is there a way I can have Firebird actually return the table using the above SQL? No. You would have to intercept the SQL at some point and change it. If you want the whole table, leave out the WHERE clause and if that isn't possible, use a tautology, e.g. ...where 1=1 (or append or 1=1 to the existing clause). Good luck, Paul Vinkenoog