Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Dec. 2, 2010 15:13:56

Tim S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


Hello,I'm using Django against an Oracle 10 database. It used to work. Thenthey upgraded it to 10.2.0.5 (not sure what from, I can probably find out).This query now gives: ORA-01425: escape character must be characterstring of length 1.'SELECT "BROKER_LENDER_LOG"."BLL_SECURITY_TOKEN","BROKER_LENDER_LOG"."BLL_TRANSACTION","BROKER_LENDER_LOG"."BLL_TYPE","BROKER_LENDER_LOG"."BLL_AGREEMENT_NUMBER","BROKER_LENDER_LOG"."BLL_MODULE","BROKER_LENDER_LOG"."BLL_LENDER",
"BROKER_LENDER_LOG"."BLL_SERIAL",
"BROKER_LENDER_LOG"."BLL_VERSION",
"BROKER_LENDER_LOG"."BLL_JOBID",
"BROKER_LENDER_LOG"."BLL_PROJECT","BROKER_LENDER_LOG"."BLL_XML","BROKER_LENDER_LOG"."BLL_LENDER_RESPONSE", "BROKER_LENDER_LOG"."BLL_DATE"FROM "BROKER_LENDER_LOG" WHERE ("BROKER_LENDER_LOG"."BLL_JOBID" LIKETRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS) AND"BROKER_LENDER_LOG"."BLL_MODULE" = %s ) ORDER BY"BROKER_LENDER_LOG"."BLL_SERIAL" ASC'I guess the problem is:

LIKE TRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS)

where it thinks that \'\\\' is more than one character?

Cheers for any clues,

Tim.

--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#2 Dec. 2, 2010 15:41:20

Jirka V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


> I'm using Django against an Oracle 10 database.  It used to work.  Then they
> upgraded it to 10.2.0.5 (not sure what from, I can probably find out).

Hi Tim,

sorry, I don't have a solution for you, but you might want to check
outhttp://code.djangoproject.com/ticket/14149and add description of
your environment there so there is more "use cases" listed there.

Actually, I do have a solution - I do monkeypatch the Oracle backend
so it matches my version of Oracle (i.e. 2 or 4 backslashes).

Cheers

Jirka

P.S. This got me thinking - maybe the Oracle backend could do some
"autodetection" of which version works fine in the current
environment? Yes, it'd be extra query at startup I guess, but don't
really see any other way...

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#3 Dec. 2, 2010 15:47:31

Tim S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


Interesting. I'm using Django 1.2.3.

I just manually applied the diff fromhttp://code.djangoproject.com/ticket/5985which is to change from LIKE to LIKEC and it works now. Has thisregressed for some reason?Looks like it washttp://code.djangoproject.com/browser/django/trunk/django/db/backends/oracle/base.py?rev=12293that regressed back to LIKE.http://code.djangoproject.com/ticket/11017the reason.Tim.

On 02/12/10 15:13, Tim Sawyer wrote:Hello,

I'm using Django against an Oracle 10 database. It used to work. Then
they upgraded it to 10.2.0.5 (not sure what from, I can probably find out).

This query now gives: ORA-01425: escape character must be character
string of length 1.

'SELECT "BROKER_LENDER_LOG"."BLL_SECURITY_TOKEN",
"BROKER_LENDER_LOG"."BLL_TRANSACTION",
"BROKER_LENDER_LOG"."BLL_TYPE",
"BROKER_LENDER_LOG"."BLL_AGREEMENT_NUMBER",
"BROKER_LENDER_LOG"."BLL_MODULE",
"BROKER_LENDER_LOG"."BLL_LENDER",
"BROKER_LENDER_LOG"."BLL_SERIAL",
"BROKER_LENDER_LOG"."BLL_VERSION",
"BROKER_LENDER_LOG"."BLL_JOBID",
"BROKER_LENDER_LOG"."BLL_PROJECT",
"BROKER_LENDER_LOG"."BLL_XML",
"BROKER_LENDER_LOG"."BLL_LENDER_RESPONSE", "BROKER_LENDER_LOG"."BLL_DATE"
FROM "BROKER_LENDER_LOG" WHERE ("BROKER_LENDER_LOG"."BLL_JOBID" LIKE
TRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS) AND
"BROKER_LENDER_LOG"."BLL_MODULE" = %s ) ORDER BY
"BROKER_LENDER_LOG"."BLL_SERIAL" ASC'

I guess the problem is:

LIKE TRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS)

where it thinks that \'\\\' is more than one character?

Cheers for any clues,

Tim.--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#4 Dec. 2, 2010 16:18:53

Tim S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


On 02/12/10 15:40, Jirka Vejrazka wrote:I'm using Django against an Oracle 10 database. It used to work. Then they
upgraded it to 10.2.0.5 (not sure what from, I can probably find out).Hi Tim,

sorry, I don't have a solution for you, but you might want to check
outhttp://code.djangoproject.com/ticket/14149and add description of
your environment there so there is more "use cases" listed there.

Actually, I do have a solution - I do monkeypatch the Oracle backend
so it matches my version of Oracle (i.e. 2 or 4 backslashes).

Cheers

Jirka

P.S. This got me thinking - maybe the Oracle backend could do some
"autodetection" of which version works fine in the current
environment? Yes, it'd be extra query at startup I guess, but don't
really see any other way...Thanks for that.

Interesting that I'm seeing this in an upgrade from 10.2.0.4 to 10.2.0.5.Instead of changing from LIKE to LIKEC - if I add more backslashes willthat work?Cheers,

Tim.

