Max column length
I will like to find out what is the MAX column length for nchar and nvarchar types using AL16UTF16.
As per the metalink article 'Examples and limits of BYTE and CHAR semantics usage' it is 1000 and 2000 for 2 bytes characters. But in Al16UTF16, characters can also take up to 4 bytes. So does that change the max limits.
Also what is MAX length for a Clob and NClob type
in Al16UTF16, characters can also take up to 4 bytes. No. One character (code point) is represented in 2 bytes. However, some characters are mapped to surrogate pair of code points, as pointed out by the Note "In AL16UTF16 this will use 2 UTF16 codepoints and so occupy 4 bytes.".
So the limits noted still applies. If you have logical characters mapped to more than one code point, more space will of course be required for storage.
Similar Messages
-
How to retreive the max data length of a column
Hello All,
I know how to do a select to get the max data length of a column it is this :
SELECT MAX(LENGTH(COLUMN_NAME) FROM table.
However, I need this information combined with my SQL that returns the Data_type and length from the USER_TAB_COLUMNS. So taking the emp example if the ename column was 50 as VARCHAR2 but the max data entered in it was just 20 I want the information like this:
SELECT COLUMN_NAME, DATA_LENGTH, and the Max length of 20
FROM USER_TAB_COLUMNS WHERE TABLE_NAME='EMP';
I don't know how to get the Max Length of the Column in this table. Can anyone suggest me a hint? An Inline view maybe?
ThanksStill not sure about your requirements, but how about this
SQL> CREATE OR REPLACE FUNCTION get_max_length(p_table in varchar2, p_col in varchar2) return pls_integer
2 is
3 v_cnt pls_integer;
4 begin
5 execute immediate 'select max(length('||p_col||')) from '||p_table into v_cnt;
6 return v_cnt;
7 end get_max_length;
8 /
Function created.
SQL>
SQL> SELECT COLUMN_NAME,
2 DATA_LENGTH,
3 get_max_length(TABLE_NAME, COLUMN_NAME) max_length
4 FROM USER_TAB_COLUMNS
5 WHERE TABLE_NAME='EMP'
6 AND DATA_TYPE like '%CHAR%'
7 ;
COLUMN_NAME DATA_LENGTH MAX_LENGTH
ENAME 10 6
JOB 9 9
SQL> -
SELECT_LIST_FROM_QUERY max query length
Is there a max query length for SELECT_LIST_FROM_QUERY?
I have the basis of a list working OK but when I tried to make the query more complex to meet the business requirement I am getting a
ORA-06550: line 1, column 845: PLS-00103: Encountered the symbol "end-of-file" when expecting one of the following: ;
I have tried to ensure that I have all the quotes strings working and the like.
Thanks
MarkMark,
How long is your query? The SELECT_LIST_FROM_QUERY function accepts the query as a varchar2, so it’s "limited" to 32767 characters.
Regards,
Marc -
Token longer than max allowable length of 258 chars
Hi all,
i tried to apply a sql case statement in sql loader control file in " " the load succeed with 258 chars case or decode statement but when i add more cases it return
sql loader 350 token longer than max
LOAD DATA
INFILE 'F:\Vou\vou20110613_102_951454.unl'
BADFILE 'F:\Vou\vou.pad'
DISCARDFILE 'F:\Vou\vou.dic'
replace
INTO TABLE vou_test_2
FIELDS TERMINATED BY '|'
TRAILING NULLCOLS
(SERIALNO,TIMESTAMP "to_date(:TIMESTAMP,'yy/mm/dd hh24:mi:ss')",BRANDID,SUBCOSID,CHARGINGPARTYNUMBER,PAYTYPE,VOUCHERPINNUMBER,VOUCHERBATCHNUMBER,VOUCHERSEQUENCE,VOUCHERCOSID,VOUCHERSPID,CARDFACEVALUE,CARDVALUEADDED,CARDVALIDITYADDED,TRADETIME "to_date(:TRADETIME,'yy/mm/dd hh24:mi:ss')",OPERATEDBY,THIRDPARTYNUMBER,ACCESSMETHOD,TRADETYPE,RECHARGEAREANUMBER,TRANSITIONID,VOUCHERENCRYPTNUMBER,Location_Number,RESERVED2,RESERVED3,PRODUCTID,SERVICETYPE,OLDUSERSATE,CURRENTUSERSATE,PREVIOUSACTIVESTOP "to_date(:PREVIOUSACTIVESTOP,'yy/mm/dd hh24:mi:ss')",NEWACTIVESTOP "to_date(:NEWACTIVESTOP,'yy/mm/dd hh24:mi:ss')",SUSPENDSTOP "to_date(:SUSPENDSTOP,'yy/mm/dd hh24:mi:ss')",DISABLESTOP "to_date(:DISABLESTOP,'yy/mm/dd hh24:mi:ss')",VALIDITYADDED,REWARDCYCLES,REBATEPRODUCTID,BILLCYCLEID,SUBSCRIBERID,RESERVED4,RESULTCODE,ACCOUNTID,RECHARGETAX,RECHARGEPENALTY,CURRENCYCODE,RESERVED5,PREPAIDBALANCEBEFORE,RECHARGEFORPREPAID,PREPAIDBALANCE,POSTPAIDBALANCEBEFORE,RECHARGEFORPOSTPAID,POSTPAIDBALANCE,ACCOUNTTYPE1,REWARDAMOUNT1,CURRENTACCTAMOUNT1,ACCOUNTTYPE2,REWARDAMOUNT2,CURRENTACCTAMOUNT2,ACCOUNTTYPE3,REWARDAMOUNT3,CURRENTACCTAMOUNT3,ACCOUNTTYPE4,REWARDAMOUNT4,
CURRENTACCTAMOUNT4,ACCOUNTTYPE5,REWARDAMOUNT5,CURRENTACCTAMOUNT5,ACCOUNTTYPE6,REWARDAMOUNT6,CURRENTACCTAMOUNT6,ACCOUNTTYPE7,REWARDAMOUNT7
,CURRENTACCTAMOUNT7,ACCOUNTTYPE8,REWARDAMOUNT8,CURRENTACCTAMOUNT8,ACCOUNTTYPE9,REWARDAMOUNT9,CURRENTACCTAMOUNT9,ACCOUNTTYPE10,REWARDAMOUNT10,
CURRENTACCTAMOUNT10,BONUSVALIDITY1,BONUSVALIDITY2,BONUSVALIDITY3,BONUSVALIDITY4,BONUSVALIDITY5,BONUSVALIDITY6,BONUSVALIDITY7,BONUSVALIDITY8,
BONUSVALIDITY9,BONUSVALIDITY10,PREVIOUSSUSPENDSTOP "to_date(:PREVIOUSSUSPENDSTOP,'yy/mm/dd hh24:mi:ss')",
PREVIOUSDISABLESTOP "to_date(:PREVIOUSDISABLESTOP,'yy/mm/dd hh24:mi:ss')",AGENTNAME,ADDTIONALINFO,FILE_TIME,FILE_NAME,
ODATE "SYSDATE",ACCOUNT_2001 "CASE WHEN:ACCOUNTTYPE1='2001'THEN :REWARDAMOUNT1 WHEN :ACCOUNTTYPE2='2001' THEN :REWARDAMOUNT2
WHEN :ACCOUNTTYPE3='2001' THEN :REWARDAMOUNT3
WHEN :ACCOUNTTYPE4='2001' THEN :REWARDAMOUNT4
WHEN :ACCOUNTTYPE5='2001' THEN :REWARDAMOUNT5 END")
the above one succeed when i edit the case statement as follow
ACCOUNT_2001 "CASE WHEN:ACCOUNTTYPE1='2001'THEN :REWARDAMOUNT1 WHEN :ACCOUNTTYPE2='2001' THEN :REWARDAMOUNT2
WHEN :ACCOUNTTYPE3='2001' THEN :REWARDAMOUNT3
WHEN :ACCOUNTTYPE4='2001' THEN :REWARDAMOUNT4
WHEN :ACCOUNTTYPE5='2001' THEN :REWARDAMOUNT5
WHEN :ACCOUNTTYPE6='2001' THEN :REWARDAMOUNT6
WHEN :ACCOUNTTYPE7='2001' THEN :REWARDAMOUNT7
WHEN :ACCOUNTTYPE8='2001' THEN :REWARDAMOUNT8
WHEN :ACCOUNTTYPE9='2001' THEN :REWARDAMOUNT9
WHEN :ACCOUNTTYPE10='2001' THEN :REWARDAMOUNT10 END"
i got the Error sql loader 350 token longer than max allowable length of 258 chars .
note : i cant modify the table structure to shorten the column names .
please help me ....
thanlks
Edited by: user7998081 on Jun 23, 2011 3:24 AMRon Gittleman (guest) wrote:
: In migrating a Sybase 11 database to Oracle 8.0.5, there's a
: step toward the end of the data-moving endeavor in which a
script
: called genctl.scr is executed. This creates control files for
: 'sqlload'. For one-third or so of the source tables (.dat
files)
: sqlload complains about the control file:
: SQL*Loader-350: Syntax error at line 20.
: Token longer than max allowable length of 258 chars
: in_paid_period,15,6) -
Problem Summary
DG4ODBC: STRING DATA, RIGHT TRUNCATION ERROR WHILE ACCESSING VARCHAR(MAX) COLUMN
Driver
Microsoft® ODBC Driver 11 for SQL Server® - RedHat Linux
Problem Description
When selecting a MS SQL VARCHAR (max) column over a ODBC Gateway database connection I am getting this error from Oracle:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
[Microsoft][ODBC Driver 11 for SQL Server]String data, right truncation {01004}
ORA-02063: preceding 2 lines from <LINK_NAME>
The ODBC driver should map the varchar(max) column to SQL_LONGVARCHAR which would be appropriate for Oracle but the column is getting truncated
Issue
By default the SQL Server ODBC driver exposes the varchar(max) data type as a SQL_VARCHAR. When reporting the maximum size of a varchar(max) column, the driver returns 0, which is the Microsoft convention for "unlimited".
[ODBC][25518][1399527750.588980][SQLDescribeCol.c][497]
Exit:[SQL_SUCCESS]
Column Name = [raw_response]
Data Type = 0x7fffe3cbe1a4 -> 12
Column Size = 0x7fffe3cbe158 -> 0
Decimal Digits = 0x7fffe3cbe1ac -> 0
Nullable = 0x7fffe3cbe1b0 -> 1
DG4ODBC is unable to interpret a zero length as an "unlimited" size and returns an error when retrieving varchar(max) data.
FreeTDS and DataDirect ODBC drivers return SQL_LONGVARCHAR instead of SQL_VARCHAR with 0 precision. So there is no problem reported for these drivers.
Is there a fix for this or is the Microsoft ODBC driver team working on a fix for the driver regarding varchar(max)?
Regards,
JamesHi James,
Thank you for your question. I am trying to involve someone more familiar with this topic for a further look at this issue. Sometime delay might be expected from the job transferring. Your patience is greatly appreciated.
If you have any feedback on our support, please click
here.
Regards,
Elvis Long
TechNet Community Support -
Re: [iPlanet-JATO] Finding the database column length
This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
>This is the technique I would recommend. If you'd like to wrap this
mechanism up in the model class itself, create a subclass of QueryModelBase
that provides such a method and use that as the base class for all your
QueryModels.
Todd
----- Original Message -----
From: "Craig V. Conover" <craig.conover@S...>
Sent: Friday, October 19, 2001 12:15 PM
Subject: Re: [iPlanet-JATO] Finding the database column length
Chidu,
The result set that you get back is a JDBC ResultSet, not a "JATO" resultset. In ND, everything was wrapped in a "spider" data
structure, and therefore, difficult to get to the underlying datastructure, in many cases. In some case ND made it easier to do
certain things, and in other ways, made it more difficult or impossible(like seeing the SQL for an insert, update, delete).
>
Anyway, looking at the java.sql package, you can do this.
java.sql.ResultSet rs = <jata-model>.getResultSet();
java.sql.ResultSetMetaData rsMeta = rs.getMetaData();
// not sure if this is what you need, but it was the closest thing I couldfind
int colSize = rsMeta.getColumnDisplaySize(int column);
There are numerous other methods in the ResultSetMetaData interface thatmay be of use as well.
>
c
chidusv@y... wrote:
Hi,
How do I find out the length of a database column in a data model? In
NetDynamics, we can do dataobject.getDataField(<field
name>).getColumnLength(). Is it possible to achieve this in JATO
without using a resultset?
Thanks,
Chidu.
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>>
>>
>>
>>
>
>
>
For more information about JATO, please visit
http://developer.iplanet.com/tech/appserver/framework/index.jsp
>
>
>
>
>
>
> -
Increase the column lengths of excel sheet through abap
I developed a abap program and it was displayed the output.
So i need to display this out put in excel sheet.
for that I read the out put and placed in the excel,
the only problem is the column lengths are small
after download i am dragging the each column,
But i need to increase the each column by the program
How can I ?
I am using the following code
lastline = new_line_c + 13.
DO .
READ LINE sy-index LINE VALUE INTO it_read-excel.
APPEND it_read.
IF sy-index > lastline.
EXIT.
ENDIF.
ENDDO.
lastline = new_line_c - 38.
colm = ( length - 37 ) / 18.
colm = colm + 4.
FOR THE EXCEL CONVERTION
INCLUDE ole2incl.
DATA: w_cell1 TYPE ole2_object,
w_cell2 TYPE ole2_object.
*--- Ole data Declarations
DATA: h_excel TYPE ole2_object, " Excel object
h_mapl TYPE ole2_object, " list of workbooks
h_map TYPE ole2_object, " workbook
h_zl TYPE ole2_object, " cell
h_f TYPE ole2_object, " font
gs_interior TYPE ole2_object, " Pattern
worksheet TYPE ole2_object,
h_cell TYPE ole2_object,
h_merge TYPE ole2_object,
h_cell1 TYPE ole2_object,
range TYPE ole2_object,
h_sheet2 TYPE ole2_object,
h_sheet3 TYPE ole2_object,
gs_font TYPE ole2_object,
flg_stop(1) TYPE c.
*DATA: t_excel_bckord LIKE t_excel OCCURS 0 WITH HEADER LINE,
*t_excel_bcklog LIKE t_excel OCCURS 0 WITH HEADER LINE,
*t_excel_blkord LIKE t_excel OCCURS 0 WITH HEADER LINE.
TYPES: data1(1500) TYPE c,
ty TYPE TABLE OF data1.
DATA: it TYPE ty WITH HEADER LINE,
it_2 TYPE ty WITH HEADER LINE,
it_3 TYPE ty WITH HEADER LINE,
rec TYPE sy-tfill,
deli(1) TYPE c,
l_amt(18) TYPE c.
DATA: BEGIN OF hex,
tab TYPE x,
END OF hex.
FIELD-SYMBOLS: <fs> .
CONSTANTS cns_09(2) TYPE n VALUE 09.
ASSIGN deli TO <fs> TYPE 'X'.
hex-tab = cns_09.
<fs> = hex-tab.
DATA gv_sheet_name(20) TYPE c .
M A C R O Declaration
DEFINE ole_check_error.
if &1 ne 0.
message e001(zz) with &1.
exit.
endif.
END-OF-DEFINITION.
DATA: xy TYPE i,
xz TYPE i,
yz TYPE i,
ab TYPE i,
pterm TYPE i.
IF h_excel-header = space OR h_excel-handle = -1.
start Excel
CREATE OBJECT h_excel 'EXCEL.APPLICATION'.
ENDIF.
PERFORM err_hdl.
*--- get list of workbooks, initially empty
CALL METHOD OF h_excel 'Workbooks' = h_mapl.
PERFORM err_hdl.
SET PROPERTY OF h_excel 'Visible' = 1.
add a new workbook
CALL METHOD OF h_mapl 'Add' = h_map.
PERFORM err_hdl.
*GV_SHEET_NAME = '1st SHEET'.
gv_sheet_name = 'Price Comparison List'.
GET PROPERTY OF h_excel 'ACTIVESHEET' = worksheet.
SET PROPERTY OF worksheet 'Name' = gv_sheet_name .
index1 = 3.
LOOP AT it_read.
heading
IF sy-tabix < 4.
it_item = it_read.
IF it_item CS '-----'.
CLEAR it_item.
APPEND it_item.
ELSE.
IF sy-tabix = 1.
it_item+0(1) = deli.
ENDIF.
APPEND it_item.
ENDIF.
ENDIF.
headear data and item
IF sy-tabix > 4 AND sy-tabix < descline1.
it_item = it_read.
IF it_item CS '----'.
ELSE.
REPLACE ALL OCCURRENCES OF sy-vline IN it_item WITH deli.
APPEND it_item.
ENDIF.
ENDIF.
xy = 2.
xz = 38.
discount etc
IF sy-tabix >= descline1 AND sy-tabix < descline.
it_item = it_read.
it_item+12(1) = deli.
it_item+22(1) = deli.
it_item+43(1) = deli.
WHILE xy < colm.
xz = xz + 18.
it_item+xz(1) = deli.
xy = xy + 1.
ENDWHILE.
APPEND it_item.
ENDIF.
payment terms
xy = 2.
xz = 37.
pterm = descline + 6.
IF sy-tabix > descline AND sy-tabix < pterm.
it_item = it_read.
IF it_item CS '-----'.
CLEAR it_item.
APPEND it_item.
ELSE.
it_item+12(1) = deli.
it_item+15(1) = deli.
it_item+36(1) = deli.
WHILE xy < colm.
xz = xz + 17.
it_item+xz(1) = deli.
xy = xy + 1.
ENDWHILE.
APPEND it_item.
ENDIF.
ENDIF.
prepared by
lastline = pterm + 3.
IF sy-tabix >= pterm AND sy-tabix <= lastline.
it_item = it_read.
IF it_item CS '-----'.
ELSE.
it_item+0(1) = deli.
it_item+54(1) = ' '.
it_item+16(1) = deli.
APPEND it_item.
ENDIF.
ENDIF.
remaarks
yz = lastline + 10.
IF sy-tabix > lastline AND sy-tabix <= yz.
it_item = it_read.
it_item+0(1) = deli.
it_item+54(1) = ' '.
APPEND it_item.
ENDIF.
approved by
ab = yz + 5.
IF sy-tabix > yz AND sy-tabix < ab.
it_item = it_read.
IF it_item CS '-----'.
ELSE.
it_item+0(1) = deli.
it_item+54(1) = ' '.
it_item+14(1) = deli.
APPEND it_item.
ENDIF.
ENDIF.
ENDLOOP.
*--Formatting the area of additional data 1 and doing the BOLD
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the second row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 2
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the fourth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 4
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the fifth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 5
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
*Bold for the sixth row
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 6
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = colm.
CALL METHOD OF h_excel 'Range' = h_cell
EXPORTING
#1 = w_cell1
#2 = w_cell2.
*CALL METHOD OF gs_cells 'Select' .
GET PROPERTY OF h_cell 'Font' = gs_font .
SET PROPERTY OF gs_font 'Bold' = 1 .
DATA l_rc TYPE i.
CALL METHOD cl_gui_frontend_services=>clipboard_export
IMPORTING
data = it_item[]
CHANGING
rc = l_rc
EXCEPTIONS
cntl_error = 1
error_no_gui = 2
not_supported_by_gui = 3
OTHERS = 4.
CALL METHOD OF h_excel 'Cells' = w_cell1
EXPORTING
#1 = 1
#2 = 1.
CALL METHOD OF h_excel 'Cells' = w_cell2
EXPORTING
#1 = 1
#2 = 1.
PERFORM err_hdl.
CALL METHOD OF h_excel 'Range' = range
EXPORTING
#1 = w_cell1
#2 = w_cell2.
CALL METHOD OF range 'Select'.
PERFORM err_hdl.
CALL METHOD OF worksheet 'Paste'.
PERFORM err_hdl.
CALL METHOD OF h_excel 'QUIT'.
FREE OBJECT h_zl.
FREE OBJECT h_mapl.
FREE OBJECT h_map.
FREE OBJECT h_excel.Hello Ravi,
Thank you very much for your suggestions.. but still have some more doubts:
What i want to do is :
-->call report in background job with a selection criteria.
-->the output of the report should be trasnsfered to excel sheet
-->then the excel sheet should be sent to XI..
My doubts are:
-> is it possible with every report or we need some extra code to achieve this
-> If yes, then how exactly it should be done. can you please explain in more detail.
Thank you very much for your help.
Best Regards,
Jasmeet -
Need help in modifying the column length
Hi Experts,
I need to modify the length of a column from char(10) to char(5), but it's showing the error of:
ALTER TABLE appr_group_table MODIFY (APPR_TBLNO CHAR(5)) It's showing the below error:
ERROR at line 1:
ORA-01441: cannot decrease column length because some value is too bigI've checked in the dbase but there is no any value of this column having more than 5 characters:
SQL> SELECT APPR_TBLNO FROM appr_group_table;
APPR_TBLNO
ANTAB
ANTAB
ANTST
SCCTR
SOTAB
SOTAB
SOTAB
SOTAB
SOTAB
SOTAB
SOTAB
11 rows selected.Thnx in advance for helping me out.....char means fixed length variable. when you say char(10) oracle will reserve 10 places for your data. that means in your output what you are seeing as blank spaces are also considered as data. that is the reason, it is not allowing you to reduce the size.
better solution is to create new column with varchar2 or char(5) datatype and transfer this column data into new column and then drop original column. -
Set the column length in an sql query
Hi,
Is there a way to set the column length in a query without using sqlplus commands like row size and format column.
I'd like to do it just from the sql query itself.
select 'this is a test' from dual; Can I define the width of this column in the select statement
Cheers.Use RPAD,
SQL> WITH T
2 AS (SELECT 'this is test' str FROM DUAL
3 UNION ALL
4 SELECT 'this is a long test' FROM DUAL
5 UNION ALL
6 SELECT 'this is a long long long long test' FROM DUAL)
7 SELECT RPAD ( str, 20) str,LENGTH( RPAD ( str, 20)) len
8 FROM T;
STR LEN
this is test 20
this is a long test 20
this is a long long 20
SQL> G. -
How to decrease the column length in working time (CATS) table
Hi all,
Can you please tell me how we can decrease the column length in CATS table in the portal. Is it something we can do in webdynpro or in the back end.
Thanks in advance.
RK ReddyI was looking for something similar and ran across OSS Note 989453. I would recommend checking out this note to see if it helps. Apparently, there is a JAVA program error that makes the columns wider than they need to be.
We have not yet tried this so if you happen to use it, let me know how it works for you.
Mark Musser
County of Sacramento -
Column length of a LONG RAW column
How to find out the column length of a LONG RAW column, to compute the average row size in Oracle 7.3.4
Thanks.The Member Feedback forum is for suggestions and feedback for OTN Developer Services. This forum is not monitored by Oracle support or product teams and so Oracle product and technology related questions will not be answered. We recommend that you post this thread to the Database - General forum. General Database Discussions
OTN -
In Primavera Risk Analysis, the MIN. ML, MAX columns is for imput the minimum impact, most likely impact , maximum impact duration of a risk or the remaining duration for MIN, ML and adding remaining duration with maximum impact for MAX?
You are welcome. I'm glad you got it back up.
(1) You say you did the symbolic link. I will assume this is set correctly; it's very important that it is.
(2) I don't know what you mean by "Been feeding the [email protected] for several weeks now, 700 emails each day at least." After the initial training period, SpamAssassin doesn't learn from mail it has already processed correctly. At this point, you only need to teach SpamAssassin when it is wrong. [email protected] should only be getting spam that is being passed as clean. Likewise, [email protected] should only be getting legitimate mail that is being flagged as junk. You are redirecting mail to both [email protected] and [email protected] ... right? SpamAssassin needs both.
(3) Next, as I said before, you need to implement those "Frontline spam defense for Mac OS X Server." Once you have that done and issue "postfix reload" you can look at your SMTP log in Server Admin and watch as Postfix blocks one piece of junk mail after another. It's kind of cool.
(4) Add some SARE rules:
Visit http://www.rulesemporium.com/rules.htm and download the following rules:
70sareadult.cf
70saregenlsubj0.cf
70sareheader0.cf
70sarehtml0.cf
70sareobfu0.cf
70sareoem.cf
70sarespoof.cf
70sarestocks.cf
70sareunsub.cf
72sare_redirectpost
Visit http://www.rulesemporium.com/other-rules.htm and download the following rules:
backhair.cf
bogus-virus-warnings.cf
chickenpox.cf
weeds.cf
Copy these rules to /etc/mail/spamassassin/
Then stop and restart mail services.
There are other things you can do, and you'll find differing opinions about such things. In general, I think implementing the "Frontline spam defense for Mac OS X Server" and adding the SARE rules will help a lot. Good luck! -
How can we restrict Column length in ALV using POWL.
Hello,
I have a new assignment o ABAP Web Dynpro, data displaying ALV by using POWL is a part of that assignment. Everything went fine and at last moment I was stuck with a small issue. In my application I am displaying first ALV by using POWL concept and on the basis of selected row I am displaying second level LAV by using normal ALV procedure (SALV_WD_TABLE). Here the issue is as soon as second ALV is displaying columns in first level ALV are getting expanded. How can I restrict Column length in first level ALV using POWL. I browsed a lot for getting the solution for this, Can any one help me out from this issue.
Regards,
KumarDone, in field catalog method...
-
Export failure due to column length in DRM 11.1.2.1
Hi All,
We have migrated recently from 11.1.1.43 to 11.1.2.1 and the issue is with one of the exports
In the earlier version you have the option of manipulating the column length inspite of the actual length set in the table column. This can be edited in the column options when the table is selected at the last option of export.
Now the issue is i could see the length of the column in the 11.1.2.1 export option but i was unable to edit that length and reduce it to the required
Viz., i have the column length of 80 set in the table and in the export it is restricted to 50 in the old version. Now i'm unable to edit this in 11.1.2.1
Could anyone help me on this? I believe i may be missing some basics here
ThanksIn the earlier versions by default every property length is treated as 50 Characters while we export the data from DRM,
Now in the new version we need to alter the table before we export based on the property length,
Thanks,
Murali -
How to change (decrease) primary key column length?
Hi all,
I have plenty of data in the table and I need to decrease the primary key column from CHAR(17) to CHAR(13).
I try to use:
ALTER TABLE xx MODIFY (prmy_key (13));
but Oracle give:
ERROR at line 1:
ORA-01441: column to be modified must be empty to decrease column length
Can anyone give me advice on what is the best way to decrease column length? Thanks in advance for your help.To add to the above, I have done a simple test in the lines that I was suggesting the solution for this problem,
CREATE TABLE testA
(pk_col varchar2(20), jd date, constraint pk1 PRIMARY KEY(pk_col));
--Insert data into testA
create table testB as select * from testA;
TRUNCATE table testA;
ALTER TABLE testA modify(pk_col VARCHAR2(10));
INSERT INTO testA SELECT substr(pk_col, 1, 10), jd from testB;
DROP TABLE testB;
Select constraint_name, constraint_type, status from all_constraints
Where table_name = 'TESTA';
CONSTRAINT_NAME C STATUS
PK1 P ENABLEDAlter command is successful as the table is empty. TRUNCATE flushes the data and resets the high water mark keeping all the constraints. If we safely want to use the TRUNCATE as far as storage issues are concerned,
TRUNCATE table table_name reuse storage;
I think, this would accoplish what has been asked.
Let me know,
SriDHAR
Maybe you are looking for
-
Using OR with WHEN in .ctl file
Hello, Can I use OR with WHEN clause in .ctl file? I am trying to load txt file into oracle table. I used positions. INTO TABLE ABC WHEN ((814:834)!=BLANKS) OR ((934:938)!=BLANKS) DE_CASE POSITION(1:7) NULLIF DE_CASE=BLANKS, DE_WHERECODE POSITION(814
-
SQL Developer 3.1 EA3: ORA-01446: cannot select ROWID . . .
I'm running into a problem in 3.1 EA3 that I did not see in 3.0 (Oracle IDE 3.0.04.34). Both Installations are 64 bit using 64 bit Java under Windows 7 x64 SP1. When from either the "Connections" or "Schema" window I open some views and select th
-
Direct connection between 2 SPA9000
I'm considering on buying SPA9000. My question is: is it possible setup a call through 2 different SPA9000 located on different site directly, without using ITSP intermediary. Can a line on one SPA9000 be set to register to a line on another? Can I u
-
Jframe lose focus with jdk 1.4 beta90
My jframe has two JInternalFrame. One contains a jtree, another contains a jeditorpane. A jpopup menu will appear, after I click the jtree. After I finish the jpopupmenu action, my jeditorpane can not recieve any keyboard event. The only workaround i
-
Hi Is it possible to add a calender object in Oracle Reports Parameter form, if yes then how can we do it.... thankz