sqlplus

SqlPlus SP2-0734: Error

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-02 22:27:49
I am new to using SqlPlus but not new to using SQL, and I get the following error after writing this in my editor and attempting to run the script that I wrote. All of this appears to be valid and works on sql fiddle... I am not sure what the issue is. Any ideas?? None of the files I create seem to work.... SQL> start sales.sq; which contains 1 create table salesreps 2 (empl_num number(3,0) primary key, 3 name varchar2(15) not null, 4 age number(3,0), 5 rep_office number(2,0), 6 title varchar2(10), 7 hire_date varchar2(10) not null, 8 manager number(3,0), 9 quota number(10,2), 10 sales number

How do I display the full content of LOB column in Oracle SQL*Plus?

邮差的信 提交于 2019-12-02 22:15:30
When I try to display the contents of a LOB (large object) column in SQL*Plus, it is truncated. How do I display the whole thing? SQL> set long 30000 SQL> show long long 30000 You may also need: SQL> set longchunksize 30000 Otherwise the LOB/CLOB will wrap. 来源: https://stackoverflow.com/questions/122772/how-do-i-display-the-full-content-of-lob-column-in-oracle-sqlplus

executing a function in sql plus

北城以北 提交于 2019-12-02 20:17:25
I created a function in oracle that inserts records in specific tables and return an output according to what occurs within the function. e.g (ins_rec return number) How do I call this function and see its output in sql plus declare x number; begin x := myfunc(myargs); end; Alternatively: select myfunc(myargs) from dual; One option would be: SET SERVEROUTPUT ON EXEC DBMS_OUTPUT.PUT_LINE(your_fn_name(your_fn_arguments)); As another answer already said, call select myfunc(:y) from dual; , but you might find declaring and setting a variable in sqlplus a little tricky: sql> var y number sql> begin

arrow keys are not functional in sqlplus

烈酒焚心 提交于 2019-12-02 20:06:39
I find that the arrow keys don't work on the sqlplus console. For example if I press left arrow key, it shows like SQL>^[[B Does any solutions exist to solve this problem? You can use a third party utility called rlwrap . rlwrap is a readline wrapper, a small utility that uses the GNU readline library to allow the editing of keyboard input for any other command. It maintains a separate input history for each command, and can TAB-expand words using all previously seen words and/or a user-specified file. So you will be able to use arrows and also get a command history as a bonus. After you have

Back to the sqlplus prompt

守給你的承諾、 提交于 2019-12-02 19:53:15
问题 I'm a beginner in PL/SQL, I'm trying some sql script but sometimes I have an error in my script and the prompt doesn't appear; I remain in input mode. How can I retrieve the prompt without shutting down the terminal? (p.s.: I used sql plus for oracle 11g under Ubuntu OS) 回答1: From the documentation SQL*Plus treats PL/SQL subprograms in the same manner as SQL commands, except that a semicolon (;) or a blank line does not terminate and execute a block. Terminate PL/SQL subprograms by entering a

sqlplus how to find details of the currently connected database session

♀尐吖头ヾ 提交于 2019-12-02 19:22:43
I have very recently started to work on oracle databases. Generally I have many sqlplus windows open to different oracle databases. When switching from one sqlplus session to another, how can i view the current session details for each sqlplus session ? Any help is greatly appreciated! Take a look at this one (c) Tanel Poder . You may either run it from your glogin.sql (so these settings will update each time you connect, or just run it manually. Notice host title command - it changes your sql*plus console window title with session information - extremely useful with many windows open

Is there a good alternative to SQL*PLUS for Oracle?

感情迁移 提交于 2019-12-02 17:56:08
I am not a fan of using SQL*PLUS as an interface to Oracle. I usually use yasql , but it hasn't been updated since 2005 and can do with some improvements. A quick Google search shows yasql and SQLPal . I am using linux, so SQLPal is not an option. Are there any alternatives out there, or am I stuck with an interface that I do not like or one that is no longer maintained? ropable I presume that you want a low-overhead method of knocking out queries, but want more functions than SQL*Plus provides? Why not use Oracle's SQL Developer ? It's free. Install, make a new connection to your database,

【小技巧】sqlplus去掉欢迎信息和提示信息,静默模式(silent option)

久未见 提交于 2019-12-02 17:48:24
每次登陆sqlplus,都会有提示信息,如下: SQL*Plus: Release 11.1.0.6.0 - Production on Mon Dec 26 14:21:01 2016 Copyright (c) 1982, 2007, Oracle. All rights reserved. Connected to: Oracle Database 11g Release 11.1.0.6.0 - Production 在shell中与sqlplus交互时,这些提示信息往往会破坏数据格式。 比如用spool导出数据的时候,不希望显示这些提示信息。 好在sqlplus提供了一个静默选项,关闭所有提示信息。 SILENT Option -S[ILENT] Suppresses all SQL*Plus information and prompt messages, including the command prompt, the echoing of commands, and the banner normally displayed when you start SQL*Plus. If you omit username or password, SQL*Plus prompts for them, but the prompts are not visible!

SQL Not A Single Group Group Function

一个人想着一个人 提交于 2019-12-02 17:41:51
问题 Okay guys here is the question. I have to list the department ID, department name, count of sales reps, and average commission rate for each department. Also I need to Group by department, and sort by average commission rate in ascending order. I am receiving an error at line 1 under the De.Dept_ID saying that is not a group by expression Here is my code: SELECT DE.Dept_ID as DeptID, Dept_Name as DeptName, COUNT(SR.Sales_Rep_ID) as SalesRepCount, Comm_Rate as AvgCommRate FROM DEPT_arb DE,

Why can't I connect via jdbc using SQLcl

↘锁芯ラ 提交于 2019-12-02 17:15:52
问题 I can connect to a remote database using SQLDeveloper. I am trying to connect to the same database using sqlcl from the command line, but I am getting an error. Here is the command that I am running: /bin/sql username/pass@delphix-vdb-n-1.va2.b2c.nike.com:1521/vdbsl14 I have also tried: /bin/sql username/pass@//delphix.......etc. Here is the error I am receiving: SQLcl: Release 4.2.0.16.131.1023 RC on Wed Jun 15 11:36:33 2016 Copyright (c) 1982, 2016, Oracle. All rights reserved. USER =