--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#5 Dec. 2, 2010 16:28:59

Jirka V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


> Interesting that I'm seeing this in an upgrade from 10.2.0.4 to 10.2.0.5.
>
> Instead of changing from LIKE to LIKEC - if I add more backslashes will that
> work?


Honestly, I can't tell. It's been too long and I can't test it now :-(((

Jirka

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#6 Dec. 2, 2010 19:07:24

I.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


On Dec 2, 8:40 am, Jirka Vejrazka <jirka.vejra...@gmail.com> wrote:

> P.S. This got me thinking - maybe the Oracle backend could do some
> "autodetection" of which version works fine in the current
> environment? Yes, it'd be extra query at startup I guess, but don't
> really see any other way...

It looks as though something like that may be necessary. For those of
you running into this problem, do you get the error with the following
query?

>>> cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING NCHAR_CS)
>>> LIKE TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\' USING NCHAR_CS)")

I'd like to know whether this will work for autodetection.

Thanks,
Ian

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#7 Dec. 2, 2010 19:14:47

Jirka V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


> It looks as though something like that may be necessary.  For those of
> you running into this problem, do you get the error with the following
> query?
>
>>>> cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING NCHAR_CS)
>>>> LIKE TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\' USING NCHAR_CS)")

No error for me, but that's on a monkeypatched system. I can try
without the patch, but only after weekend :(

In : res = c.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING
NCHAR_CS) LIKE TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\'
USING NCHAR_CS)")

In : list(res)
Out:


Jirka

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#8 Dec. 2, 2010 19:30:25

Jirka V.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


> No error for me, but that's on a monkeypatched system. I can try
> without the patch, but only after weekend :(

Actually, screw production servers :) Tried on unpatched Django
1.2.1, got exactly the same result, no error.

Jirka

--
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#9 Dec. 2, 2010 22:17:49

Tim S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


On 02/12/10 19:14, Jirka Vejrazka wrote:It looks as though something like that may be necessary. For those of
you running into this problem, do you get the error with the following
query?cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING NCHAR_CS) LIKE
TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\' USING NCHAR_CS)")No error for me, but that's on a monkeypatched system. I can try
without the patch, but only after weekend :(

In : res = c.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A' USING
NCHAR_CS) LIKE TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\'
USING NCHAR_CS)")

In : list(res)
Out:


JirkaI unpatched mine (changed LIKEC to LIKE) and then ran:

>>> from django.db import connection
>>> cursor = connection.cursor()>>> result = cursor.execute(r"SELECT 1 FROM DUAL WHERE TRANSLATE('A'USING NCHAR_CS) LIKE TRANSLATE('A' USING NCHAR_CS) ESCAPE TRANSLATE('\'USING NCHAR_CS)")>>> rows = cursor.fetchall()
>>> for row in rows:
> ... print row
> ...
> 1
>>> print rows
> ((1,),)

Tim.

--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

#10 Dec. 3, 2010 13:29:47

Tim S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

ORA-01425


On 03/12/10 12:52, Jani Tiainen wrote:On Thursday 02 December 2010 17:13:48 Tim Sawyer wrote:Hello,

I'm using Django against an Oracle 10 database. It used to work. Then
they upgraded it to 10.2.0.5 (not sure what from, I can probably find out).

This query now gives: ORA-01425: escape character must be character
string of length 1.

'SELECT "BROKER_LENDER_LOG"."BLL_SECURITY_TOKEN",
"BROKER_LENDER_LOG"."BLL_TRANSACTION",
"BROKER_LENDER_LOG"."BLL_TYPE",
"BROKER_LENDER_LOG"."BLL_AGREEMENT_NUMBER",
"BROKER_LENDER_LOG"."BLL_MODULE",
"BROKER_LENDER_LOG"."BLL_LENDER",
"BROKER_LENDER_LOG"."BLL_SERIAL",
"BROKER_LENDER_LOG"."BLL_VERSION",
"BROKER_LENDER_LOG"."BLL_JOBID",
"BROKER_LENDER_LOG"."BLL_PROJECT",
"BROKER_LENDER_LOG"."BLL_XML",
"BROKER_LENDER_LOG"."BLL_LENDER_RESPONSE", "BROKER_LENDER_LOG"."BLL_DATE"
FROM "BROKER_LENDER_LOG" WHERE ("BROKER_LENDER_LOG"."BLL_JOBID" LIKE
TRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS) AND
"BROKER_LENDER_LOG"."BLL_MODULE" = %s ) ORDER BY
"BROKER_LENDER_LOG"."BLL_SERIAL" ASC'

I guess the problem is:

LIKE TRANSLATE(%s USING NCHAR_CS) ESCAPE TRANSLATE(\'\\\' USING NCHAR_CS)

where it thinks that \'\\\' is more than one character?

Cheers for any clues,I'm running against 10.2.0.5 (64 bit) and I don't see that problem appear.
Same appliest to other 10.2.0.x series, all of them work with that LIKE part.

Reason just was that LIKEC queries took ages in my modest 21M rows containing
address table.

Could that be some artifacts from upgrade migration progress - I know it has
happened sometimes.

Can you also post you charsets you're using, maybe they're causing some
oddities here - with Oracle you never know .Hi,

We're on Solaris Sparc, 64-bit. Charset is WE8MSWIN1252

Tim.

--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to
django-users+unsubscr...@googlegroups.com.
For more options, visit this group athttp://groups.google.com/group/django-users?hl=en.

Offline

Board footer

Moderator control

Enjoy the 19th of August
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support