Problem with the DATA types, in a UNION

Hello
I m trying to disply a custom message when no data found using the structure below. Unfortunately I ve you have a problem with the data types I im trying to union
I tried different types of data in the 2nd SELECTION tool but the rest of the problem. Help, please.

SELECT HOSP_NAME 'HOSPITAL' DOC_SUR 'NAME', 'NAME' DOC_NAME, d.DOC_ID ID, diagnosis
H., DOCTOR d, (SELECT d.DOC_ID, COUNT (d.DIAGN_ID) diagnosis
OF PATIENT_DIAGNOSIS d
GROUP BY d.DOC_ID)
WHERE diagnosis > 1

UNION ALL

SELECT TO_CHAR ('test'), TO_CHAR ('test'), TO_CHAR ('test'), TO_CHAR ('test'), 0
OF THE DOUBLE
If NOT EXISTS (HOSP_NAME 'HOSPITAL' 'NAME' 'NAME' DOC_NAME DOC_SUR, d.DOC_ID ID, diagnosis
OF ΝΟΣΟΚΟΜΕΙΟ h, ΙΑΤΡΟΣ d, (SELECT d.DOC_ID, COUNT (d.DIAGN_ID) diagnosis
OF PATIENT_DIAGNOSIS d
GROUP BY d.DOC_ID)
WHERE diagnosis > 1);


ORA-01790: expression must have same type of data, matching expression
01790 00000 - "expression must have the same type of data, matching expression.

DOC_SUR 'NAME' DOC_NAME 'NAME', ID d.DOC_ID, HOSP_NAME "HOSPITAL", diagnosis

What is the data type for these columns

To_char('test'), to_char ('test'), to_char ('test'), to_char ('test'), 0

What you're doing here 'test' is already a character. Why do you use TO_CHAR?

Tags: Database

