2

Sqlplus to csv conversion of scientific number

 3 years ago
source link: https://www.codesd.com/item/sqlplus-to-csv-conversion-of-scientific-number.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Sqlplus to csv conversion of scientific number

advertisements

I have the following in Unix under my shell script:

SET linesize 2000
SET pagesize 50000
SET ECHO OFF
SET FEEDBACK OFF
SET VERIFY OFF
SET MARKUP HTML OFF
set numwidth 17
set colsep ","

select accountnum, cardnum, name, address, number from employee;

Once it generates the output in .csv, cardnum and accountnum becomes scientific like:

5.30706E+15

I want it to be:

501889176278289

I know how to change it in Excel but since I am sending these reports to a client. I want it to go to them in the correct format so they don't have to change anything.


I would suggest this:

SELECT TO_CHAR(accountnum,'9999999999999999999') accountnum
     , TO_CHAR(cardnum,'9999999999999999999') cardnum
     , name, address, number
  FROM employee;

Related Articles

In Access 2007 CSV Export: Disable Scientific Notation

When exporting a CSV from Access 2007, it automatically converts decimals into scientific notation. Unfortunately the tool that receives them treats these fields as text, and displays them as is. The values being exported are from a query being run a

CSV Conversion per Spring Batch

I am working on txt file to csv conversion in spring Batch, a am using pipe seperated text file and my problem is when i try to write into csv if a field encounters comma a new field is created in csv, i.e if i have address like |Mumbai,India| in tex

A decimal to binary conversion of a number that also has a fractional part

How to represent 500.2 in binary number system. I want to know the conversion method. I know how to convert numbers without points but if point comes in any number I don't know how to convert it.Quoting the conversion description from Modern Digital

Extract the scientific number of the string in Java

I am trying to extract scientific numbers from string. Something like: String str = "Name of value 1.111E-11 Next Name= 444.4"; I want result like: Result: [1.111E-11, 444.4] Please suggest better solution for it.You can use scanner for this: St

Conversion of scientific notation - Scheme

I am trying to do simple subtraction arithmetic on two very large numbers. (- 1.8305286640724363e+023 (floor 1.8305286640724363e+023)) When I do this, I get a result of 0.0. I'm expecting an output of: (- 1.8305286640724363e+023 (floor 1.830528664072

Unable to flatten the JSON network to prepare CSV conversion using Ruby 2.1.4

I have an array of nested JSON "hash" objects that I need to completely flatten so it ports over to CSV cleanly, which is obviously not nested and "multidimensional" like JSON typically is. But the flatten method (used here with ! bang

Dual-to-Chain Conversion without Scientific Notation

How to convert a double into a floating-point string representation without scientific notation in the .NET Framework? "Small" samples (effective numbers may be of any size, such as 1.5E200 or 1e-200) : 324897123469820000000000000000000000000000

How do I create a CSV so that a number appears as a string in the spreadsheet?

I am trying to build an application that extracts some data from a database, and then uses some of the data to create a CSV file to be loaded up by Excel. The codez: foreach (xOFDocInfo cm in docs) { string s = bi.Agency + "," + cm.BatNbr.Trim()

json to csv conversion to php

i am getting a json response from a site, then convert it into json decoded file, my code is $author = $_POST['author_name']; $author_name = str_replace(' ', '+', $author); $term = $_POST['term']; $term_search = str_replace(' ', '+', $term); $country

Redux Payload Conversion Form from Number to String on Blur

I'm trying to isolate why React/Redux/Redux-Form is automatically converting my payload to a string, whenever I focus and blur a input field. There must be some process that is interfering but I don't know how to troubleshoot. I've tried using the Re

Binary record to CSV Conversation

Hi Folks I have been working on a python module which will convert a binary string into a CSV record. A 3rd Party application does this usually, however I'm trying to build this logic into my code. The records before and after conversion are as follo

Decrease-formatted conversion error analysis number as a number group separator

In mvc I have formatted a numeric value using a comma as the number group separator as is specified in the Indian numbering system: PaymentReceived = String.Format(new CultureInfo("en-IN", true), "{0:n}", t.PaymentReceived) Later, I ne

How to generate Sqlplus in csv file?

i am trying to generate the csv file out of oracle SQLPLUS by shell script, I am getting headers repeated multiple times and also null values are coming at the end of the line, echo "****************************************************************&qu

Date of conversion to week number

This question already has an answer here: ISO week number in CMD 4 answers Hi Not sure if anyone can help me. How can I convert current date to week number in a batch scripting? I only know how to generate current date from my pc. %DATE% eg. 3/16/201

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK