What's wrong with this query--need help

Requirement: need to get the names of employees who were hired on tuesday this has to use to_char function
select ename
from emp
where to_char(hiredate,'day')='tuesday';
when i execute the query
o/p is no rows selected
please help.
thanks in advance.

Hi,
861173 wrote:
Requirement: need to get the names of employees who were hired on tuesday this has to use to_char function
select ename
from emp
where to_char(hiredate,'day')='tuesday';
when i execute the query
o/p is no rows selected Try:
WHERE   TO_CHAR (hiredate, 'fmday')  = 'tuesday'Without 'FM" in the 2nd argument, TO_CHAR pads the results to make it a consistent length. If your NLS_DATE_LANGUAGE=ENGLISH, that means it will always return a 9-character string, since the longest name in English ('Wednesday') has 9 letters. 'FM' (case-insernsitive) tells TO_CHAR not to add that kind of padding.

Similar Messages

  • What is wrong with this? pls help!

    I have this as a listener for a JButton:
         public void actionPerformed(ActionEvent e){
              try{
                   Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
                   String url = "jdbc:odbc:RezSystem";
                   Connection con = DriverManager.getConnection(url, "user10", "");
                   PreparedStatement stmt = con.prepareStatement("select cPassword from RezShopper where cShopperID = ?");
                   stmt.setString(1, textSignInName.getText());
                   ResultSet res = stmt.executeQuery();
                   if(res.next()){
                        String tp = String.valueOf(passPassword.getPassword());
                        String dp = res.getString(1);
                        System.out.println("text field = " + tp);
                        System.out.println("database = " + dp);
                        if (dp.equals((String)dp)){
                             System.out.println("Password accepted");
                        else{
                             System.out.println("Invalid password");
                   else{
                        System.out.println("Invalid sign in name");
              catch(Exception ex){
                   System.out.println(ex);
         }this is used to compare the value in a password field and a value in a column in an sql data base with a char data type and should check if they are the same. The problem is that even if they are the same it still prints out "Invalid password". What went wrong???
    thanks

    dp.equals(dp) should give you true, but I guess you meant dp.equals(tp). To debug it, I would print the character values of both strings. You don't need to cast the String to a String before you call equals..
    for (int x = 0; x < dp.length(); x++)
      System.out.println("dp("+x+")="+(int)dp.charAt(x));
    for (int x = 0; x < tp.length(); x++)
      System.out.println("tp("+x+")="+(int)tp.charAt(x));I assume that getPassword returns a char array and not a byte array. If it returns a byte array, it is possible that the charset encoding gives you a different string than you expected.

  • What is wrong with this query?

    Hi,
    The below query is showing this error:
    ORA-01788:CONNECT BY LOOP in user data.
    Please let me know where i am going wrong?
    The data in the table xx_dates is :
    Empno        date1                      date2
    1           20-JAN-2008            24-JAN-2008
    2           20-JAN-2008            20-JAN-2008The query i am using is:
    select empno,date1,date2,date1+level-1,level,DBMS_RANDOM.random
    from xx_dates
    connect by empno=prior empno  start with empno=1
               and date1 <= date2-level + 1Edited by: Sreekanth Munagala on Nov 17, 2008 6:01 AM

    Or maybe it's this you are looking for...
    SQL> ed
    Wrote file afiedt.buf
      1  with xx_dates as (select 1 as empno, to_date('20-JAN-2008','DD-MON-YYYY') as date1, to_date('24-JAN-2008','DD-MON-YYYY') as date2 from dual union all
      2                    select 2, to_date('20-JAN-2008','DD-MON-YYYY'), to_date('20-JAN-2008','DD-MON-YYYY') from dual)
      3  --
      4  select empno,date1,date2,date1+level-1,level,DBMS_RANDOM.random
      5  from xx_dates
      6  connect by level <= (date2-date1) + 1
      7* start with empno=1
    SQL> /
         EMPNO DATE1                DATE2                DATE1+LEVEL-1             LEVEL     RANDOM
             1 20-JAN-2008 00:00:00 24-JAN-2008 00:00:00 20-JAN-2008 00:00:00          1 -291581367
             1 20-JAN-2008 00:00:00 24-JAN-2008 00:00:00 21-JAN-2008 00:00:00          2 1347815622
             1 20-JAN-2008 00:00:00 24-JAN-2008 00:00:00 22-JAN-2008 00:00:00          3 -595509310
             1 20-JAN-2008 00:00:00 24-JAN-2008 00:00:00 23-JAN-2008 00:00:00          4 -1.602E+09
             1 20-JAN-2008 00:00:00 24-JAN-2008 00:00:00 24-JAN-2008 00:00:00          5 -1.511E+09
    SQL>

  • What's wrong with this query ?

    v_SQL := 'OPEN RCT' || v_iLevel || ' FOR
                   SELECT     datasets.*,
                        CASE fn_GetSupplierStatus(:p_SupplierID, DatasetID)
                             WHEN 1 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 1)
                             WHEN 3 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 2)
                             WHEN 4 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 3)
                             WHEN 5 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 4)
                             ELSE
                                  CASE IsDataset
                                       WHEN 0 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 5)
                                       ELSE SMfn_GetSpecifiedRow(:p_SupplierStatus, 5)
                                  END
                             END AS CStatus,
                             CASE fn_GetUserPermission(:p_UserID, DatasetID)
                                  WHEN 2 THEN SMfn_GetSpecifiedRow(:p_UserPermission, 1)
                                  ELSE
                                       CASE IsDataset
                                            WHEN 0 THEN ''''
                                            ELSE SMfn_GetSpecifiedRow(:p_UserPermission, 2)
                                       END
                             END AS UStatus,
                             SMfn_DatasetHasChildren(DatasetID) as HasChildren,
                             :p_RoleID as RoleID
                        FROM datasets
                        WHERE     Level_ = :v_iLevel';
              raise_application_error(-20001, v_SQL);
              execute immediate v_SQL
                   using     p_SupplierID, p_SupplierStatus, p_SupplierStatus, p_SupplierStatus, p_SupplierStatus,
                        p_SupplierStatus, p_SupplierStatus, p_UserID, p_UserPermission, p_UserPermission, p_RoleID, v_iLevel;
    What I am trying to do is to populate the cursor using a dynamic query, so that I can change cursor name each time.
    All functions used exist, and still I get this error: Invalid SQL statement.
    Is it possible to populate a cursor which is a parameter to the procedure (ref cursor) with a dynamic query ?
    Thanks.

    this is the query that gets executed:
    OPEN RCT1 FOR
                   SELECT     datasets.*,
                        CASE fn_GetSupplierStatus(:p_SupplierID, DatasetID)
                             WHEN 1 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 1)
                             WHEN 3 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 2)
                             WHEN 4 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 3)
                             WHEN 5 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 4)
                             ELSE
                                  CASE IsDataset
                                       WHEN 0 THEN SMfn_GetSpecifiedRow(:p_SupplierStatus, 5)
                                       ELSE SMfn_GetSpecifiedRow(:p_SupplierStatus, 5)
                                  END
                             END AS CStatus,
                             CASE fn_GetUserPermission(:p_UserID, DatasetID)
                                  WHEN 2 THEN SMfn_GetSpecifiedRow(:p_UserPermission, 1)
                                  ELSE
                                       CASE IsDataset
                                            WHEN 0 THEN ''
                                            ELSE SMfn_GetSpecifiedRow(:p_UserPermission, 2)
                                       END
                             END AS UStatus,
                             SMfn_DatasetHasChildren(DatasetID) as HasChildren,
                             :p_RoleID as RoleID
                        FROM datasets
                        WHERE     Level_ = :v_iLevel
    The select works fine (without "Open RCT1 FOR") if I try to run it, but when trying to populate the cursor, I get the error Ivalid SQL statement.

  • What's wrong in this? Need help please..

    CREATE OR REPLACE PROCEDURE UPDATE_SOMETABLE
    IS
    BEGIN
    LOOP
    UPDATE SOMETABLE
    SET SEQ_NO = MYSEQ.NEXTVAL
    WHERE ROWNUM<1000;
    EXIT WHEN SQL%ROWCOUNT = 0;
    END LOOP;
    COMMIT;
    END;
    /

    I need  a way to commit rows in batches based on the rownum.Isn't this violating the ACID rule of database? A transaction should not be committed until it is fully complete.
    Check - Atomicity (database systems)
    >
    Example: If one wants to transfer some amount of money from one account to another, then he/she would start a procedure to do it. However, if a failure occurs, then due to atomicity, the amount will either be transferred completely or will not even start. Thus atomicity protects the user from losing money due to a failed transaction.

  • What is wrong with this api Pls help

    I am creating api to migrate jobs from an extenal table to hr but when executing the script it only inserts the first record and gives this message
    "-20001 ORA-20001: The job you have entered already exists in this Business Group. Please enter a unique name for your job."
    as I mentioned the job which he means already created is the first row of the table
    here is the code
    DECLARE
    l_count Number :=0;
    v_business_group_id Number :=101;
    v_date_from date := TO_DATE('01-01-1900','DD-MM-YYYY');
    v_job_group_id number := 21;
    v_object_version_number number :=1;
    v_segment1 varchar2(10);
    v_segment2 varchar2(150);
    v_attribute2 varchar2(150);
    v_attribute3 varchar2(100);
    v_attribute4 varchar2(50);
    v_attribute5 varchar2(50);
    v_attribute6 varchar2(50);
    cursor job is select DESGN_CODE,
         DESGN_DESP_M_A,
         DESGN_DESP_F_A,
         DESGN_DESP_E ,
         DESGN_TYPE ,
         DESGN_CAT_CODE,
         GRP_CODE
    from aa_tdesignation
    Where rownum < 10
    and desgn_desp_e is not null;
    v_segment5 varchar2(100) := NULL;
    v_segment6 varchar2(100) := NULL;
    v_job_id number;
    v_job_definition_id number;
    v_name varchar2(100);
    begin
    dbms_output.put_line('##########################################################');
    dbms_output.put_line('Data Migration Of Jobs:');
    dbms_output.put_line('##########################################################');
    dbms_output.put_line('Start Time : ' || TO_CHAR(SYSDATE,'DD-MON-YYYY HH24:MI:SS'));
    for my_cur in job
    LOOP
    BEGIN
    v_segment1 := my_cur.DESGN_CODE;
    v_segment2 := my_cur.DESGN_DESP_M_A;
    v_attribute2 := my_cur.DESGN_DESP_F_A;
    v_attribute3 := my_cur.DESGN_DESP_E;
    v_attribute4 := my_cur.DESGN_TYPE;
    v_attribute5 := my_cur.DESGN_CAT_CODE;
    v_attribute6 := my_cur.GRP_CODE;
    HR_JOB_API.CREATE_JOB
    (p_business_group_id => v_business_group_id
    ,p_date_from => v_date_from
    ,p_job_group_id => v_job_group_id
    ,p_object_version_number => v_object_version_number
    ,p_segment1 => v_segment1
    ,p_segment2 => v_segment2
    ,p_segment5 => v_segment5
    ,p_segment6 => v_segment6
    ,p_attribute2 => v_attribute2
    ,p_attribute3 => v_attribute3
    ,p_attribute4 => v_attribute4
    ,p_attribute5 => v_attribute5
    ,p_attribute6 => v_attribute6
    ,p_job_id => v_job_id
    ,p_job_definition_id => v_job_definition_id
    ,p_name => v_name);
    Dbms_output.put_line('Sucess'||' '||my_cur.DESGN_CODE||' '||my_cur.DESGN_DESP_M_A);
    L_COUNT:=L_COUNT+1;
    END;
    END LOOP;
    DBMS_OUTPUT.PUT_LINE ('Total Nubmer of record'||L_COUNT);
    Exception
    When others then
    dbms_output.put_line(sqlcode||' '||sqlerrm);
    DBMS_OUTPUT.PUT_LINE ('Total Nubmer of record'||L_COUNT);
    end;
    Thanks

    You've got to remove either the semicolon or the slash at the end of the script as both will execute it, so the second time with the same info it fails.

  • Any see what is wrong with this query?

    Logs Record Set - query - Top 4 of 4 Rows
    ATTRIBUTES DATELASTMODIFIED DIRECTORY MODE NAME SIZE TYPE
    1 [empty string] 06/06/2007 10:59:17 AM
    G:\Tracker\wwwRoot\Data
    [empty string] ChargedOut_06Jun2007_ILS_105634322.txt 828
    File
    2 [empty string] 06/06/2007 10:57:00 AM
    G:\Tracker\wwwRoot\Data
    [empty string] Error_06Jun2007_ ILS_105634322.txt 88 File
    3 [empty string] 06/06/2007 10:58:46 AM
    G:\Tracker\wwwRoot\Data
    [empty string] Final_06Jun2007_ ILS_105634322.txt 27841 File
    4 [empty string] 06/06/2007 10:56:07 AM
    G:\Tracker\wwwRoot\Data
    [empty string] Upload_06Jun2007_ ILS_105634322.txt 94768 File
    ChargeOut Stats - struct
    CACHED false
    COLUMNLIST NAME
    EXECUTIONTIME 0
    RECORDCOUNT 0
    SQL SELECT Name FROM Logs WHERE Name = 'ChargedOut_06Jun2007_
    ILS_105634322.txt'
    chargeOut Record Set - query - Top 0 of 0 Rows
    NAME
    CODE
    <cfdirectory directory="#ExpandPath('data')#"
    action="list" name="Logs"
    sort="Name">
    <cfquery dbtype="query" name="ChargedOut"
    result="stats">
    SELECT Name
    FROM Logs
    WHERE Name = 'ChargedOut#Set#.txt'
    </cfquery>
    I can not see why SELECT Name FROM Logs WHERE Name =
    'ChargedOut_06Jun2007_ ILS_105634322.txt' is not returning
    the
    corresponding record from the logs record set.

    Thanks, I finally saw the errant white space character!

  • What is wrong With My Query

    Pleas what is wrong with this query
         select h.business_unit_id bu, h.edi_sequence_id seq, d.edi_det_sequ_id dseq, s.edi_size_sequ_id sseq, h.po_number po, h.total_unit tUnit, h.total_amount tDollar, s.quantity qty, s.unit_price price,
    (select (case when count(*) = 0 then 'N' else 'Y' end)
    from(select s.business_unit_id, s.edi_sequence_id, s.edi_det_sequ_id, s.edi_size_sequ_id
    from sewn.nt_edii_purchase_size s
    where s.business_unit_id='01'
    and s.edi_sequence_id = '168420'
    and (s.edi_sequence_id, s.edi_det_sequ_id, s.edi_size_sequ_id) not in
    (select edi_sequence_id, edi_det_sequ_id, edi_size_sequ_id
    from sewn.nt_edii_po_det_error
    where business_unit_id = '01'
    and edi_sequence_id='168420'
    and error_code in(select error_code
    from sewn.nt_edii_error_codes
    where severity='CR'))))eligible
    from sewn.nt_edii_purchase_size s, sewn.nt_edii_purchase_det d,
    sewn.nt_edii_purchase_hdr h
    where h.business_unit_id = '01'
    and h.edi_sequence_id = '168420'
    and h.business_unit_id = d.business_unit_id
    and h.edi_sequence_id = d.edi_sequence_id
    and d.business_unit_id = s.business_unit_id
    and d.edi_sequence_id = s.edi_sequence_id
    and d.edi_det_sequ_id = s.edi_det_sequ_id
    group by h.business_unit_id, h.edi_sequence_id, d.edi_det_sequ_id,
    s.edi_size_sequ_id,h.po_number, h.total_unit, h.total_amount, s.quantity,s.unit_price

    Never mind, I got it working

  • Whats wrong with this query.can anyone help me......

    select CASE WHEN TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0 AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
    THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)||'00',SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),'DD-MM-YYYY HH24:MI:SS') end
    from table;
    i have written this query.whats wrong with this query..........
    the error is "literal does not match format string"
    Reegards soumen

    Why does your date_format loose, ununify and not fix ?
    And what is your exact requirement?
    >>
    CASE WHEN
    TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'DDMMYYYY HH24:MM:SS'),13,2))>0
    AND TO_NUMBER(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)) <14
    <<
    This is
    CASE WHEN TO_CHAR(START_TIME_TIMESTAMP,'MM') between '01' and '13'
    >>
    THEN TO_DATE(CONCAT(SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MM:SS'),13,2)
    ||'00',
    SUBSTR(TO_CHAR(START_TIME_TIMESTAMP,'YYYYMMDD HH24:MI:SS'),16)||'00'),
    'DD-MM-YYYY HH24:MI:SS')
    <<
    This is
    TO_DATE(
    TO_CHAR(START_TIME_TIMESTAMP,'MM"00"SS"00"),
    'DD-MM-YYYY HH24:MI:SS')
    Obviously, format is not matching !
    SQL> select to_char(sysdate,'MM"00"SS"00') from dual;
    TO_CHAR(
    06004900
    SQL> select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual;
    select to_date('06004900','DD-MM-YYYY HH24:MI:SS') from dual
    ERROR at line 1:
    ORA-01861: literal does not match format string

  • Can someone tell me what's wrong with this LOV query please?

    This query works fine..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = 'ADAM'
    But this one..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = apex_application.g_user
    Gives the following error.
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Thanks very much,
    -Adam vonNieda

    Ya know, I still don't know what's wrong with this.
    declare
    l_val varchar2(100) := nvl(apex_application.g_user,'ADAM');
    begin
    return 'select filter_name display_value, filter_id return_value
    from otmgui_filter where username = '''|| l_val || '''';
    end;
    Gets the same error as above. All I'm trying to do is create a dropdown LOV which selects based on the apex_application.g_user.
    What am I missing here?
    Thanks,
    -Adam

  • FileFilter????What's wrong with this code???HELP!!

    I want to limit the JFileChooser to display only txt and java file. But the code I wrote has error and I don't know what's wrong with it. can anyone help me to check it out? Thank you.
    import java.io.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.event.*;
    public class FileFilterTest extends JPanel
         public static void main(String[] args)
              new FileFilterTest();
         public class fFilter implements FileFilter
              public boolean accept(File file)
                   String name = file.getName();
                   if(name.toLowerCase().endsWith(".java") || name.toLowerCase().endsWith(".txt"))
                        return true;
                   else
                        return false;
         public FileFilterTest()
              JFileChooser fc = new JFileChooser();
              fc.setFileFilter(new fFilter());
              fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
              fc.setCurrentDirectory(new File(System.getProperty("user.dir")));
              //fc.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
              //fc.setMultiSelectionEnabled(true);
              int returnVal = fc.showDialog(FileFilterTest.this, "Open File");
              if(returnVal == JFileChooser.APPROVE_OPTION)
                   String file = fc.getSelectedFile().getPath();
                   if(file == null)
                        return;
              else if(returnVal == JFileChooser.CANCEL_OPTION)
                   System.exit(0);
              else
                   System.exit(0);
              JFrame f = new JFrame();
              FileFilterTest ff = new FileFilterTest();
              f.setTitle("FileFilterTest");
              f.setBackground(Color.lightGray);
              f.getContentPane().add(ff, BorderLayout.CENTER);
              f.setSize(800, 500);
              f.setVisible(true);
    }

    There are two file filters
    class javax.swing.filechooser.FileFilter
    interface java.io.FileFilter
    In Swing you need to make a class which extends the first one and implements the second. Sometimes you may not need to implement the second, but it is more versitle to do so and requires no extra work.

  • What's wrong with this?HELP

    What's wrong with this piece of code:
    clickhereButton.addActionListener(this);
         ^
    That's my button's name.
    Everytime I try to complie the .java file with this code in it it says:
    Identifier expected: clickhereButton.addActionListener(this);
    ^
    Please help.

    You must have that code in a method or an initilizer block... try moving it to eg. the constructor.

  • What's wrong with this function

    What's wrong with this Function(PL/SQL) in this formaula column definition in Reports 6i
    function currdateFormula return Date is
    curr_date date;
    begin
    select to_char(sysdate, 'DD-MM-YYYY') into curr_date from dual;
    return(curr_date);
    end;
    I get the following error in compiling
    REP-1401. 'currdateformula'.Fatal PL/SQL error occured. ORA-01843 not a valid month.
    The SQL select to_char(sysdate, 'DD-MM-YYYY') from dual; worked well in SQL Plus prompt.
    I got a clean compile when i use just sysdate in the function (see below).
    function currdateFormula return Date is
    curr_date date;
    begin
    select sysdate into curr_date from dual;
    return(curr_date);
    end;
    Appreciate your help
    Raja Lakshmi

    hello,
    what you are trying to do :
    fetch the current date and return it as the result of the formula-column.
    what you are actually doing :
    fetch the current date, convert it to text, assign this text to a date-variable which causes an implicit type-conversion.
    in your case you create a date-string with the format dd-mm-yyyy. the implicit conversion then tries to convert this string back to date using the NLS settings of your session. depending on your NLS_LANG and NLS_DATE_FORMAT this might work, if your session-date-format is dd-mm-yyyy which obviously it is NOT as you get the error.
    what you should do :
    select sysdate into curr_date from dual;
    this fetches the sysdate and stores it in your date-variable. there is no type conversion needed what so ever.
    regards,
    the oracle reports team

  • What's wrong with this SQL?

    what's wrong with this SQL?
    Posted: Jan 16, 2007 9:35 AM Reply
    Hi, everyone:
    when I insert into table, i use the fellowing SQL:
    INSERT INTO xhealthcall_script_data
    (XHC_CALL_ENDED, XHC_SWITCH_PORT, XHC_SCRIPT_ID, XHC_FAX_SPECIFIED)
    VALUES (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT, HH_SCRIPT,'N'
    FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE' UNION
    SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT, HH_SCRIPT,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE');
    I always got an error like;
    VALUES (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS'), HH_SWITCHPORT,
    ERROR at line 3:
    ORA-00936: missing expression
    but I can't find anything wrong, who can tell me why?
    thank you so much in advance
    mpowel01
    Posts: 1,516
    Registered: 12/7/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:38 AM in response to: jerrygreat Reply
    For starters, an insert select does not have a values clause.
    HTH -- Mark D Powell --
    PP
    Posts: 41
    From: q
    Registered: 8/10/06
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:48 AM in response to: mpowel01 Reply
    Even I see "missing VALUES" as the only error
    Eric H
    Posts: 2,822
    Registered: 10/15/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:54 AM in response to: jerrygreat Reply
    ...and why are you doing a UNION on the exact same two queries?
    (SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS') ,HH_SWITCHPORT ,HH_SCRIPT ,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE' UNION SELECT TO_DATE(HH_END_DATE||' '||HH_END_TIME,'MM/DD/YY HH24:MI:SS') ,HH_SWITCHPORT ,HH_SCRIPT ,'N' FROM tmp_healthhit_load WHERE HH_SCRIPT !='BROCHURE');
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:55 AM in response to: mpowel01 Reply
    Hi,
    thank you for your answer, but the problem is, if I deleted "values" as you pointed out, and then execute it again, I got error like "ERROR at line 3:
    ORA-03113: end-of-file on communication channel", and I was then disconnected with server, I have to relogin SQLplus, and do everything from beganing.
    so what 's wrong caused disconnection, I can't find any triggers related. it is so wired?
    I wonder if anyone can help me about this.
    thank you very much
    jerry
    yingkuan
    Posts: 1,801
    From: San Jose, CA
    Registered: 10/8/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 9:59 AM in response to: jerrygreat Reply
    Dup Post
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:00 AM in response to: Eric H Reply
    Hi,
    acturlly what I do is debugging a previous developer's scipt for data loading, this script was called by Cron work, but it never can be successfully executed.
    I think he use union for eliminating duplications of rows, I just guess.
    thank you
    jerry
    mpowel01
    Posts: 1,516
    Registered: 12/7/98
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:03 AM in response to: yingkuan Reply
    Scratch the VALUES keyword then make sure that the select list matches the column list in number and type.
    1 insert into marktest
    2 (fld1, fld2, fld3, fld4, fld5)
    3* select * from marktest
    UT1 > /
    16 rows created.
    HTH -- Mark D Powell --
    Jagan
    Posts: 41
    From: Hyderabad
    Registered: 7/21/06
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 10:07 AM in response to: jerrygreat Reply
    try this - just paste the code and give me the error- i mean past the entire error as it is if error occurs
    INSERT INTO xhealthcall_script_data
    (xhc_call_ended, xhc_switch_port, xhc_script_id,
    xhc_fax_specified)
    SELECT TO_DATE (hh_end_date || ' ' || hh_end_time, 'MM/DD/YY HH24:MI:SS'),
    hh_switchport, hh_script, 'N'
    FROM tmp_healthhit_load
    WHERE hh_script != 'BROCHURE'
    UNION
    SELECT TO_DATE (hh_end_date || ' ' || hh_end_time, 'MM/DD/YY HH24:MI:SS'),
    hh_switchport, hh_script, 'N'
    FROM tmp_healthhit_load
    WHERE hh_script != 'BROCHURE';
    Regards
    Jagan
    jerrygreat
    Posts: 8
    Registered: 1/3/07
    Re: what's wrong with this SQL?
    Posted: Jan 16, 2007 11:31 AM in response to: Jagan Reply
    Hi, Jagan:
    thank you very much for your answer.
    but when I execute it, I still can get error like:
    ERROR at line 1:
    ORA-03113: end-of-file on communication channel
    so wired, do you have any ideas?
    thank you very much

    And this one,
    Aother question about SQL?
    I thought I already told him to deal with
    ORA-03113: end-of-file on communication channel
    problem first.
    There's nothing wrong (syntax wise) with the query. (of course when no "value" in the insert)

  • What's wrong with this content type definition?

    Could someone tell me what's wrong with this content type definition? When I click "New Folder" in a custom list, it should bring two fields 1) Name 2) Custom Order. However in my case when I click new folder, I see 1) Member (which is totally
    weird) 2) custom order. Where is it getting that Member field from?
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Parent ContentType: Folder (0x0120) -->
    <ContentType ID="0x012000c0692689cafc4191b6283f72f2369cff"
    Name="Folder_OrderColumn"
    Group="Custom"
    Description="Folder with order column"
    Inherits="TRUE"
    Version="0">
    <FieldRefs>
    <FieldRef ID="{35788ED2-8569-48DC-B6DE-BA72A4F87B7A}" Name="Custom_x0020_Order" DisplayName="Custom Order" />
    </FieldRefs>
    </ContentType>
    </Elements>

    Hi,
    According to your post, my understanding is that you had an issue about the custom content type with custom column.
    I don’t think there is any issue in the content type definition, and it also worked well in my environment.
    Did you have the Member field in the project?
    I recommend you create a simple project only with one custom Order column and one custom Folder_OrderColumn, then you can add more fields one by one.
    By doing this, it will be easier to find out the root cause of this error.
    Thanks,
    Jason
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Jason Guo
    TechNet Community Support

Maybe you are looking for

  • Ditribution cycle with WBS as sender

    Hi Friends, We have support project cost cost booked on WBS elements , we want to allocate that costs to some cost cost centers. We created 1 distributiion cycle having the WBS as sender & cost center as the receiver. but when we run the distribution

  • Conditional Formula for Shared DateVar

    I have a subreport where I'm creating (make that trying to create) headers for the main report based on data in a table.  Below are the first few rows of the results. What I would like to do is to create 6 Shared DateVar variables (Header1, Header2,

  • Location of imported a Financial Report ?

    I imported a Financial Report in the HFM 9.3 workspace but I cannot find it. I was never prompted for a location to import to. Where does an imported Financial report go ? We are using HFM 9.3.1

  • AE2280 - Cannot update BIOS

    I'm working on a Wind Top AE2280 that freezes in sleep mode occasionally, so I'm trying to update the BIOS - no luck.  Using this download: msi.com/service/download/bios-17021.html There are two folders, BIOS and EC.  Using a boot disk and trying to

  • Java application not launching

    Greetings all. Ununderstandably, I am stuck with the following problem at start up: I have reinstalled "JavaForMacOSX10.5Update10", with no success. Any suggestions most welcome. Thank you.