Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Differences between SQL Plus and "regular" SQL?

I'm new to the Oracle Platform (having primarily used MySQL, with a little Postgres and SQL Server as well). I recently discovered the following statment

DESC TABLE_NAME;

will only work in the SQL*Plus tool I use to test my queries. It will NOT work when I use PHP's standard functions to connect to the oracle database. I need to use something like

SELECT * FROM USER_TAB_COLUMNS WHERE TABLE_NAME = 'TABLE_NAME'

instead.

From what I understand, this is because the "DESC" statment is an add-on in the SQL*Plus application.

My questions are

  1. Is my understanding correct, or is there something more subtle going on?
  2. What other special additions are there to SQL*Plus?
  3. Is there a way to turn off these special additions while I'm coming up to speed on Oracle?
  4. Any other general advice for an Oracle newb from vetrans of the platform is appreciated.
like image 512
Alan Storm Avatar asked Dec 22 '22 10:12

Alan Storm


1 Answers

  1. Yes. SQL*Plus is a client tool. SQL is what actually gets run on the server.
  2. Documentation for SQL*Plus is here and here A lot of the 'extensions' are presentation related (eg how wide your screen is)
  3. Not really in SQL*Plus. If you use SQL*Plus for long, you'll soon find out you really NEED to be able to change the default linesize, page size, column sizes, number formatting...
  4. Personally, while it is good to know how to do things in SQL*Plus, one of the GUI client tools can be a lot easier. Personally I use SQL Squirrel for most stuff, and my favourite editor and SQL*Plus for PL/SQL program development.
like image 74
Gary Myers Avatar answered Dec 28 '22 06:12

Gary Myers