Probs in modifying datatype of column!
hi there..
am having a table without data..as
Name Null? Type
FIRST_NAME VARCHAR2(15)
LAST_NAME CHAR(50)
ADDRESS CHAR(50)
CITY CHAR(50)
COUNTRY CHAR(25)
BIRTH_DATE DATE
now i need to change the data type of column char in to varchar2(15)..
in single step...not by..
alter table customer
modify first_name varchar2(15);
this takes so many steps for each column to modify..
plz guide me..
As a general rule you will get a better response to SQL questions in the Oracle PL/SQL forum
PL/SQL
For an answer and example for this specific question you can check out this website:
http://www.dba-oracle.com/t_alter_table_modify_column_syntax_example.htm
Similar Messages
-
Modifying datatype of columns across multiple tables
Hi,
I have a requirement where-in I have to modify the datatypes of columns across multiple tables. Is there any direct way to do this? I mean does oracle has any function or in-built functionality to achieve this.
Example;
Table1 -> col1 datatype needs to be changed to varchar2(10)
Table2 -> col2 datatype needs to be changed to varchar2(30)
Table3 -> col3 datatype needs to be changed to number.
and so on....
Do we have such functionality?
Thanks,
IshanHi Aman,
Seeing the replies, I think I was unclear in the requirements. But I guess you understood it fully, but still I would like to restate my question once again, just to be 100% sure.
What I actually want is that in one shot, I would be able to modify columns of multible tables.
eg, table1-> col1 changed to varchar2(20);
table2->col2 changed to varchar2(10)
table3-> col3 changed to number;
I know how to do it individually, but just wanted to check, if only one command can modify the datatypes of multiple tables/.
If not, I have already written half the script, but just for knowledge sake wanted to check if some feature is available in oracle for that.
Regards,
Ishan -
How do I modify the Title Column of a Task List using JSLink
I would like to modify the title column of a Task List in SharePoint 2013. I would like to make the title column different colors based on a selection in another field. For some reason I can run the TitleRendering function
on a different filed and it works perfectly, but when I try to run it on the Title field it is completely ignored. Is there some kind of work around for this?
var taskSample = taskSample || {};
taskSample.CustomizeFieldRendering = function () {
RegisterSod('hierarchytaskslist.js', '/_layouts/15/hierarchytaskslist.js');
LoadSodByKey('hierarchytaskslist.js', null);
// Intialize the variables for overrides objects
var overrideCtx = {
Templates: {
Fields: {
"Title": {
'View' : taskSample.TitleRendering
// Register the override of the field
SPClientTemplates.TemplateManager.RegisterTemplateOverrides(overrideCtx);
taskSample.TitleRendering = function (ctx) {
var output = [];
switch(ctx.CurrentItem.Unit) {
case "Unit 1":
output.push('<span style="color: blue;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
case "Unit 2":
output.push('<span style="color: green;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
case "Unit 3":
output.push('<span style="color: red;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
case "Unit 4":
output.push('<span style="color: yellow;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
case "Unit 5":
output.push('<span style="color: orange;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
case "Unit 6":
output.push('<span style="color: pink;">');
output.push(ctx.CurrentItem.Title);
output.push('</span>');
break;
default:
output.push(ctx.CurrentItem.Title);
break;
return output.join('');
taskSample.CustomizeFieldRendering();Hi,
Per my understanding, the TitleRendering function is not been applied to the Title column of the Task list.
I suggest you replace the “Title” with “LinkTitle” in your .js file:
var overrideCtx = {
Templates: {
Fields: {
"LinkTitle": {
'View' : taskSample.TitleRendering
In IE Developer Tools, we can see that the “name” attribute of the Title column is “LinkTitle”:
Best regards
Patrick Liang
TechNet Community Support -
How to modify a table column name
Hi all,
How to modify a table column name...
Thankscould type the command here... but will not do that..because you are supposed to read the docs.
You can find the command here..
http://www.faqs.org/docs/ppbook/r22871.htm
Regards,
G. -
How can you modify the displayed columns on a Related Information List?
How can you modify the displayed columns on a Related Information List? For example, how could you add the "Type" column to the List of columns displayed for Service Requests when you are viewing the Contacts Detail page?
ThanksI'd have to say I think this is one of the biggest flaws in the OnDemand system currently. The solution I have come up with is to create reports and put them in webapplets showing the data I want to show. I have then removed the standard Related Info List Objects and added weblinks to create new records as the button on the List object is also gone.
Keep in mind that doing this does slow things down a little, so it may not work if you have a big user base.
RWB. -
How to modify primary key column?
I want to modify one primary key column, But TT reported error.
How do I modify primary key column? Thanks first.In TimesTen, the values in primary key columns cannot be updated (except for the trivial case where you update the value to the same value as it currently has). If you want to change the values stored in primary key columns the application must insert a new row with the new key values (and of course values for the other columns) and then delete the old row.
Chris -
SQL*Loader-418: Bad datafile datatype for column XMLDOC
Hi,
I am trying to load a xml document into a xmltype column in a table using SQL*Loader and I receive this error:
SQL*Loader-418: Bad datafile datatype for column XMLDOC
My ctl is:
LOAD DATA INFILE 'marginalpdbc_xml_20030529.xml'
APPEND INTO TABLE PRUEBA_CARGA
( XMLDOC LOBFILE (CONSTANT 'marginalpdbc_xml_20030529.xml')
TERMINATED BY EOF,
NOMBFICH CONSTANT 'marginalpdbc_xml_20030529.xml' )
And the table is:
create table prueba_carga (NOMBFICH VARCHAR2(200),xmldoc xmltype);
What is wrong with my ctl?
I am using SQL*Loader: Release 9.2.0.1.0 and Oracle9i Enterprise Edition Release 9.2.0.1.0
Thanks in advance.Looks like there is data which takes > 8 digits for the 'DTE_ADDED' column.
Plz check that first.
Can you provide a couple of lines of data for sampling ??? -
APEX don't allow modify rows in columns which are Primary Key ?
I have tables:
http://img508.imageshack.us/my.php?image=21269582oe8.jpg
book(id_book - "Primary Key", title, year); book_author(id_book - "Primary Key", id_author - "Primary Key"); author(id_author - "Primary Key", name)
I have created a new page -> Form -> Tabular Form for table 'author' because I would like to add new authors, modify and delete. During creating this page I have choosen column 'id_author' as 'primary key column 1' and everything is OK (I can't modify column 'id_author' - this column is autoincrement and I can modify column 'name').
BUT I have also created a new page -> Form -> Tabular for table 'book_author' because I would like to write numbers as id_book and id_author, modify and delete them (so add relations between tables: book, book_author and author). During creating this page I have choosen column 'id_book' as 'primary key column 1' and 'id_author' as 'primary key column 2'. And on website I can't modify (edit) these fields. And I can't also add new row because I see in each column in new row: (null).
http://img444.imageshack.us/my.php?image=11324615yk9.jpg
APEX don't allow modify rows in columns which are Primary Key ? This is stupid....... What can I do ?
Edited by: user10731158 on 2008-12-20 11:40Single-column and non-meaningful so you never want to update them. In the case of your example, you would need to add an ID column to the book_author intersection table. Honestly, I was so blown away (and pleasantly surprised) by the lack of rebuttal and the "thx" that I went ahead and put together an example of how I would define the book_author table:
create table book_author
(id varchar2(32),
book_id varchar2(32),
author_id varchar2(32),
modified_on date,
modified_by varchar2(255),
constraint book_author_pk primary key (id),
constraint book_auth_book_fk foreign key (book_id) references books(id),
constraint book_auth_author_fk foreign key (author_id) references authors(id)
create unique index book_author_uq on book_author (book_id,author_id)
create or replace trigger biu_book_author before insert or update on book_author
for each row
begin
if inserting then
:new.id := sys_guid();
end if;
modified_on := sysdate;
modified_by := nvl(v('APP_USER'),user);
end;
/Good luck,
Tyler -
I have been using PowerPivot for a couple of months now and whilst it is extremely quick when pulling in data to populate Pivot Tables, it is extremely slow to make the following kind of changes to the Data Model:
- Add a Measure / Calculated Field
- Add a Calculated Column
- Rename a Calculated Field
- Re-name a Calculated Column
- Modify a relationship
- Change a tables properties
- Update a table
In the status bar of excel I get a very quick 'calculating', then it spends a lot of time 'reading data',
then it 'finalises' after which nothing is in the status bar but it still takes approx. 45 seconds before the program becomes responsive again. This waiting time does not change depending on the action, it is the same if I rename a
column as it is if I add a new measure.
My question is what affects performance of these actions and how do I improve it?
To give you an idea of where my data comes from, I have:
- 7 tables that feed into the Data Model directly from within the workbook which contains the data model itself. These are a combination of static tables and tables that connect to a MySQL database.
- 6 separate workbooks which contain static data that is updated manually periodically (copied and pasted from another source)
- 5 separate workbooks which contain dynamic tables that are linked to our MySQL database and update when opened.
Now I realise that this is probably where my issue is, however I have no idea how to fix it. You do not seem to be able to connect to a MySQL database directly within the PowerPivot window itself so there is no way to generate and update tables without
first creating them either in a worksheet or separate workbook (as far as I know). If I try to create all of the tables directly within the single workbook containing the Data Model I get performance and crashing issues hence why I separate tables into
individual workbooks.
Any advice on how to improve performance would be tremendously appreciated. I'm new and keen to learn, I'm aware this set-up is far from best practice.
Hardware wise I am using:
- Windows 8 64-bit
- Excel 2013 64-bit
- Intel Core i7 processor
- 6 GB Ram
Thanks,
JamesDarren,
I think the point I was making is its in memory, geez... BTW what do all applications do when they run out of paged memory, if PowerPivot is using all available memory then wouldn't this force the other applications to use Virtual or essentially write
back and forth to the disks? I think Virtual memory white to disk ??, lol Also, there are parts if the architecture of Excel 2013 that when importing data into PowerPivot require memory and when working in SharePoint the PowerPivot data is cached to disk
unless recently refreshed... But this conversation isn't help the James who asked the question and as much as I would love to continue its become a little boring..
Hi James,
If you download one the ODBC MySQL Connectors
http://dev.mysql.com/downloads/connector/odbc/ and I believe yours is the first one for x64 systems and connect directly to the data you should be able to reduce the number of workbooks your opening and if you notice in the following graphic these
connection are automatically refreshed by default, the parts in red are the differences between PowerPivot 2010 and 2013
You should notice a lot of improvement especially when refreshing data please let us know how it goes...
After registering the ODBC Driver
Click Add. on the User-DSN sheet, choose the “MySQL ODBC 5.x driver”, fill in the credentials, choose a database (from the select menu) and a data source name and you’re done.
Back in Excel you go on the PowerPivot section of the ribbon and open the PowerPivot window (the green icon on the left side). In the ‘Home’ section of that window you will see a small gray cylindrical symbol (the international
symbol for “database”) which will suggest to you different data sources to choose from. Take the one where it says “ODBC”.
In the next dialog you click on create, choose the adapter, and then Ok. Back in the assistant you can check the connection and proceed.
Now you have the choice between importing the data from tables using the import assistant or Query depends on your skillset..
Cheers,
Ivan
Ivan Sanders <a href="http://www.linkedin.com/in/iasanders">My LinkedIn </a> , <a href="http://msmvps.com/blogs/ivansanders">My Blog</a>, <a href="http://twitter.com/iasanders"> @iasanders</a>,
<a href="http://shop.oreilly.com/product/0790145372703.do">BI in SP2013</a>, <a href="http://sharepointdemobuilds.codeplex.com">SP2013 Content Packs</a>. -
Datatype of columns in a table
How do I get the data type of a column without using data dictionary?
Is there any generic construct to find the datatype which will work for SQL Server and Oracle?How do I get the data type of a column without using data dictionary?You can't.
Is there any generic construct to find the datatype which will work for SQL Server and Oracle? None that I'm aware of.
Cheers, APCE -
Can you modify the default columns displayed in standard lists?
Hi,
Is it possible to changes the columns displayed in the standard out of the box lists? e.g. All Companies.
After making our customisations most objects need to have their standard list columns modified and I do not really want to have to re-create all the standard lists we want to use in order to get relevant columns displayed?
Thanks for the help.Hi,
I don't believe you can modify the out of the box lists without recreating them.
Not sure if this will work for you, but a possible workaround would be to use Search Layouts to achieve your desired result. For example, if you were to modify the Search Layout for accounts to reflect all the relevant columns you need to display, then a simple search for "*" as the Account Name would result in a search for All Accounts in the list format you wish to see.
Hope this helps.
Regards,
Cameron -
Multiple datatype casted column to be displayed
Hi All,
I have a column which is VARCHAR at database level, but it will be having both numbers and chars in the column. for example
pay_scale
11
22
33
44
normal
high
now, my requirement is when the column value is a number i need to display {first digit of number} * 100, if column value is string then display the string value.
I have written the query this way:
SELECT
CASE
WHEN SUBSTR(pay_scale,1,1) IN ('0','1','2','3','4','5','6','7','8','9')
THEN CAST(pay_scale AS NUMBER) * 100 ELSE pay_scale
END as c3
FROM pay_grade;
but this results in following error:
ORA00932: inconsistent datatypes: expected number got char
Thanks,
Sreekanth.JUPS wrote:
I have a column which is VARCHAR at database level, but it will be having both numbers and chars in the column.OK, so you have a poorly designed table. Any chance you can fix it? If not, you're going to have a host of problems later on.
now, my requirement is when the column value is a number i need to display {first digit of number} * 100, if column value is string then display the string value.
I have written the query this way:
SELECT
CASE
WHEN SUBSTR(pay_scale,1,1) IN ('0','1','2','3','4','5','6','7','8','9')
THEN CAST(pay_scale AS NUMBER) * 100 ELSE pay_scale
END as c3
FROM pay_grade;
but this results in following error:
ORA00932: inconsistent datatypes: expected number got charAll rows in the result set need to have the same data type. So you would need to return a string for every row.
If we can assume that the first character indicates whether the data is numeric (i.e. you don't have to worry about data like '100abc234'), you could do something like
SELECT
CASE
WHEN SUBSTR(pay_scale,1,1) IN ('0','1','2','3','4','5','6','7','8','9')
THEN SUBSTR(pay_scale,1,1) || '00'
ELSE pay_scale
END as c3
FROM pay_grade;Justin -
Hi Oracle Experts,
I have a challenging question . Lets say I have two table with same name, but these two tables comes from two different databases with 2 different users.
Source Database A and User SCOTT
Table
Column
Data_Type
Length
Precision
Scale
Primary Key
Nullable
Default
Comment
BOOKS
BOOK_ID
Varchar2
4
1
ISBN_10
Varchar2
13
yes
PRICE
Number
6
2
yes
Target Database B and User DAVID
Table
Column
Data_Type
Length
Precision
Scale
Primary Key
Nullable
Default
Comment
BOOKS
BOOK_ID
Varchar2
20
1
PRICE
Number
6
2
yes
TITLE
Varchar2
50
yes
What I want to do:
I want to get a query script that shows which columns need to modify, add and drop depends on source table (Make any necessary changes to make Target table columns same as Source table columns) . No need to do any changes in the database only want to see the query that needs to run for making these changes.
EXAMPLE: I was using below query to get EMP table creation query. But seeing column information to create same column for other user is hard:(
select dbms_metadata.get_ddl ('TABLE', 'EMP') from dualTools > Database DIFF
Use the object selector to only compare BOOKS
You'll get an ALTER Script as part of the results. -
Modify sytem table column title
Hi Experts,
I want to modify system form (A/R invoice). I need to change column title in this system form.
Help me please.Hi,
You may check this thread first:
Re: Change statictext caption
Thanks,
Gordon -
Cannot modify datatype of mapped attribute
com.sap.tc.webdynpro.progmodel.context.ContextException: MappedAttributeInfo(DisplayEmpLeave.Year): must not modify the datatype of a mapped attribute
IWDAttributeInfo attinfo=wdContext.getNodeInfo().getAttribute("Year"); ISimpleTypeModifiable modinfo=attinfo.getModifiableSimpleType();
IModifiableSimpleValueSet valset=modinfo.getSVServices().getModifiableSimpleValueSet();Hi,
It is not possible to map the this variable to a controller.
So if u remove the mapping, the code will work.
For that, right click the atrribute <b>"Year"</b>->Delete Context Mapping.
If u want to pass the value to controller, create one context variable of type string, map it to controller and get the value from the variable <b>Year</b> to this
Regards
Fahad Hamsa
Maybe you are looking for
-
Time Capsule 2TB interoperability with existing home network
Can I still use Time Machine backing up to my 2B Time capsule if it is LAN wired to a Netgear router? I am using my Netgear router as the primary and wireless device. I have my TimeCapsule Wired via a lan port. I mostly want to use the time capsule
-
3Gs No Longer Recognized in Third Party Software
For years now I've plugged my iPhone 3Gs into my Mac and downloaded the images and video from it into programs like Photomechanic, Adobe Lightroom, Image Capture, etc... Sometime within the past 3 months this functionality has quit. None of the above
-
Hi all I write a simple application use html + js to display something locally, the files to be displayed is in the device ,it is ok in iOS 4.2 & 4.3 but not work correctly in iOS 5.0.1. why?
-
MainStage 2.2.1 - CPU issues with old MacBook
I just downloaded MainStage 2 for my trusty old MacBook - it's 2.0GHz Core Duo, 2GB... best spec you can make it really. I use it to run both Ableton Live and Garageband with absolutely no problems... The CPU handles both apps fine, unless I have som
-
I can't find where to enter my activate code for Apple TV
I cannot find where to enter my Apple TV activation code on my I-Pad.