PL/SQL :: How To Format Columns Properly In SQLPlus

Nov 18, 2013

How do you setup a default style for displaying the output columns in sqlplus? The columns look clumsy when queried. They display correctly in Toad but, I wanted to learn through sqlplus and I am relatively new to Oracle world. Here is the DESC of table  

SQL> DESC EMP.GROUP_TYPE
Name
Null?    Type
-------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-------------- -------- --------------------------------------------------------
------------------------------------------------------------
GROUP_TYPE

[code]...

View 11 Replies


ADVERTISEMENT

Convert Oracle Sqlplus Output Into ASCII Format?

Sep 20, 2012

I am using oracle database 9iR2 (9.2.0.8) on windows 2003 server.

Is there any method to convert following output in to ASCII format ??

select ename from scott.emp;

ENAME
--------
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS

View 6 Replies View Related

PL/SQL :: Arabic Letters In Sqlplus Spool Output In CSV Format

Jul 4, 2013

I have 11.2.0.3 Db in HP UX 11.31, I have to spool a table output in csv format which contains arabic letters in few columns. my spool output is not showing the arabic letters properly.

[oratest@]$ echo $NLS_LANGAmerican_America.
AL32UTF8 V$NLS_PARAMETERS NLS_LANGUAGE                                                    
AMERICANNLS_TERRITORY  
AMERICANLS_CURRENCY                                                    
$NLS_ISO_CURRENCY                                                
AMERICANLS_NUMERIC_CHARACTERS                                          
.,NLS_CALENDAR                                                    

[Code]....

View 0 Replies View Related

Client Tools :: Handling DATETIME Format Using SQLPLUS COPY Command

Jul 29, 2012

I am using the SQL*PLUS COPY command to move the data from my database to another remote database. The data in my database also contains DATETIME format. But since COPY command cannot handle DATETIME format, I am wondering is there any workaround for this.

Note: Due to some limitations, I cannot use other methods like DATABASE LINK or EXPDP/IMPDP commands.

View 12 Replies View Related

SQL & PL/SQL :: Date Format - Do (ORDER BY) By Concatenating Two Columns?

Jun 26, 2013

I want to do 'ORDER BY' by concatenating the two columns(date +varchar2).But not working and geting the error - ORA-01855: AM/A.M. or PM/P.M. required

SQL> create table dat2 (
mod_date date,
am_pm varchar2 (10) ) ; 2 3

Table created.
SQL> INSERT INTO DAT2 ( MOD_DATE, AM_PM ) VALUES (
TO_Date( '06/05/2003 12:00:00 AM', 'MM/DD/YYYY HH:MI:SS AM'), '7:25AM'); 2

1 row created.

[code]...

ERROR at line 2:
ORA-01855: AM/A.M. or PM/P.M. required

View 25 Replies View Related

Separate Date Format For Specific Columns In A Database

May 25, 2011

As we know that date datatype can store both date part and time part. If I specify the Date format for my database as 'DD-MM-YYYY HH@$:MI:SS' can i ensure i anyways for a particular columns in the database containing date values the format is 'DD-MM-YYYY' i.e without the time part.Can we specify seperate date formats for specific columsn in database during table creation?

View 1 Replies View Related

Can't Get Joins On Tables Properly

May 2, 2008

why how ever way i try i cant get the joins on the tables properly.... well i know i have to work hard....if join is not proper the data i extract is also not proper.Well now i have 3 tables...

ps_operations

Name Null? Type
----------------------------------------- -------- --------
ASSB_PT_NBR_SEQ_ID NOT NULL NUMBER(8)
OPERATION_NBR NOT NULL VARCHAR2(10)
EFFECTIVE_FROM_DT NOT NULL DATE
DML_TS NOT NULL DATE
DML_USER_ID NOT NULL VARCHAR2(30)
OPERATION_DESC NOT NULL VARCHAR2(70)
HOURS_PER_PIECE_QTY NOT NULL NUMBER(9,6)
PIECES_PER_HOUR_RATE_QTY NOT NULL NUMBER(15,7)
EFFECTIVE_TO_DT DATE
EXTRACT_IND VARCHAR2(1)
[code]...

