On Sunday, March 26, 2017 at 7:55:09 PM UTC+5:30, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
>
> > You need to change the placeholders back. The poster who told you to
> > replace them was misinformed.
>
> okey altered them back to
>
> cur.execu
Gregory Ewing writes:
> Νίκος Βέργος wrote:
>
>> Its still a mystery to em whay this fails syntactically when at the
>> same time INSERT works like that.
>
> I don't think *anyone* understands why SQL was designed with
> INSERT and UPDATE having completely different syntaxes.
> But it was, and we
Νίκος Βέργος wrote:
Its still a mystery to em whay this fails syntactically when at the same time
INSERT works like that.
I don't think *anyone* understands why SQL was designed with
INSERT and UPDATE having completely different syntaxes.
But it was, and we have to live with it.
--
Greg
--
ht
Thank you very much Johann.
i was using print(update wuery here) and i was seeing that print was able
to parser the query and that consused me as to why execute wont do the same
since with print all values was gettign substituted.
of course pymysql doesnt behave the same with print but until i fu
Νίκος,
I am glad that you solved the problem.
I am not using mysql but postgresql. When I get a problem using python to
communicate with the database, one of my first steps will be to determine
whether the error is a python (maybe psycopg-related) related error or a
database error. What I do th
Τη Δευτέρα, 27 Μαρτίου 2017 - 6:00:34 π.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote:
> > Its NOT that i have not read it exactly, but for some strange reason i was
> > under the belief that the way i had syntactically typed the UPDATE query
>
On Mon, Mar 27, 2017 at 1:52 PM, Νίκος Βέργος wrote:
> Its NOT that i have not read it exactly, but for some strange reason i was
> under the belief that the way i had syntactically typed the UPDATE query was
> correctly and more consistent and similar to thr INSERT query and it was
> prefered
Τη Δευτέρα, 27 Μαρτίου 2017 - 5:43:01 π.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος wrote:
> >> MariaDB / MySQL shows part of your SQL from where they failed to parse.
> >> In your case, your MariaDB can't parse from '('
> >> LIKE clause is not probl
On Mon, Mar 27, 2017 at 1:39 PM, Νίκος Βέργος wrote:
>> MariaDB / MySQL shows part of your SQL from where they failed to parse.
>> In your case, your MariaDB can't parse from '('
>> LIKE clause is not problem for this issue?
>
> Yes indeed it is.
> I was just so sure that UPDATE was working like I
Τη Δευτέρα, 27 Μαρτίου 2017 - 2:27:31 π.μ. UTC+3, ο χρήστης INADA Naoki έγραψε:
> > i dont have to update table set column1 = this value, column2=that value and
> > so on
>
> Why do you think so? Did you really read the manual?
>
> mysql> create table test_update (a int primary key, b int, c int
On Mon, 27 Mar 2017 07:13 am, Νίκος Βέργος wrote:
> OMG!!! It actually worked!
>
> Can't believe that 3 days in a row i have tried everything concerning
> string manipulation and mysql escaping nd the error was the UPDATE
> itself
You tried everything except what we told you, over and over a
> i dont have to update table set column1 = this value, column2=that value and
> so on
Why do you think so? Did you really read the manual?
mysql> create table test_update (a int primary key, b int, c int);
Query OK, 0 rows affected (0.02 sec)
mysql> insert into test_update values (1, 2, 3);
Qu
On Sunday, March 26, 2017 at 8:33:49 PM UTC+1, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης
> bream...@gmail.com έγραψε:
> > On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote:
> > > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ia
On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
>
> > The database wrapper won't do substitution into the middle of a string
> > like that. Either concatenate the literal %'s on in the SQL statement
> > or
Τη Κυριακή, 26 Μαρτίου 2017 - 11:59:21 μ.μ. UTC+3, ο χρήστης Larry Hudson
έγραψε:
> On 03/26/2017 01:21 AM, Νίκος Βέργος wrote:
> > print('''UPDATE visitors SET (pagesID, host, ref, location, useros,
> > browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE
> > "%s"''', (pID, doma
On 03/26/2017 01:21 AM, Νίκος Βέργος wrote:
print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser, visits)
VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID, domain, ref,
location, useros, browser, lastvisit, domain) )
prints out:
UPDATE visitors SET (pag
Τη Κυριακή, 26 Μαρτίου 2017 - 11:05:34 μ.μ. UTC+3, ο χρήστης Νίκος Βέργος
έγραψε:
> Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico
> έγραψε:
> > On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote:
> > > Since i'm incopetent as you suggest i'am show us your level of
Τη Κυριακή, 26 Μαρτίου 2017 - 10:56:07 μ.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote:
> > Since i'm incopetent as you suggest i'am show us your level of skills and
> > expertise and provide a solution, otherwise you are also what you claim of
On Mon, Mar 27, 2017 at 6:33 AM, Νίκος Βέργος wrote:
> Since i'm incopetent as you suggest i'am show us your level of skills and
> expertise and provide a solution, otherwise you are also what you claim of me.
It's not his problem. An expert does not have to provide solutions to
prove his expert
Τη Κυριακή, 26 Μαρτίου 2017 - 10:23:27 μ.μ. UTC+3, ο χρήστης bream...@gmail.com
έγραψε:
> On Sunday, March 26, 2017 at 4:11:54 PM UTC+1, Νίκος Βέργος wrote:
> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> >
> > > The database wrapper won't do substitution into the mi
Τη Κυριακή, 26 Μαρτίου 2017 - 10:04:31 μ.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 5:52 AM, Νίκος Βέργος wrote:
> > Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico
> > έγραψε:
> >> On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote:
> >> >
On Mon, Mar 27, 2017 at 5:52 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico
> έγραψε:
>> On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote:
>> > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki
>> > έγραψε:
>> >> Rea
Τη Κυριακή, 26 Μαρτίου 2017 - 8:58:55 μ.μ. UTC+3, ο χρήστης alister έγραψε:
> On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote:
>
> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister
> > έγραψε:
> >> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote:
> >>
> >> > Τη Κ
Τη Κυριακή, 26 Μαρτίου 2017 - 9:32:13 μ.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote:
> > Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki
> > έγραψε:
> >> Read my mail again.
> >>
> >> > This error came from MySQL. If t
On Sunday, March 26, 2017 at 3:11:50 PM UTC+1, Ian wrote:
> On Sun, Mar 26, 2017 at 7:39 AM, MeV wrote:
> > On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote:
> >> with import cgitb; cgitb.enable()
> >>
> >> ProgrammingError(1064, "You have an error in your SQL syntax; check the
>
On Mon, Mar 27, 2017 at 4:54 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki
> έγραψε:
>> Read my mail again.
>>
>> > This error came from MySQL. If there are no logs in error_log, it's
>> > your configuration issue.
>>
>> > See https://dev.mysql
On Sun, 26 Mar 2017 07:43:51 -0700, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister
> έγραψε:
>> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote:
>>
>> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian
>> > έγραψε:
>> >
>> >> You n
Τη Κυριακή, 26 Μαρτίου 2017 - 8:06:07 μ.μ. UTC+3, ο χρήστης INADA Naoki έγραψε:
> Read my mail again.
>
> > This error came from MySQL. If there are no logs in error_log, it's
> > your configuration issue.
>
> > See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update
> > statement syn
I do not see why my UPDATE fails.
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s)''') works
i dont have to update table set column1 = this value, column2=that value
and so on
It's just when the LIKE clause jumps in th
Read my mail again.
> This error came from MySQL. If there are no logs in error_log, it's
> your configuration issue.
> See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update
> statement syntax.
--
https://mail.python.org/mailman/listinfo/python-list
Any ideas on how to make progress on that?
After all its just an UPDATE with a WHERE clause?!
Do you also think is DBI related issue?
--
https://mail.python.org/mailman/listinfo/python-list
On Sun, Mar 26, 2017 at 11:48 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano
> έγραψε:
>> On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote:
>>
>> > I just tried:
>> >
>> > domain = '.'.join( host.split('.')[-2:] )
>> > domain = '%' + domain +
Currently to avoid any misinformations my code looks as follows:
domain = '.'.join( host.split('.')[-2:] )
domain_query = '%%%s' % domain
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE %s''',
(pID, d
On Mon, Mar 27, 2017 at 2:48 AM, Νίκος Βέργος wrote:
>> > which you can see at http://superhost.gr
>>
>> Ah, Nikos, its been a long time! I thought I recognised your style of
>> posting.
>
>
> Howdy Steve!
> Yes its me and yes its have been a long time! How are you?!
>
Irony lost.
ChrisA
--
htt
Τη Κυριακή, 26 Μαρτίου 2017 - 6:39:01 μ.μ. UTC+3, ο χρήστης Steve D'Aprano
έγραψε:
> On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote:
>
> > I just tried:
> >
> > domain = '.'.join( host.split('.')[-2:] )
> > domain = '%' + domain + '%'
> >
> > cur.execute('''UPDATE visitors SET (pagesID, host,
Τη Κυριακή, 26 Μαρτίου 2017 - 6:28:12 μ.μ. UTC+3, ο χρήστης Chris Angelico
έγραψε:
> On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote:
> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> >
> >> The database wrapper won't do substitution into the middle of a string
> >
On Mon, 27 Mar 2017 02:11 am, Νίκος Βέργος wrote:
> I just tried:
>
> domain = '.'.join( host.split('.')[-2:] )
> domain = '%' + domain + '%'
>
> cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
> browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"
On Mon, Mar 27, 2017 at 2:11 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
>
>> The database wrapper won't do substitution into the middle of a string
>> like that. Either concatenate the literal %'s on in the SQL statement
>> or add them to the
domain = '.'.join( host.split('.')[-2:] )
domain = '%' + domain + '%'
domain = '%%%s%%' % domain
domain = '%{}%'.format(domain)
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s" ''',
Τη Κυριακή, 26 Μαρτίου 2017 - 5:49:00 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> The database wrapper won't do substitution into the middle of a string
> like that. Either concatenate the literal %'s on in the SQL statement
> or add them to the string before you pass it in, i.e. '%' + domain +
> '%' or '
On Sun, Mar 26, 2017 at 8:24 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
>
>> You need to change the placeholders back. The poster who told you to
>> replace them was misinformed.
>
> okey altered them back to
>
> cur.execute('''UPDATE visitors
I see thank you for pointing that out.
Now i'm receiving no error in error_log but when i'm running the script
it displays this:
ProgrammingError(1064, "You have an error in your SQL syntax; check the
manual that corresponds to your MariaDB server version for the right syntax
to use near '(pages
On Mon, 27 Mar 2017 12:52 am, Νίκος Βέργος wrote:
> cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
> browser, visits) VALUES ({}, {}, {}, {}, {}, {}, {}) WHERE host LIKE
> "{}"'''.format(pID, domain, ref, location, useros, browser, lastvisit,
> domain) )
>
> Same kind o
i have tried that 2 days ago.
Problem is that you maintained space before and after '%s' which wont work
within like
How would you type it without space as in "%%s%" ?
Στις Κυρ, 26 Μαρ 2017 στις 5:32 μ.μ., ο/η INADA Naoki <
songofaca...@gmail.com> έγραψε:
> > I MEAN HOW TO DIFFERENTIATE '%S' F
On Mon, 27 Mar 2017 01:24 am, Νίκος Βέργος wrote:
> I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character.
Use %% for a literal percent character.
py> '%s %% %s' % ('hello', 'world')
'hello % world'
--
Steve
“Cheer up,” they said, “things could be worse.” So I cheered up, and sure
en
Τη Κυριακή, 26 Μαρτίου 2017 - 5:38:57 μ.μ. UTC+3, ο χρήστης alister έγραψε:
> On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote:
>
> > Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> >
> >> You need to change the placeholders back. The poster who told you to
> >> re
On Sun, 26 Mar 2017 07:24:49 -0700, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
>
>> You need to change the placeholders back. The poster who told you to
>> replace them was misinformed.
>
> okey altered them back to
>
> cur.execute('''UPDATE vi
I used space only for readability. It's not required.
>>> '%%%s%%' % (42,)
'%42%'
On Sun, Mar 26, 2017 at 11:35 PM, Νίκος Βέργος wrote:
> i have tried that 2 days ago.
>
> Problem is that you maintained space before and after '%s' which wont work
> within like
>
> How would you type it without
> I MEAN HOW TO DIFFERENTIATE '%S' FROM LITERAL '%' character.
>
>>> '%% %s %%s' % (42,)
'% 42 %s'
Use %%
--
https://mail.python.org/mailman/listinfo/python-list
Τη Κυριακή, 26 Μαρτίου 2017 - 5:19:27 μ.μ. UTC+3, ο χρήστης Ian έγραψε:
> You need to change the placeholders back. The poster who told you to
> replace them was misinformed.
okey altered them back to
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VAL
On Sun, Mar 26, 2017 at 8:07 AM, Νίκος Βέργος wrote:
> Τη Κυριακή, 26 Μαρτίου 2017 - 5:04:27 μ.μ. UTC+3, ο χρήστης INADA Naoki This
> error came from MySQL. If there are no logs in error_log, it's
>> your configuration issue.
>>
>> See https://dev.mysql.com/doc/refman/5.7/en/update.html for Upda
On Sun, Mar 26, 2017 at 7:39 AM, MeV wrote:
> On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote:
>> with import cgitb; cgitb.enable()
>>
>> ProgrammingError(1064, "You have an error in your SQL syntax; check the
>> manual that corresponds to your MariaDB server version for the rig
Τη Κυριακή, 26 Μαρτίου 2017 - 5:04:27 μ.μ. UTC+3, ο χρήστης INADA Naoki This
error came from MySQL. If there are no logs in error_log, it's
> your configuration issue.
>
> See https://dev.mysql.com/doc/refman/5.7/en/update.html for Update
> statement syntax.
cur.execute('''UPDATE visitors SET (
"Νίκος Βέργος" wrote in message
news:8c5f0443-c61b-4059-8d6f-576152d59...@googlegroups.com...
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE
%s''',
(pID, domain, ref, location, useros, browser,
On Sun, Mar 26, 2017 at 10:34 PM, Νίκος Βέργος wrote:
> with import cgitb; cgitb.enable()
>
> ProgrammingError(1064, "You have an error in your SQL syntax; check the
> manual that corresponds to your MariaDB server version for the right syntax
> to use near '(pagesID, host, ref, location, useros
cur.execute('''UPDATE visitors SET (pagesID, host, ref, location, useros,
browser, visits) VALUES ({}, {}, {}, {}, {}, {}, {}) WHERE host LIKE
"{}"'''.format(pID, domain, ref, location, useros, browser, lastvisit, domain) )
Same kind of output in the error-log even with this attempt.
--
https:/
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε:
> On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote:
> > with import cgitb; cgitb.enable()
> >
> > ProgrammingError(1064, "You have an error in your SQL syntax; check the
> > manual that corresponds to your Ma
Τη Κυριακή, 26 Μαρτίου 2017 - 4:39:44 μ.μ. UTC+3, ο χρήστης MeV έγραψε:
> On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote:
> > with import cgitb; cgitb.enable()
> >
> > ProgrammingError(1064, "You have an error in your SQL syntax; check the
> > manual that corresponds to your Ma
Ths is the whole snippert i'am trying so you can see what i'm tryong to do.
[code]
# if bot is contained in hostname update all previous database
bot hostname entries with current bot hostname
for bot in bots:
if bot in host:
On Sunday, March 26, 2017 at 6:34:30 AM UTC-7, Νίκος Βέργος wrote:
> with import cgitb; cgitb.enable()
>
> ProgrammingError(1064, "You have an error in your SQL syntax; check the
> manual that corresponds to your MariaDB server version for the right syntax
> to use near '(pagesID, host, ref, loc
with import cgitb; cgitb.enable()
ProgrammingError(1064, "You have an error in your SQL syntax; check the manual
that corresponds to your MariaDB server version for the right syntax to use
near '(pagesID, host, ref, location, useros, browser, visits) VALUES (1,
'cyta.gr', '' at line 1")
that i
Νίκος Βέργος writes:
> print('''UPDATE visitors SET (pagesID, host, ref, location, useros,
> browser, visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE
> "%s"''', (pID, domain, ref, location, useros, browser, lastvisit,
> domain) )
>
> prints out:
>
> UPDATE visitors SET (pagesID, host,
print('''UPDATE visitors SET (pagesID, host, ref, location, useros, browser,
visits) VALUES (%s, %s, %s, %s, %s, %s, %s) WHERE host LIKE "%s"''', (pID,
domain, ref, location, useros, browser, lastvisit, domain) )
prints out:
UPDATE visitors SET (pagesID, host, ref, location, useros, browser, vi
63 matches
Mail list logo