Select Query resulting in Scientific Notation

Hello all,
I am running a Select query through a batch file that extracts data from an Oracle database. Several of the fields that I am extracting from contain numbers that are up to 38 digits long. When I extract the data, it converts the numbers into scientific notation and it is important for me to have the entire field. Is there something I can change to my query that will pull the data in its entire form? This is what I'm running now:
select * FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy'
I apologize in advance if this has been answered already.
Thanks!

>
When the extractor finishes, it returns the data into a flat file.
don't quite understand the TO_CHAR function. Does this function mean I need to say something like this: select "TO_CHAR('column name', 99999999999999999999999999999999999999" FROM ML.APPT where APPTDATE >= to_date('01/1/2010','mm/dd/yyyy')
>
Yes- if the tool you use to extract the data (your 'extractor') is converting the numeric data to a string then it is responsible for creating the string in the proper format. If the number is an integer that can have as many digits as you have '9's in your sample format string then that is what you need to do.
Here is how sql*plus (Oracle's tool) will display the data using default settings
SQL> select 12345678901234567890123456789012345678 no_format,
  2  to_char(12345678901234567890123456789012345678, '99999999999999999999999999
999999999999') with_format
  3   from dual;
NO_FORMAT WITH_FORMAT
1.2346E+37  12345678901234567890123456789012345678
SQL>
----- TOAD will display something similiar but the default uses more decimal digits in the scientific notation data
NO_FORMAT,WITH_FORMAT
1.23456789012346E37, 12345678901234567890123456789012345678You can either format the numeric data in the query using TO_CHAR or the 'extractor' can do it when it converts the data to a string.

Similar Messages

  • Result in scientific notation

    Hi,
    We migrated an instance from 7.3 to 7.6 x64 (no unicode) and I get an expression result in scientific notation.
    How can I make the notation use decimal? I cannot find anything in the documentation.
    sqlcli
    EXPRESSION1
    1.3192E7
    1 row selected (449 msec)
    Cheers,
    Jan

    Hi,
    the function FIXED (<your expression>, <number of digits) may help
    Elke

  • Select query resulting in redo?

    Hi All,
    Does select query results in redo? In what cases this happens?
    Regards,
    Sphinx

    mtefft wrote:
    Another possibility is that the SELECT query invokes a PL/SQL function that performs insert, update or delete.
    This is a poor practice for a number of reasons but they are out there.
    Disagree with that. Proof:
    SQL> create table x(y number);                                   
    Table created.                                                   
    SQL> create function f return number as                          
      2  begin                                                       
      3  insert into x values (2);                                   
      4  return 1;                                                   
      5  end;                                                        
      6  /                                                           
    Function created.                                                
    SQL> select dummy, f() from dual;                                
    select dummy, f() from dual                                      
    ERROR at line 1:                                                 
    ORA-14551: cannot perform a DML operation inside a query         
    ORA-06512: at "HR.F", line 3                                     

  • How to insert the select query result into table?

    How to insert the select query result into table?
    SELECT  top 20 creation_time  
            ,last_execution_time 
            ,total_physical_reads
            ,total_logical_reads  
            ,total_logical_writes
            , execution_count 
            , total_worker_time
            , total_elapsed_time 
            , total_elapsed_time / execution_count avg_elapsed_time
            ,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
             ((CASE statement_end_offset 
              WHEN -1 THEN DATALENGTH(st.text)
              ELSE qs.statement_end_offset END 
                - qs.statement_start_offset)/2) + 1) AS statement_text
    FROM sys.dm_exec_query_stats AS qs
    CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
    ORDER BY total_elapsed_time / execution_count DESC;
    Thanks,
    Tirumala

    1. SELECT INTO
    Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
    Use AdventureWorks2008R2;
    Go
    ---Insert data using SELECT INTO
    SELECT AddressLine1, City
    INTO BothellAddresses
    FROM Person.Address
    where City = 'Bothell';
    GO
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    2. INSERT INTO SELECT
    Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
    another table.
    Use AdventureWorks2008R2;
    Go
    ---Create Table
    CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
    ---Insert into above table using SELECT
    INSERT INTO BothellAddresses(AddressLine1, City)
    SELECT AddressLine1, City
    FROM Person.Address
    where City = 'Bothell';
    ---VERIFY DATA
    Select AddressLine1, City
    FROM BothellAddresses
    ---DROP TABLE
    DROP TABLE BothellAddresses
    GO
    Regards,
    Vishal Patel
    Blog: http://vspatel.co.uk
    Site: http://lehrity.com

  • Select query result set order

    Hi,
    Can I know the order in which Oracle outputs the result set of a simple SELECT query ? Will the output always be same as the order in which rows got inserted ?
    Please advise,
    Thanks,
    Smitha

    If you include an ORDER BY than the order of the result set is known.
    It will not always be the same as the order in which rows got inserted.

  • Select query results into excel file

    Hi,
    I want to put the results of a select query in an csv file(tab separated columns). I dont want to spool command for this . Is there any other method to do this.
    Thanks

    To get data from oracle to excel to use odbc driver to achive this.

  • Select Query Results to a .csv file????

    Hello All,
    I have a question in Oracle, if anyone knows how to do this. Please help me.
    How can I get the results of select query in Oracle loaded into a Excel file (.csv) file.
    Thanks in Advance,
    Sarada.

    Hi Sarada,
    as a csv is nothing more than a list of Comma Separated Values your best shot is to simply read do this with your values. read each value in an iteration add them to a string / stringbuffer and add a "," between them. When you read then next line in the ResultSet you just add a carriage return to the end. Depending on what format you want your csv list in.
    After you written all of this into a String you write this out to a file (unless you want to do it slower and write them line by line whenever you read them).
    Hope this helps,
    Kalle

  • Problem with select query (results cant b displayed)

    SELECT url,SUM(data_received) xyz FROM logs GROUP BY url ORDER BY xyz desc
    when i triedthe above query in the worksheet it works fine but when i write same query in code i get this error.
    myjsp page has this code.
    <%while (rset.next())
    out.println("<tr>");
    out.println("<td>" +
    rset.getString(1) + "</td><td>" +
    rset.getInt(2) + "</td><td> " +
    "</td>");
    out.println("<tr>");
    %>
    This is the error
    500 Internal Server Error
    java.sql.SQLException: Invalid column name at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:138) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:175) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:240) at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:3201) at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:1880) at oracle.jdbc.driver.ScrollableResultSet.findColumn(ScrollableResultSet.java:1308) at oracle.jdbc.driver.OracleResultSet.getInt(OracleResultSet.java:1618) at list_action._jspService(_list__action.java:67) [list_action.jsp] at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.0.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:60) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:416) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:478) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:401) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:719) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:376) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:870) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:451) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:218) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:119) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:112) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:230) at oracle.oc4j.network.ServerSocketAcceptHandler.access$800(ServerSocketAcceptHandler.java:33) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:831) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.0.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303) at java.lang.Thread.run(Thread.java:595)
    please help

    it is better to use  into table ....itab.
    dont go for joins if u r joining four tables .......
    it is better to for all entries.
    SELECT aauart awerks akdauf akdpos
    bftrmi baufnr bstlbez baufpl
    blead_aufnr bprodnet
    FROM aufk AS a
    INNER JOIN afko AS b
    ON baufnr EQ aaufnr
    INTO  TABLE i_data1
    WHERE a~auart IN s_auart
    AND a~kdauf IN s_vbeln
    AND a~werks EQ p_werks
    AND b~aufnr IN s_aufnr
    AND b~ftrmi IN s_ftrmi.
    if i_data1[] is not initial .
    if any sorting criteria is required based on primary keys write the sort statement here.
    select  crueck crmzhl
    cvornr carbid clmnga cxmnga
    crmnga cism04 cism05 cbudat
    d~kunnr
    e~arbpl
    FROM afru AS c inner join vbak AS d
    ON caufnr EQ aaufnr  innerjoin  crhd AS e
    like this u need to do...........................
    u have joined around five tables ...definetly that wont work
    endif.

  • CF9 Problems with Select * query, resulting in Value can not be converted to requested type.

    So, I work on a legacy CF web site and there are numerous SELECT * FROM USERS_TABLE queries all over the site.
    Well, we changed the structure of said table in the database on our Testing and Staging sites, with no issues.
    When we pushed up to our production environment and changed the structure of the production DB table, the server kept kicking back "Value can not be converted to requested type."
    After doing some searching out there, it looks like CF caches the structure of the table, and you either have to restart CF to clear it, or rename and then name-back the DSN to fix the issue.
    http://www.bennadel.com/blog/194-ColdFusion-Query-Error-Value-Can-Not-Be-Converted-To-Requ ested-Type.htm
    That said, this doesn't happen in our testing and staging environments - so what would be the difference?
    Is there some setting I need to change in the CF Admin to keep this from happening again?

    Also, if you can use a Stored Procedure to retrieve the data, do so.  Standard queries gets all the information, anyway, chokes bandwidth passing it all to the CF server, and forces the CF server to filter, sort, and format the data.  SPs tell the db server to get ONLY the data requested, and forces the db server to filter and sort the data, leaving only formatting to the CF server.
    That's not true. The only time CF messes with data returned from the DB is if there's a maxrows attribute, and the record set returnded from the DB has more than that number of records... which causes CF to truncate the recordset to the correct size before returning it. The DB might or might not stop sending rows down to CF after CF says "yeah, I've got all I want now".
    Other than that, for all intents and purposes all CF does with the SQL is pass it to the DB and wait for an answer. The only thing it does to the returned data is to create a CF record set ("query") with it... this does not involve any filtering and sorting.
    Adam

  • Difference in count(*) query and select * query results

    i am using Oracle9i Enterprise Edition Release 9.2.0.8.0.
    in a table select count(*) returns 34, but when i run select * statement it returns only 6 rows. Results are pasted below. Can any one knows the reason of this mismatch
    SQL> select * from pay_at;
    EMP_CODE STA IN_OUT_DA TIME
    100341 IN 07-MAR-04 09:32
    100341 OUT 07-MAR-04 10:24
    103165 IN 31-MAR-03 14:41
    103165 OUT 31-MAR-03 20:00
    101204 IN 19-APR-04 13:00
    101204 OUT 19-APR-04 23:59
    6 rows selected.
    SQL> select count(*) from pay_at;
    COUNT(*)
    34
    ------------------------------------------------------

    Maybe you pressed CTRL-c during the fetch phase of "select * from" ?
    If this is not the case, try to build a very small test case we can run that shows this behaviour and post it here.
    Regards,
    Rob.

  • Show Select query result in the text file.

    Hi all,
    i want to show my select statment records in the text file.
    thanks in advance.
    Mob.

    you cannot do a select in a stored procedure.
    you could do something like
    SQL> set serverout on
    SQL> spool output.txt
    SQL> declare
           x varchar2(40);
         begin
           select * into x from dual;
           dbms_output.put_line(x);
         end;
    X
    SQL> spool offor use the utl_file package (more powerfull, less secure, write on the db-server instead of the sqlplus-client)

  • Calculator: removing scientific notation in results?

    This seems like it must be a bug or a corrupted app, but I'd just like to confirm: with the calculator in "basic" mode, dividing two numbers which only have one significant digit returns a result like so: 1/3000 = 0.000333 (the setting for decimal places seems to be irrelevant).
    However, changing either number to have more than one significant digit returns the result in scientific notation, like so: 1/3100 = 3.225806e-04.
    Can anyone else duplicate this or help me correct it? It's obnoxious to have to keep adjusting the numbers. And yes, I realize that means my math skills suck. Thanks in advance.

    Bumpty-bump. Can anyone at least confirm or deny? TIA.

  • 2.1EA2: Pinning Query Results and changing Connections [fixed in 2.1.0]

    I am on 2.1EA2 (JDK 1.6.0_16) and been playing with the new SQL Worksheet pin query results functionality. I have found that it is possible to run a query against one connection, pin the results and then change connection and run the same (or a different) query against another connection. I really like this, but found a few problems:
    #1 There doesn't seem to be any way to tell which connection a query result tab was actually run against
    #2 Even if all rows are fetched, if I then disconnect from the first connection it can get quite messy. Sometimes I get an empty connection dialog (I can't remember the exact title and it doesn't reproduce consistently) with only the close window X in the corner. Some times I get prompted to log in with a connection information dialog with no reference to the connection it is connecting to - cancelling only brings up the same dialog again until I successfully connect. Some times I get prompted to log in and while that is still on the screen, SQL Developer logs me back in to the connection (even though I don't save passwords) - I even get a new worksheet for the reconnected connection.
    theFurryOne

    Raghu,
    I am happy with both.
    #1 - I would be happy if the connection name was at the start of the tool-tip style pop-up when hovering over Query Results tab and the Query Result SQL dialog that opens on the SQL button. -K-'s suggestion makes it immediately obvious for the currently selected Query Results tab, without having to move the mouse or click on something.
    Ideally, I would like something similar for the other output tabs (ie Script Output), but they seem to show results for all connections that the worksheet has used, so the same concept may not work.
    #2 - I am used to the grid being cleared when disconnecting from earlier versions - I assumed that this was a bug where SQLD was not checking the connection of the results, just the current connection of the worksheet.
    theFurryOne

  • Transferring multi-column query result into MS Excel

    Hello everybody!
    An ultimate novice in Oracle, with some database concepts, is here.
    The very first challenge; which I encoutered is that I want to transfer a Select query result, with multiple columns, into MS Excel sheet in a way that each field occupies a separate column in the sheet.
    I hope the forum members will show me a simple way to get around the problem.
    Thanks in anticipation.
    Rabi

    what will happen the query returns too many rows that
    Excel cant hold? I faced this problem and divided the
    report into "n" numbers based on the number of rows
    returned. Is there any internal logic for it in
    oracle?Excel is capable of holding 65536 rows of data on a sheet.
    Oracle is capable of writing data out to files.
    Oracle does not know or care whether the file it is writing is for Excel or any other product, as the file you are likely to be writing is CSV (comma seperate format) which is an open format, not specifically for Excel. If you need to limit the number of rows per CSV file then you will have to code this "business logic" into your code that produces the CSV file from Oracle.

  • CohQL command line Tool select query output in file (unix)

    Ho to insert Coherence CohQL command line Tool select query result in file in unix platform. I have tried below query but failed
    query.cmd -s -c -l "select * from 'dist-example'" >myOutput.txt
    I also tried below query, result is displayed in command line but no file is created in folder.
    select * from dist-example >myOutput.txt
    I also tried one more query, result is displayed in command line but no file is created in folder.
    select * from dist-example >/opt/bin/myOutput.txt

    Hi,
    In Unix you should use query.sh instead of query.cmd
    In your case then the command would be smething like:
    query.sh -s -c -l "select * from 'dist-example'" >myOutput.txt
    You can also try using '>>' instead of '>' in order to redirect to a text file.
    Hope this helps.
    -Cris

