How to recover the data type of a column in a table?

Hello

I want to retrieve the data type of a column in a table. At the moment I'm querying attribute 'OCI_ATTR_DATA_TYPE', but it is SQLT_CHR varchar2 and nvarchar2 data type columns. I need to make a distinction between these columns of two separate data types. Y at - it all API through which I could get the exact data type of a column, i.e. "nvarchar2?

Thanks in advance.

Hashim

Hello

It is not a very direct way to do it. What you can do is to call OCIDescribeAny on the table that you want to get information. You can then get the OCI_ATTR_CHARSET_FORM attribute for the column. If the value of the attribute that you get is SQLCS_IMPLICIT, that would mean its a varchar/char/varchar2 column regular. If you get SQLCS_NCHAR, this means that the column is NCHAR. You can get the example of it here:

http://download.Oracle.com/docs/CD/B14117_01/AppDev.101/b10779/oci06des.htm#446491

Just look for the section "Recovering for a Table column Datatypes".

Thank you
Sumit

Tags: Oracle

Similar Questions

  • How to declare the data type of a column in a select query?

    How can we give the data type of each column on the fly during the selection of rows in a query?

    the cast function converts one data type to another.

    The syntax of the cast function is:

    Cast ({expr |}) (subquery) | (MULTISET (subquery)} AS type_name)

    Select cast (22 August 2003 ' AS varchar2 (30))
    Double;

    Published by: b_ * August 12, 2011 10:08

  • How can I find what is the data type of a column of a Table in oracle or SQL?

    (a) what happens if I want to know the type of data in a specific column in the Table.

    (b) how to find the column data types?

    Can someone help me please. I am new to oracle and try to learn a few tricks

    Hello

    How to do

    SQL > desc

    SQL> desc emp
     Name                                      Null?    Type
     ----------------------------------------- -------- ----------------------------
     EMPNO                                     NOT NULL NUMBER(4)
     ENAME                                              VARCHAR2(10)
     JOB                                                VARCHAR2(9)
     MGR                                                NUMBER(4)
     HIREDATE                                           DATE
     SAL                                                NUMBER(7,2)
     COMM                                               NUMBER(7,2)
     DEPTNO                                             NUMBER(2)
    
  • How to change the data type of a column after the creation of the table

    It comes to my table desc

    SQL > desc job1

    Name                                      Null?    Type

    ----------------------------------------- -------- ----------------------------

    JOB_CODE NOT NULL VARCHAR2 (3)

    JOB_CLASS VARCHAR2 (30)

    CHG_HOUR NUMBER (5.2)

    OVERTIMECHARGE NOT NULL NUMBER

    I want to change column CHG_HOUR to store numbers up to 12 digits in length (including the decimal points).

    I tried the following and it did not help

    SQL > alter table job1 change column chg_hour number (6.6);

    ALTER table job1 change column chg_hour number (6.6)

    *

    ERROR on line 1:

    ORA-01735: invalid option of ALTER TABLE

    SQL > alter table job1 change chg_hour number (6.6);

    ALTER table job1 change chg_hour number (6.6)

    *

    ERROR on line 1:

    ORA-01438: value larger than the precision specified for the column

    where I'm going wrong?

    Hello

    I want to change the CHG_HOUR column to store numbers up to 12 digits in length (including the decimal points).

    I tried the following and it did not help

    ALTER table job1 change chg_hour number (12.6);

  • How to recover the data pin and a location for visitors to the Web site

    need help

    I'm doing a project with asp.net blackberry

    How to recover the data pin and a location for visitors to the Web site when he pressed the button on the web using asp.net?

    so far, this is the only code that works for me to get a location in a web widget:

    http://docs.BlackBerry.com/en/developers/deliverables/17954/CS_Retrieving_a_GPS_loc_by_using_a_web_p...

  • change the data type of a column

    Since the previous post: how to change the data type of column number to varchar2 in oracle10g

    Measures may be:
    create table TestTable (ColA varchar2 (5));
    Insert into TestTable values('12345');

    ALTER table TestTable Add (ColATemp number (5));
    setting a day of TestTable set ColATemp = ColA;

    ALTER table TestTable remove column ColA;
    change the column in table TestTable rename ColATemp CLC;

    My question is:
    If the table half million records

    setting a day of TestTable set ColATemp = ColA;

    will it be a good solution? Any performance issues? There is no index on this column.

    Sort while you do DDL, you will not be able to do any operation on the table. You the best suites you. It's a time operation, you can change the table to change the data type, but it may not work if some of the data in the table confirms no new data type of column.

    Concerning

  • How to recover the data file in Oralcle 10 g...? No backups and no newspaper archiving

    All,

    I need to recover the data file 2, which is for the undo tablespace and it is in the State to recover and I need to recover the data files now.

    But the bad news is we have no backup at all and we have no archive logs (log archiving is disabled in the database)...

    In this case how can I recover the data file...?


    SQL > select a.file #, b.SID, a.status from v$ datafile a, v$ tablespace b where a.ts #= b.ts #;

    FILE NAME STATUS NO.
    ---------- ------------------------------------------------------------------------------------------ -------
    1 /export/home/oracle/flexcube/product/10.2.0/db_1/oradata/bwfcc73/system01.dbf SYSTEM
    * RETRIEVE /export/home/oracle/logs/bw/undotbs01.dbf 2 *.
    3 /export/home/oracle/flexcube/product/10.2.0/db_1/oradata/bwfcc73/sysaux01.dbf online
    4 /export/home/oracle/datafiles/bw/bwfcc73.dbf online
    5 /export/home/oracle/datafiles/bw/bwfcc73_01.dbf online

    SQL > archive logs list;
    Database log mode no Archive Mode
    Automatic archival disabled
    Destination of archive USE_DB_RECOVERY_FILE_DEST
    Sequence of journal online oldest 4940
    Current log sequence 4942

    Hello

    First, you must open a ticket with oracle Support and explore the options

    You can use this note to fix:
    RECOVERY OF A LOST IN A [ID 1013221.6] UNDO TABLESPACE DATA FILE

    If you are unable to drop Undo tablespace as Undo Segment recovery must

    You can download the trace file following the opening of the ticket

    SQL>Alter session set tracefile_identifier='corrupt';
    
    SQL>Alter system dump undo header "";
    
    Go to udump
    
    ls -lrt *corrupt*
    
    Upload this trace file
    
    Also upload the alert log file
    

    Kind regards
    Levi Pereira

    Published by: Levi Pereira on November 29, 2011 13:58

  • How to get the data type of an object?

    I have some custom classes, and I would like to make conditional function that behaves differently depending on the data type of the object. How can I do this?

    you could do something like

    var obj:CustomObject = new CustomObject();

    If (obj is Objetpersonnalise)

    {

    do something

    }

    or you could look at using getQualifiedClassName() or getDefinitionByName()

  • How to recover the date in a specific format on button clicked?

    I'm trying to update the date in a data template on a user clicks the button, but unfortunately the Date() function gives just a format long unncesseray.  I want just the day/month/year (i.e. 10/09/2013).  How to change the Date() function to achieve this?

     Button {
                                        leftPadding: 30
                                        rightPadding: 30
                                        preferredWidth: 150
                                        horizontalAlignment: HorizontalAlignment.Center
                                        imageSource: "asset:///images/ic_add.png"
                                        onClicked: {
    
                                            rootItem.ListItem.view.getApp().updateObject(ListItemData.customerID, ListItemData.name, ListItemData.description, Date(), parseInt(ListItemData.lat) + 1, ListItemData.lon, ListItemData.categorySelect, ListItemData.mapurl)
                                        }
                                    }
    

    Thanks in advance.  Solutions and love will see for those who help.

    Kind regards

    Brandon

    I was actually able to find a workaround simpler.  I just used objects attached within the key and attached to a date function:

    Button {
    
                                        imageSource: "asset:///images/ic_add.png"
                                        onClicked: {
    
                                            rootItem.ListItem.view.getApp().updateObject(ListItemData.customerID, ListItemData.name, ListItemData.description, datefield3.text, parseInt(ListItemData.lat) + 1, ListItemData.lon, ListItemData.categorySelect, ListItemData.mapurl)
    
                                        }
                                        attachedObjects: [
                                            Label {
                                                id: datefield3
                                                text: {
                                                    var today = new Date();
                                                    (today.getMonth() + 1) + "/" + today.getDate() + "/" + (today.getFullYear() - 2000);
                                                }
    
                                            }
                                        ]
                                    }
    
  • How to set the date type date of work

    This is perhaps a silly question, but I can't seem to get the data type date to work for a member account. When I go to the planning application and choose an account I want to put in a date entry account, the web form seems to show that the setting of the date works for the account. I even put my account type to be saved hypothesis. For example, I expect to see the date formatted in 10/20/2009 when I enter this value in the web form under my account "Hire Date". I also checked the display options in the preferences of planning. If anyone knows if this function works even on 9.3 or 11.1?

    Hello

    Looks like you have not defined the order of evaluation of Auditors. Administration > Dimensions > evaluation order > select plan type > moving accounts to another window, apply.
    Try the form again.

    See you soon

    John
    http://John-Goodwin.blogspot.com/

  • Display the data type of a column in the status bar

    Hi all

    n pl/sql developer, when I select a column in a table.

    If I clicked with the mouse on the column in the query results box, it shows me the type of data and the size of the column in the status bar

    Developer SQL does not by default,

    is there an option I can change to do the same task?

    Thank you

    No, you will need to open a popup DESC of the query to see the data types of the data returned.

  • length of the data type of a column

    Hello

    I would like to know if it is possible to find the length of the
    data type in a create table stmt.

    For example:
    create employee table (empno number (3), empname varchar (10));


    in the DDL above I mentioned the size of my 3 number data type.
    is there a way to retrieve this info. ?
    outside desc < table_name >?


    Thanks in advance
    SQL> create table employee(empno number(3),empname varchar(10))
      2  /
    
    Table created.
    
    SQL> select column_name
      2       , data_length
      3       , data_precision
      4       , data_scale
      5    from user_tab_columns
      6   where table_name = 'EMPLOYEE'
      7  /
    
    COLUMN_NAME                    DATA_LENGTH DATA_PRECISION DATA_SCALE
    ------------------------------ ----------- -------------- ----------
    EMPNO                                   22              3          0
    EMPNAME                                 10
    
    2 rows selected.
    

    Details on the columns can be found in the documentation: http://download.oracle.com/docs/cd/B19306_01/server.102/b14237/statviews_2094.htm#I1020277

    Kind regards
    Rob.

  • How to return the data type complex of a synchronous BPEL process

    Hi all
    I have created a synchronous BPEL process, so a partner customer link was automatically created in the project. Now the link partner of this client is to have input and output variable of type normal string where as my BPEL process finally returns a complex data type.
    In order to solve this problem, I took a processing activity and mapped the collection [variable returned by my BPEL process] to the chain of production of the customer but in this way I just get a single string to store the entire collection but I want that they separately.

    Can someone tell me, how to manage this scenario.

    Concerning
    Lokesh

    After creating the partner link and the invoke (to create the variables), change the element type of the response message to the complex type definition of your collection that appears in the XSD. You can do the same thing if you want to change the element type of the payload of the request message as well.

  • How to recover the disc type and geometry of the disk on an optiplex gx260

    the disc type and the disc geometry has changed in the program of installation-F2 is NOT HOW they GOT CHANGED? OptiPlex gx260

    Hi TrumanFowler,
     
    See if this manual can guide you:
     
     
    Contact the system manufacturer for assistance on this issue.
     
    Visit the following link to do the same thing:
  • How to force the data type in create table field?

    Hi all

    I need to force my table to create as follows

    Create table XYZ

    (Test varchar2 (10 CHAR)

    ...

    );

    When I run my Interface the script is

    Create table XYZ

    (Test varchar2 (10))

    ...

    );

    and the DBMS translated into

    Create table XYZ

    (Test varchar2 (10 BYTE),

    ...

    );

    I have the same problem with I$, C$, and so on.

    Best regards

    Marco

    Hi all

    I fix my problem:

    In Phisical Tecnology, under ORACLE Tecnology, data TYPE, I modified the definition of VARCHAR2 in VARCHAR2(%L CHAR).

    (Before it was VARCHAR2 (%)).

    Thank you all.

    Marco

Maybe you are looking for

  • List of cursor only save last position in loop for

    Hi, I'm new to LabView 2010 and try the list of cursor to use in a different program to the top of the label. My test program has a problem however, only displays the last Summit of cursor not all. Basically my program will simulate periodic signal j

  • How to scan a document of several pages with a Photosmart HP 5510

    I want parsing a file page 17 but when I scan the first page it just says: registered under the Scan 001 and does not give me the ability to add pages more like my Epson printer used to! The 5510 is not able to scan multiple pages to PDF? If Yes, how

  • Strike F1 key to continue, F2 to run the Setup utility

    Floppy drive seek failure 1 driver not found: Serial ATA, SATA 1 Pilot 2 not found: Serial ATA, SATA 2 Driver 3 not found: Serial ATA, SATA 3 Has tried to get some HP programs start from the start, my Dell Dimension 8400 computer.  Unchecked HP 4 fun

  • switching

  • Cannot delete the files after reinstall Vista

    Hard drive crashed. Reinstalled Vista who created a folder named Windows.old. I can't delete this folder or its contents. I tried the folder/file attributes, but it only works for some files. Thank you