Employee_number hr.per_all_people_f varchar2 data type

Hello Oracle gurus, could someone tell me why the number of employee in the table Per_All_People_F column is varchar2 instead of the data type data type Number.

Thanks in advance, Naveen Gagadam

Hi Naveen

The employee number may be whatever it is based on the requirement, for example, you can have employee number which begins with the a. The data type of this field is Varchar2 instead of the number so you can customize employee number using the quick forumla.

HTH
Gerard

Tags: Oracle Applications

Similar Questions

  • VARCHAR2 data type do not convert date

    Dear gurus

    Version of database - 10.2.0

    I have a problem of varchar2 data type do not convert date...

    I have a table like


    SQL > table desc.
    Name Null? Type
    ----------------------------------------- -------- ----------------------------
    NAME VARCHAR2 (10)
    RECORD_DATE VARCHAR2 (20)

    and the record consists are...

    SQL > select * from table;

    NAME RECORD_DATE
    ---------- --------------------
    Nimai 09/09/2012 09:10
    Nimai 09/09/2012 10:10
    Scott 09/09/2012 11:10
    Scott 09/10/2012 10:00
    Nimai 09/10/2012 11:00


    If the "Record_date" column that's 09/09/2012(dd/mm/yyyy)

    09/09/2012 and I want to query the records which includes the date ' select * from table where record_date = 09/09/2012 "...
    This work of query...

    Select * from table where
    TO_CHAR (to_date (substr(record_date,1,10), ' dd/mm/yyyy'), ' dd/mm/yyyy')
    =
    TO_CHAR (to_date (substr('09/09/2012',1,10), ' dd/mm/yyyy'), ' dd/mm/yyyy')
    ;

    But if the "record_date" column that's 9/9/2012(d/m/yyyy) I did not what to do which function to use? /

    Help, please!

    Thanks in advance
    Nimai kinzonzi

    Published by: 955748 on September 22, 2012 03:47

    Published by: 955748 on September 22, 2012 04:10

    Hello;

    Keep things simple: (get rid of TO_CHAR)

    SELECT TO_DATE ((substr (record_date, 1, 10), ' DD/MM/YYYY') of?)

    TO_DATE (substr (record_date, 1, 12), "HH24 MON-DD-YY")

    Best regards

    mseberg

  • NVL function varies from char to varchar2 data type

    SQL> select * from v$version;
    
    BANNER
    --------------------------------------------------------------------------------
    Oracle Database 11g Release 11.2.0.1.0 - Production
    PL/SQL Release 11.2.0.1.0 - Production
    CORE    11.2.0.1.0  Production
    TNS for 32-bit Windows: Version 11.2.0.1.0 - Production
    NLSRTL Version 11.2.0.1.0 - Production
    
    SQL> create table fullJoinTest1(col1 char(14));
    
    Table created.
    
    SQL> create table fullJoinTest2(col1 char(14));
    
    Table created.
    
    SQL> insert all
      2  into fullJoinTest1 values('aaa')
      3  into fullJoinTest1 values('bbb')
      4  into fullJoinTest2 values('aaa')
      5  into fullJoinTest2 values('ccc')
      6  select 1 from dual;
    
    4 rows created.
    
    SQL> select nvl(a.col1,b.col1) as aaaa
      2    from fullJoinTest1 a full join fullJoinTest2 b
      3      on a.col1=b.col1
      4   where nvl(a.col1,b.col1)= 'ccc';
    
    no rows selected
    
    SQL> create table fullJoinTest3 as
      2  select nvl(a.col1,b.col1) as "WhatIsType?"
      3    from fullJoinTest1 a full join fullJoinTest2 b
      4      on a.col1=b.col1
      5   where nvl(a.col1,b.col1)= 'ccc';
    
    Table created.
    
    SQL> desc fullJoinTest3
     Name          Null?    Type
     ------------- -------- ------------
     WhatIsType?            VARCHAR2(14)
    
    SQL> create table fullJoinTest4 as
      2  select case when a.col1 is not null then a.col1 else b.col1 end as "WhatIsType?"
      3    from fullJoinTest1 a full join fullJoinTest2 b
      4      on a.col1=b.col1;
    
    Table created.
    
    SQL> desc fullJoinTest4
     Name        Null?    Type
     ----------- -------- --------
     WhatIsType?          CHAR(14)
    My question is why nvl function varies from char to varchar2 data type?
    Same case expression does not change the data type.
    I insist that this is a bug of function nvl isn't - it.

    Documented behavior:
    http://download.Oracle.com/docs/CD/E11882_01/server.112/e17118/functions119.htm#SQLRF00684

    If expr1 is character data, then Oracle Database converts expr2 to the data type of expr1
    before comparing them and returns VARCHAR2 in the character set of expr1.
    
  • convert the varchar2 data type to the data number type

    How to convert the varchar2 data type to the data type number.


    It looks like my data

    create table one)
    col1 varchar2 (50)
    col2 varchar2 (500);

    Insert in a (col1, col2) values ('1234 ', ' 2345');

    Select Column1 of number (19)) cast (to_number (col1);

    IAM getting error invalid number


    I need to create a table with the same columns with data like number types (19)

    can someone help me

    Thank you

    You have changed your original post, so now I see that you get the invalid number.

    This is why you should always avoid the varchar columns to store numbers or dates...

    Since your table source contains a nonnumeric value, you can write a pl/sql to convert data and see what records are false:

    SQL> insert into a (col1,col2) values ('xxxx','2345');
    
    1 row created.
    
    SQL> select * from a;
    
    COL1     COL2
    -------- --------
    1234     2345
    xxxx     2345
    
    2 rows selected.
    
    SQL> create table b (col1 number(19), col2 number(19));
    
    Table created.
    
    SQL> set serverout on
    
    SQL> declare
      2  cursor c is
      3  select * from a;
      4  begin
      5    for r in c loop
      6     begin
      7       insert into b values (to_number(r.col1), to_number(r.col2));
      8     exception
      9       when invalid_number then
     10        dbms_output.put_line('Row rejected: col1='||r.col1||' col2='||r.col2);
     11     end;
     12    end loop;
     13  end;
     14  /
    Row rejected: col1=xxxx col2=2345
    
    PL/SQL procedure successfully completed.
    
    SQL> select * from b;
    
          COL1       COL2
    ---------- ----------
          1234       2345
    
    1 row selected.
    

    Max

    Published by: Massimo Ruocchio, June 14, 2011 20:00
    Added the first query in the example

  • How can I justify the difference between varchar and varchar2 data type

    Hi all

    How can I justify the difference between the data type varchar and varchar2 on any table for space management.
    Is there any query to justify this.


    Concerning
    Girish

    Published by: boujemaa on February 2, 2011 21:23

    http://download.Oracle.com/docs/CD/B19306_01/server.102/b14220/datatype.htm#sthref3780


    The VARCHAR data type

    The VARCHAR data type is synonymous with the VARCHAR2 data type. To avoid any changes in behavior, always use the VARCHAR2 data type to store strings of variable length.

  • Convert a varchar2 data type Date

    Hi guys,.

    Can someone help me convert a Varchar2 data type in the data type Date?

    I have a query and my column is a varchar2 data type.
    I want to just that convert the Varchar2 in a DATE, because I met
    problem in my query. I want to do the day1 day10 transaction.

    Ex:
    Day 1 = January 1, 2010
    Day10 = January 10, 2010

    table.record_date varchar2 (12)

    SELECT column1, Column2
    table
    where record_date between? and?

    How can I set the record_date between day1 and day10 since record_date is of type varchar?

    Thank you.

    Laetitia

    Lala,

    If the data in the database are in the format MM-DD-RR , then you must use the same format when you convert back to this day.

    So change the query to

    SELECT COLUMN1, COLUMN2 FROM TABLE WHERE TO_DATE(RECORD_DATE, 'MM-DD-RR') BETWEEN TO_DATE('01-JAN-2010') AND TO_DATE('10-JAN-2010')
    

    Kind regards

    Manu.

  • Change the number in Varchar2 Data Type

    Hello

    We have a running production applications. There is a column called home_number which is a type of data number, now called the new requirement to change of varchar2.

    I tried to edit the table get the below error.


    -Edit the "TECH_SOURCING_EMPLOYEE_DETAILS" table change
    -("HOME_PH_NUMBER" VARCHAR2 (1000))
    -- /

    -ORA-01439: column to change must be empty to change data type

    Please suggest me how to change the data type of column without affecting the data.

    Thank you
    Sudhir

    Try below, I tested in my database.

    create table tmp
    (ID NUMBER,
     HOME_NUMBER NUMBER(8));
    
    insert into tmp values(1, 9122222);
    
    alter table tmp add MY_HOME_NUMBER VARCHAR2(1000);
    
    update tmp
      set my_home_number = home_number;
    
    update tmp
       set home_number = NULL; 
    
    alter table tmp drop column home_number;   
    
    alter table tmp rename column my_home_number to home_number; 
    
  • Bad high and low value with the varchar2 data type

    Hello

    It is an application on e - biz on database 9205, with inventory module.

    In one of the mtl_txn_request_headers of the table, the data for the number of application type is varchar2 (30). When I checked the low_value & high_value in dab_tab_columns, I see that the low_value is 100001 (6 digits) and high_value is 99999 (5 digits).

    I used the utl_raw.cast_to_varchar2 (low_value) to convert the value.

    In our case, we save a large part of the value in incremental number and some of our query will be in the predicate of the range (between).

    How should I handle this kind of situation and which option do I?

    Appreciate any help. Thank you.

    Accepted this looks like a classic bad-data type problem, but as this picture seems be part of Oracle E-Business Suite the OP should probably talk first Oracle.

  • Long and varchar2 data type

    Afternoon people,
    My apologies if I use the wrong forum, but I can't seem to find a place related to SQL and PL/SQL. In the affirmative, please let me know.

    Here's my problem on site:
    I have a very long sql who fault kept in my program with an ORA error 6502. After a while I thought about it and I was trying to assign a length of 48000 string to a variable declared in my PL/SQL which is varchar2 (32767). Then, of course the program is a failure for known causes.

    I know there a CLOB, but this isn't workign fine with dbms_sql.parse. Anyone know what is the precision for a long TIME? I found some information on lONG but my program doesn't work.

    --> Long character variable length up to 2 gigabytes of data, is 2 to the power of 31-1 bytes. Provided for backward compatibility.

    Number of bytes = 2147483647

    So, how is it I'm being not able to entrust the 48000 string? Anyone know of a better solution? Any help is greatly appreciated!

    Thank you

    This is the wrong forum. There is a forum called SQL and PL/SQL where you'll get better answers.

    The short answer is that long (which are obsolete) and LOBS require special treatment and behave differently from other types of data.

  • How to make the sum of hours which is the varchar2 data type in oracle

    Hi my table is like this
    emp_ngtshthrs (empno number (10), nightshifthrs varchar2 (20));

    now I want sum employee nightshifthrs how do the sum hours, it's my hours 01:00, 05:00, 08:00, 10:00, 07:00 and 09:00
    I want the sum type varchar2 hours how to do? and I want to display the sum is greater than 24:00

    Well, first of all you have posted your question in the wrong forum. You should have posted your question in the forum SQL and PL/SQL .

    The second problem I see is that you are being too generic when you have your employees enter their night shift hours worked. If you are able, I recommend that you change your table to record hours separately from minutes and make columns of type NUMBER instead of the VARCHAR2() type. Then, you can simply use arithmatic to total the hours and minutes worked.

    If you are locked in your table and cannot change it, you can convert characters to numbers and then perform your basic arithmatic on values. For example:

      1  with tab1 as (
      2  select 10 as empno, '01:00' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:00' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:00' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(replace(nightshifthrs,':','.'))) AS hours_worked
      9* from tab1
    SQL> /
    
    HOURS_WORKED
    ------------
              40
    SQL> 
    

    Of course, if your users can and do enter the minutes, then which complicates the example I provided. You will need to convert the decimal minute, sum the amount, then convert the decimal time and add this to your hours. For example:

      1  with tab1 as (
      2  select 10 as empno, '01:15' as nightshifthrs from dual union all
      3  select 10 as empno, '05:00' as nightshifthrs from dual union all
      4  select 10 as empno, '08:30' as nightshifthrs from dual union all
      5  select 10 as empno, '10:00' as nightshifthrs from dual union all
      6  select 10 as empno, '07:45' as nightshifthrs from dual union all
      7  select 10 as empno, '09:00' as nightshifthrs from dual)
      8  select sum(to_number(substr(nightshifthrs,1,2))) + SUM(to_number(SUBSTR(nightshifthrs,4,5)))/60
      9* from tab1
    SQL> /
    
    HOURS_WORKED
    ------------
            41.5
    SQL> 
    

    I hope this helps.

    Craig...

  • How to compare a long data type with a varchar2 data type?

    I need to select these views in my database that contains some passages.
    To do this, I wrote this query

    Select * from user_views
    where lower (text) like '% "| Cast ('text to compare' as long). '%'

    but this gives exception: ora-00932

    Can you please help how to do that?

    May be give this a try.
    
    select object_name
         , view_text
      from (
              select object_name
                   , dbms_metadata.get_ddl('VIEW', object_name, user) view_text
                from user_objects
               where object_type = 'VIEW'
           )
     where lower(view_text) like '%text to compare%';
    
  • How to display "ename" (varchar2 data type) in Initcap, lower- or uppercase...

    Hello

    I am new to ORACLE DBA and just started my training...

    I know how to put in the form of "Columns" using sqlplus, but my question is how can I display "ename" (from EMP table) at the TOP, bottom or Initcap case using "SELECT *"...?

    I know that i can make it in writing for example select statement

    Select

    EmpNo,

    Lower (ename),

    etc.

    etc.

    Of

    EMP;

    and the above statement show me the ename result is converted to lowercase.

    But suppose that if table has too many columns and I want to just change columen name in initcap so how can I do. I don't mean every column in my select as above.

    is it possible that I can use the format column command with "Select *" statement.

    for example

    Col ename as initcap

    Select * from emp;

    ...????????

    Something like that? It will show all the coulmns of emp and INITCAP column (ename)

    SELECT e.*, INITCAP (ename) initcap_ename e emp;

  • change the data type of column in a view

    Hi gurus,

    Please suggest.


    I have been created as below in the region of production.

    CREATE OR REPLACE TYPE PROD. (OBJECT) ACE FEATURE_CUSTOM_LIST_OBJ
    TERMINAL_FEATURE_ID NUMBER (8).
    DATA_VALUE NUMBER (8)
    );
    /


    And the view is created below the base have the PROD. FEATURE_CUSTOM_LIST_OBJ

    CREATE OR REPLACE FORCE VIEW PROD. TERMINAL_FEATURE_TYPE
    (
    TERMINAL_FEATURE_ID,
    DATA_VALUE
    )
    AS
    SELECT
    TERMINAL_FEATURE_ID,
    DATA_VALUE
    TABLE)
    CAST)
    PROD. TERM_RELATED_REF_DATA. GET_TERMINAL_FEATURE_TYPE AS PROD. FEATURE_CUSTOM_LIST_TAB));

    Examples of data must be inserted into the display

    TERMINAL_FEATURE_IDDATA_VALUE
    120
    121
    123
    11THERE
    11N

    If iam thinking is possible that we can change the data type of number of varchar2 data type column in a view?

    Or should I follow create or replace type as whenevr the nonnumeric data tries to bring into view
    sound by giving the number plsql for digital character conversion error since it is a number of data type here.

    I have been created as below in the region of production.

    CREATE OR REPLACE TYPE PROD. (OBJECT) ACE FEATURE_CUSTOM_LIST_OBJ

    OK - but it is a SCALAR - not a collection object

    And the view is created below the base have the PROD. FEATURE_CUSTOM_LIST_OBJ

    CREATE OR REPLACE FORCE VIEW PROD. TERMINAL_FEATURE_TYPE

    No - it isn't. Your type of object is a SCALAR - not a collection. You need create a view on a table or a collection that is treated as a table.

    DDL perspective you posted doesn't even mention your FEATURE_CUSTOM_LIST_OBJ.

    If iam thinking is possible that we can change the data type of number of varchar2 data type column in a view?

    Have you tried using TO_CHAR to format the number as a string?

  • Expression-matter ORA-00932: inconsistent data types

    I'm trying to use the following condition

    Select

    case

    When

    Count (exception.exception_number) > 1

    then 0

    on the other

    ENTITY_TYPE_DEF.NAME

    end name

    With the exception of the table, exception_number has a varchar2 data type. My requirement is such that if the number of exception number is greater than 1, it should show 0 (integer) and if not then see the name column of the entity_type_def table (varchar2).

    My query fails with the following error

    ERROR on line 7:

    ORA-00932: inconsistent data types: expected NUMBER obtained TANK

    Please could someone suggest a workaround solution for above question.

    Hello.

    For example,.

    Select

    case

    When

    Count (exception.exception_number) > 1

    then "0"

    on the other

    ENTITY_TYPE_DEF.NAME

    end name

  • Insert/update the column with the clob data type

    Hi all

    ORCL Version: 11g.

    I have a table with the clob data type.

    Test12

    (col1 clob);

    I'm trying to insert/update to update the column with more than 4000 characters.

    But due to the limitation of tank 4000, I could not Insert/Update.

    Need your help in resolving this issue.

    THX

    Rod.

    The limit of 4000 characters is incorrect.  That pertains only to the varchar2 data type.  A clob can hold more than 4 G.

    Here is an example that shows how to insert it, I found...

    Otherwise, here is a way 'dirty' to do.

    insert into your_table (COLA, COLB)

    values

    (PRIMARY_KEY, PART 1 OF DATA)

    ;

    Update your_table

    Define COLB = COLB | PART 2 OF BIG DATA

    where COLA = PRIMARY_KEY;

    Update your_table

    Define COLB = COLB | PART 3 OF BIG DATA

    where COLA = PRIMARY_KEY;

    .. and so on...

    I don't know that I personally recommend the second style...  But he could do the job.

Maybe you are looking for