September 13, 2010 at 6:00 am
I'm used to SQL Server. Oracle syntax is a bit different. I have Oracle SQL Plus (v9). I've solved most of my problems but need help with these 3.
How do I specify an alias for a table? T-SQL equivalent of FROM Table [/b]AS T[/b]
How do I stop the output from repeating the column headings every 10 items?
How do I load an existing script to re-run it?
September 13, 2010 at 6:14 am
Tom Brown (9/13/2010)
I'm used to SQL Server. Oracle syntax is a bit different. I have Oracle SQL Plus (v9). I've solved most of my problems but need help with these 3.How do I specify an alias for a table? T-SQL equivalent of FROM Table [/b]AS T[/b]
don't include the AS keyword;
you can use the AS keyword for columns, but not for table names;:
--Oracle Syntax:
SELECT
COL1 AS CITY,
COL2 AS STATE
FROM TableName MyAlias;
How do I stop the output from repeating the column headings every 10 items?
run this group of settings in SQL plus before running the rest of your commands:
set linesize 1000;
set pagesize 48;
set arraysize 20;
set wrap off;
SET DEFINE OFF;
How do I load an existing script to re-run it?
not sure....
Lowell
September 15, 2010 at 9:10 am
Tom Brown (9/13/2010)
I'm used to SQL Server. Oracle syntax is a bit different. I have Oracle SQL Plus (v9). I've solved most of my problems but need help with these 3.How do I specify an alias for a table? T-SQL equivalent of FROM Table [/b]AS T[/b]
How do I stop the output from repeating the column headings every 10 items?
How do I load an existing script to re-run it?
Let me take the last one.
Assuming your script name is mysqlscript.sql located in /opt/oracle/scripts once you are logged into sqlplus just type
@/opt/oracle/scripts/mysqlscript.sql
Hope this helps.
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.September 15, 2010 at 9:42 am
Thank-you both.
Apart from the cranky text editor and lack of syntax colouring, I'm quite enjoying a minor foray into Oracle.
September 15, 2010 at 2:11 pm
Tom Brown (9/15/2010)
Thank-you both.Apart from the cranky text editor and lack of syntax colouring, I'm quite enjoying a minor foray into Oracle.
Glad to help.
In regards to "the cranky..." you can always download - it's free! - Oracle's SQL Developer, you will feel much better, at least in terms of having a GUI interface
_____________________________________
Pablo (Paul) Berzukov
Author of Understanding Database Administration available at Amazon and other bookstores.
Disclaimer: Advice is provided to the best of my knowledge but no implicit or explicit warranties are provided. Since the advisor explicitly encourages testing any and all suggestions on a test non-production environment advisor should not held liable or responsible for any actions taken based on the given advice.September 3, 2011 at 11:01 pm
You can use SQLS*Plus (http://www.memfix.com) - this is a free SQL Server tool that acts as SQL*Plus for Oracle
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy