dbTalk Databases Forums  

Using Reserved words as table names....

comp.databases.ingres comp.databases.ingres


Discuss Using Reserved words as table names.... in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Ingres Forums
 
Posts: n/a

Default Using Reserved words as table names.... - 02-02-2011 , 08:44 AM






Hi,

I've got a customer that has recently upgraded to Ingres 9.3 from
6.4/03.

The following statement now gives the customer a database error:

update case set txt = 'bob' where case.ref = 1;

The error states that there is a syntax error on '.'

Removing the 'case' table correlation name from the where clause allows
it to run without fail.

I've a slight problem in that I cannot change the source, so any
suggestions along the lines of putting quotes around the correlation
name won't help.

Is anyone aware of a 'switch' at the database installation level that
would cause the parser(?) to recognise this as a table correlation name
and not a 'case' statement (which I think is what is happening).

Thanks

Adrian


--
Adrian Williamson

Reply With Quote
  #2  
Old   
Karl Schendel
 
Posts: n/a

Default Re: [Info-Ingres] Using Reserved words as table names.... - 02-02-2011 , 09:03 AM






On Feb 2, 2011, at 9:44 AM, Ingres Forums wrote:

Quote:
...
Is anyone aware of a 'switch' at the database installation level that
would cause the parser(?) to recognise this as a table correlation name
and not a 'case' statement (which I think is what is happening).
Nope.

If you can't change the source, you're out of luck.

Karl

Reply With Quote
  #3  
Old   
Ingres Forums
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-02-2011 , 11:34 AM



Hi Karl,

As I feared, thanks for responding.

Adrian


--
Adrian Williamson

Reply With Quote
  #4  
Old   
Ingres Forums
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-02-2011 , 12:40 PM



In the past I have been able to "rescue" similar situations using a
binary editor, substituting strings. Haven't tried it for a long, long
time though...


--
ipauland

Reply With Quote
  #5  
Old   
Peter Gale
 
Posts: n/a

Default Re: [Info-Ingres] Using Reserved words as table names.... - 02-02-2011 , 01:12 PM



Hi Adrian,

Do you mind me asking why the customer has gone to 9.3? This isn't a
supported release and was only ever intended as a release that would give
early exposure to new features for SI's and ISV's. Patches are not available
and upgrading to 10 will almost certainly require an unload, reinstall and
reload.

Peter Gale

On 2 February 2011 14:44, Ingres Forums <
info-ingres (AT) kettleriverconsulting (DOT) com> wrote:

Quote:
Hi,

I've got a customer that has recently upgraded to Ingres 9.3 from
6.4/03.

The following statement now gives the customer a database error:

update case set txt = 'bob' where case.ref = 1;

The error states that there is a syntax error on '.'

Removing the 'case' table correlation name from the where clause allows
it to run without fail.

I've a slight problem in that I cannot change the source, so any
suggestions along the lines of putting quotes around the correlation
name won't help.

Is anyone aware of a 'switch' at the database installation level that
would cause the parser(?) to recognise this as a table correlation name
and not a 'case' statement (which I think is what is happening).

Thanks

Adrian


--
Adrian Williamson
------------------------------------------------------------------------
Adrian Williamson's Profile:
http://community.ingres.com/forum/me...p?userid=11340
View this thread: http://community.ingres.com/forum/sh...ad.php?t=12974

_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres



--
Peter Gale
pgale61 (AT) gmail (DOT) com

Reply With Quote
  #6  
Old   
Matt Charles
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-02-2011 , 03:49 PM



Quote:
Is anyone aware of a 'switch' at the database installation level that
would cause the parser(?) to recognise this as a table correlation name
and not a 'case' statement (which I think is what is happening).
If you're really desperate... you could try using a hex editor to edit
the ingres iidbms process executable (iimerge?) and replace instances of
'case' with 'pase' or some such. You'd effectively be changing the
reserved word itself so your original query would be unaffected. (Or
perhaps you can hex edit your executable to change case to another name
and change the DB schema accordingly?)

