sqlplus

Convert epoch to date in sqlplus / Oracle

帅比萌擦擦* 提交于 2019-11-26 14:23:09
问题 I have the following table: SQL> desc recording Name Null? Type -------------------- -------- ------ CAPTUREID NOT NULL NUMBER(9) STARTDATE NOT NULL DATE ENDDATE DATE STATE NUMBER(1) ESTIMATEDENDTIME NUMBER(13) Here's a single line for this table: SQL> select * from recording where CAPTUREID=14760457; CAPTUREID STARTDATE ENDDATE STATE ESTIMATEDENDTIME ---------- ------------------- ------------------- ----- ---------------- 14760457 29/09/2010 08:50:01 29/09/2010 09:52:04 0 1285746720000 I'm

PL/SQL ORA-01422: exact fetch returns more than requested number of rows

戏子无情 提交于 2019-11-26 12:44:03
问题 I get keep getting this error I can\'t figure out what is wrong. DECLARE * ERROR at line 1: ORA-01422: exact fetch returns more than requested number of rows ORA-06512: at line 11 Here is my code. DECLARE rec_ENAME EMPLOYEE.ENAME%TYPE; rec_JOB EMPLOYEE.DESIGNATION%TYPE; rec_SAL EMPLOYEE.SALARY%TYPE; rec_DEP DEPARTMENT.DEPT_NAME%TYPE; BEGIN SELECT EMPLOYEE.EMPID, EMPLOYEE.ENAME, EMPLOYEE.DESIGNATION, EMPLOYEE.SALARY, DEPARTMENT.DEPT_NAME INTO rec_EMPID, rec_ENAME, rec_JOB, rec_SAL, rec_DEP

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor

二次信任 提交于 2019-11-26 12:41:11
We have an application running locally where we're experiencing the following error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor I've tested the connection using TNSPing which resolved correctly and I tried SQLPlus to try connecting, which failed with the same error as above. I used this syntax for SQLPlus : sqlplus username/password@addressname[or host name] We have verified that: the TNS Listener on the server is running. Oracle itself on the server is running. We don't know of any changes that were made to this environment. Anything else we can

How to get Oracle create table statement in SQL*Plus

折月煮酒 提交于 2019-11-26 11:17:02
问题 I have a table that exists in an Oracle database, but doesn\'t show on my list of tables in the tool SQL Developer. However, if I go to SQL*Plus, and do a select table_name from user_tables; I get the table listed. If I type desc snp_clearinghouse; it shows me the fields. I\'d like to get the create statement, because I need to add a field. I can modify the table to add the field, but I still need the create statement to put into our source control. What pl/sql statement is used to get the

How to display table data more clearly in oracle sqlplus

女生的网名这么多〃 提交于 2019-11-26 09:19:30
问题 I want to be able to display the resulting data from a select in a pretty way, not all columns under others. Here is the way sqlplus displays my table data: But I want to show them as: Name | Address | Phone | -------+---------------+-------------+ name1 | address1 | phone1 | name2 | address2 | phone2 | name3 | address3 | phone3 | Not each column under the other 回答1: I usually start with something like: set lines 256 set trimout on set tab off Have a look at help set if you have the help

Maximum length of command line argument that can be passed to SQL*Plus?

荒凉一梦 提交于 2019-11-26 08:59:57
问题 I am calling SQL*Plus from Linux C Shell: sqlplus username/password @file.sql var1 var2 var3 If I pass a string as var1 , how long can this string be? Is it governed by the OS? In this case: Linux version 2.6.9-100.ELsmp (mockbuild@x86-010.build.bos.redhat.com) (gcc version 3.4.6 20060404 (Red Hat 3.4.6-11)) #1 SMP Tue Feb 1 12:17:32 EST 2011 Update: Empirical testing yielded the following results: A command line argument of 5200 characters gave the error, \"Word too long.\" 1300 characters

DBMS_OUTPUT.PUT_LINE not printing

╄→гoц情女王★ 提交于 2019-11-26 06:05:38
问题 When executing the following code, it just says the procedure is completed and doesn\'t print the infomation i want it to (firstName, lastName) and then the other values from the select query in a table below. CREATE OR REPLACE PROCEDURE PRINT_ACTOR_QUOTES (id_actor char) AS CURSOR quote_recs IS SELECT a.firstName,a.lastName, m.title, m.year, r.roleName ,q.quotechar from quote q, role r, rolequote rq, actor a, movie m where rq.quoteID = q.quoteID AND rq.roleID = r.roleID AND r.actorID = a

Escaping ampersand character in SQL string

末鹿安然 提交于 2019-11-26 05:25:00
问题 I am trying to query a certain row by name in my sql database and it has an ampersand. I tried to set an escape character and then escape the ampersand, but for some reason this isn\'t working and I\'m uncertain as to what exactly my problem is. Set escape \'\\\' select * from V1144engine.T_nodes where node_id in( select node2_id from V1144engine.T_edges where node1_id in( select node2_id from V1144engine.T_edges where node1_id in( select node2_id from V1144engine.T_edges where node1_id =

Webrick is very slow to respond. How to speed it up?

对着背影说爱祢 提交于 2019-11-26 04:33:12
问题 I have a Rails application that I\'m running on my server. When I go to a remote desktop and attempt to load the application, the server takes a good 3-4 minutes to respond with a simple HTML page. However, when I load up the page locally on the server, the page shows up in just a second. I tried pinging the server from my remote desktop and the pings are going through successful in a reasonable amount of time. This all seems to have started after I installed Oracle\'s basic client and

ORA-12514 TNS:listener does not currently know of service requested in connect descriptor

主宰稳场 提交于 2019-11-26 02:41:17
问题 We have an application running locally where we\'re experiencing the following error: ORA-12514: TNS:listener does not currently know of service requested in connect descriptor I\'ve tested the connection using TNSPing which resolved correctly and I tried SQLPlus to try connecting, which failed with the same error as above. I used this syntax for SQLPlus : sqlplus username/password@addressname[or host name] We have verified that: the TNS Listener on the server is running. Oracle itself on the