In order to learn the SQL statements of the database, after a long wait and learning, I finally learned how to use Oracle 10 Gb to learn the SQL statements of the database over the past few days.
Required Software: Oracle 10g, TOAD for Oracle
The installation of Oracle10g is
Related link parsing Oracle data scanning Oracle SQL optimization guide local scanning method (1) http://www.bkjia.com/database/201205/130424.html Parsing Oracle data scanning Oracle SQL optimization guide local scanning method (2
When writing a stored procedure in Oracle, a large SQL statement is sometimes used, but when viewed with the Pl/sql tool test you cannot see the SQL, and the discovery can be handled through an Oracle physical temporary table.
Add dbms_output.put_line ('
Oracle BASICS (1): Use the oracle instance and SQL * plus commandI. Three-tier structure of oracle Database1. Client: used to access databases. Such as sqlplus and pl/SQL dev. 2. database Server-oracle dbms (database management sy
Tags: having multiple columns Ges repeating return expression Common nbsp genPart two common SQL usage and considerations1. Exists and in2. Union and UNION ALL3. With AS4. ORDER BY5. GROUP BY6. Where and having7. Case and Decode 1.exits and in usage1) Description:1. Exists first to the appearance of the loop, each cycle of internal table query; In the inner table and the appearance of the hash connection2. Using exists
Label:In SQL Server, the number of affected rows returned is: If @ @RowCount In Oracle, the number of affected rows returned is: If sql%rowcount Cases: Sql server: Create procedureproc_test@Stat int=0,
@MsgId varchar( -)="',
as
BEGIN
UpdateT_mtSetStat=@Stat, Ostat=@Stat, Rpttime=Getdate()WhereM
download down the path of the package. There is one last problem, you need to set a character set, so that the query out of the data will not be garbled, write a batch processing Pldev. BAT is placed in the PL installation directory with the following contents:Set Nls_lang=simplified Chinese_china. Zhs16gbkPLSQLDev.exeThis character set, refers to the server side of the character set, please configure according to the actual situation.Finally, just double-click this batch, then fill in the acco
you created the soft link through the command line 3.checking Oracle Instant Client SDK Header directory ... configure:error:Oracle Instant Client SDK header files not Foun DWhether your SDK folder is located in the Instantclient directory. 4.ERROR: '/tmp/pear/temp/oci8/configure--with-oci8=instantclient,/usr/local/lib/instantclient ' failedThe path followed by the--with-oci8 is correct and should be the last directory we copied. Ubuntu 14.04 I
is recommended for use with this select NO, listagg (EMP, ', ') within GROUP (ORDER by NULL) as Valsfrom onepiecegroupAbove we see the Listagg function syntax has over function, of course, our Listagg can also do analysis functionsSELECT NO, listagg (EMP, ', ') within GROUP (ORDER by NULL) through (partition by NO) from onepieceThe 3rd method of implementation has the To_string function, where the source code is as follows:CREATE OR REPLACE FUNCTION to_string (nt_in in Varchar2
Oracle SQL Developer is Oracle's official database management tool. This article uses Oracle SQL developer to perform the migration from MySQL to the Oracle database. March 6, 2017 Operation Steps: 1. Create a migration repository user in the
SQL format execution sequence of oracle data structure and sequence number of SQL query processing, oraclesql
I. execution sequence of SQL format
FROM-> WHERE-> group by-> HAVING-> SELECT-> ORDER
1. The from clause assembles data from different data sources;
2. The where clause filters record rows based on specified c
Tns_admin and the value is the path to the Tnsnames.ora file, for example: E:\oracleclient\instantclient_11_24.After installing Plsql, start, Cancel, and click Tools->preferences->connection:Oracle home=e:\oracleclient\instantclient_11_2OCI Library=e:\oracleclient\instantclient_11_2\oci.dllRestart Plsql, enter the user name, password, select the PL/SQL instance name to enter the database5.The initial login may have the problem of Chinese garbled, the
First download instantclient can be downloaded to the Oracle website, to register the account, must be under the corresponding version, otherwise unsuccessful,10g,11g version of, I have been sent up, free download: Is crossing, wait a minuteConfiguration file Tnsnames.ora This one place is generally put (network/admin), only in PL/SQL----->tools-->proferences ...------>connection---- >
Just note that the output parameter is registered with the Registeroutparameter method inside the CallableStatement.Stored procedures:Import java.sql.CallableStatement;Import java.sql.Connection;Import Java.sql.DriverManager;Import java.sql.PreparedStatement;Import java.sql.SQLException;Import Java.sql.Types;Calling Oracle's stored procedures in Javapublic class Javacallpro {public static void Main (string[] args) {String driver= "Oracle.jdbc.driver.OracleDriver";String url= "JDBC:ORACLE:THIN:@1
Share two SQL statements
1. regexp_replace supported by Oracle SQL
SQL> select regexp_replace ('fuck', '(.) (.)', '/123') from dual;Regexp_replace ('fuck ','(.)(------------------------------Ufkcy UO
(Haha)
There are two letters in a pair.
//////////////////////////////////////// /////////////////////////////
number of records in totalrecouds table select COUNT (*) from table name totalpages total pages totalpages= totalrecouds%pagesize==0?totalrecouds/pagesize:totalrecouds/pagesize+1 pages start position pages= pagesize* (pageNumber-1) sql statement: select * from table name limit pages, pageSize; mysql paging depends on the keyword limit it requires two parameters: start position and pagesize Start position = page Size * (pages 1) Star
Use Oracle SQL * Plus to analyze SQL
I. Analyze and execute SQL statements
SQL> set autotrace on; Description: Enables automatic analysis statistics and displays the running results of SQL statements.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.