Professional Documents
Culture Documents
Oracle Database Express Edition 2 Day Developer Guide 10g Release 2 (10.2) Part Number B25108-01
Previous Next
12/6/12
This contains the following topics: Starting and Exiting SQL Command Line Displaying Help With SQL Command Line Entering and Executing SQL Statements and Commands SQL Command Line DESCRIBE Command SQL Command Line SET Commands Running Scripts From SQL Command Line Spooling From SQL Command Line Using Variables With SQL Command Line Note: Before starting SQL Command Line, make sure that the necessary environmental variables have been set up properly. See Oracle Database Express Edition 2 Day DBA for information about setting environmental variables for SQL Command Line.
12/6/12
SL HL IDX Q> EP NE From the list of SQL Command Line Help topics, you can display Help about an individual topic by entering H L EP with a topic name. For example, the following displays Help about the SQL Command Line C L M command, which OUN enables you to format column output: SL HL CLM Q> EP OUN
3/6
12/6/12
HR_AE IEDT JBI O_D SLR AAY CMISO_C OMSINPT MNGRI AAE_D DPRMN_D EATETI
NTNL DT O UL AE NTNL VRHR(0 O UL ACA21) NME(,) UBR82 NME(,) UBR22 NME() UBR6 NME() UBR4
12/6/12
See Also: Oracle Database Express Edition 2 Day DBA for information about setting environment variables for Oracle Database Express Edition SQL*Plus User's Guide and Reference for information about setting the SQL Command Line S L A Henvironment variable to specify the default location of SQL QPT scripts
12/6/12
- pop frepoe_di aqey yune t etravldI sc a 15 - rmt o mlyei n ur, o ed o ne ai D uh s 2 SLC epoe_d ls_ae jbi FO epoes EET mlyei, atnm, o_d RM mlye WEEepoe_d=&mlyei; HR mlyei epoe_d When you run the previous S L C statement, the output is similar to: EET Etrvlefrepoe_d 15 ne au o mlyei: 2 ... EPOE_DLS_AE MLYEI ATNM JBI O_D ---------------------------- ------------ ----15Nyr 2 ae S_LR TCEK Reusing a Variable Value in a Query You can use & to identify a variable that you want to define dynamically multiple times, but only want to prompt the & user once. In Example A-2, including the & c l m _ a evariable causes the SQL statement to prompt for a &ounnm value when the statement is executed. The value that is entered is substituted for all remaining occurrences of & c l m _ a ein the SQL statement. &ounnm Example A-2 Reusing a Variable Value in SQL Command Line - pop fraclm nm,sc a jbi,wihi te sbtttdi te - rmt o oun ae uh s o_d hc s hn usiue n h - rmiigietclsbttto vralspeie wt & - eann dnia usiuin aibe rfxd ih & SLC epoe_d ls_ae &clm_aeFO epoes EET mlyei, atnm, &ounnm RM mlye ODRB &clm_ae RE Y &ounnm; Defining a Variable Value for a Query In Example A-3, the & o _ dvariable is defined before running the SQL statement with the D F N command, jbi EIE and the defined value is substituted for the variable when the statement is executed. Because the variable has already been defined, you are not prompted to enter a value. Example A-3 Defining a Variable for a Query in SQL Command Line - dfn avral vlefraqeya flos - eie aibe au o ur s olw DFN jbi ="TCEK EIE o_d S_LR" - rnaqeyuigtedfndvlefrjbi (TCEK - u ur sn h eie au o o_d S_LR) SLC epoe_d ls_aeFO epoesWEEjbi ='jbi' EET mlyei, atnm RM mlye HR o_d &o_d;
Previous Next
docs.oracle.com/cd/B25329_01/doc/appdev.102/b25108/xedev_sqlplus.htm#BJEEGJGJ
6/6