473,320 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Need to change any and all Nulls to Blanks when Selecting into an Outfile

I am needing to SELECT all fields/records from a large table (96 columns, over 100 million records) into an outfile. I need to change any "NULL" to a blank. I can use

"SELECT IFNULL(field_name,'') FROM table_name WHERE transDate = date INTO OUTFILE '/tmp/sample-file.csv' FIELDS TERMINATED BY '|';",

but that only works by column name - it does not work for

"SELECT IFNULL(*,'') FROM TABLE...etc".

I cannot go through checking IFNULL for every single column individually - much too time consuming and too long to write, plus columns may be added or deleted as time goes along and this will be a script that may need to set to select on a daily or weekly basis.

Is there a single Mysql command line statement that can change any NULL fields to blank fields when Selecting ALL (*) columns/records into an outfile?
Feb 22 '10 #1
0 1254

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: dan | last post by:
I am wondering if anyone can tell me how to add the totals city by city clearing the screen after each, then putting the grand total of all the city's on the final screen. The input file has id,...
3
by: Drewdog | last post by:
I am getting some error messages which I can't figure out their meaning. I have the code setup, I think it's correct but it doesn't work. My goal is to get this program to read from a data file and...
9
by: Jacob | last post by:
Is there any way (maybe using an attribute) that I can force strings or other reference parameters to always have an instance even if they are blank? Ex: public string DoSomething(string Text)...
31
by: Martin Jørgensen | last post by:
Hi, I've had a introductory C++ course in the spring and haven't programmed in C++ for a couple of months now (but I have been programmed in C since january). So I decided to do my conversion...
17
by: Nirjhar Oberoi | last post by:
Hi, I am new to Linux and wanted to know how to use GCC to Compile the Code written in C? I dont want to use EMacs or VI for my editor. Can you suggest a good IDE for linux for C Programming.. ...
2
by: jschmidt | last post by:
Hello Everyone, I have a View that is returning null values. This is not a problem except that I don't want the user to see "NULL" in the data. I want to replace "NULL" with a blank. The sql that I...
1
by: mzladyd | last post by:
I am loading data to an Oracle table with Informatica. There are six fields set to number format. The data includes nulls that shows in the table as zeros. How do I make the zeros show as blanks in...
2
by: Chedda | last post by:
everytime i try to compile and run the program, on the compiler it states on line where it says ofstream outfile("c:\\Users\\Michael\\Desktop\\Statistics.txt");#include <iostream> that theres an...
4
by: Jim | last post by:
Hi There, I'm trying to read a file character by character. When I write the file out, there is one extra character which shows on the screen as a solid circle with a small question mark in the...
3
by: Eric_Dexter | last post by:
I am trying to take some data in file that looks like this command colnum_1 columnum_2 and look for the command and then cange the value in the collum(word) number indicated. I am under...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.