Home » SQL & PL/SQL » SQL & PL/SQL » Col size (oraclae 10 G, Windows 2003)
Col size [message #430532] Tue, 10 November 2009 22:42 Go to next message
deep0983
Messages: 28
Registered: April 2009
Junior Member
Hi

I have written one script file and i want to show all my select data in log file.

so for that i have wrote query like this.

Set Heading on
col aa FOR A30
col bb FOR A30
col MED FOR A30


aa bb MED
-------------- ------------ ---------------------------
########## ########## Comment


########## ########## Comment


########## ########## Document content


the return type for aa and bb is integer.

it should return int value. but for third col it's var char. it's perfectly return the values.

can any body help me to short it out.
Re: Col size [message #430534 is a reply to message #430532] Tue, 10 November 2009 22:46 Go to previous messageGo to next message
manu_jariwala
Messages: 20
Registered: August 2005
Location: Surat
Junior Member

Hi,
Pls send your script or sql statement also. Its very difficult to say what could be problem.

R'gards,
Manish H Jariwala
Re: Col size [message #430535 is a reply to message #430534] Tue, 10 November 2009 22:52 Go to previous messageGo to next message
deep0983
Messages: 28
Registered: April 2009
Junior Member
hi manu,

i have written the query like this.

ACCEPT LOG_DIR PROMPT 'Please enter the full path to the log files (default C:\Temp): ' DEFAULT C:\Temp

column dcol new_value addedValue noprint
select USER||'_'||(SELECT GLOBAL_NAME FROM GLOBAL_NAME)||to_char(sysdate,'YYYYMMDD_HH24MISS') dcol from dual;
SPOOL &&LOG_DIR\sol_&addedValue..log
set serveroutput on size 1000000 format wrapped
set heading off
Set Verify off
Set autotrace off
SET PAGESIZE 300
SET LINESIZE 500
set feedback off



Set Heading on
col aa FOR A30
col bb FOR A30
col med FOR A30


select query......


set feedback off
Re: Col size [message #430567 is a reply to message #430532] Wed, 11 November 2009 01:22 Go to previous messageGo to next message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
If aa and bb are integers then the format in column statements is not correct.

Please read OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format.
Indent the code, use code tags and align the columns in result.
Use the "Preview Message" button to verify.
Also always post your Oracle version with 4 decimals.

Regards
Michel
Re: Col size [message #430580 is a reply to message #430567] Wed, 11 November 2009 01:46 Go to previous messageGo to next message
deep0983
Messages: 28
Registered: April 2009
Junior Member
Hi Michel,


then what should be correct statement for this.
Re: Col size [message #430583 is a reply to message #430580] Wed, 11 November 2009 02:05 Go to previous message
Michel Cadot
Messages: 64102
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
SQL*PlusĀ® User's Guide and Reference
Chapter 6 Formatting SQL*Plus Reports
Section Formatting Columns
Chapter 12 SQL*Plus Command Reference
Section COLUMN

Regards
Michel
Previous Topic: DDL for a Table
Next Topic: Use CLOB XML coming from Oracle
Goto Forum:
  


Current Time: Fri Dec 02 18:19:53 CST 2016

Total time taken to generate the page: 0.24511 seconds