Different results on timestamps in SQL developer

Hi
I have this table with a TIMESTAMP column in it.
CREATE TABLE my_table ("TID" TIMESTAMP (6) NOT NULL ENABLE);
I use this query in SQL developer:
SELECT tid from my_table;
There is one row in the table, that has a timestamp in the hour of the change to european summertime.
The timestamp of this row is displayed differentliy in SQL developer:
- when the query is run by 'run stamement' (Ctrl+enter) the result is
11-03-27 03:17:00,000000000
- when the query is run as a script (F5) the result is
11-03-27 02:17:00,000000000
Notice the difference in the hours of the timestamp.
Why this difference? (It only occurs for timestamps within the hour of 2 am to 3 am on that date - the hour that should'nt exist as the clock advances from 2 am to 3 am that night...)
What is actually stored in the database? (the 3.17 am or 2.17 am value)
Is there a conversion taking place when running as a script in SQL developer, but not when just running the single stamement?
Regards Søren

Hi Søren,
This is rather an "edge" condition error, but I have posted an internal bug for it:
Bug 13088622 - FORUM: RUN SCRIPT/STATEMENT TIMESTAMP VALUE DIFFERS DURING DT/ST CHANGEOVER
Please provide some version information about your environment: SQL Developer, Java JDK, OS, etc.
Regards,
Gary
SQL Developer Team

Similar Messages

  • SELECT returning different rows when issued from SQL Developer or Java apps

    Hi there. I'm facing a problem here: I'm trying to issue a SELECT from Java, which should return me 2 rows; but I'm getting just one. When I issue the SELECT directly through SQL Developer it gives me the expected result. I've pastebin the code at http://paste.uni.cc/11821, where I've described in details the problem.
    What could it be? Any help would be appreciated.
    Thanks in advance!

    Marco,
    I would code it a bit differently, but I don't think that would solve your problem.
    I suggest setting up the JDBC logging. I'm not promising it will help, but I guess it
    can't hurt. Here is a white paper about it:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/pdf/logging%20white%20paper.pdf
    You can also access that link from this Web page:
    http://www.oracle.com/technology/tech/java/sqlj_jdbc/index.html
    Good Luck,
    Avi.

  • How export result in sybase in SQL Developer 2.1 ?

    Hi,
    I cant find any option to export from the result grid when i query on a sybase database, how can i export the result in excel or csv in SQL Developer 2.1?
    This option was available in SQL Developer 1.5

    There was a statement by Raghu that 3rd party database data export in the worksheet grid (to Excel and other formats) was disabled for this release, and I can confirm that this is not working for MySQL in addition to Sybase. Is this a bug, or was it intentional? Obviously, I'd like to have the feature restored. Thanks.

  • Store result in file in SQL Developer

    Hi,
    Is there any way to store results from query or SP in physical file ?
    I could not find any option for that, I'm running it from Windows machine using SQL Developer,
    then I expect output file will be stored on Ora server machine, right ? There is probably no option for Oracle to store it on local W machine.
    Tx All
    TRent

    A few remarks:
    - This is not the SQL Developer forum
    - SQL Developer comes with online help
    - Did you see the print and the disk icon in the upper left hand corner of the output window
    Could you please avoid this type of question in the future? It makes you look very silly.
    Thank you in advance
    Sybrand Bakker
    Senior Oracle DBA

  • Apex report result doesn't agree with the result of sql developer

    Hello guys,
    at the moment I try to create a standard report which takes his content from several spreadsheets. Because of some problems with the searchbar I'm not able to use an interactive report. The sql query contains a function, which sets some space characters into the content of a column. But there is a big problem. When I call my sql query in apex from the spreadsheets the result doesn't agree with the result which affords the sql developer.
    I know that the sql developer affords the right result.
    best regards
    wderr
    Edited by: user9072567 on 07.02.2010 12:57

    thats the query:
    select "TWORKITEM"."WORKITEMKEY",
    "TWORKITEM"."PROJCATKEY",
    "TPROJECT"."LABEL",
    "TWORKITEM"."PACKAGESYNOPSYS",
    replace(replace("TWORKITEM"."PACKAGEDESCRIPTION", chr(10), '<br>'),'<td></td>','&lt;td&gt;&lt;/td&gt;') packagedesc,
    suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY") "CHANGEDESCRIPTION"
    from "TWORKITEM" "TWORKITEM", "TPROJECT" "TPROJECT", "TPROJCAT" "TPROJCAT"
    where "TWORKITEM"."PROJCATKEY" = "TPROJCAT"."PKEY"
    and "TPROJCAT"."PROJKEY" = "TPROJECT"."PKEY"
    and (instr(upper("TWORKITEM"."WORKITEMKEY"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY"))) > 0
    or instr(upper("TPROJECT"."LABEL"), upper(nvl(:P10_SEARCHTEXT, "TPROJECT"."LABEL"))) > 0
    or instr(upper("TWORKITEM"."PACKAGESYNOPSYS"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGESYNOPSYS"))) > 0
    or instr(upper("TWORKITEM"."PACKAGEDESCRIPTION"), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."PACKAGEDESCRIPTION"))) > 0
    or instr(upper(suche_ohne_ti_be("TWORKITEM"."WORKITEMKEY")), upper(nvl(:P10_SEARCHTEXT, "TWORKITEM"."WORKITEMKEY")))>0
    I mean with spreadsheets some tables/charts. And I take those informations from 3 of them.
    regards
    wderr

  • CVS Versioning unable to connect in SQL Developer 2.1

    I just upgraded to SQL developer 2.1 from 1.5. I did the check for updates and the CVS Versioning that gets installed is version 11.1.1.2.36.49.42 For some reason this version will not let me connect through ssh to CVS. I double checked the connection and the test of it fails. The CVS versioning in SQL developer 1.5 worked fine (11.1.1.0.22.49.42). is there any way to use SQL developer 2.1 with CVS Versioning 11.1.1.0.22.49.42??

    I am having this same issue, with slightly different versions and on two different computers. I have SQL Developer 1.5 on WinXP running cvs version 11.1.1.0.22.49.44. Connections to CVS via ssh work fine. I installed SQL Developer 2.1 on a new machine with Win 7. I had to check for updates becuase CVS versioning was missing from this release. The update gave me cvs version 11.1.1.2.36.55.30. I set up a CVS connection and the test failed. I tried exporting the connections - didn't work. I also tried pasting in the cvs_connect.xml file from the old computer to the new one - that also did not work.
    Is there any resolution for this issue? Or a work around?

  • SQL Developer Unit Test

    I'm trying out the Unit Test tool in SQL Developer version 3.2.09 and I keep getting the following error on the Teardown Process:
    Teardown Table or Row Restore (1/1) failed: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
    ORA-06512: at line 22
    I have no idea what line 22 refers to? I cannot seem to find more detailed information in order to correct the problem.
    Any insight or help would be great!
    Thanks,
    Paul

    I'm having the same issue with SQL Developer 3.2.20.09 on Oracle 11.2.0.3.0. However, I think it's somewhat data dependent as I've had success and I've also encountered the ORA-06502 error.
    I ran a generic test on a very simple table and was successful using the teardown restore of the table. The procedure isn't important in this scenario, but is given as reference to creating the test. The simple, successful case is given first.
    Note that in both cases/tests, the original table of data already existed, so I question the error message pointing to data being inserted is longer than the field allows or that data types are somehow different...+unless+ SQL Developer is translating or getting it wrong. ALSO NOTE, running the SQL inserts as given works if run through the worksheet. It's only in the Teardown that I see the ORA-06502 error message.
    Data
    CREATE TABLE EMPLOYEES (EMPLOYEE_ID NUMBER, COMMISSION_PCT NUMBER, SALARY NUMBER);
    Insert into EMPLOYEES (EMPLOYEE_ID,COMMISSION_PCT,SALARY) values (1001,0.2,8400);
    Insert into EMPLOYEES (EMPLOYEE_ID,COMMISSION_PCT,SALARY) values (1002,0.25,6000);
    Insert into EMPLOYEES (EMPLOYEE_ID,COMMISSION_PCT,SALARY) values (1003,0.3,5000);
    CREATE OR REPLACE PROCEDURE AWARD_BONUS AS
    BEGIN
    null;
    END award_bonus;
    Startup: Table or Row Copy
    description = "TMP$AWARD_BONUS_TEST" := SELECT ROWID AS SRC$ROWID, s.* FROM "EMPLOYEES" s
    source = "EMPLOYEES"
    temp = "TMP$AWARD_BONUS_TEST"
    Teardown: Table or Row Restore
    description = "TMP$AWARD_BONUS_TEST" -> "EMPLOYEES"
    source = "EMPLOYEES"
    key = PRIMARY KEY
    temp = "TMP$AWARD_BONUS_TEST"
    The above worked without error.
    The following did not work.* (Again, the procedure isn't relevant.)
    Data
    CREATE TABLE "xxdss_fact_detail_history"
    "fact_trx_id" NUMBER(15, 0),"number_of_records" NUMBER,
    "product_code" VARCHAR2(250 byte),"item_code" VARCHAR2(250 byte),
    "item_description" VARCHAR2(250 byte),"trade" VARCHAR2(250 byte),
    "item_system" VARCHAR2(250 byte),"unit" VARCHAR2(250 byte),
    "fuel_source" VARCHAR2(250 byte),"component" VARCHAR2(250 byte),
    "assembly" VARCHAR2(250 byte),"part" VARCHAR2(250 byte),
    "symptoms" VARCHAR2(250 byte),"diagnosis_item" VARCHAR2(250 byte),"coa"
    VARCHAR2(250 byte),"cchs_parts" VARCHAR2(250 byte),
    "region" VARCHAR2(250 byte),"state" VARCHAR2(250 byte),
    "county" VARCHAR2(250 byte),"zip" VARCHAR2(250 byte),"vendor_id" NUMBER,
    "vendor_site_id" NUMBER,"vendor_name" VARCHAR2(250 byte),
    "vendor_site" VARCHAR2(250 byte),"c_service_call_cost" NUMBER,
    "c_labor_cost" NUMBER,"c_part_cost" NUMBER,"c_tax" NUMBER,
    "c_cchs_oh_cost" NUMBER,"c_cchs_total_low_cost" NUMBER,
    "c_cchs_total_high_cost" NUMBER,"c_cchs_avg_total_cost" NUMBER,
    "c_nc_c_labor_cost" NUMBER,"c_nc_c_part_cost" NUMBER,"c_nc_tax_cost" NUMBER
    ,"c_nc_total_low_cost" NUMBER,"c_nc_total_high_cost" NUMBER,
    "c_nc_avg_total_cost" NUMBER,"c_flat_low_cost" NUMBER,
    "c_flat_high_cost" NUMBER,"c_flat_avg_cost" NUMBER,
    "p_cycle_time_day_low" NUMBER,"p_cycle_time_day_high" NUMBER,
    "p_cycle_avg_time_day" NUMBER,"p_reasgn_low" NUMBER,"p_reasgn_high" NUMBER,
    "p_reasgn_avg" NUMBER,"p_recall_low" NUMBER,"p_recall_high" NUMBER,
    "p_recall_avg" NUMBER,"s_sp_nps_score_low" NUMBER,
    "s_sp_nps_score_high" NUMBER,"s_sp_avg_nps_score" NUMBER,
    "s_cchs_nps_score_low" NUMBER,"s_cchs_nps_score_high" NUMBER,
    "s_cchs_avg_nps_score" NUMBER,"cps_cost" NUMBER,"cps_perfrmce" NUMBER,
    "cps_sat" NUMBER,"coa_score" NUMBER,"comments" VARCHAR2(4000 byte),
    "complete_flag" VARCHAR2(1 byte),"last_update_date" DATE,
    "last_updated_by" NUMBER(15, 0),"creation_date" DATE,
    "created_by" NUMBER(15, 0),"last_update_login" NUMBER(15, 0),
    "vendor_number" VARCHAR2(200 byte)
    SET DEFINE OFF;
    Insert into XXDSS.XXDSS_FACT_DETAIL_HISTORY (FACT_TRX_ID,NUMBER_OF_RECORDS,PRODUCT_CODE,ITEM_CODE,ITEM_DESCRIPTION,TRADE,ITEM_SYSTEM,UNIT,FUEL_SOURCE,COMPONENT,ASSEMBLY,PART,SYMPTOMS,DIAGNOSIS_ITEM,COA,CCHS_PARTS,REGION,STATE,COUNTY,ZIP,VENDOR_ID,VENDOR_SITE_ID,VENDOR_NAME,VENDOR_SITE,C_SERVICE_CALL_COST,C_LABOR_COST,C_PART_COST,C_TAX,C_CCHS_OH_COST,C_CCHS_TOTAL_LOW_COST,C_CCHS_TOTAL_HIGH_COST,C_CCHS_AVG_TOTAL_COST,C_NC_C_LABOR_COST,C_NC_C_PART_COST,C_NC_TAX_COST,C_NC_TOTAL_LOW_COST,C_NC_TOTAL_HIGH_COST,C_NC_AVG_TOTAL_COST,C_FLAT_LOW_COST,C_FLAT_HIGH_COST,C_FLAT_AVG_COST,P_CYCLE_TIME_DAY_LOW,P_CYCLE_TIME_DAY_HIGH,P_CYCLE_AVG_TIME_DAY,P_REASGN_LOW,P_REASGN_HIGH,P_REASGN_AVG,P_RECALL_LOW,P_RECALL_HIGH,P_RECALL_AVG,S_SP_NPS_SCORE_LOW,S_SP_NPS_SCORE_HIGH,S_SP_AVG_NPS_SCORE,S_CCHS_NPS_SCORE_LOW,S_CCHS_NPS_SCORE_HIGH,S_CCHS_AVG_NPS_SCORE,CPS_COST,CPS_PERFRMCE,CPS_SAT,COA_SCORE,COMMENTS,COMPLETE_FLAG,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,CREATED_BY,LAST_UPDATE_LOGIN,VENDOR_NUMBER) values (324,2,'L&F-MPP03TR','STCOL-SPL','Straight Cool Split System','HVAC',null,'STCOL-SPL',null,null,null,null,null,null,'REAPIR','N',null,'VA','ASHBURN','20148',22024,118957,'Air Lingus Inc',null,50,55,44,12,180,40,78,76.5,60,50,20,100,180,130,50,110,80,2,8,3.9323148148178,40,60,43,9,10,8.2,100,201,150,20,40,35,50,30,20,100,null,null,to_date('01-JAN-13','DD-MON-RR'),1,to_date('01-JAN-13','DD-MON-RR'),1,null,'122023');
    Insert into XXDSS.XXDSS_FACT_DETAIL_HISTORY (FACT_TRX_ID,NUMBER_OF_RECORDS,PRODUCT_CODE,ITEM_CODE,ITEM_DESCRIPTION,TRADE,ITEM_SYSTEM,UNIT,FUEL_SOURCE,COMPONENT,ASSEMBLY,PART,SYMPTOMS,DIAGNOSIS_ITEM,COA,CCHS_PARTS,REGION,STATE,COUNTY,ZIP,VENDOR_ID,VENDOR_SITE_ID,VENDOR_NAME,VENDOR_SITE,C_SERVICE_CALL_COST,C_LABOR_COST,C_PART_COST,C_TAX,C_CCHS_OH_COST,C_CCHS_TOTAL_LOW_COST,C_CCHS_TOTAL_HIGH_COST,C_CCHS_AVG_TOTAL_COST,C_NC_C_LABOR_COST,C_NC_C_PART_COST,C_NC_TAX_COST,C_NC_TOTAL_LOW_COST,C_NC_TOTAL_HIGH_COST,C_NC_AVG_TOTAL_COST,C_FLAT_LOW_COST,C_FLAT_HIGH_COST,C_FLAT_AVG_COST,P_CYCLE_TIME_DAY_LOW,P_CYCLE_TIME_DAY_HIGH,P_CYCLE_AVG_TIME_DAY,P_REASGN_LOW,P_REASGN_HIGH,P_REASGN_AVG,P_RECALL_LOW,P_RECALL_HIGH,P_RECALL_AVG,S_SP_NPS_SCORE_LOW,S_SP_NPS_SCORE_HIGH,S_SP_AVG_NPS_SCORE,S_CCHS_NPS_SCORE_LOW,S_CCHS_NPS_SCORE_HIGH,S_CCHS_AVG_NPS_SCORE,CPS_COST,CPS_PERFRMCE,CPS_SAT,COA_SCORE,COMMENTS,COMPLETE_FLAG,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,CREATED_BY,LAST_UPDATE_LOGIN,VENDOR_NUMBER) values (465,4,'L&F-MPP03TR','STCOL-SPL','Straight Cool Split System','HVAC',null,'STCOL-SPL',null,null,null,null,null,null,'REPLACE','N',null,'VA','ASHBURN','20148',1768,1090523,'Airmax Heating And Air Conditioning Llc',null,65,50,80,15,110,50,60,70,70,40,20,100,180,130,50,110,80,3,5,0.878969907411374,10,70,20,1,2,2,130,150,140,20,40,60,40,30,30,100,null,null,to_date('01-JAN-13','DD-MON-RR'),1,to_date('01-JAN-13','DD-MON-RR'),1,null,'101767');
    CREATE OR REPLACE PROCEDURE dss AS
    BEGIN
    null;
    END dss;
    Startup: Table or Row Copy
    description = "TMP$DSS_TEST" := SELECT ROWID AS SRC$ROWID, s.* FROM "XXDSS_FACT_DETAIL_HISTORY" s
    source = "XXDSS_FACT_DETAIL_HISTORY"
    temp = "TMP$DSS_TEST"
    Teardown: Table or Row Restore
    description = "TMP$DSS_TEST" -> "XXDSS_FACT_DETAIL_HISTORY"
    source = "XXDSS_FACT_DETAIL_HISTORY"
    key = PRIMARY KEY
    temp = "TMP$DSS_TEST"

  • SQL Developer 2.1 availability

    Hi, I have an issue with SQL Developer 2.1, and would like to get hold of the media to perform a test install to try and reproduce it, but can't seem to get the media from anywhere.
    Is it still available please?
    Martin

    Hi Martin,
    The SQL Developer product web pages actually do have such links, but they appear broken:
    1. http://www.oracle.com/technetwork/developer-tools/sql-developer/overview/index.html -- then select the Downloads tab
    2. Scroll to the Archived Releases section at the bottom and select the 3.0.04.34 release, which takes you here...
    3. http://www.oracle.com/technetwork/developer-tools/sql-developer/downloads/sqldev30downloads-1525485.html
    4. If you want 3.0.04.34, the download still works.
    5. Or scroll to the Download Archived Releases section at the bottom. All those links seem broken.
    I will ping Product Management about that, but if you want a copy quickly you may be forced to look for it on sharing sites such as mediafire or 4shared. You can do a Google search and definitely get results.
    Regards,
    Gary
    SQL Developer Team
    Edited by: Gary Graham on Feb 22, 2012 12:44 PM
    Actually, I tried the 2.1.1 link inside the Oracle firewall and it worked, so this issue is really about whether
    the links should be externalized.

  • Explain plan results are different in SQL Developer than SQL Plus

    My Environment:
    SQL Developer 1.0.0.15.27
    Platform where SQL Developer is running: Windows XP 2002 SP2
    Oracle Database and Client 9.2.0.7
    Optimizer_mode: FIRST_ROWS
    I have the following SQL statement:
    SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE :b2 = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > :b1
    When I run an Explain in SQL Developer I get the following access path (which is the one I really want):
    SELECT STATEMENT                          TABLE ACCESS(BY INDEX ROWID) FEDLINK.AU_COMPANY          NESTED LOOPS                                   INDEX(RANGE SCAN)
    FEDLINK.UX2_TEMP_AU_COMPANY
              INDEX(RANGE SCAN) FEDLINK.PX1_COMPANY
    However, when I execute the statement with sql_trace turned on and use tkprof to generate the actual access path, the statement executes as follows (which is WAY more expensive):
    call count cpu elapsed disk query current rows
    Parse 1 0.00 0.00 0 0 0 0
    Execute 1 0.00 0.00 0 0 0 0
    Fetch 1 3.58 6.68 28136 29232 0 0
    total 3 3.58 6.69 28136 29232 0 0
    Misses in library cache during parse: 1
    Optimizer goal: FIRST_ROWS
    Parsing user id: 979 (FEDLINK) (recursive depth: 1)
    Rows Row Source Operation
    0 NESTED LOOPS
    0 TABLE ACCESS FULL AU_COMPANY
    0 INDEX RANGE SCAN UX2_TEMP_AU_COMPANY (object id 49783)
    Notice the FULL access of au_company.
    I understand that SQL Developer has nothing to do with why the statement executed the way it did, but why is the Explain in SQL Developer different than the actual execution plan?
    Added note....when I run the explain in SQL Plus it is the same as the actual execution. Here is the explain from SQL Plus:
    explain plan for SELECT a1.comp_id
    FROM temp_au_company a0, au_company a1
    WHERE '1' = a0.temp_emp_code
    AND a0.comp_id = a1.comp_id
    AND a0.sls_terr_code != a1.sls_terr_code
    AND a1.last_mdfy_date > '01-MAY-2006';
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 2 | 76 | 2597 |
    | 1 | NESTED LOOPS | | 2 | 76 | 2597 |
    | 2 | TABLE ACCESS FULL | AU_COMPANY | 2 | 42 | 2595 |
    | 3 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 1 | 17 | 2
    Thanks,
    Brenda

    The explain is different (full scan of au_company in SQL Plus / index access in SQL Developer) even when I use variables in SQL Plus. Here is the output for SQL Plus using variables instead of literals:
    SQL> variable b1 varchar2
    SQL> variable b2 char
    SQL> explain plan for SELECT a1.comp_id
    2 FROM temp_au_company a0, au_company a1
    3 WHERE :b2 = a0.temp_emp_code
    4 AND a0.comp_id = a1.comp_id
    5 AND a0.sls_terr_code != a1.sls_terr_code
    6 AND a1.last_mdfy_date > :b1
    7 /
    Explained.
    PLAN_TABLE_OUTPUT
    | Id | Operation | Name | Rows | Bytes | Cost |
    | 0 | SELECT STATEMENT | | 3184 | 118K| 2995 |
    | 1 | HASH JOIN | | 3184 | 118K| 2995 |
    | 2 | INDEX RANGE SCAN | UX2_TEMP_AU_COMPANY | 3187 | 54179 | 3 |
    | 3 | TABLE ACCESS FULL | AU_COMPANY | 24009 | 492K| 2983 |
    Any other ideas? They should be the same.
    Brenda

  • DATE arithmetic in SQL Workshop v SQL Developer - different results

    Hi
    I want a date picker to default to the Monday of the current week. I'm basing it on TO_CHAR with a format mask so this should give me the number of the day of the week:
    SELECT SYSDATE, to_char(SYSDATE, 'D')
    FROM dual
    In APEX SQL Workshop, I get
    09/25/2013  4
    which is wrong - today is Wednesday.
    The same code in SQL Developer gives
    25-SEP-13  3
    which is correct.
    Am I missing some APEX setting here which determines when the start of the week is (Monday v Sunday)?
    Many thanks
    Brian
    Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 - 64bit Production
    APEX 4.2.2.00.11
    Windows 2008 R2 Enterprise Server

    I'm guessing this: (from Oracle documentation)
    The datetime format element D returns the number of the day of the week (1-7). The day of the week that is numbered 1 is specified implicitly by the initialization parameter NLS_TERRITORY.
    For me:
    select sysdate, to_char(sysdate,'D'), to_char(sysdate,'Day')  from dual;
    25-SEP-13    4    Wednesday
    Which is (for me) correct. (Sunday == 1 )
    What have we learned?
    NLS_TERRITORY can be different depending on who/how/when the DB connection is made.
    This is the same as NLS_DATE_FORMAT.
    Solution:
    Never ever trust anything that depends on them unless the code explicitly sets the value.
    This is why you ALWAYS provide the date format when converting from String to Date using the TO_CHAR();
    MK

  • Oracle SQL Developer O/P and Toad O/P is Different for Same QUERY.

    Hi,
    can any one calrify me why i'm getting different result when i run the same QUERY in Oracle Developer and TOAD.
    When i Ran a Query in TOAD i could see Null&Data in a column called Customer_Category but when i Ran the same Query in Oracle SQL Developer i'm getting all Null N i couldnt see any data in the column.
    i have not performed any DDL r DML statement, just i got the Query and i Ran it in TOAD & Oracle SQL Developer.
    I found that the OUT PUT is different for perticular column.
    Thanks in Advance....

    > I found that the OUT PUT is different for perticular column.
    The RENDERING of data from Oracle (or any other server such as a POP3 server, web server, etc) IS DONE BY THE CLIENT.
    So to repeat - RENDERING IS DONE BY THE CLIENT.
    If one client selects to display the output received from the server differently than another client, it is a CLIENT ISSUE.
    It is not a server issue. It is not a SQL issue. It is not a PL/SQL issue.
    In other words, wrong forum for this question. You have a pure client side rendering problem which has absolutely nothing to do with SQL and/or PL/SQL.

  • Timestamp presentation in SQL Developer

    Hi everybody,
    is there a way to format how a timestamp is presented in the result pane of SQL Developer?
    Doing a simple
    select sysdate from dual;
    shows something like : 24-SEP-09
    What I would like to see is: 24-09-2009 08:46:10
    without having to use a to_char all the time.
    Thanks for your help
    Regards
    Andy

    Hi K,
    thanks for your help. Unfortunately it didn't seem to work - but then it could be my mistake :-).
    The NLS before I changed it:
    Timestamp format: RR-MM-DD HH24:MI:SSXFF
    NLS after my change:
    Timestamp format: DD-MM-YYYY HH24:MI:SS
    select sysdate from dual still shows 09-09-24
    Thanks
    Regards
    Andy

  • SQL Query produces different results when inserting into a table

    I have an SQL query which produces different results when run as a simple query to when it is run as an INSERT INTO table SELECT ...
    The query is:
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      The INSERT INTO code:
    TRUNCATE TABLE applicant_summary;
    INSERT /*+ APPEND */
    INTO     applicant_summary
    (  account_number
    ,  main_borrower_status
    ,  num_apps
    SELECT   mhldr.account_number
    ,        NVL(MAX(DECODE(ap.party_sysid, mhldr.party_sysid,ap.empcat_code,NULL)),'UNKNWN') main_borrower_status
    ,        COUNT(1) num_apps
    FROM     app_parties ap
    SELECT   accsta.account_number
    ,        actply.party_sysid
    ,        RANK() OVER (PARTITION BY actply.table_sysid, actply.loanac_latype_code ORDER BY start_date, SYSID) ranking
    FROM     activity_players actply
    ,        account_status accsta
    WHERE    1 = 1
    AND      actply.table_id (+) = 'ACCGRP'
    AND      actply.acttyp_code (+) = 'MHLDRM'
    AND      NVL(actply.loanac_latype_code (+),TO_NUMBER(SUBSTR(accsta.account_number,9,2))) = TO_NUMBER(SUBSTR(accsta.account_number,9,2))
    AND      actply.table_sysid (+) = TO_NUMBER(SUBSTR(accsta.account_number,1,8))
    ) mhldr
    WHERE    1 = 1
    AND      ap.lenapp_account_number (+) = TO_NUMBER(SUBSTR(mhldr.account_number,1,8))
    GROUP BY mhldr.account_number;      When run as a query, this code consistently returns 2 for the num_apps field (for a certain group of accounts), but when run as an INSERT INTO command, the num_apps field is logged as 1. I have secured the tables used within the query to ensure that nothing is changing the data in the underlying tables.
    If I run the query as a cursor for loop with an insert into the applicant_summary table within the loop, I get the same results in the table as I get when I run as a stand alone query.
    I would appreciate any suggestions for what could be causing this odd behaviour.
    Cheers,
    Steve
    Oracle database details:
    Oracle Database 10g Release 10.2.0.2.0 - Production
    PL/SQL Release 10.2.0.2.0 - Production
    CORE 10.2.0.2.0 Production
    TNS for 32-bit Windows: Version 10.2.0.2.0 - Production
    NLSRTL Version 10.2.0.2.0 - Production
    Edited by: stevensutcliffe on Oct 10, 2008 5:26 AM
    Edited by: stevensutcliffe on Oct 10, 2008 5:27 AM

    stevensutcliffe wrote:
    Yes, using COUNT(*) gives the same result as COUNT(1).
    I have found another example of this kind of behaviour:
    Running the following INSERT statements produce different values for the total_amount_invested and num_records fields. It appears that adding the additional aggregation (MAX(amount_invested)) is causing problems with the other aggregated values.
    Again, I have ensured that the source data and destination tables are not being accessed / changed by any other processes or users. Is this potentially a bug in Oracle?Just as a side note, these are not INSERT statements but CTAS statements.
    The only non-bug explanation for this behaviour would be a potential query rewrite happening only under particular circumstances (but not always) in the lower integrity modes "trusted" or "stale_tolerated". So if you're not aware of any corresponding materialized views, your QUERY_REWRITE_INTEGRITY parameter is set to the default of "enforced" and your explain plan doesn't show any "MAT_VIEW REWRITE ACCESS" lines, I would consider this as a bug.
    Since you're running on 10.2.0.2 it's not unlikely that you hit one of the various "wrong result" bugs that exist(ed) in Oracle. I'm aware of a particular one I've hit in 10.2.0.2 when performing a parallel NESTED LOOP ANTI operation which returned wrong results, but only in parallel execution. Serial execution was showing the correct results.
    If you're performing parallel ddl/dml/query operations, try to do the same in serial execution to check if it is related to the parallel feature.
    You could also test if omitting the "APPEND" hint changes anything but still these are just workarounds for a buggy behaviour.
    I suggest to consider installing the latest patch set 10.2.0.4 but this requires thorough testing because there were (more or less) subtle changes/bugs introduced with [10.2.0.3|http://oracle-randolf.blogspot.com/2008/02/nasty-bug-introduced-with-patch-set.html] and [10.2.0.4|http://oracle-randolf.blogspot.com/2008/04/overview-of-new-and-changed-features-in.html].
    You could also open a SR with Oracle and clarify if there is already a one-off patch available for your 10.2.0.2 platform release. If not it's quite unlikely that you are going to get a backport for 10.2.0.2.
    Regards,
    Randolf
    Oracle related stuff blog:
    http://oracle-randolf.blogspot.com/
    SQLTools++ for Oracle (Open source Oracle GUI for Windows):
    http://www.sqltools-plusplus.org:7676/
    http://sourceforge.net/projects/sqlt-pp/

  • SQL Developer 2.1.0.63.73 exports DATE as TIMESTAMP

    I believe this is a bug. When I export a table to an XLS file, the values contained in DATE columns are saved as if they were TIMESTAMP:
    eg. 31-DEC-09 12:00:00 AM would export as 31-DEC-09 12.00.00.000000000 AM
    Not really a huge deal until you try to import it back in, in which case you can't import a TIMESTAMP into a DATE column. First, you'll get an error about the AM/A.M. or PM/P.M. missing. You can't explicitly specify the date format during the import either as Oracle rejects it since it's not supported. The proper way is to cast it back to a date, but you can't do that through the import function.
    Regardless, I think the export function should export DATEs according to the Date Format NLS settings but it is not.
    If it makes any difference, I'm using the 64-bit Windows version of SQL Developer on Windows 7 64-bit with the Oracle 64-bit client.

    Hi,
    Not sure if this is something related to my previous problem.
    My SQL Dev gives the correct date format on exporting to Excel, but fails on export INSERT statement
    Vasan, one of the sql dev's team member, gave this workaround which solved my problem
    >
    You can add the following in the sqldeveloper.conf to ensure that the driver doesn't report the column type of a DATE column as TIMESTAMP.
    AddVMOption -Doracle.jdbc.mapDateToTimestamp=false
    >
    as suggested in this thread
    Re: 2.1 EA1: Problems on Date type columns
    Hope this help,
    Buntoro

  • Unable to display results of multiple query in grid in Oracle SQL Developer

    Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
    My question: How to display multiple query results in grid in Oracle SQL Developer.
    Example:
    select * from Employee;
    select * from Department;
    - when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
    - How to display result of both the queries in Grid.
    Any thoughts on this would be really helpful.
    Thanks in advance.
    Harsh

    Hi Harsh,
    I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
    I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
    Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid?

Maybe you are looking for

  • Unable to send a mail

    Hai All, I have just started learning workflow.I have created a 'Send Mail' event & given " &_WF_INITIATOR& " in recipient name. when I tested this workflow , a work flow item got added to the OUTBOX in the SBWP transaction. it is almost 3-4 hours si

  • Increase /var filesystem Solaris nine.

    I was having an issue with my 5.9 solaris not booting up , this was due to /var being full. I was able to decrease /var and login. I notice I took the defaults when installing solaris 9 on a 40gb drive and only allowed 56mb of space for /var and 36gb

  • Incorrect username/password on email

    When I open email on my 4th Generation iPod Touch, it says username/password is incorrect, but I can still log in to my email on the computer and all my details are correct - help?

  • Error in menu painter

    Hello All, I m getting one red icon in Menu Painter> appln tool bar option(where we define appln icons). Its showing some red icon next to  the appln tool bar. Kindly guide how to proceed. Thanks, Vibha

  • Pwm salida digital

    Hola que tal, andaba en busca de un pwm por salida digital y encontre el link http://digital.ni.com/public.nsf/allkb/1561D31534F07D608625727900391114?OpenDocument  , pero tengo unas preguntas como se podría configurar este programa para que mande cie