473,657 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

2 New Member
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_na me,'') 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 1262

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

Similar topics

1
2145
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, price, purchased, sold, returned, and then a letter indicating a city. ex. 200 1.40 30 13 1 B #include <iostream> #include <cctype> #include <iomanip> #include <fstream> #include <cstdlib>
3
2664
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 basically put it into an output file that I can access as a test file. Here is my header file: #include <iostream.h> #include <fstream.h> #include <iomanip.h>
9
1371
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) { if (Text != null) /// i would like to avoid checks like this. they get to be annoying when passing a lot of strings DoWork();
31
3131
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 utility in C++, before I forget everything. But it doesn't compile: ------------
17
2168
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.. Does C Programming on windows environment and on linux environment differ??? Thank you.
2
1372
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 have is shown below: SET QUOTED_IDENTIFIER ON GO SET ANSI_NULLS ON GO ALTER VIEW dbo.CUSVW_SCHEMATIC_DETAILS_VENDOR AS SELECT , , , , , , , , ,
1
1306
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 the Oracle table?
2
1565
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 error, why is that? someone help, i dont know if theres a logical error or just some other error, someone please help..... this is the program
4
3671
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 middle. Here is what I have: infile = fopen("encrypted.txt", "r"); outfile = fopen("plain.txt", "w");
3
1823
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 the impression I need enumerate but I am not sure what to do with it any help would be nice. import sys
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.