• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Joe Ess
  • salvin francis

sql script works in mssql but not in mysql

 
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The following

SELECT count(*) FROM itemlist WHERE ID like '%a%' or itemDescription like '%a%'

works in mssql but i get the error "Table 'xxx.itemlist' doesn't exist"
in mysql. How can I make this work
 
author & internet detective
Posts: 39755
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Most databases (including mysql, Oracle, db2, ...) use an owner name for the schema. When you do a query, the database tries to run the query on the schema for the id running. There are two ways to execute the query:

1) Use a fully qualified name (with schema owner) in your query directly.
2) Create a synonym to map the fully qualified name to the one word table name.

I favor #1 because it allows you to run the query as different users without having to change the synonym/alias.
 
john mattucci
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realized my mistake in mssql the table names are not case sensitive but in mysql they are
 
Jeanne Boyarsky
author & internet detective
Posts: 39755
797
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John,
Good to know. I'm surprised because db2 and Oracle aren't case sensitive either.
 
Live ordinary life in an extraordinary way. Details embedded in this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!