Decode and different types of data

Hello

I am using the function decode like this

SELECT decode(:p_group_by_value, 2,rl.group_code , 3,r.relative_code , 4,r.REG_DATE, null)

and there is an error because inconsistent datatypes (4, reg_date).

is there a way to avoid this error? or a replacement for the decode function?

Thanks in advance

Yes, it will not work.

think about doing it. Use to_char for all.

so the numbers also convert char using to_char.

SELECT decode (: p_group_by_value, 2, to_char (rl.group_code), to_char (r.relative_code), 3, 4, to_char (r.REG_DATE), null)

Hope this will help you...

Tags: Database

Similar Questions

  • Initializing the elements of the array to different types of data

    Hello!

    Receiving data sring and write it in the table. Shot data consist of different types of data, so now I have to initialize my element of berries somehow to correct the data type. Table example:

    char

    char

    int

    int

    float

    float

    Is it possible somehow? Or should I use the formula node or something like?

    Thank you! (new)

    These data resembles a cluster to create a cluster, you can create a constant of cluster on the comic book and use the cast function to fill in the cluster. Some things you need to be aware of:

    What is the size of the Int?

    What is the size of the float?

    What is SSE-endian data.

    Here are two examples:

    Tone

  • How can insert different types of data in the table?

    Hello
    How can I insert different types of data in the table, (e.g., numeric and string) in the same index of a table.

    example:
    index0 car 10 green

    car red 11 index1
    Index2 car Blue 12

    where green car red and blue car as string and 10, 11 and 12 in the numeric form.
    then I extracted 10, 11 and 12 a digital table

    and, the green car, red car, blue car in a string array

    Help!

    Use 'Analysis of the chain' as in the picture as an attachment.  This will extract the number and color that you can add tables later.

  • How to ensure the separation of data from different types of data for ESXi 4?

    Does anyone have a reference architecture to ensure the separation of the point of creating data in transit and storage of different types of dataexample PCI DSS data (personal credit card), data ITAR/EAR, etc.  Concern is due to the mix of data VLAN or crossed, VLAN themselves not to use as a security boundary.  VMware offers to ensure the separation at the application levelif I read it correctlywell in transit even in stockdata must be separated.  Suggestions?

    Hello VMwear8,

    The chances of anyone to play with the hypervisor itself is actually quite thin, what must be addressed is the data accessed in virtual machines. If you need protect administrators to access these data.

    Right now that is not possible to 100%, however you can restrict access by implementing different controls:

    (1) execute all access to your ESX hosts and vCenter via the HyTrust appliance, this is a preventive measure in some cases.

    (2) turn off the navigation data store in the vSphere Client (this is a RBAC vCenter)

    (3) turn off 'root' or superuser for each ESX host (except in a situation of "break the glass"). If they need access 'root' follow it via sudo.

    (4) add the audit in order to know who did what, when, where and how

    (5) protect your management tools as if they were gold. Check out this post performance and security management in the virtual environment tools as an aid to help with this.

    At most you can only put controls around the problem, we can not currently permanently prohibit access to one person give you access as being able to connect as root in the ESX host.

    Best regards

    Edward L. Haletky

    Host communities, VMware vExpert,

    Author: VMware vSphere and Virtual Infrastructure Security,VMware ESX and ESXi in the 2nd business edition

    Podcast: the Podcast for security virtualization of resources: the virtual virtualization library

  • Different types of data in the table

    Hello
    I have problem with creating a table that contains different data types (in particular, string, intiger, boolean)
    I'll be thankful, if somebody give me some advice how to fix this

    Thanks in advance

    You must convert all data channels. A table is nothing more that an array of strings 2D and all the elements in an array must be the same data type.

  • DESC, showing the different type of data value via dblink

    Hi friends,

    We have two databases and for two of them, the configuration is as below

    Version of the operating system: Solaris 5.10

    DB version: 10.1.0.4

    For security reasons, I'm going by names of junk. Assume the names of database DB1 and DB2.

    We have a table T1 S1 schema of database DB1. to extract data from this table in DB2 in schema S2, we created a database DB1 and DB2 (lets say the name of dblink is XYZ)

    In DB1, in table T1, we have a column by name SYS_CREATED and its data type is varchar2(40 char).

    After you create the database link, below we have the table as desc

    DESC S1. T1@XYZ

    When we describe this statement, instead of showing the value of data type of column SYS_CREATED as varchar2(40 char), it's showing as varchar2(160 Char).

    Then, we created a table in DB2 under schema S2 as below

    SQL > create table S2. T2 in select * from S1. T1@XYZ;

    and now, when we describe the table T2, its original display value is varchar2 (40 Char).

    Then just when we described, it shows a higher value for the data type and when we create the table, his watch even than the original. In addition, what is happening to only varchar2 datatype. other data types such as number or tank remain same even when we describe.

    one thing is, when he demonstrated a different value using describe, sound exactly multiplying by 4 times. for example, if we have varchar2 (1000 char), the varchar2 (4000 tank) showing

    I would like to know if anyone in this strange situation earlier, if so, what is the reason?

    Thank you very much in advance

    > Unlike when you access a local object, the SELECT privilege is required to access a remote object because the database has no distance describe ability. The database must be a SELECT * on the remote object to determine its structure.

    http://docs.Oracle.com/CD/B28359_01/server.111/b28310/ds_concepts002.htm

    What happens if you give the right to select on the remote object.

    Concerning

    Girish Sharma

  • How to inner join 2 different types of data

    I have 2 tables. and I want to get the name of the branch of table2... but the thing is
    I have 2 different data type to bind or join the two tables.
    tbl1
    -user
    -branch_id (number) e.g. 1,2,3...

    TBL2
    -branch_code (varchar2) e.g. 001, 002, 003...
    -branch_name

    995017 wrote:
    Unfortunately. table 2 has a value of character branch code: (.)

    Well, you can do a join for rows that are convertible to amount

    select
     branch_id
    ,branch_code
    from
    tbl1,
    (select branch_code from tbl2
    where
    -- this is valid for positiv integers
    translate ( branch_code , 'a1234567890', 'a') is null
    ) tbl2
    where
    branch_id = to_number( branch_code )
    

    You can also go further and clean the "dirty branch_codes." To help this, you give some examples of invalid data.

    Published by: chris227 on 20.03.2013 05:19

    Published by: chris227 on 20.03.2013 05:20

  • How to compare two different types of data

    I have two columns from two tables

    Suppose
    Select ced.incident_id in the cs_estimate_details Dec, question ra_customer_trx_lines_all where ratl.interface_attribute6 = ced.order_line_id and org_id = 101 and ced.incident_id = 22222;


    Here the error call 01722 - invalid number

    This is the scenario

    in fact the data type is not valid
    But even if I need to contact how can I do this.

    Published by: Sandy on June 24, 2010 05:46
    SQL> create table t1 as select level col from dual connect by level <= 10;
    
    Table created.
    
    SQL> create table t2 (col varchar2(2));
    
    Table created.
    
    SQL> insert into t2 select level col from dual connect by level <= 10;
    
    10 rows created.
    
    SQL> update t2 set col = 'A1' where col = 1;
    
    1 row updated.
    
    SQL> select * from t1, t2 where t1.col = t2.col;
    select * from t1, t2 where t1.col = t2.col
                                        *
    ERROR at line 1:
    ORA-01722: invalid number
    
    SQL> select * from t1, t2 where to_char(t1.col) = t2.col;
    
          COL CO
    --------- --
           10 10
            2 2
            3 3
            4 4
            5 5
            6 6
            7 7
            8 8
            9 9
    
    9 rows selected.
    
    SQL> 
    

    T1.Col = NUMBER
    T2.Col = VARCHAR2

    You can read these:

    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:45012348053
    http://asktom.Oracle.com/pls/Apex/f?p=100:11:0:P11_QUESTION_ID:11504677087008

  • unite with different types of data

    Hi all

    I am working in Oracle 10 g R2.

    I have the following function and each record would have one of the below fields filled... where Im trying to get the value non-zero to be the 'actual_data '. When I try to run I get the following error

    VALUE_NBR is a NUMERIC field in the table
    VALUE_DT is a DATE field in the table
    VALUE_CD is a VARCHAR2 in the table
    VALUE_TXT is a VARCHAR2 in the table
    ORA-00932: inconsistent datatypes: expected NUMBER got DATE
    COALESCE(VALUE_NBR,VALUE_DT,VALUE_CD,VALUE_TXT) AS ACTUAL_DATA,
    Please suggest me a solution or an alternative... I tried NVL... who had the same error as well.


    Thanks in advance
    HU

    Convert the dates and numbers to strings:

    coalesce( to_char(value_nbr)
            , to_char(value_dt, 'yyyymmddhh24miss') -- or some other format mask
            , value_cd
            , value_txt
            ) as actual_data,
    
  • Problems with WMP54G and different types of connections

    Good so I had originally a WPA network, but the computer that I was using this adapter could not connect to it.  When I called the help line that the woman told me that I needed to change the connection to a WEP, because of the computer being a "battery 2.  So I did, and it worked.  But then we discovered that one of our laptops to work cannot connect to WEP key because of the limitations of security set by the company.  Of course, the work computer is more important, so we had to return the WPA connection, and of course, the computer with the WMP54G could not connect.

    I went out and drivers me for the card, but when I tried to install it told me I had already.  So I do not know where to go from here.  Any suggestions?

    AS the drivers for the card is already installed on your computer, the best way is to upgrade the Service Pack on your computer. Open IE and click on 'Tools' Menu bar and click on Windows Update, this will download all later corrected from the Microsoft Web site and once the update the complited, then your computer can connect to your network using WPA security.

  • data binary file plugin: navigate through different types of data

    Hello

    I am currently trying to load a binary file in DIAdem with the following structure:

    block 1

    1 x 8 - bit ascii

    12 x double

    block 2

    int16 1280 x

    block 3

    int16 1280 x

    block 4

    12 x double

    Block 5

    int16 1280 x

    block 6

    int16 1280 x

    block 7

    12 x double

    block 8

    int16 1280 x

    block 9

    int16 1280 x

    ...

    I managed to read the first value chain, but I did not get any further.

    Could you please give me an advance on how to proceed?

    / Phex

    Hello Phex,

    Try this. Not sure its exactly what you are looking for, but probably close.

    Andreas

  • different type of terminals of elapsed time of the DAQ assistant

    I connected a digital relay to one of the outputs. I have installation wizard DAQ to operate a valve with the relay. Now, I want to control the valve to drive all... .lets say 20 seconds, until I stop the program. What I need, is to change the State of each 20 seconds. I tried to use the "Out of time", but when I try to connect 'elapsed time' 'Data' on the ass of data acquisition. It reports on the different types of data. What would be the way easy and clean to use a "timer" to operate a relay on a basis of time fixed and periodic? Thanks in advance!

    I enclose a picture of my horrible test...

    I'm using Labview student 2009 edition.

    Put an is not in there also.

  • determination of the sampling rate and the frequency waveform data record

    Hello

    I write a simple program that collect data from a triaxial accelerometer input, convert it to a frequency spectrum, and then save the time domain and the frequency of the waveforms in an external file separated.  I don't understand how to set the sampling frequency, however.  On the DAQ Assistant, I updated the acquisition mode "Samples continues" and read samples is 2 k, which corresponds to the total number of data points that are collected.  How can I program sampling for awhile, it 30 seconds, for example?  Wouldn't be better to set up a trigger, as it will continue to collect data up to what I told it to stop?

    I also want to save waveform data in a separate file that can be easily seen by other computers that have not installed Labview.  I have currently the program put in place to convert a text string of the waveform of the time domain and then save it in a text file or a spreadsheet.  It works fine, but I would also like to record the frequency wave, which is a different type of data.  How can I do this or is there a better way?

    My program is attached.  Thanks for your help!

    Here's how you can use the shift register to build the table, and also where you can choose to play exactly 100 samples per while the loop iteration.

    Brian

  • File containing different types of question

    Hello

    I have a use case where I need to play the file with different types of data delimiter, for example:



    ABC, 123, xyz


    Thank you.

    Hello

    This seems doable with nxsd. In our case, each line seems to be a different record type and you can handle this case with a sequence of elements (one for each record type).

    For example,.

    <[...]>

  • Mix the virtual switch different type in a Cluster and a data center.

    Can I mix standard virtual switch and a virtual switch distributed in different hosts to a Cluster/DataCenter? Can I vMotion virtual machine to a host of switch distributed to a host of standard switch and vice versa? Let's assume that the hosts have the same port group name (but have virtual swaitch different type), in the same data center, and have the same subnet IP vMotion.

    You can mix standard switches and distributed, that's what we call hybrid architecture... but to be able to migrate virtual machines between virtual switches, you must the vSphere 6 and again there are some limitations, like not be able to migrate from VDS vs.

    Have a look here for more details on the cross switch vMotion: http://www.vladan.fr/vmotion-enhancements-vsphere-6-0/

Maybe you are looking for