I have never worked on CPK and UK....so i dont know how to use them to join the tables,.

View 11 Replies View Related

SQL & PL/SQL :: Merge Is Not Working Properly?

Apr 23, 2013

I am using the following merge statement it's not working properly. If I tried to insert (or) update the existed record. I am getting unique key constraint violated error.

DECLARE
p_buid NUMBER;
p_ordernum NUMBER;

[Code].....

View 12 Replies View Related

SQL & PL/SQL :: Cursor Not Working Properly?

Nov 29, 2011

I'm trying to Create a procedure that generates:
Customer
Description of Order
Amount of Order
Total Of Order

As this Generates More than One Row I thought i would need to use cursor in order to store the results and then use them from the object So this is what i Coded:

CREATE OR REPLACE PROCEDURE UP_CustOrders
AS
/*I Am Selecting A Cursor Cause It Return More Than One Row*/
CURSOR ReportCursor IS
SELECT Company

[code]..

It appears It creates the procedure but im not sure why it has compilation errors Perhaps im missing some symbols? Here are the tables:

CREATE TABLE Customers
(CustNum NUMBER(10) NOT NULL,
Company VARCHAR2(20) NOT NULL,
CustRep NUMBER(10),

[code]...

View 12 Replies View Related

SQL Command Not Properly Ended?

Jan 13, 2013

am learning the Oracle PL/SQL language using CBT Nuggets tutorials and practicing what I learn. I seem to be getting confused with the ROUND function...For example, what am I doing wrong in this statement:

select avg(salary) from employees,
ROUND (avg(salary) , 2;

Basically I am trying to round the result to two decimal places but get the error ORA - 00933 - SQL command not properly ended?

View 6 Replies View Related

Forms :: Cannot Exit_form Properly

May 12, 2011

I enter a form, do nothing, and exit_form. It closes but reenter again. The second try, does not cause this effect and ends properly. Checked and commented code around the form, but no use.What could be happening ?

View 4 Replies View Related

PL/SQL :: DML Triggers Not Working Properly?

Jul 18, 2013

There are two servers A and B ,and i am maintaining one table suppose table1 and another table suppose table2 , DML triggers are made for both of these tables.The action of DML trigger is that the movement we are inserting values , suppose a table1 on server A so automatically the same set of value in table2 on server Bso my problem is that the movement i inserted value on table1 on server A ,

the same set of values were inserted into table2 of server B and as the values were inserted intotable2 , the same set of values were inserted into the tabld1 because of the trigger.  How to stop the non ending loop which occurs due to the simultaneous firing of triggers and insertion of same records into both the table endlessly...

version :---Personal Oracle Database 10g Release 10.2.0.3.0 TNS for 32-bit Windows: Version 10.2.0.3.0

View 0 Replies View Related

ODI Invoke Is Not Generating XML Properly

Feb 5, 2013

In weblogic server Axis2 is deployed and it is showing Active.And we have uploaded ODI invoke service also in AXIS2 succesfully and it is showing Active status also...By using the soap its generating the XML with below mentioned error..

some info:- We rae using ODI 10g.
Weblogic 10.3.5.0

XML GENERATING:--_

<xs:element name="inPhasesUptoAndIncludingPostDispatch" nillable="true" type="xs:anyType" />
<xs:element name="key" nillable="true" type="xs:anyType" />
<xs:element name="localPolicyAssertions" nillable="true" type="xs:anyType" />

[code]...

The XML page cannot be displayed Cannot view XML input using XSL style sheet. correct the error and then click the Refresh button, or try again later.

The operation completed successfully. Error processing resource [URL]

</xs:schema></wsdl:types><wsdl:message name="invokeScenarioMessage"><wsdl:part name="part1" element="ns...

View 2 Replies View Related

SQL & PL/SQL :: WITH Clause Not Working Properly?

Nov 8, 2010

It seems some issue with With Clause along with Row Number. Output is strange when it comes with SELECT MIN()... But Looks fine Once you add "order by" or "where" clasue inside WITH Clause

SQL> select * from v$version;

BANNER
----------------------------------------------------------------
Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - 64bi
PL/SQL Release 10.2.0.5.0 - Production
CORE 10.2.0.5.0 Production

[code]....

But Output looks fine once you add ORDER By clause inside WITH clause

SQL> WITH EM AS
2 (
3 SELECT EMPNO, ROWNUM RN
4 FROM SCOTT.EMP T ORDER BY ROWNUM

[code]....

why it happens ?

View 4 Replies View Related

How To Verify Serverside TAF Working Properly

Apr 22, 2009

#service setup:

$ srvctl add service -d dc1ext -s addval.dc1 -r "dc1ext1" -a "dc1ext2" -P BASIC
$ srvctl start service -d dc1ext -s addval.dc1

begin
DBMS_SERVICE.MODIFY_SERVICE(
service_name=>'addval.dc1',
aq_ha_notifications => true,
failover_method=>DBMS_SERVICE.FAILOVER_METHOD_BASIC,
[code]......

my attempt at verifying the TAF is working.

SQL> run
1 SELECT MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER, COUNT(*)
2 FROM GV$SESSION
3* GROUP BY MACHINE, FAILOVER_TYPE, FAILOVER_METHOD, FAILED_OVER

MACHINE FAILOVER_TYPE FAILOVER_M FAI COUNT(*)
---------------------------------------------------------------- ------------- ---------- --- ----------
anetapp02.dc2 NONE NONE NO 10
anetapp01.dc2 NONE NONE NO 10
app02.st2 NONE NONE NO 5
racdb02 NONE NONE NO 44
anetapp03 NONE NONE NO 10
anetapp04 NONE NONE NO 10
GNOME\APTSEA-6GKJHF1 SELECT BASIC NO 3
app01.st2 NONE NONE NO 5
anetapp05 NONE NONE NO 10
anetapp01 NONE NONE NO 10
anetapp03 NONE NONE NO 10

so it looks as thought the sessions are failing over, but my app guy says he get a few errors during the process.. i need it setup to move the current query over without returning an error.. do i not have this setup properly?

View 3 Replies View Related

ORA-00933 / SQL Command Not Properly Ended

Mar 15, 2013

i have a problem with a syntax in sql navigator. everytime a run this sql command, this message appears:

ORA-00933: SQL command not properly ended.

INSERT INTO table1
(year, id, Date, categ)
VALUES (2013, id, '15-mar-2013', 2)
select year, id, date, categ from table1 where id=5000 and year=2013;

also

INSERT INTO table1
(year, id, Date, categ)
VALUES (2013, 5000, '15-mar-2013', 2)
select year, id, date, categ from table1 where id=5000 and year=2013;

View 3 Replies View Related

SQL & PL/SQL :: ORA-00933 / SQL Command Not Properly Ended

Jan 13, 2011

I created a table named dept2 which is a duplicate of the dept table in scott schema.

create table dept2 as select * from dept;

after that I altered it woth the following statements :

alter table dept2 add ddate date;
alter table dept2 modify deptno unique;

all operations were successful , now when I execute the following ddl statements :

alter table dept2
add constraint xx unique (loc,dname)
add constraint yy check (mod (deptno,10) =0) disable
modify ddate default sysdate
modify deptno number (5)
drop unique (deptno)

I get the error : SQL Error: ORA-00933: SQL command not properly ended

when I remove the statement of drop unique (deptno) it works

View 13 Replies View Related

Properly Removing Old Temp Files From ASM Storage

Dec 16, 2010

The other day, we had a query run amok in our 2-node production cluster. The 3 temp files for the temp tablespace were all still set to autoextend unlimited, something I forgot to change after a recent upgrade. I created 3 new temp files and tried to delete the huge temp files. I did this from sqlplus with this commad:

ALTER TABLESPACE PSTEMP DROP TEMPFILE '+DATA/isis/tempfile/pstemp.291.641298061';

The huge files are still in ASM storage. dba_temp_files reports that the status of them is AVAILABLE but they have no RELATIVE_FNO. Grid Control reports their status as OFFLINE and their size as 0. They are actually close to 20 GB each.

I tested the above alter statement in two test instances, also RACed with ASM storage and the temp files were successfully deleted, but they were much smaller in size. At this point, how do I delete the three 20GB files from ASM in our production instance? Why didn't they delete the first time?

View 1 Replies View Related

Log Of Materialized View - Trigger Not Working Properly

Oct 25, 2012

I have created a Table and a log of materialized view in an Schema SchemaAA of Server A

CREATE TABLE TABLA_TEST
(
TEST_PK NUMBER,
TEST_TEXTO VARCHAR2(50),
CONSTRAINT PK_TEST PRIMARY KEY (TEST_PK)
);

CREATE MATERIALIZED VIEW LOG ON TABLA_TEST;

I have created a DB Link from server B with user REPLIC

I have granted SELECT to REPLIC to the table and the log materialized View.

I have created a table in instanceBA of Server B

CREATE TABLA_TEST
(
HOSPCODE NUMBER(3),
TEST_PK NUMBER,
TEST_TEXTO VARCHAR2(50),
FECHA_INSERT DATE,
FECHA_UPDATE DATE,
FECHA_DELETE DATE,
CONSTRAINT TTEST_PK PRIMARY KEY (HOSPCODE, TEST_PK);

I have created a materialized view in schema SchemaBB of Server B with a trigger

CREATE MATERIALIZED VIEW WORKAREA.TABLA_TEST70
BUILD IMMEDIATE
REFRESH FAST ON DEMAND
WITH PRIMARY KEY
AS
SELECT TEST_PK,
TEST_TEXTO
[code].........

All schemas have the appropriate grants.

When inserting in TABLA_TEST (SchemaAA) and refreshing MView TABLA_TEST70 things go nicely.

But, when updating a record in the original TABLA_TEST and refreshing the MView the results in TABLA_TEST in SchemaBA are as if I have deleted the record (FECHA_DELETE is set to SYSDATE).

View 1 Replies View Related

Forms :: Tree Hierarchy - Not Working Properly?

Apr 8, 2009

i have created a tree hierarchy....when the user clicks on any node,that particular form will open....But there is some problem...i click on form A,it opens.,...then i exit that form via a exit button on the toolbar....and then I click on form B on the tree....but first the form A only opens...and then again i exit form A, then form B will open..

i have written the following code in when_tree_node_selected trigger :

if condition then
call_form(path,no_hide,do_replace);

View 3 Replies View Related

Forms :: Vertical Scroll Bar Is Not Showing Properly?

Mar 1, 2010

When I first access the form and query for records, it works as per the expectation and with scroll bar to scroll up and down. But when I do "View>Record>Last", it reaches to last record, but not able to use the scroll bar to scroll the records up(I am on last record, so can't do downward scrolling).

The scroll bar is displaying in Full, no room to scroll up down.It happens only when I do "View>Record>Last".

View 2 Replies View Related

SQL & PL/SQL :: Insert Into Table - Command Not Properly Ended

Oct 23, 2012

INSERT INTO Table (NID, NType) SELECT DTreeNotifySequence.NextVal, 1 FROM Dee WHERE ID =354344 commit;

I get the following error:

ORA-00933: SQL command not properly ended

I tried it in several ways...are more semicolons needed?

View 4 Replies View Related

SQL & PL/SQL :: Converting Column Into Row - Command Not Properly Ended

Aug 9, 2010

My requirement with one table which contains 20 columns. Now I want to convert 18 column into rows. I tried with the following query but its throwing sql error is given below.

select * from tmpl_pop_age_range_col_lvl
UNPIVOT
(
quantity FOR product IN (COUNT_0_TO_4 as 'a', COUNT_5_TO_9 as 'b', COUNT_10_TO_14 as 'c',
COUNT_15_TO_19 as 'd',
COUNT_20_TO_24 as 'e',
COUNT_25_TO_29 as 'f',

[code].....

ERROR at line 4: ORA-00933: SQL command not properly ended

View 8 Replies View Related

Windows :: SP2-0152 / ORACLE May Not Be Functioning Properly

Dec 18, 2009

I installed oracle 10g R2 in my laptop with win7 ultimate(32-bit).But when i try to run sqlplus from command prompt...It retrns error..

C:Usersabhishek>sqlplus
SP2-1503: Unable to initialize Oracle call interface
SP2-0152: ORACLE may not be functioning properly.

I checked the oracle folder but there is db_1 and oradata folder inside product..but no admin folder.. Listener and database service is started..

View 7 Replies View Related

SQL & PL/SQL :: Executing Procedure - Command Not Properly Ended

Jan 18, 2012

After creating this procedure...we r not able to execute it...

SQL> ed
Wrote file afiedt.buf
1 create or replace procedure dyn_pro1
2 (tablename varchar2,colname varchar2, prodid number) is
3 cmd varchar2(100);
4 begin
5 cmd := 'delete ' || tablename || ' where'|| colname|| '=' ||prodid;
6 execute immediate cmd ;--using College_id;
7* end;
SQL> /

Procedure created.

SQL> exec dyn_pro1('stu_4','COLLEGE_ID',200);
BEGIN dyn_pro1('stu_4','COLLEGE_ID',200); END;
*
ERROR at line 1:
ORA-00933: SQL command not properly ended
ORA-06512: at "APPS.DYN_PRO1", line 6
ORA-06512: at line 1

View 8 Replies View Related

Server Administration :: Listener Not Functioning Properly?

Nov 22, 2006

while aim starting listener But Services in windows services showing listerner status as "started"

LSNRCTL> status
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=server1.NTS.rethi.com)(P
ORT=1521)))
TNS-12541: TNS:no listener
TNS-12560: TNS:protocol adapter error

[code]....

View 7 Replies View Related

Performance Tuning :: Hint Is Not Working Properly

Jul 14, 2010

I have a query with FULL hint that is behaving in a strange manner. The query fetches around 700000 of data. Sometimes it fetches the data with the hint and sometimes it does not fetch any data with the hint and then I have to remove the hint and have to fetch the data. Below is the query,

select /*+ FULL(COMP_TM) FULL(TRANS_TM) FULL(INVC_TM) */
CUST_BE_ID ,
DISTR_BE_ID ,
FG_BE_ID ,
KIT_BE_ID ,
BG_ID_NO_BE_ID ,
[code]....

The statistics gathering activity of FACT_DLY_ALGND_SLS table takes around 5 hours to complete. It is a range partitioned table with subpartitions.

View 14 Replies View Related

Server Administration :: CPU Patch Not Working Properly?

Feb 10, 2009

I applied the Jan 09 CPU to my database this past Saturday and now my daily schema export is not running properly:

With the Partitioning, OLAP, Data Mining and Real Application Testing optionsExport done in WE8MSWIN1252 character set and UTF8 NCHAR character set server uses UTF8 character set (possible charset conversion)

About to export specified users ...
. exporting pre-schema procedural objects and actions
. exporting foreign function library names for user TEST
. exporting PUBLIC type synonyms
. exporting private type synonyms

[code]...

View 8 Replies View Related

PL/SQL :: Up And Down Arrow Keys Not Working Properly When Using SQL CLI On Linux?

Feb 27, 2013

Every time I hit up, down, left, and right arrow keys to return to a previous sql command I got ^[[D, fix this issue? The backspace works fine with me.

View 2 Replies View Related

Forms :: (Drag And Drop) Not Working Properly?

Jun 6, 2013

I created one Form manually. how to Drag and drop from items in Data Blocks to Canvas. when I created text in Canvas it was automatically creating the item in Data block. but when i create the items in Data blocks and then trying to copy to canvas.

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved