Sql: how to alter a type of a filed

Hi all,
Quick question, how can I change a type of a field with a sql statment.
I have my username set to varchar(50) and i want to expend it to (300);
thanks
peter

If you can do it in your database, it will likely be with SQL like:
ALTER TABLE table_name MODIFY username VARCHAR2(300)The syntax and limitations vary from database to database and version to version; in some versions of Oracle, you can increase the size of a VARCHAR2 but not decrease it. In MySQL, such an alteration is made by copying the entire table to a temporary table and back again, which is slow for large tables.
You should find a SQL reference for your database.
MySQL
http://dev.mysql.com/doc/mysql/en/alter-table.html
Oracle
http://download-east.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_3001.htm#sthref3982

Similar Messages

  • SQL - How to check data type definition

    Is it possible to check (inside SQL statement) how particular field is defined. Is it VARCHAR2(5) or VARCHAR2(10)

    If by field you mean column, then use USER_TAB_COLUMNS, ALL_TAB_COLUMNS or DBA_TAB_COLUMNS:
    SELECT  TABLE_NAME || '.' || COLUMN_NAME || ' ' || DATA_TYPE ||
            CASE
              WHEN DATA_TYPE LIKE '%CHAR%' THEN '(' || DATA_LENGTH || ')'
              WHEN DATA_TYPE = 'NUMBER' THEN '(' || DATA_PRECISION  || ',' || DATA_SCALE || ')'
            END X
      FROM  USER_TAB_COLUMNS
      WHERE TABLE_NAME = 'EMP'
      ORDER BY COLUMN_ID
    X
    EMP.EMPNO NUMBER(4,0)
    EMP.ENAME VARCHAR2(10)
    EMP.JOB VARCHAR2(9)
    EMP.MGR NUMBER(4,0)
    EMP.HIREDATE DATE
    EMP.SAL NUMBER(7,2)
    EMP.COMM NUMBER(7,2)
    EMP.DEPTNO NUMBER(2,0)
    8 rows selected.
    SQL>   SY.

  • How to handle DATE type problems in migrating from mysql to oracle.?

    Hi,
    I'm migrating only the data from mysql to oracle with the help of sql loader.But with this type i cannot able to insert the date values from mysql to oracle.In mysql i have defined date as "DATETIME" type and in oracle it is in TimeStamp.Whenever i'm inserting the values thru CTL file ,i'm getting an error invalid date format entered.How to solve this problem?
    Thanks in Advance
    JAI

    you need to supply a mask to the timestamp entry. see http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14215/ldr_field_list.htm#i1006714 for details on datatypes within the ctl file
    B

  • Creating Web service for PL/SQL Procedure with Complex Data Types

    I need to created web service for PL/SQL Procedure with Complex Data types like table of records as parameters, how do we map the pl/sql table type parameters with web service, how to go about these?

    Hello,
    When you are creating a service from a Stored Procedure, the OracleAS WS tools will create necessary Java and PL wrapper code to handle the complex types (table of record) properly and make them compatible with XML format for SOAP messages.
    So what you should do is to use JDeveloper or WSA command line, to create a service from your store procedure and you will see that most of the work will be done for you.
    You can find more information in the:
    - Developing Web Services that Expose Database Resources
    chapter of the Web Service Developer's guide.
    Regards
    Tugdual Grall

  • How to alter username

    how to alter username

    Hi,
    This is not directly possible by any sql command,so for doing this
    1.create a new user as per your requirement.
    2.create export of existing user.
    3.import existing user data into newly created user.
    so all this will be possible by Exp/Imp.
    Thanks
    Kuljeet Pal Singh

  • Deploy resulset of PL\SQL function, that returns ANYTABLE%TYPE

    How can deploy resulset of PL\SQL function, that returns ANYTABLE%TYPE in SQL?

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by angelrip:
    Hello everyone,
    I've come through the following problem:
    1.- I created an PL/SQL stored procedure which returns a REF CURSOR element, definition looks like this:
    PACKAGE PKG_LISTADOS AS
    TYPE tuplas IS REF CURSOR;
    /* Procedimientos exportados por el paquete */
    PROCEDURE inicializarModuloListados;
    FUNCTION recaudacionUltimoMes(medioPago DEF_MEDIO_PAGO.MEDIO_PAGO%TYPE)
    RETURN tuplas;
    2.- Now I would like to call the stored procedure and retrieve the PL/SQL cursor as a ResultSet Java Object. The code I wrote is this:
    Connection conn;
    XmlDocument paramDef;
    conn=poolMgr.getConnection str_poolDBConnection);
    try
    CallableStatement cstmt=conn.prepareCall("{?=call PKG_LISTADOS.recaudacionUltimoMes(?)}");
    cstmt.registerOutParameter(1, java.sql.Types.OTHER);
    cstmt.setString(2, "MONEDA");
    cstmt.executeQuery();
    ResultSet rs=(ResultSet)cstmt.getObject(1);
    catch(SQLException sqlE)
    3.- However, I can't make it OK, all the time I get the following error:
    SQL Error(17004), java.sql.SQLException: Non valid column type
    May anyone help me with this, thanks in advance:
    Miguel-Angel<HR></BLOCKQUOTE>
    Do something like the following:
    cstmt = conn.prepareCall("{call customer_proc(?, ?)}");
    //Set the first parameter
    cstmt.setInt(1, 40);
    //Register to get the Cursor parameter back from the procedure
    cstmt.registerOutParameter(2, OracleTypes.CURSOR);
    cstmt.execute();
    ResultSet cursor = ((OracleCallableStatement)cstmt).getCursor(2);
    while(cursor.next())
    System.out.println("CUSTOMER NAME: " + cursor.getString(1));
    System.out.println("CUSTOMER AGE: " + cursor.getInt(2));
    cursor.close();
    null

  • How to get storage type of XMLType through OCI

    How can you get the storage type of an XMLType through OCI? An XMLType column can be created as BINARY, CLOB, or OBJECT RELATIONAL type, is there any way to get this information through OCI? SQLPlus seems to know how to detect these types with the DESCRIBE command, is it possible to get this information programmatically?
    SQL> describe T_SRC_XML_COL_CLOB_UTF8;
    Name Null? Type
    COL1 NOT NULL NUMBER(8)
    COL2 SYS.XMLTYPE
    SQL> describe T_SRC_XML_COL_BINARY;
    Name Null? Type
    COL1 NOT NULL NUMBER(8)
    COL2 SYS.XMLTYPE STORAGE BINARY
    SQL> describe T_SRC_XML_COL_OBJECT;
    Name Null? Type
    COL1 NOT NULL NUMBER(8)
    COL2 SYS.XMLTYPE(XMLSchema "http:
    //www.oracle.co
    m" Element "Parent") STORAGE
    Object-relational TYPE "Par
    ent808_T"

    Hi,
    Here's one possible (simplified) way to determine this (assumes all handles allocated, etc):
    - get a describe handle for table via OCIDescribeAny
    - get parameter handle via OCIAttrGet on the describe handle
    - get number of columns in table via OCIAttrGet on the parameter handle
    - get column list handle via OCIAttrGet on the parameter handle
    - loop for the number of columns
    - use OCIAttrGet to get the column data type
    - use OCIAttrGet to get if the column is a specific storage type
    Here's what the part to determine if the columns is a specific storage type would look like:
    ** determine if storage type is binary for this xmltype column
    rc = OCIAttrGet((void *) p_col,
                    OCI_DTYPE_PARAM,
                    (void *) &colstorage,
                    (ub4 *) 0,
                    (ub4) OCI_ATTR_XMLTYPE_BINARY_XML,
                    p_err);If the column is declared to have binary xml storage then colstorage will be set to 1 after the call, 0 if not.
    OCI_ATTR_XMLTYPE_BINARY_XML is from oci.h (as well as OCI_ATTR_XMLTYPE_STORED_OBJ)
    Perhaps that will be enough to get you what you need.
    Regards,
    Mark

  • How do i add type kit fonts to muse web site

    how do I +add type kit fonts to muse website

    Hi.
    Check this video, might be helpful
    Let me know if you have any questions

  • How to connect PCMCIA Type II card to my Satellite A200?

    I have Satellite A200-19L (NEW) laptop
    could you guide me how to connect a ( Type II PCMCIA Card ) to my laptop
    Because I think that this laptop dose not support this card.
    Your fast response is required
    ASEM

    Hi
    If you think the Satellite A200 does not support this card so how do you want connect this PCMCIA Card Type II if the compatible slot is not available???
    As far as I know this unit supports only the Express Card slot and the PCMCIA slot in not supported!!!

  • How to maintain inspection type at the time of material creation using LSMW

    Hi All,
    I have a differnet Issue.
    I am using a std. LSMW to create the materials.
    But now using same LSMW i have to maintain Inspection types(ART-RMQAM) for the materials to be created.
    How this can be done.
    This filed is not found in any structures like BGR....to  BMMH8
    Can I create such a structure ??
    Amol

    Some need the hard answer: it is not possible in one go.
    It is an embedded functionality in material master like classification, but it is not stored in a material master table.

  • In OBIEE 11g How to Change  Import Type Local Machine to Remote Machine

    Hi All,
    I Have Installed OBIEE 11g Client tools in my Machine and server is in Other Server.when i tried to Import metadata i am getting Connection Falied error.
    When i tried to import metadata in import type option i can see only one option Local Machine that is also in Disable mode.
    how to make import type option to Remote.
    Thanks and Regards
    Kiran Kumar

    In BI EE 10g, there was no Oracle Client bundled along with BI EE. So, BI EE will use your Oracle DB Home client to connect to the database. So, when you try to connect to the database through the Repository or BI Server, it will try to find the tnsnames entry in the Oracle Client of BI EE 11g instead of your database. There are 2 options to work around this
    Copy your tnsnames.ora and Paste it to
    1. Drive:Oracle\Middleware\Oracle_BI1}network\admin
    2 Drive:Oracle\Middleware\oracle_common\network\admin
    TNS File like,
    DBName =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = Your Server IP)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = DBName)
    Thanks,
    Balaa...

  • How to identify a type of consolidation in a system?

    Hi,
    I need to understand how to identify the type of consolidation we are doingion the system.
    Example like Step consolidation, Simultaneous consolidation or other method.
    This will be helpfull for me in doing my currest support issues.
    Thanks in advance,
    Richard..

    Not sure to understand your question.
    What is the precise context of your issue ? Is it a problem of SEM-BCS configuration or a general problem on how consolidation works ?

  • How to Restrict Material Type in MM01 ?

    *Hi experts,*
    *How to restrict material type ? i wanted to restrict the end-user not to access any other material types than Raw material,Semi-finished goods. it means when end user trying to create material then if he enters other than these two material types then he should get error saying that "your not authorized to select that xyz material type".*
    *I have tried to restrict the object M_MATE_MAR(Material Master : Material type) but am unable to do so. is there any other object which take care of Material types ? did i selected correct object or not??*
    *can anyone help out.*

    Hi,
    You have to make few configuration settings before you actually restrict at the object level. The solution is clearly discussed in the below thread:
    how to restrict material master by material type  t-code MM01
    Hope this helps!!
    Regards,
    Raghu

  • How to get data type of variable in program..

    Hi ABAP Guru.
    I need to know how to get data type of variable or any structure field.. because I got short dump when use command REPLACE ALL OCCURANCE ... with variable/structure field that has data type I or P, I think it should be used with data type CHAR only, So I need to check the data type first.
    Please give me your advice
    Thank you all.
    Nattapash C.

    data : v_value type i,
             v_char(10) type c.
    v_value = 10.
    move v_value to v_char.
    REPLACE ALL OCCURRENCES of '#' from v_char....
    Best regards,
    Prashant

  • How to change data type of attribute in caf

    hi.
    this is my problem.
    i been added a attribute in an entity service called emloyee. named "Birthday", use the data type "com.sap.caf.core.date".
    when i tried modify the entity service, i hit exception about "DST Daylight Saving Time".
    because of DST, the date will add an hour such like "1957/04/01 00:00:00.0" to "1957/04/01 01:00:00.0", and com.sap.caf.core.date will throw an exception.
    is anyone had same problem like me?
    how to fixed it(if passable)?
    and, how to change data type?
    thanks.

    Hi Sruthi,
    all you need to do on this is open the report go to the parameters, select the parameter that you wish to change and click "Edit". This will allow you to change thefield to a date rather than a date time.
    Regards,
    Noel

Maybe you are looking for

  • How do I get more than one signature option in Fill and sign?

    How do I get more than one signature option in Fill and sign?

  • Launchd eating 100% of a CPU, causes machine to permanently hang

    Gentleones, I'm attempting to create and schedule a script that will rotate the apache2 logs in a nice fashion like all the other logs on the machine. (Why Apache can't do logging like everybody else, I don't know, but I guess that's a little off-top

  • "accept scanned at EDC Apple"

    Sorry to post it here, but I need to know where my MBP "17 is, since I don't find any information on TNT etc. The only information I can find is on the www.apecode.com and this is what they tell me: 10 may 06 40 69 accept scanned at EDC Apple Shangha

  • Grainy Still Images and Titles

    I've just completed about a 10 minute film utilizing still images and video clips. It was made with the Adobe Premiere Elements 3 that came with my Sanyo Xacti camera, running on Windows XP. The video looks great all the way up until the end. I have

  • Widget is missing it's scroll bar

    After publishing my project and viewing the project in Chrome, the tabs within a widget that have more content then the widget frame can hold are not accessible because the scroll bar has dissapeared.  Please advise on how to fix this. Thank you in a