Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-09 Thread stephen barncard
On Tue, Aug 9, 2016 at 8:40 AM, Dr. Hawkins wrote: > Now that you mention that . . . is it possible that past runnings have > created db entries of "NULL" rather than NULL? > I've had that happen. Stephen Barncard - Sebastopol Ca. USA - mixstream.org

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-09 Thread Dr. Hawkins
On Mon, Aug 8, 2016 at 7:00 PM, Kay C Lan wrote: > As I said I'll get around > to completely rebuilding the db > Now that you mention that . . . is it possible that past runnings have created db entries of "NULL" rather than NULL? -- Dr. Richard E. Hawkins, Esq.

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-08 Thread Kay C Lan
On Mon, Aug 8, 2016 at 11:46 PM, Peter Haworth wrote: > > It doesn't explain the difference between using a parameter vs an embedded > value, you should get the same result either way. I think you should submit > a bug report. > Yes I would if other's were seeing the same thing so

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-08 Thread Peter Haworth
SQLite is very forgiving about what data type it accepts for a column. It will pretty much accept anything no matter what the defined data type is. mySQL on the other hand rejects anything that doesn't match the declared data type. That would explain the difference between the two systems. It

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-08 Thread Ludovic THEBAULT
> Le 8 août 2016 à 13:36, Kay C Lan a écrit : > Unfortunately: > > put null into pValue > > worked fine for SQLite, but I still got the exact same mySQL ERROR = > Incorrect integer value: '' for column 'postcode' at row 1 > After the revexecuteSQL do a : if pValue =

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-08 Thread Kay C Lan
On Sun, Aug 7, 2016 at 1:05 PM, Ludovic THEBAULT wrote: > > > If my variable is empty, i set it to null. > (the mysql column accept null) > Hi Ludovic, sorry for the slow reply but for some reason your email ended up in my SPAM folder. Thanks for the suggestion,

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-06 Thread Ludovic THEBAULT
> Le 6 août 2016 à 11:07, Kay C Lan a écrit : > > Thanks Erik, > > yes that's what I'm doing as a workaround at the moment, I test the > variable and see if it's empty, if not I use place holders and execute > the original statement, if it is empty, then I've written

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-06 Thread Kay C Lan
Thanks Erik, yes that's what I'm doing as a workaround at the moment, I test the variable and see if it's empty, if not I use place holders and execute the original statement, if it is empty, then I've written out the longhand statement without place holders and execute that. It's just a pain, I

Re: [SQL] placeholders work for SQLite but not for mySQL

2016-08-06 Thread Erik Beugelaar
AFAIK it is possible to add your parameter in the WHERE clause. So maybe you can test on NULL or NOT EMPTY as the first condition before the other ones. Cheers, Erik Kay C Lan wrote: What is the trick to passing an empty variable to a mySQL database using

[SQL] placeholders work for SQLite but not for mySQL

2016-08-05 Thread Kay C Lan
What is the trick to passing an empty variable to a mySQL database using placeholders? I have an SQL statement that works in SQLite and mySQL except if the value is empty, in which case it doesn't work with mySQL (works OK with SQLite). I'm using a placeholder :1. If I remove the place holder and