Is their any function in sql to identify datatype and length of each column

Hi
i need to identify datatype and length of each column in a table by using SQL query.
plz assist me reagard the same.
thanks

Try this:
SELECT column_name,
       data_type,
       data_length,
       data_precision
FROM   user_tab_columns
WHERE  table_name = <table_name>

Similar Messages

  • Is their any function module for deleting condition record i am trying

    Hi Experts,
    Is their any function module for deleting condition record i am trying  this way.......
    DATA: TABLE (4) TYPE C.
    DATA: KNUM LIKE KONH-KNUMH
    DATA: K_VEWE LIKE T681-KVEWE VALUE 'A'.
    DATA: T681_STR LIKE T681.
    DATA: LV_NUM TYPE I.
    GET PARAMETERS
    PARAMETERS: TABNO LIKE T681-KOTABNR.
    PARAMETERS: TESTMODE DEFAULT 'X' AS CHECKBOX.
    REFRESH INT_KNUMH.
    Select single * from T681 into T681_STR
    where kvewe = K_VEWE AND
    KOTABNR = TABNO.
    IF SY-SUBRC NE 0.
    WRITE: / 'No entry in T681 for number ', TABNO.
    WRITE: / 'Check whether corresponding condition table exists.'.
    EXIT.
    ENDIF.
    TABLE = T681_STR-KOTAB.
    SELECT KNUMH FROM (TABLE) INTO KNUM.
    SELECT SINGLE * FROM KONH WHERE KNUMH = KNUM.
    IF SY-SUBRC NE 0.
    INT_KNUMH-KNUMH = KNUM.
    COLLECT INT_KNUMH.
    ENDIF.
    ENDSELECT.
    DESCRIBE TABLE INT_KNUMH LINES LV_NUM.
    IF LV_NUM EQ 0.
    WRITE: / 'No inconsistent entries found.'.
    WRITE: / 'Each record in the condition table has a corresponding.'.
    WRITE: / 'entry in the KONH table.'.
    EXIT.
    ENDIF.
    LOOP AT INT_KNUMH.
    IF TESTMODE IS INITIAL.
    DELETE FROM (TABLE) WHERE
    KNUMH = INT_KNUMH-KNUMH.
    IF SY-SUBRC = 0.
    WRITE: / 'KNUMH =', INT_KNUMH-KNUMH(10), ' deleted from table ' ,TABLE.
    ELSE.
    WRITE: / 'DELETE: SY-SUBRC is', SY-SUBRC , ' FOR KNUMH = ' .
    WRITE: INT_KNUMH-KNUMH(10).
    ENDIF.
    ELSE.
    WRITE: / 'TESTRUN: KNUMH =', INT_KNUMH-KNUMH(10).
    ENDIF.
    ENDLOOP.
    is their any Standerd Function module  for comparing  tables if the condition record not exist in it has to exit if it is their then compare  those two tables if not exist in one table also that has  to be delete  the condition record
    Please let me know .....

    Hi,
       You can use Function module PRICING_CHECK to check condition record. Do a where-used list on it to see how to call it.
    Regards
    Kiran Sure

  • Is their any function module to  see the details of employee ?

    Hello ,
    Is their any function module through which we can  see the details of employee
    ASAP
    SANDEEP JADHAV

    BAPI_EMPLOYEE_GETLIST
    BAPI_EMPLOYEE_GETDATA
    BAPI_PERSDATA_GETDETAIL: Read personal data
    BAPI_PERSDATA_GETDETAILEDLIST: Read instances with data
    BAPI_PERSDATA_GETLIST: Read instances

  • How to dump block and identify the bytes stored for each column

    SQL> select header_file, header_block
    2 from dba_segments
    3 where segment_name = 'APARTMENTS';
    HEADER_FIL HEADER_BLO
    4 1692
    1 row selected.
    SQL> alter system dump datafile 4 block 1693;
    Statement processed.
    How can I see the dump block and identify the bytes stored for each column?
    tab 0, row 0, @0x73b
    tl: 125 fb: H-FL lb: 0x1 cc: 4
    col 0: [25]
    52 65 64 77 6f 6f 64 20 53 68 6f 72 65 73 20 41 70 61 72 74 6d 65 6e 74 73
    col 1: [20] 00 54 00 01 02 08 00 00 00 01 00 00 00 01 00 00 00 00 1b 8d
    col 2: [53]
    00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 00 1b 8e 00 21 09 00 00
    00 00 00 00 11 00 00 00 00 00 01 45 6d 65 72 67 65 6e 63 79 20 44 65 74 61
    69 6c 73
    col 3: [20] 00 54 00 01 01 08 00 00 00 01 00 00 00 01 00 00 00 00 1b 8f

    SQL> select header_file, header_block
    2 from dba_segments
    3 where segment_name = 'APARTMENTS';
    HEADER_FIL HEADER_BLO
    4 1692
    1 row selected.
    SQL> alter system dump datafile 4 block 1693;
    Statement processed.
    How can I see the dump block and identify the bytes stored for each column?
    tab 0, row 0, @0x73b
    tl: 125 fb: H-FL lb: 0x1 cc: 4
    col 0: [25]
    52 65 64 77 6f 6f 64 20 53 68 6f 72 65 73 20 41 70 61 72 74 6d 65 6e 74 73
    col 1: [20] 00 54 00 01 02 08 00 00 00 01 00 00 00 01 00 00 00 00 1b 8d
    col 2: [53]
    00 54 00 01 02 0c 00 00 00 01 00 00 00 01 00 00 00 00 1b 8e 00 21 09 00 00
    00 00 00 00 11 00 00 00 00 00 01 45 6d 65 72 67 65 6e 63 79 20 44 65 74 61
    69 6c 73
    col 3: [20] 00 54 00 01 01 08 00 00 00 01 00 00 00 01 00 00 00 00 1b 8f

  • Any function in SQL or PL/SQL

    how the occurance-position of a particular character in a given string can be extracted with in a pl/sql block or procedure. is there any function available to do so.

    Maybe the INSTR function.
    See http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions55a.htm#SQLRF00651
    how the occurance-position of a particular character
    in a given string can be extracted with in a pl/sql
    block or procedure. is there any function available
    to do so.

  • Is there any function module to get vc characteristics and its value using material number?

    Hi Experts,
    I am using BAPI_CLASS_GET_CHARACTERISTICS, BAPI_OBJCL_GETCLASSES to get characteristics description and its values.
    Is there any other Function module to pull this values using material number?
    Thanks in Advance.
    Ramkumar

    Have you tried this BAPI_OBJCL_GETDETAIL
    Import parameters
    MATNR value in the OBJECTKEY
    MARA in OBJECTTABLE
    Class name in CLASSNUM
    '001' in CLASSTYPE
    You will get the Class Characteristics data into these tables:
    ALLOCVALUESNUM
    ALLOCVALUESCHAR
    Jogeswara Rao K

  • How can I take 3 devices off of my email account and give them their own account. We are sharing storage and need to each have our own account.

    Everyone in my family has an iPhone or iPad and they are all on one email account. How do I take them off and give them their own accounts so I can have my storage back?

    Have them delete the iCloud account (your email address) on their devices then let them create their own iCloud account -> http://support.apple.com/kb/ht4436.  If all of you are syncing contacts and calendars on the same iCloud account, they have to re-organise those stuffs once they have their own iCloud account.  When you delete an iCloud account, it normally asks what would you do for the synced information - keep it on the iOS device or delete.  If they choose to keep the synced information (e.g. Contacts and Calendars), they have to delete those thare aren't theirs or they can start from scratch by deleting the synced information from the iOS device.  Hope this helps.  Cheers!

  • Any difference between distinct and aggregate function in sql query cost???

    Hi,
    I have executed many sql stmts patterns- such as:
    a) using a single table
    b) using two tables, using simple joins or outer joins
    but i have not noticed any difference in sql stmts in cost and in execution plan....
    Anyway, my colleague insists on that using aggregate function is less costly compared to
    distinct....(something i have not confirmed, that's why i beleive that they are exactly the same...)
    For the above reffered 1st sql pattern.. we could for example use
    select distinct deptno
    from emp
    select count(*), deptno
    from emp
    group by deptno select distinct owner, object_type from all_objects
    select count(*), owner, object_type from all_objects
    group by owner, object_typeHave you found any difference between the two ever...????
    Note: I use Ora DB 10g v2.
    Thank you,
    Sim

    distinct and aggregate function are for different uses and may give same result but if u r using aggregate function to get distinct records, it will be expensive...
    ex
    select distinct deptno from scott.dept;
    Statistics
    0 recursive calls
    0 db block gets
    2 consistent gets
    0 physical reads
    0 redo size
    584 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    0 sorts (memory)
    0 sorts (disk)
    4 rows processed
    select deptno from scott.emp group by deptno;
    Statistics
    307 recursive calls
    0 db block gets
    60 consistent gets
    6 physical reads
    0 redo size
    576 bytes sent via SQL*Net to client
    488 bytes received via SQL*Net from client
    2 SQL*Net roundtrips to/from client
    6 sorts (memory)
    0 sorts (disk)
    3 rows processed
    Nimish Garg
    Software Developer
    *(Oracle & ASP.NET)*
    Indiamart Intermesh Limited, Noida
    To Get Free Oracle & ASP.NET Code Snippets
    Follow: http://nimishgarg.blogspot.com

  • Any function module to get Stock and value of material on a given date?

    Hi Friends
    Is there any function module available to get Stock/and  value of material on a given date?
    Thanks
    Harish

    Sorry I didn't elaborate the requirement.
    I am asked to develop a custom report for inventory management. For range of materials it is required to display stock and value on particular date and GRs GIs for the range.
    I need function module to use in Zreport.
    Thanks
    Harish

  • Any function module

    is there any function module to find VAT value and FREIGHT value  based on the condition type of VAT and condition type of FREIGHT.

    WEEK_GET_FIRST_DAY
    pass 'YYYYWW' (200524) to WEEK parameter it will give you the week start date
    Raja

  • SQL Error: ORA-12899: value too large for column

    Hi,
    I'm trying to understand the above error. It occurs when we are migrating data from one oracle database to another:
    Error report:
    SQL Error: ORA-12899: value too large for column "USER_XYZ"."TAB_XYZ"."COL_XYZ" (actual: 10, maximum: 8)
    12899. 00000 - "value too large for column %s (actual: %s, maximum: %s)"
    *Cause:    An attempt was made to insert or update a column with a value
    which is too wide for the width of the destination column.
    The name of the column is given, along with the actual width
    of the value, and the maximum allowed width of the column.
    Note that widths are reported in characters if character length
    semantics are in effect for the column, otherwise widths are
    reported in bytes.
    *Action:   Examine the SQL statement for correctness.  Check source
    and destination column data types.
    Either make the destination column wider, or use a subset
    of the source column (i.e. use substring).
    The source database runs - Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    The target database runs - Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    The source and target table are identical and the column definitions are exactly the same. The column we get the error on is of CHAR(8). To migrate the data we use either a dblink or oracle datapump, both result in the same error. The data in the column is a fixed length string of 8 characters.
    To resolve the error the column "COL_XYZ" gets widened by:
    alter table TAB_XYZ modify (COL_XYZ varchar2(10));
    -alter table TAB_XYZ succeeded.
    We now move the data from the source into the target table without problem and then run:
    select max(length(COL_XYZ)) from TAB_XYZ;
    -8
    So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
    alter table TAB_XYZ modify (COL_XYZ varchar2(8));
    -Error report:
    SQL Error: ORA-01441: cannot decrease column length because some value is too big
    01441. 00000 - "cannot decrease column length because some value is too big"
    *Cause:   
    *Action:
    So we leave the column width at 10, but the curious thing is - once we have the data in the target table, we can then truncate the same table at source (ie. get rid of all the data) and move the data back in the original table (with COL_XYZ set at CHAR(8)) - without any issue.
    My guess the error has something to do with the storage on the target database, but I would like to understand why. If anybody has an idea or suggestion what to look for - much appreciated.
    Cheers.

    843217 wrote:
    Note that widths are reported in characters if character length
    semantics are in effect for the column, otherwise widths are
    reported in bytes.You are looking at character lengths vs byte lengths.
    The data in the column is a fixed length string of 8 characters.
    select max(length(COL_XYZ)) from TAB_XYZ;
    -8
    So the maximal string length for this column is 8 characters. To reduce the column width back to its original 8, we then run:
    alter table TAB_XYZ modify (COL_XYZ varchar2(8));varchar2(8 byte) or varchar2(8 char)?
    Use SQL Reference for datatype specification, length function, etc.
    For more info, reference {forum:id=50} forum on the topic. And of course, the Globalization support guide.

  • Function Module to Find Actual costs and Total Cost Commitments

    Hi PS Experts ,
    Please let me know if there  is any function module to  find Acutal costs and Total cost commitments by passing WBS element as Input .
    Regards,
    Karan

    Hi Karan,
    I think for actual cost - there is definately one FM availbale. Try to find it out.
    Just ensure - if you are using Network Activity then you may have to pass NWA OBJNR into this FM to get actual cost. As some entry posting happens against NWA like Timesheet. Hope it will give you some idea to get rid on your issue.

  • Function module related to procurement type and special procurement type

    Hi Gurus,
    Is there any function module related to procurement type and special procurement type?
    Regards
    Rajib

    Dear Rajib,
    What is your exact requirment?do you want to find out the list of materials based on procurement type
    and special procurement type?
    You can get the details from the table MARC.
    Regards
    Mangalraj.S

  • Function Module to update the FI and Logistics Invoice

    Hi All,
    Is there any function module which updates the FI and Logistics Invoice simultaneously?
    Regards,
    Adapala M

    For material bom: CSAP_MAT_BOM_CREATE
    and CSAP_ORD_BOM_CREATE for Order BOM.
    Regards,
    Ravi

  • Function Module to Execute BEx Query and Save as work book.

    Hi
    I have a requirement for executing the Query after the data is loaded into the cube and save as Workbook and emailing to the user. Is there any Function module to Execute the Query and saving as Work book? . Please suggest me the way how to approach the problem.
    Thanks for your help in advance.

    Hi,
    It is possible to execute the Query and send the result as workbook vial email to the user.
    For that use should use Information Broadcaster.
    Steps:
    1. Goto information broadcaster.
    2. Choose object type as "Query"
    3.Click create new setting.
    4. Give description and choose distribution type as "Broadcast E-mail"
    5.Choose output format "XML(MS Excel)
    6.In recipient tab Give valid e-mail addres which you want to send.
    7.Save it. and give technical name
    8.Click schedule.
    9.choose "Execution with Data Change in the InfoProvider " correspondig infoprovider will be shown (check the check box)
    10. that's it. whenever data loaded in your infocube, it will be automatically executed and send to user mail.
    <removed> if u want more information let me know.
    Regards,
    Senthil Kumar.P

Maybe you are looking for

  • Custom Report Needed

    Hi, One of my client needs the custom report as follows . The report should display the  MONTHLY SALES QTY ,  AVAILABLE STOCK  AT THE ENDOF THE MONTH  for an Item by Warehouse or Location. The format is like this                                    It

  • OS X won't boot after installing XP

    So I installed XP with boot camp (111 GB Partition), and now it is running fine. Well, sort of fine, it doesn't recognize the ethernet port on the iMac, but I assume that's a driver problem that I should be able to fix once in OS X. So I booted into

  • Apple TV2 - rental system "needs improvement"

    Hi...I own an iPod Nano, an iPod Touch, two iPhones, an iPad, and two Apple TVs (one new#1, one old-the big first one) -- not to mention four Apple Towers and a laptop. Suffice it to say.. I support Apple; I love Apple. Go Apple! But the Apple TV2 le

  • F4 help in ALV grid field

    Hello Experts, I am using cl_salv_table=>factory to display ALV grid. Now I also want to attach f4 help in one of the field of ALV grid. I am unable to locate any event or method. Please help.

  • Old 3D Dreams Xtras

    Hello, everyone! I'm trying to get an old (1999) .dcr to work. I've got all the Xtras it needs except for two called thus: 3DDreams.x32 3ddplay.x32 These are old 3D (Pre-Shockwave3DAsset) Xtras called "Shells Interactive's 3D Dreams Player". They wer