aspose file tools*
The moose likes JDBC and the fly likes SQL sintax Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL sintax " Watch "SQL sintax " New topic
Author

SQL sintax

André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Guys I am having the following problem:

When I use Sybase database I get to do this: select * from DatabaseCars.. TableKindOfCar it is the same to
select * from TableKindOfCar however you must be into that Database else does not work

but in my Mysql it does not work...

bye,
André AS
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Hi André.
I'm trying to understand what you are doing, and what doesn't work. But I don't get it yet.
What is the difference between what happens in Sybase and what happens in MySQL?


OCUP UML fundamental and ITIL foundation
youtube channel
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
When I am using Sybase the query "select * from DatabaseCars.. TableKindOfCar " works differently when I use Mysql because the same query does not work... got it?
Arpit Panwar
Greenhorn

Joined: Jul 16, 2009
Posts: 12
André Asantos wrote:When I am using Sybase the query "select * from DatabaseCars.. TableKindOfCar " works differently when I use Mysql because the same query does not work... got it?


Can you post the error you get


SCJP 75%
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Not yet , but working on it.

"DatabaseCars.. TableKindOfCar "

Is DatabaseCars the name of your schema?
Is TableKindOfCar the name of your table?
Why are there two dots and a blank between DatabaseCars and TableKindOfCar?
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
You are right. The DatabaseCars is the name of Database that we are using right now and TableKindOfCar is the name of Table tha we are using.

So, about the dots I think that comes from Sybase syntax because it does not work in MySql... It is an interesting way to work because you can declare your database together during the select, got it?
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2516
    
  10

Can you try if "DatabaseCars.TableKindOfCar" works (only a single dot between your schema name and table name)?

If it doesn't work, then post the complete and exact error message in this thread.
André Asantos
Ranch Hand

Joined: Nov 23, 2009
Posts: 234
Wow it is work perfectly you are the man! Thank you very very very much...

Thanks,
André AS
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: SQL sintax