易截截图软件、单文件、免安装、纯绿色、仅160KB

SQL*Plus FAQ

 What is SQL*Plus and where does it come from?
SQL*Plus is a command line SQL and PL/SQL language interface and reporting tool that ships with the Oracle Database Client and Server software. It can be used interactively or driven from scripts. SQL*Plus is frequently used by DBAs and Developers to interact with the Oracle database.
If you are familiar with other databases, sqlplus is equivalent to:
"sql" in Ingres,
"isql" in Sybase and SQL Server,
"sqlcmd" in Microsoft SQL Server,
"db2" in IBM DB2,
"psql" in PostgreSQL, and
"mysql" in MySQL.
SQL*Plus's predecessor was called UFI (User Friendly Interface). UFI was included in the first Oracle releases up to Oracle 4. The UFI interface was extremely primitive and, in today's terms, anything but user friendly. If a statement was entered incorrectly, UFI issued an error and rolled back the entire transaction (ugggh).
 How does one use the SQL*Plus utility?
Start using SQL*Plus by executing the "sqlplus" command-line utility from the $ORACLE_HOME/bin directory. Some of the command line options:
userid/password@db -- Connection details
/nolog             -- Do not login to Oracle. You will need to do it yourself.
-s or -silent      -- start sqlplus in silent mode. Not recommended for beginners!
@myscript          -- Start executing script called "myscript.sql"
Look at this example session:
sqlplus /nolog
SQL> connect scott/tiger
SQL> select * from tab;
SQL> disconnect
SQL> exit
Please note that one must prepare the environment before starting sqlplus.
Linux/ Unix example:
$ . oraenv
ORACLE_SID = [orcl] ? orcl
$ sqlplus scott/tiger
Windows Example:
Click on "Start" -> "Run" and enter "cmd"
C:> set ORACLE_SID=orcl
C:> sqlplus scott/tiger
or...
C:> sqlplus scott/tiger@orcl
 What commands can be executed from SQL*


相关文档:

sql server访问远程数据库

--创建链接服务器
exec sp_addlinkedserver   'ITSV ', ' ', 'SQLOLEDB ', '远程服务器名或ip地址 '
exec sp_addlinkedsrvlogin 'ITSV ', 'false ',null, '用户名 ', '密码 '
--查询示例
select * from ITSV.数据库名.dbo.表名
--导入示例
select * into 表 from ITSV.数据库名.dbo.表名
--以后不 ......

解决SQL 死锁的语句

ALTER     procedure [dbo].[sp_lock_check]
@spid1 int = NULL,               
@spid2 int = NULL               
as
set nocount on
if @spid1 is not NULL
begin
        select ......

sql日期模糊查询 SQL时间转换格式

Select * from t_user_profile where convert ( varchar ( 21 ),regDate, 120 ) like ' 2008-05-07% ' 表名称:t_user_profile 日期字段名称:regDate
Select   *   from t_user_profile  where  convert(varchar(21),regDate,120) like '2008-05-07%'< ......

PL/SQL学习笔记三


1.条件控制
1.1 if .. then .. end if
if 条件 then
    语句段;
end if;
1.2 if .. then .. else .. end if
if 条件 then
    语句段;
else 
    语句段;
end if;
1.3 if嵌套
2.循环控制
2.1 loop .. exit .. end loop
loop  
   & ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号