It might not work but might be worth a quick try for just amusement's
sake. :-)

Or you could even recompile your own custom version of Ingres from the
open source with 'case' changed to something else...

Reply With Quote
  #7  
Old   
Ingres Forums
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-02-2011 , 04:02 PM



Patching the DBMS sounds like a seriously bad idea, I think. My rescue
idea was only with respect to the client app and would not have any
effect on anything else.


--
ipauland

Reply With Quote
  #8  
Old   
west
 
Posts: n/a

Default Re: [Info-Ingres] Using Reserved words as table names.... - 02-02-2011 , 04:23 PM



Peter,

I did this quite awhile ago when few people realised this. Ingres
eventually pointed this out after a week of dealing with my issue.
Maybe it still isn't well documented? But like you, I was wondering....

At 11:12 AM 2/2/2011, you wrote:
Quote:
Hi Adrian,

Do you mind me asking why the customer has gone to 9.3? This isn't a
supported release and was only ever intended as a release that would
give early exposure to new features for SI's and ISV's. Patches are
not available and upgrading to 10 will almost certainly require an
unload, reinstall and reload.

Peter Gale

On 2 February 2011 14:44, Ingres Forums
mailto:info-ingres (AT) kettleriverconsulting (DOT) com>info-ingres (AT) kettleriverconsulting (DOT) com
wrote:

Hi,

I've got a customer that has recently upgraded to Ingres 9.3 from
6.4/03.

The following statement now gives the customer a database error:

update case set txt = 'bob' where case.ref = 1;

The error states that there is a syntax error on '.'

Removing the 'case' table correlation name from the where clause allows
it to run without fail.

I've a slight problem in that I cannot change the source, so any
suggestions along the lines of putting quotes around the correlation
name won't help.

Is anyone aware of a 'switch' at the database installation level that
would cause the parser(?) to recognise this as a table correlation name
and not a 'case' statement (which I think is what is happening).

Thanks

Adrian


--
Adrian Williamson
------------------------------------------------------------------------
Adrian Williamson's Profile:
http://community.ingres.com/forum/member.php?userid=11340>http://community.ingres.com/forum/me...p?userid=11340
View this thread:
http://community.ingres.com/forum/showthread.php?t=12974>http://community.ingres.com/forum/sh...ad.php?t=12974

_______________________________________________
Info-Ingres mailing list
mailto:Info-Ingres (AT) kettleriverconsulting (DOT) com>Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres




--
Peter Gale
mailtogale61 (AT) gmail (DOT) com>pgale61 (AT) gmail (DOT) com
_______________________________________________
Info-Ingres mailing list
Info-Ingres (AT) kettleriverconsulting (DOT) com
http://ext-cando.kettleriverconsulti...fo/info-ingres

Reply With Quote
  #9  
Old   
Matt Charles
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-02-2011 , 04:51 PM



On 02/02/2011 22:02, Ingres Forums wrote:
Quote:
Patching the DBMS sounds like a seriously bad idea, I think. My rescue
idea was only with respect to the client app and would not have any
effect on anything else.
Sorry I'd not seen your post. Great minds think alike. Yes probably
"hacking" the client exe is the most sensible course of action compared
with the DBMS executable (but still a little crazy!).

Reply With Quote
  #10  
Old   
Ingres Forums
 
Posts: n/a

Default Re: Using Reserved words as table names.... - 02-03-2011 , 03:59 AM



Hi,

Yes I had a couple of goes at global replace on the W4GL image file,
but it seems that W4GL is very sensative to change. (or I wasn't trying
hard enough with the binary editors)

We're on 9.3 Peter, to give us access to the II_WINSOCK2_NODELAY
parameter, which works wonders for the network perfomance.

The database is of a mangelable size so a move to 10 once everyone else
has found the bugs would be an activity measured in tens of minutes.

Thanks for your input, the binary edit of the parser to distract it
from the concept of 'case' was inspirational.

Biodiversity should be celebrated.

Adrian


--
Adrian Williamson

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.