Similar Questions

  • Problem with the data type date

    Hi team


    I'm very confused in the associated date coversion

    for example if I have question
    Select name, hire_date from employee

    the o/p looks like this

    Suresh 24/05/1999, but if I need to display as 24-May-1999, should I use
    and please help me understand

    Function TO_NUMBER to_char TO_DATE, I bit confused in this? Please you can get a few suggestion to laymensterm

    Thank you
    Suresh

    If you want to present a DATE data type in a specific format, you will use TO_CHAR.
    If you want to transform a (varchar2) STRING to a DATE data type in a specific format, you will use TO_DATE.
    Never compare strings to dates
    Never compare strings to numbers
    You never rely on implicit data type conversions
    Long version:
    http://asktom.Oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:2858890655722

  • Problems with the date and time - have to reset the date & time on reboot

    original title: problems with the date and time

    Whenever I turn on my computer (Windows XP 2002) I click on F2.  Then I re - set the date and time it occurred in January 2006 1 h every time I have turn off the computer.  Can someone tell me what I need to do?

    You need to replace the battery in time clock (RTC) real of your computer.  It can also be called the CMOS or BIOS battery.

    Many computers, this battery is an inexpensive CR2032 button available in almost every pharmacy corner.  There are, however, some computers (especially laptops) that require a different (and probably more expensive) battery.

    Whatever the expense, almost all of these batteries are easy to replace.

    To get help, post back with the brand and model of your computer.

  • Problems with the data connection

    Hello
    I bought a Z3 Compact Xperia on December 10, 2014. I live in Italy and I use Vodafone as my everyday.
    I got a SIM card replacement nano with LtE capabilities just to get the phone in the new fast network. The problem I encounter is that, since on January 13, 2015, I had some problems with the data in mode 3 G connection.
    So far, I used my phone normally, then I tried to send a text message with WhatsApp and phone stuck with the clock icon in the lower corner of the bubble of the message. I thought it was a temporary network problem but I'm not sure about this.
    I live in a small town where the coverage is really good, either in 3G and LTE. I tend to use the 3G because it uses less battery and it does not affect my 4G data plan.
    Th issue, it's that if I do a speedtest when I feel that network glitch I have a ping, but with very good download speeds up to 2000ms.
    The problem is that I believe that this is not a network problem because my mother has a phone HtC One S and runs vodafone without problem even when I'm having the glitch.
    I tried to reset the phone to factory settings, but it did not help.
    In LTE / 4G I do not experience this issue. In fact, I think if there is problem need a phone related software because the antenna works very well.
    If it doesn't I'll try to contact ad Vodsfone then I'll send my phone for the helpdesk if Vodafone tell me that the question is not on their network.

    Thanks in advance for your help.
    Simone

    It's pretty strange, double check the APN settings and contact EE in this regard.

  • How to make a list of question field with the data type DATE?

    I have a column with the DATE data type. Using forms 6i I want to generate a poplist field of list item with this column while the value of the items in the list of names of days like SATURDAY, SUNDAY, MONDAY. If we change the date to a char data type, it won't work properly, but now with the data type DATE behind him, it gives the following error message

    "FRM-32082: invalid value for given the type of element."
    List WEEKREST
    Article: WEEKREST
    Block: EMPRESTS
    Form: module 3
    FRM-30085: unable to adapt to the shape for the release. »


    Using forms 6i how a list item field type DATE data which may contain names of days?

    Set your date as a hidden field (not shown) column. Create your item list with the names of day of varchar2. Create the list item as a base table field that accepts the values of text in the names of the days. On this area, create a when-validate-item trigger that translated the text into an actual date that it then uses to set the value of the real object of the base table.

  • problem with the CLOB type

    Hello, I am a beginner, I have a problem with the CLOB type, please help me
    I want to write the input file is filename and string base64, then output decoded base64 content in dicrectory location (for example C:\),my code was executed but if entry with base64 long string, it displays error)
    ORA-29285: file write error
    ORA-06512: at "SYS.UTL_FILE", line 136
    ORA-06512: at "SYS.UTL_FILE", line 813
    ORA-06512: at "SYSTEM.WRITED", line 9
    ORA-06512: at line 1
    29285. 00000 -  "file write error"
    *Cause:    Failed to write to, flush, or close a file.
    *Action:   Verify that the file exists, that it is accessible, and that
               it is open in write or append mode.
    And this is my code
    create or replace directory dir_temp as 'C:\';
    /
    create or replace procedure writed(filename varchar2,code  clob)
    as
      f utl_file.file_type;
      v_lob          BLOB;  
    
    begin
      v_lob :=  UTL_ENCODE.BASE64_DECODE( UTL_RAW.CAST_TO_RAW(to_char(code)) ); 
      f := utl_file.fopen('DIR_TEMP', filename, 'w');
      utl_file.put_line(f,to_clob(utl_raw.cast_to_varchar2(v_lob)));  
      utl_file.fclose(f); 
    end;
    Thank you
    DBMS_XSLPROCESSOR.clob2file(
      cl => l_clob
    , flocation => 'XML_LOG'
    , fname => myfile_name
    );
    

    for example

    SQL> ed
    Wrote file afiedt.buf
    
      1  declare
      2    type t_emps is table of emp%ROWTYPE;
      3    v_emps    t_emps;
      4    --
      5    v_clob    clob;
      6    v_newline varchar2(2) := chr(13)||chr(10);
      7  begin
      8    -- get the rows into a PL/SQL collection of records
      9    select *
     10    bulk collect into v_emps
     11    from emp;
     12    -- build up the CLOB
     13    v_clob := 'EMPNO,ENAME,JOB,MGR,HIREDATE,SAL,COMM,DEPTNO';
     14    for i in 1..v_emps.count
     15    loop
     16      v_clob := v_clob||v_newline||
     17                to_char(v_emps(i).empno,'fm9999')||','||
     18                v_emps(i).ename||','||
     19                v_emps(i).job||','||
     20                to_char(v_emps(i).mgr,'fm9999')||','||
     21                to_char(v_emps(i).hiredate,'YYYYMMDD')||','||
     22                to_char(v_emps(i).sal,'fm99999')||','||
     23                to_char(v_emps(i).comm,'fm99999')||','||
     24                to_char(v_emps(i).deptno,'fm99');
     25    end loop;
     26    -- write the CLOB to a file
     27    DBMS_XSLPROCESSOR.clob2file(cl => v_clob, flocation => 'TEST_DIR', fname => 'myfile.csv');
     28* end;
    SQL> / 
    
    PL/SQL procedure successfully completed.
    
  • problems with the date picker

    I found some problems with the date picker to make my first presentation of object BPM.

    I created a group with a datetimestamp it contains. When I click on it in run mode, it will bring a new tab in the browser. This behavior is different from that of a date picker outside a group where there just a small javascript popup.

    Anyway around this problem?

    Also, would be nice if could be set by default to the current date. is there a way to who?

    For the component "time" it seems impossible to define the default value - at least on the tab object structure.

    Thank you

    Try to set the property "DHTML" to control date Yes. This option is under the Properties tab-> the calendar section. This will force it to use the popup javascript on screen instead of opening a new browser window/tab.

    To set a default value for a date/time, you can simply set the value in the constructor of the BPM object in which the property is located.

  • Problems with the date in the procedure on Oracle 11 g

    Hi gurus,

    I have some problems with the date under Oracle 11 g format.

    Let me explain the situation:

    When I start such a request
    Select to_number (to_char (to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'))
    of sys.dual

    I had as a result 2009 under the number.

    When I do the same thing in a procedure of a package like this

    my_year: = to_number (to_char (to_date('01.04.2009','dd.mm.yyyy'), 'yyyy'));

    the my_year variable contains the value 9 instead of 2009.

    Can someone explain to me what goes wrong?

    I just tested with the evolution of the variable nls_date_format of environment for the session and the database is complete without success.

    Kind regards
    Björn

    Yes, it has everything to do with your environment settings.

    SQL> set serveroutput on;
    SQL>
    SQL> declare
      2    my_date date;
      3    my_zeitstempel varchar2(32767);
      4    my_tageswechsel float;
      5  begin
      6    my_zeitstempel := '01.03.1998 07:00';
      7    my_tageswechsel := .25;
      8    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
      9    dbms_output.put_line( my_date);
     10  end;
     11  /
    01-MAR-98
    
    PL/SQL procedure successfully completed.
    
    SQL> alter session set nls_date_format = 'dd.mm.yyyy hh24:mi:ss'
      2  /
    
    Session altered.
    
    SQL> declare
      2    my_date date;
      3    my_zeitstempel varchar2(32767);
      4    my_tageswechsel float;
      5  begin
      6    my_zeitstempel := '01.03.1998 07:00';
      7    my_tageswechsel := .25;
      8    my_date := to_date (substr (my_zeitstempel, 1, 10), 'dd.mm.yyyy') + my_tageswechsel +1/24;
      9    dbms_output.put_line( my_date);
     10  end;
     11  /
    01.03.1998 07:00:00
    
    PL/SQL procedure successfully completed.
    
  • How to auto-off rounded af:inputText liaison with the data type Double?

    Hello Experts,

    If a component af:inputText is bind with a field whose data type is Double I saw if I enter 12.0 in the text field, and then it changes automatically to 12. Another example: 12,010 turns into 12.01.

    My requirement is to maintain the value that it has been seized. But the validation client side of the field, that ADF provides by default, should be present. I mean that ADF throws the error message if I get 12a.01; as it is not a Double.

    How can I achieve this?

    Any pointer would be vary useful.

    JDeveloper version: 11.1.1.6.0

    No, what I mean is that if you keep the zeros on the right, the data type is not a Double.

    Once you save 12.010 and read it again, you will see zero residue. You would see only the zero if you or the other say the number still show for example 3 fraction digits or if you store the value as a string that will store the entry as is and use a regular expression validator to ensure that only valid numbers are entered.

    In the first case ever number has 3 digits of fraction for example 12-> 12.000 and 12.010-> 12.010

    In summary, you will need to decide which way to go. If the data type must be Double, then there is no zero leakage or you must use the minFractionDigits which will always use the zero leak until the number of spezified. If the does not like what you have to store strings.

    Timo

  • MessageTextInput element with the Data Type - Date

    I'm working on an extension customized using OAF in a region where there are a few things and one of them is a 'messageTextInput '.
    Here I put the Data Type as 'Date' so that the date selection dialog box is displayed for the user to select the date from.
    However, when the user selects the date in the date box, messageTextInput box fills with a date in the form ' 12.7.11"but I want the date appears as July 12, 2011.
    Can someone let me know how to achieve this.

    Concerning
    Hawker

    Hawker,

    Click on Preferences and check regional > setting of the territory.

    Let me know the value that you have it here.

    Kind regards
    GYAN

  • problem with the data record

    Hi, I'm new to LabView so I know that the thing I'm doing is relatively easy, however, I'm stuck.

    I made a small program that gets 5 steps (for now replaced with random numbers) and as well as the date and time data in the text file. I intend to run the program for long periods of time, so I want to increment the file name/path every hour, but after the addition of this part of the program does not create any file, although the program runs without error.

    Block diagram is attached, could someone point out to me what is wrong and what I should do to reach my goal?

    Thanks in advance!

    Hi marcis,.

    Acually, the logic of the program was completely wrong.

    1. your comments the file path will never help you. Because after leaving of while loop, the structure of matter will run once and LV will stops running.

    2. open and close the datalog only once file. Try to make all your manipulations between opening and closing your file datalog. Otherwise, it will be difficult to manage when you develop your code.

    3 case construction outside the loop is meaning less. If you want to run the program permanently, place all functions inside the while loop you want to run. While the loop will run continuously until you get satisfied.

    4. incorrect data streams. All programmers need well with the data stream.

    Just go into the basics of labview here and try to realize your logic again

  • How to display sysdate + 1 on the MessageTextInput field with the data type Date

    Hello

    I have a class messageTextInput that the data type Date. I am able to view the sysdate in the area of the messageTextInput, now my requirement is I have to post sysdate + 1. Please let me know how to proceed.

    This is my code:

    TXN OADBTransaction = (OADBTransaction) am.getTransaction ();
    EntryDate date = txn.getCurrentDBDate ();
    System.out.println ("DATEEE > > > > > > > > >" + entryDate);
    masterRow.setAttribute ("EffectiveDate", entryDate);

    Kind regards
    Suresh.

    SELECT double ADD_MONTHS(sysdate,12)

  • Problem with the date and update form (show 1970-01-01)

    Hi, I have an update form (php/mysql) with several date entry field. When my date is 000-00-00 I show 1970-01-01. Why?

    This is the code:

    label for = "data_chiusura" > < strong > data chiusura < facilities > < / label >

    < input type = "text" name = "Data_chiusura" value = "<?" PHP echo $string = $row_Recordset1 ["data_chiusura"];

    If ($string = ' 0000-00-00') {}

    $string = ";

    } else {}

    $string = date ("d-m-Y", strtotime ($string));

    } ; ? ">" id = "Data_chiusura" >

    Thank you

    k

    Try this-

    "id ="Data_chiusura">"

  • 5 d Classic - problems with the Date of creation on the files

    I use Bridge CS5 v 4.1.0.54 and am having a problem with my 5 d classic, where some of my photos are dated correctly, and then some are dated as 11 hours later. They were all kick the same camera and same lens (no), a few seconds apart. Date information only appear to be incorrect in Bridge and are therefore sorted incorrectly, making it difficult for the workflow. However, I still have the pictures on my camera, so I took the CF card and examine its contents in Windows. In this case, all dates seem to match and be consistent. I posted in other forums, and most have suggested that there is probably a problem with Bridge, ACR, or Photoshop.

    I have provided links below for an example of images with different info Date created by bridge and then the correct information of the Date of creation in Windows when you view them on the map see

    I saw cela in at least two different scenarios recently. Haven't looked through all of my recent photos still to say whether or not it's got more than that.

    Any help would be appreciated.

    Thank you

    Jamie

    -Adobe http://www.jamiegphotography.com/portals/0/images/datecompare.jpg

    -Windows http://www.jamiegphotography.com/portals/0/images/PhotosWindows.jpg

    Have seen the problem before.  Two things to try.

    1. empty the cache in the folder with the bad weather (Tools/cache/purge cache folder xxxx).

    2. read this link http://forums.adobe.com/thread/854763.  The guy is from Austrialia and concluded that, after a certain time bridge labled it the next day.  Where are you from?

  • complex customer KSOAP of web service with the data type

    I had created my client to the web service using ksoap sample. This works very well in the Simulator.

    Now, I am creating the web service to the complex data type client. For the same thing, I want any heel KSOAP generator tool. Please suggest any tool. If this type of tool is not available then please guide me standard procedure for the management of complex data types in ksoap.

    help will be appreciated.

    Have you tried the SUN WTK stub generation tool?

Maybe you are looking for

  • W510 - install RAM

    Hi guys! I've had my W510 for about 4 months now, and I couldn't be happier. However, I recently bought 8 GB of ram (1 333 Mhz - 2 x 4 GB) to replace my current setup of 2x2gb 1066 Mhz. I found an installation guide on the Lenovos site that guided me

  • Download live streaming video

    I want to download live streaming video on my computer (my daughter-in-law live sonogram) if my husband can view them later.  Any suggestions?

  • Hi just removed hp surport prog by misstake

    restored restoration of hp prog it used now update 3 up all removed errow message went on hp website to download the copy the most recent hp surport assident applercation update message said: the update did not complete ok. errow-{3} message to the t

  • 2050 Deskjet and Mac OS x 10.10 Yosemite A

    I recently bought a MacBook Air with os x 10.10 Yosemite.  Got a deskjet 2050A already, so I downloaded the OSX driver on the site of HP, but impossible to print. I am sure that the driver is installed as I can scan correctly and when I try to print,

  • Increase the limit of maximum number of connections for a shared folder

    Hello On Windows 7,. I recently faced a problem where a folder is able to receive only 20 concurrent connections. On Google, I came to know that this is the default behavior of windows and it was clarified in the windows "end-user license agreement".