MySQL Forums
Forum List  »  Oracle

Re: From Oracle to MySql
Posted by: Anders Karlsson
Date: December 21, 2004 02:16AM

This is not a feature of the Oracle database in and of itself, but rather a feature of the Oracle Client program SQL*Plus. In MySQL, the interactive mysql client doesn't have this feature, but the MySQL Server DOES. The syntax is a bit different from SQL*Plus though.
The variable is set using the SET Command. Also, MySQL variables are treated as "real" variables in the SQL statement, whereas in Oracle, there is just plain text-substitution going on. This means that the quotes for strings should not be used, for example. MySQL variables are prefixed with a @. For your example, this is what it could look like in MySQL:
SET @X='foo';
SELECT * FROM TABLE1 WHERE TABLE_COLUMN = @X;

Hope this helps
/Karlsson

Options: ReplyQuote


Subject
Views
Written By
Posted
4269
December 17, 2004 12:50PM
Re: From Oracle to MySql
2986
December 21, 2004 02:16AM
2776
January 03, 2005 10:40PM
2685
March 04, 2008 07:51AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.