Modify Table column data type
Dear All,
We have one user contains more than 100 tables(Production). I need to change some of table columns data types without affect data's.
Please suggest me to do that.
Thanks in advance,
Moorthy.GS
Dear Sybrand,
Thanks for your reply.
I tried below ways to modify the datatypes.
1) Tried to modify datatype FLOAT to NUMBER while data is persists.
2) Tried to take a export of that user and import the dump without data's and modify the datatype. After that, i tried to import the dump with rows=y option. But it failed due to constraint problems.
Please advise...
Cheers,
Moorthy.GS
Similar Messages
-
Create List of Tables/Columns/Data Types
I am new to Oracle (from SQL Server) and I am looking for a query that will create a list of tables, columns, data types, etc. (data dictionary) in an Oracle database -- one that I can import into, say, MS Access or use Crystal reports and create a report that shows the same.
I had a query to do this in SQL Server -- but it was specific to SQL Server. Does anyone have one to do the same in Oracle? I'm hoping not to have to re-invent the wheel.
Thanks!Hi user653145!
The Data Dictionary has many queries to view informations. Some of these view are
dba_tables
dba_tab_columns
dba_views
etc.
Look for the "Oracle Database Referenc" in the Oracle Onlinedocumentation at
http://tahiti.oracle.com
to get a full list of all data dictionary views.
hope this helps! -
Hi, i am using Sybase IQ 16.0
I have created a table, when I want to change one of the data type for a column for example from char to varchar, the list box is grey color and not allow me to change.
Right click table > Properties > Columns > Data Type
I have granted all permission for dba, but still not able to edit. (please see the attached file)
Any help?
Thanks.Hi Nelson.
You can not change the datatype of an existing column.
The doc reference is here: Altering Tables
"After you create a column, you cannot modify the column data type. To change a data type, drop the column and recreate it with the correct data type."
If you already have data in the column, you can try this:
create the new column with a slightly different name
copy the data in to the new column
drop the original column
rename the new column to the old column's name.
--Kirby -
How to find the Column data type changes in table
Hi All,
I need to find out the column data type changes where made recently in table .
How do i check past changes in column data type. Any data dictionary are there to find out the data type changes in the column .
Thanks in advance..<FONT FACE="Arial" size=2 color="2D0000">
You have the answer on hand (user_arguments / all_arguments)!
SQL> desc user_arguments
Name Null? Typ
OBJECT_NAME VARCHAR2(30)
PACKAGE_NAME VARCHAR2(30)
OBJECT_ID NOT NULL NUMBER
OVERLOAD VARCHAR2(40)
ARGUMENT_NAME VARCHAR2(30)
POSITION NOT NULL NUMBER
SEQUENCE NOT NULL NUMBER
DATA_LEVEL NOT NULL NUMBER
DATA_TYPE VARCHAR2(30) --> Data Type
DEFAULT_VALUE LONG
DEFAULT_LENGTH NUMBER
IN_OUT VARCHAR2(9) -->Argument direction (IN,OUT,or IN/OUT)
DATA_LENGTH NUMBER
DATA_PRECISION NUMBER
DATA_SCALE NUMBER
RADIX NUMBER
CHARACTER_SET_NAME VARCHAR2(44)
TYPE_OWNER VARCHAR2(30)
TYPE_NAME VARCHAR2(30)
TYPE_SUBNAME VARCHAR2(30)
TYPE_LINK VARCHAR2(128)
PLS_TYPE VARCHAR2(30)
CHAR_LENGTH NUMBER
CHAR_USED VARCHAR2(1)
Look for Data_Type where IN_OUT say OUT. That will be the data type retruned by that function.
Edited :
or POSITION in argument list,or null for function return value
-SK
</FONT> -
Store the value in BLOB column data type
Hi All,
I have a file of about 5MB. I want to store this in BLOB column data type of a table.
Can we compress this file to store and when we take uncompress the same...or how do we do it.
and what is the procedure to store this....
pls. help me
Thanks,
NareshHi skud
i juast want to store the agent code to variable.if i did get ur point...
Why don't u just use a simple assign statment for example...
DECLARE
V_VALUE NUMBER;
BEGIN
V_VALUE := LC354 ; -- IF it was a value as LC354 static i mean
-- or u could use any value
V_VALUE := :ur_form_item_name; --- if it was dynamic
END;That's it .
Hope this helps...
Regards,
Ammatu Allah. -
How do I know the column data type
Hello,
For example I have created table Test:
SQL> create table Test(
2 rollNo number(3),
3 Name varchar2(80));
Table created.Now I desc Test but its not showing the column data type
SQL> desc test
Name
ROLLNO
NAME Can I know that?
Best regardsWhat happens when you issue,
set linesize 2000
SQL>desc testAre you sure that you are not missing scrolling the bar in the bottom of the window?
SQL*Plus: Release 11.2.0.1.0 Production on Sat Nov 20 19:23:01 2010
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> create table testr(test number(3), rollno varchar2(10));
Table created.
SQL> desc testr
Name Null? Type
TEST NUMBER(3)
ROLLNO VARCHAR2(10)Aman....
Edited by: Aman.... on Nov 20, 2010 7:24 PM -
4.0 EA1 - Data Modeler does not show columns data types correctly
Data Modeler shows all columns data types as 'unknown'.
Hi,
you need to check "system data types" directory and it contents. Its default location in SQL Developer is sqldeveloper\sqldeveloper\extensions\oracle.datamodeler\types
Check "Preferences>Data Modeler>Default system data types directory" setting. If it's empty then copy defaultdomains.xml from previous installation to directory above.
If it's not empty then you need to copy types.xml and defaultRDBMSSites.xml from default location to directory set as "Default system data types directory".
Philip -
How to call a stored procedure that has Table Of data types in VB6?
Hi everyone,
I need to call a stored procedure that has a Table Of data type as an input parameter (possibly even several Table Of input parameters). I can't seem to find any example of how to do this in VB6 using ODBC. Is this even possible?
Thanks you!
SteveThanks,
but I need to test stored procedures that uses type defined in the package.
e.g.
if I have s.p.
PROCEDURE get_risultati_squadra
( in_squadra IN VARCHAR2,
out_serie OUT tab_varchar2_5,
out_tiporisultato OUT tab_varchar2_5,
out_n_giornata OUT tab_varchar2_5,
out_squadre OUT tab_varchar2_200,
out_risultato OUT tab_varchar2_10,
out_marcatore OUT tab_varchar2_50,
out_punti OUT tab_varchar2_3,
out_rimbalzista OUT tab_varchar2_50,
out_rimbalzi OUT tab_varchar2_3,
out_esito OUT tab_varchar2_2);
I have to define every type external to the package, in this case five new TYPE !!
Is there another way to solve this problem?
Thanks -
Database adapter not importing table having data type as WF_EVENT_T
Hi All,
I have a requirement to import a table in the Database adapter. That table is having a column of data type “WF_EVENT_T”.
When I tried to import the table in database adapter I got the error as "The following tables are not supported in the Database Adapter and were not imported".
Then I modified the table by adding one more column with some other data type and tried to import that table.
It got imported successfully but I was not able to see the column with data type WF_EVENT_T in the table.
Any pointers to this would be of great help.
Thanks.Hi Harish
Thanks for your response.
I can create the table with the data type 'String'. However, the problem is when I try to update the table from a program in SE38 or a Function Module in SE37.
When I try to activate the PROGRAM or FUCNTION, I GET A MESSAGE THAT I MENTIONED EARLIER.
Here is the simple program that I have created that I am not able to activate
==========================================
REPORT ZTEST_STRING1.
tables: ztest.
ztest-zid = 2.
ztest-zstring1 = 'ABC'.
insert ztest.
===========================================
ztest has two fields
zid which is NUMC type
and zstring1 which is STRING type.
When I try to activate I get an error message as follows:
'ztest' must be a flat structure. You cannot use internal tables,
strings, references, or structures as components.
Edited by: Ram Prasad on Mar 20, 2008 6:08 PM -
Error when insert data in Sql Server table(DateTime data type)
Hello all,
I have created a database link in oracle 11g to SQL Server 2008 using Sqlserver gateway for oracle,Oracle run on Linux and SQL Server run on Windows platform.
I have queried a table and it fetches rows from the target table.
I am using this syntax for insert a row in Sql Server table.
Insert into Prod@sqlserver (NUMITEMCODE, NUMPREOPENSTOCK, NUMQNTY, NUMNEWOPENSTOCK, DATPRODDATE , TXTCOMPANYCODE, "bolstatus", NUMRESQNTY )
Values (1118 , 1390.0 , 100.0 ,1490 , '2012-06-23 12:37:58.000','SFP' ,0 , 0 );
but it give me error on DATPRODDATE,The data type of DATPRODDATE column in Sql Server is DATETIME.
My Question is how can i pass the date values in INSERT statement for Sql Server DateTime data type.
RegardsJust as with Oracle, you have to specify the date using the to_date() function or use the native date format for the target database (if you can figure out what that is). This is good practice anyway and a good habit to get into.
-
Need help :: how to search in nested table/varray data type
I have the following structure...
CREATE TYPE lang_con AS VARRAY(15) OF VARCHAR2(50);
CREATE TYPE rel_con AS VARRAY(15) OF VARCHAR2(50);
CREATE TABLE Country_n(
"NAME" VARCHAR2(40 BYTE) CONSTRAINT "COUNTRY_NAME_NOTNULL_N" NOT NULL ENABLE,
"CODE" CHAR(2 BYTE),
"CAPITAL" VARCHAR2(40 BYTE),
"PROVINCE" VARCHAR2(40 BYTE),
"POPULATION" NUMBER,
"AREA" NUMBER,
"LANGUAGES" lang_con,
"RELIGIONS" rel_con
after inserting data from 3 different table (country, language, religion) the table looks like this....
Cyprus cy Nicosia Government controlled area 775927 9250 VARCHAR(English,Greek,Turkish) VARCHAR(Greek Orthodox,Muslim)
Czech Republic cz Prague Prague 10246178 78866 VARCHAR(Czech) VARCHAR(Orthodox,Protestant,Roman Catholic)
Germany de Berlin Berlin 82424609 357021 VARCHAR(German) VARCHAR(Muslim,Protestant,Roman Catholic)
Djibouti dj Jibuti Jibuti 466900 23000 VARCHAR(Afar,Arabic,French,Somali) VARCHAR(Christian,Muslim)
Denmark dk Copenhagen Frederiksberg Kommune 5413392 43094 VARCHAR(Danish,Faroese,German,Greenlandic) VARCHAR(Evangelical Lutheran,Muslim)
now I want to get the countries in which german language is being spoken. Actually I need to know how to search in this custom data type of mine....I also need to perform other operation further so really need to know how can I search in this custom data type...
when I execute the following query....
select * from country_n cn where cn.languages like '%German%' order by name
I got the following error....
Error starting at line 1 in command:
select * from country_n cn where cn.languages like '%German%' order by name
Error at Command Line:1 Column:33
Error report:
SQL Error: ORA-00932: inconsistent datatypes: expected NUMBER got AHMADM.LANG_CON
00932. 00000 - "inconsistent datatypes: expected %s got %s"
*Cause:
*Action:
let me know please...looking forward to your replies....
Thanks,Hi,
Try this:
Connected to Oracle Database 10g Express Edition Release 10.2.0.1.0
Connected as hr
SQL>
SQL> SELECT t1.*
2 FROM country_n t1,
3 TABLE(t1.languages) t2
4 WHERE column_value LIKE '%German%';
NAME CODE CAPITAL PROVINCE POPULATION AREA LANGUAGES RELIGIONS
Germany de Berlin Berlin 82424609 357021 <Object> <Object>
SQL> Regards, -
Target Site Column Data Type are Undefined Status
Hi,
When I created the mapping,there was a error about data type. Data types of columns were not changed, and datatypes status are undefined.
I take this error as below;
com.sunopsis.tools.core.exception.SnpsSimpleMessageException: The source datatype is null for the column: <ColumnName>, and the technology: Hyperion Planinng
ODI 10.1.3.5
SQL Server 2005
Hyperion Planning 11
How can I changed the datatypes? Is there a problem with hyperion planning site? How can assign the data types?
thanks.First of all the error you posted
"The source datatype is null for the column: <ColumnName>, and the technology: Hyperion Planinng"
Which points to Hyperion planning....
Anyway, if as you say it is file to SQL Server, check the DataStore for the reversed SQL server table, check the columns have a Type assigned to them
Cheers
John
http://john-goodwin.blogspot.com/ -
Data Mining - Scalar Mining Structure Column Data type error...
Hoping someone will have a solution for this error
Errors in the metadata manager. The data type of the '~CaseDetail ~MG-Fact Voic~6' measure must be the same as its source data type. This is because the aggregate function is not set to count or distinct count.
Is the problem due to the data type of the column used in the mining structure is Long, and the underlying field in the cube has a type of BigInt,or am I barking up the wrong tree?You're right the error does occur when processing the mining model. I've built a simple mining structure to look into the problem - its just a decision tree based on a cube. The cube itself has a single Fact table, with numerous related dimensions. It has two measure groups - one for the use of distinct count, in the other group the aggregation functions used are count and sum.
The measure which seems to be causing a problem uses the sum aggregation in the cube. The underlying table has this field as a BigInt, which was used due to round issues on the cubes when the original Int datatype was used.
In the mining model the same field appears as a Continuous with datatype of Long. It has been tried in various guises as predictonly, and ignore modes both with the same results.
The mining model used to work without a problem when the underlying type was an Integer, but then the cube would report the wrong figures.
Interestingly, when I build a mining model directly against the source data there were no problems.
Let me know if you need any further information.
Thanks -
Direct Database Request - Incorrect Column Data type
Hello All -
hope you can help with this. I'm using the Direct Database Request in Oracle BI to send a complex query directly to our data warehouse. My problem is that the result columns containing my measures are converted to integer by Oracle BI when they should be double. The integer conversion causes decimal values to be rounded, reading to incorrect results in my reports. I've tried several tweeks to my query in an attempt to allow OBIEE to make the correct guess on the data type but nothing has worked.
Is there a way to force OBIEE to recognize the correct data type for a column in a Direct Database Request Query?
Thanks in advance for you help!
MacThank you both.
David's response was helpful from a style/readability perspective (the columns in question were complex expressions) but I had already attempted the approach and it hadn't solved the formatting issue. Nico's response solved the problem.
Regards,
Mac -
How to enter values to a database table with data type 'LCHR'?
Hello All,
I have created a database table with five fields, of which the last field is 'Value' field in which i have to enter text with a maximum of 1000characters. I have also specified a 'Length' field preceding the 'Value' field.
The datatype specified for the 'Length' field is 'INT2' and for the value field is 'LCHR' with length 1000.
When i tried inserting values to the table through a report, the report is giving an error that 'Literals that take up more than one line are not permitted', which means 255characters.
Also, when i entered a short text which is less than 250 characters to the 'Value' field,, the report is working fine and the table entry is visible.
Can anyone help me in this?
It would be really helpful if you explain how to use 'LCHR' data type in tables and how to enter values to such a field with more than 255characters.
Thanks in Advance,
ShinoHi shino,
Alternatively,
you can use STRING instead of LCHR.
I too have tried with LCHR and am facing the same issue.. i am not sure why its coming..
i have tried STRING and its working perfectly.
wa-key_field = 'IN4'.
CONCATENATE 'Long text over 200 chars length '
'another Long text over 200 chars length '
'another Long text over 200 chars length '
INTO wa-long_text.
wa-len = strlen( wa-long_text ).
INSERT zshino_table from wa.
SELECT * FROM zshino_table INTO table it.
clear wa.
LOOP AT it INTO wa.
WRITE:/ wa-len, ' ' , wa-long_text.
ENDLOOP.
Also, remember to set the type of the database field as String.
hope this was of some help,
thanks and regards,
Sagar.
Maybe you are looking for
-
Searching for Nonprinting Objects
Is it possible to do a search for objects with an attribute set to Nonprinting? I have this odd problem: I work on a magazine, and we insert a little custom endmark image at the end of each story. For some reason, whenever anyone edits that story i
-
ServiceLayer.exe 100 % after switch off cable from...
Hi all I have problem with Nokia PC Suite. WinXP S2 Nokia PC Suite 6.84.10.3 cz non-nokia cable ca42usb Nokia 3220 After i switch off cable from my USB port servicelayer.exe take me 100 % of PC process. I must CTRL+ALT+DEL and shutdown this process.
-
hi, I am trying to make a hash of hashes to store various runtime attributes. This hash of hashes is stored in an object that is accessed by multiple server threads as well as being accessed by a timer thread every two minutes. The data is of the for
-
How can I tell what exactly is being distributed from the SCCM server to a client
Hi, If I know an IP Address of a client machine, is there a way I can see what SCCM is exactly sending to that particular machine at that moment in time? thanks.
-
I purchased my daughter the new ipod. I downloaded the latest version of itunes. After syncing the ipod, all my songs appear grayed out. They have an exclamation point next to them. Even the ones I purchased from itunes. How do I get my songs back?