Maybe you are looking for

  • Issue in closure of prod order

    hi friends, even after production order is fully delivered, when i try to close the orders i am getting an error as no hr update. this error is applicabe only when the orders are confirmed based on personnel numbers in co11n. i  ticked no hr update i

  • Interrupted while setting about:config. Came back and now firefox won't open for more than 1 second.

    As above. looked up and was late to work. never 'closed' file or settings. Came back from work and now firefox opens for about 1 second and automatically closed down immediately. I've removed it. uninstalled it. redownloaded it. still does same. Now

  • IPod Touch and iHome Alarm Clock

    We were just given an iHome (iH4B) alarm clock for iPod. The specs state that it is compatible with the 2g 16gb Touch that we have. However when it is time for the alarm, the music stops after about 30 seconds and is replaced with alarm beeps. I thin

  • Can't import jpeg photos into iPad

    Can't figure out why some of my scanned jpeg photos can be imported into my iPad through iTunes and others can't. the message I get is "holiday.jpeg was not copied to the iPod because it cannot be played on this iPod." Any ideas?

  • [Issue]Scrollpane Scrolling

    I'm guessing this is the correct sub-forum since I'm not using Actionscript. Issue: I have a movie clip that is basically a container for images with text descriptions. Everything works except when you try and scroll using a mouse-wheel. When you usi