Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    MYSQL






SuperbHosting.net have generously sponsored dedicated servers to ensure a reliable and scalable dedicated hosting solution for BigResource.com.





No Digits Output/query > File ? > Spreadsheet?


Two questions: My query works fine but I need two things:

a) How can I limit the number of digits outputed? I cannot find anything in my.cnf that seems to deal with this. I would like to limit the output to one digit past the decimal point ( a computation this field - that field).

b) Getting the answer to my >select etc is just the first stage! I would like the answer to end up in a spreadsheet. mysql>select etc > /my/path/to/my file gives me an error message. I know in the command line output can be outputted to a file. Can the same thing be done in the mysql> command line? How? or what is the #command line command eg mysql select etc?




View Complete Forum Thread with Replies
Sponsored Links:

Related Messages:
How Can I Output Query Results Into A Text File?
I'm looking for a way to output the results of a simple SELECT statement into a text file instead of displaying it on the screen?

View Replies !   View Related
Output To File
how can i transfer data from table to file (ex. data.txt)?

According the book I'm raeding I should type this: '% mysql firstdb < rs.sql > data.txt' into system command line, but the substring '% mysql' looks a bit misleading (and I got an error here, the content of the file rs.sql : 'select * from sales;').

And again I encountered an error when I had type: 'firstdb < rs.sql;' in mysql server command line, ('source rs.sql;' - works fine :] ).

View Replies !   View Related
How To Output Sql Errors To A File
I am trying to output the errors of my INPUT operation to a file. I have created a list of sql statements from some input files. However, some of the data values set in the sql statements may contain outliers that are outside the domain of acceptable values in their respective fields.

How do I determine from a huge input file of sql statements which ones were acceptable and which ones were not?

For the time being, I am using the tee outputFile.txt command to save the console output. I am useing the source sqlFile.txt as the input file.

The outputFile.txt has all the output. Also, it gives messages like the following.

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

How do I know what sql statement caused this error? Is there anyway to indicate the particular sql statement caused this error?

View Replies !   View Related
Output To A File WITHOUT TAB As A Separator
I use this syntax "mysql -u$LOGIN -p$PSW < $tmp_sql > $res_out; " in order to get an output-file. This file will be forwarded to a routine that will read the file position for position, expecting fixed length on the strings. Today a TAB is used as a separator.

So, how do I get a fixed length on the columns in the output-file? (Server-version is 4.0.23)

View Replies !   View Related
SQL Statement To Output Db To A File
Is there a way to issue some sort of sql statement to backup a database to a file?

View Replies !   View Related
File Output Not Working
I'm having trouble to write to a file use select * INTO 'output.txt' FROM table; It keeps complaining: ERROR 1327 (42000): Undeclared variable: /pathtofolder even though I have the file created in the folder. I have tried to create the file in /var/tmp/, /tmp and my home directory, but none of them works, File_priv is set to Y in user table.

View Replies !   View Related
Formatted Output To A Text File
I'd like to be able to write selected fields from a table to a csv text file. However, I need to be able to write some header lines to the file first, then the csv data, then some footer lines.

Question 1: What is the best way to do this. Using the SELECT ... INTO OUTFILE won't allow me to write the headers and footers. TEE includes the mysql> prompts, etc. There doesn't seem to be a straight forward fopen, printf sort of commands.

Question 2: How do you write a string like the header lines? PRINT doesn't seem to work.

View Replies !   View Related
Save Error Output In File
need the erroroutput from mysql in a textfile. I try it with follow comand:

"mysql -uroot -ppassword -hhostname --force database < input.sql > output.txt"

But the output.txt dont contains the erroroutput. The Erroroutput is only show in the console.

View Replies !   View Related
Sending Mysql Output To File
i have a bat file that has the following statement:
c:mysqlinmysql -u root tms < d:/manish/spooled_files/tms_compliance_trend.sql

this reads the sql script file and populates the mysql table

now suppose this process yielded some errors and i want to
say make a log file for it how can i do that

i tried this
c:mysqlinmysql -u root tms < d:/manish/spooled_files/tms_compliance_trend.sql > path/to/error.txt.

View Replies !   View Related
Save Command Output In Text File
How can i save output of "Select" command to a text file on server ?

Example :

SELECT email
FROM `forums`
into outfile "/text.txt";

^^ This does not works and gives this error on mysql prompt :

ERROR 1045 (28000): Access denied for user 'database_data'@'localhost' (using password: YES)

But if i just run this command on mysql prompt : It works ...

SELECT email
FROM `forums`;

It runs fine and displays result on screen.

But i want to save the output of the command in a text file on the server... Kindly let me know, right syntax to achieve it.

View Replies !   View Related
What Is The Best File Type To Output For A MSWord Mail Merge From A Mysql Database?
I'll be working on a project soon which will involve outputting a list of names and addresses from a database, these will then be used in an MS Word Mail Merge. I need to know how best to create the file for use as a datasource in the MM.

So far I have found that a fairly easy method is to output a txt file which contains a tab delimited list of the names and addresses. This can then be used as a datasource in MSWord, afterwhich fields can be selected and the Mail Merge created.

I've not coded any of this so far, I've only created the text file manually. I was wondering though, how do you get carriage returns into the address? At the moment when I used the file, the addresses all appear on one line?

View Replies !   View Related
Output Query Result
Can I output a mysql query result direct to an Access database? I know (probably) I could use outfile to csv and read that through ODBC but then I've got the problem of not being able to overwrite it. I'm thinking that if I can output direct into an mdb it would get around that limitation.

View Replies !   View Related
Query Output Alphabetacally?
I have a very simple website that is made for moderators of a game. We can insert a player ID, a screenshot link, and who inserted it. We have the option to search the database fopr a specific player ID and retrieve how many times he has been entered for an offence and the screenshot. We also have the option to query the entire database to output them all. However, it outputs in orfer of being inserted. Is there anyone for it to populate the table in alphabetical oder by the player ID?

View Replies !   View Related
Output Query In MySQL
I have this query and this output:

Code:
SELECT * ,
COUNT(STATE) AS strSTATE,
COUNT(TYPESTATE) AS strTYPESTATE
FROM
tbl_MYSQL
WHERE STATE = 'ABSENT'
AND DATE = '2008-04-29'
GROUP BY STATE,
TYPESTATE,
DESCR
ORDER BY DESCR ASC

HTML Code:
AAA BBB-ZONE CA 9168381000 Expectancy 1 29/04/2008
AAA BBB-ZO CA-UOD MONTAG-1 9168381620 Disease 1 29/04/2008
AAA BBB-ZO CA-UOD MONTAG-9 9168381629 Holiday 1 29/04/2008
AAA BBB-ZO CA-UOD DIENSTAG 9168381650 Permit 1 29/04/2008
AAA BBB-ZO CA-UOD DIENSTAG 9168381650 Holiday 1 29/04/2008
To have this output?

HTML Code:
AAA BBB-ZONE CA 9168381000 Expectancy 1 29/04/2008
Disease 1 29/04/2008
Holiday 1 29/04/2008
Permit 1 29/04/2008
Holiday 1 29/04/2008

View Replies !   View Related
Reusing A Query Output In The Same Query
I am guessing a basic question but not one I can find an obvious answer to.

If I create a calculated or modified column in a query (such as a modified text string), and then want to reuse that in the same query as I need to do three or four operations on it in sequence, how do I do it in mySQL 4.1?

Do I need to create a new column to store the interim result in an existing table (and then clear or alter it each time I run the query), or create a temporary table, or is there an easy way to reuse the query output in the same query (does the query have a name like a table name)?

If it requires a new column or table, are there particular disciplines to ensure it is robust and self maintaining?

View Replies !   View Related
Column Names On Top Of The Query Output
Is it possible to get the columnnames on the first row of a query output? Is there a "flag" I have to add?

View Replies !   View Related
NULL Fields In CSV-output Query...
I'm trying create a query to export to a CSV file (using "SQL Manager 2007 for MySQL" query-builder).

The resulting CSV-file needs to be in a format where NULL fields are ignored (simply TAB to next field) rather than represented by the ESCAPEflag-N sequence ie: N.

Is there a modifier for the SELECT statement that would allow me to specify how NULL fields are represented in the resulting text file? Something like NULL=""?

View Replies !   View Related
Query To Output Two Unequal Tables
I have two tables, the 'aeproducts' table that lists all of our items (like part number, price, etc.) and a table ('excelexport') that shows where each item is compatible with our kits. The two tables can be joined via the part number field in each.

However, only some of the items in the products table have matches with the second table. When I do a query, it joins the two tables, but shows results only where the two tables join and ignores all the rows that don't join with the other table. Here's that query:

PHP Code:

SELECT UPC, aeproducts.PartNo, ItemName, Descr, Qty, MSRP, Brand, OffRoad, OnRoad, Oval, Photo, PressRel, Available,
excelexport.Partno, 18R, 18T, B3, B4, B44, GT, GT2, MGT, MGT8, MMGT3, RC8, RC8T, SC8, T3, T4, TC3, TC4, TC5, 10R5, 10L2, 10L2O, 10L3O, 10L3T, 10L4O, 12L3, 12L3O, 12L4, 12R5, NTC3, DS, NDS
FROM aeproducts, excelexport
WHERE aeproducts.Partno = excelexport.partno;

How do I get ALL the results from both tables while joining them properly?

View Replies !   View Related
Limit Text Output In SELECT Query
I'm looking to output a list of news stories, but only outputting the first 100 or so characters of the text and only limited to the newest 4 entries in descending order.

At the moment I'm using this nugget: But it doesn't work.

$result=mysql_query('SELECT newsheading, (LEFT newsbody,100), newsdate FROM news ORDER BY newsid DESC LIMIT 4');

View Replies !   View Related
How To Generate Html Output For Query Result With Perl
I can generate the html with the command like:

>mysql -ppassword -uusername -H -e "select distinct depID from tabledepart" databasename

but i need to know how to generate html output if i already connected with a database, and how to pass the html result to the perl program.

View Replies !   View Related
Float More Then 9 Digits
I have a data base with a float column.
When I insert a big number like 1888999,
the result save in the data base is 1.99989e+006.
How to configure the float column to acept a big number
with more then 9 digits without aroud.

View Replies !   View Related
Digits In Tinyint, Int
How large a number can be stored in a:

tinyint
int
bigint

are they the same as the C++ numbers Int8, Int16 and Int32?
also what does the size refer to (tinyint 4) or (int 20) when I view the MySQL db in Dreamweaver?
I have NaviCat and I am building a new db for my app and this is my first time working with MySQL so I would like to ensure that I have created a database appropriate for my apps info.

View Replies !   View Related
Order By All Digits
When i use Order by, it only uses the first digit then the second.

I.E. It will give me 1,2,30,9 as the order when it should be 1,2,9,30.

what query do i use to have it order for real?

View Replies !   View Related
Significant Digits For Division
I am trying select field / 10000 as Number from table1 where id = 1;

I don't want any rounding taking place, but MySQL is currently doing it.
How can I ask for a specific number of digits with division? Code:

View Replies !   View Related
SELECT And Significant Digits
Using MySQL 4.0.12, is there a way to specify significant digits for a
mathematical operation within a SELECT? In other words, the query "select
5/213" defaults to two significant digits (0.02) for the result.

How can I specify the result attributes within a SELECT?

View Replies !   View Related
All Digits Of A Float Number
Is there a way to display all the digits of a float number so that an exact search using those values may be performed... This is what is basically happening.

SELECT DISTINCT(GTC) from GEOMETRIES;

+-------------+
| GTC |
+-------------+
| 4.86368e+06 |
| 4.86369e+06 |
| 4.86369e+06 |
+-------------+

SELECT ITEM FROM GEOMETRIES where GTC=4863680;
Empty set (0.00 sec)

SELECT ITEM FROM GEOMETRIES where GTC like 4863680;
Empty set (0.62 sec)

select TRACENO FROM mysqlValues where CDP_Y = 4.8637E+06;
Empty set (0.00 sec)

View Replies !   View Related
Select Count From A List Of Digits ??
I'm using php to extract data from postgres and print to browser. I have data that was input through checkboxes on a form - each checkbox had a different value but got pushed into the same column. Code:

View Replies !   View Related
Spreadsheet
I've been trying to figure this out, is there a script or a program that could take a spreadsheet and convert it into a database table? I maintain a fairly detailed set of numbers on my site, it's based of an excel file I receive from one of the people that helps me maintain the site, I was wondering if there's an easier way to go from one to the other.

View Replies !   View Related
Comparing Times With Different Number Of Hour Digits
Why is '100:00:00' > '90:00:00' false

but time_to_sec('100:00:00') > time_to_sec('90:00:00') true?

View Replies !   View Related
Excel Spreadsheet
I was wondering if there was a relatively simple way to dump all of my info from a mysql database to an excel spreadsheet.

View Replies !   View Related
Spreadsheet To MySQL
I have a spreadsheet I am using for tracking users that are testing a number of different products. What I want to be able to do is have reporting ability to see what users are in what betas, track their survey responsiveness, whether bug reports where sent, etc... and have this accessible by multiple users.
I thought I would import my data into a database, however, is there a solution out there for creating customized reports and providing a front-end for data-entry?

View Replies !   View Related
Importing Spreadsheet
I have an Excel spreadsheet with almost 2000 rows of data and I was hoping that there was a way that I could you phpMyAdmin to import that data iwhtout having to type in each and every item?

I have 2 other spreadsheets which have a total of about 7-8000 items in them as well

I've been trying to follow the manual online and I have another book that I'm using but maybe I'm just being a bimbo because I can't figure it out

I have already set up the table and fields in phpMyAdmin and I actually started to type the items in (about 200 so far) and I decided that was a little retarded considering that the spreadsheet was already there and I shouldn't need to...

View Replies !   View Related
Spreadsheet Importing
i am wondering how can i import a spreadsheet in to phpmyadmin i have tried many ways none seem to work.

View Replies !   View Related
How To Upload A Csv Or Excel Spreadsheet?
I'm trying to figure out an efficient way to

1st: create a new database table based on my csv file (which I did a DTS on MS-SQL to get)

2nd: update that table weekly with a new csv file

Any advice?

View Replies !   View Related
Spreadsheet To Mysql Conversion
I need to convert an Excel spreadsheet to a MySQL dbf. I'm on OS X. I've found several Windows applications that do this but nothing for Mac. The only app that seems to come close is Navicat, but it needs to establish a remote connection to the existing database, which my server doesn't allow. What I need is a utility that will convert the spreadsheet locally so that I can then upload it via the server's phpMyAdmin control panel (which they've modified to prevent the uploading and converting of spreadsheet files on its own). Does anyone have any ideas? I'm spent hours and hours researching this, but so far, no cigar.

View Replies !   View Related
Importing Excel Spreadsheet Into Database
Thats when i get this error "Invalid field count in CSV input on line 1",

so i open up the .csv file and look at line 1 -

"Pcode,Locality,State,Comments,DeliveryOffice,Pres ortIndicator,ParcelZone,BSPnumber,BSPname,Category "

this is when i realise that the names in the table don't match that in database, so i then change the names so that they are the same -

"PCODE,LOCALITY,STATE,COMMENTS,DELIVERYOF,PRESORTI ND,PARCELZONE,BSPNUMBER,BSPNAME,CATEGORY"

After this i still get the same error, i then see that for the import u can specify the colum names so i do this and again i get the same error.

So what i want to know is how to fix the error?

View Replies !   View Related
Email To Spreadsheet Data Transfer
I am trying to develop a form that can be emailed to about 1000+ employees and load their responses into a spreadsheet. We are using SharePoint Enterprise with InfoPath / Outlook to run the project. I can get the form to work but cannot get the spreadsheet to load the data.

View Replies !   View Related
Edit Table In Spreadsheet Format
installed mySQL 5.1 and the GUI tools (administrator, browser) and they are all running (WinXP). My database opens OK and I can view it in the Query Browser. My question is this. Is there a spreadsheet type format for editing tables similar to the way it is done in Access? I can view the column headers, but I want to also view the records, row by row, and possibly copy and paste data.

View Replies !   View Related
Importing Data From Excell Spreadsheet - HELP
I have some data in an Excel spreadhsheet - nothing fancy, name, address, telephone number, zip code, URL address...

Can it be imported into a mysql database that already is set up with the same fields?


View Replies !   View Related
Loading Data Into A Table From Excel Spreadsheet
I have a excel spreadsheet from which I would like to load data into a table in mysql.

View Replies !   View Related
Create Table With Check Constraint Accept Only Characters No Digits And Vice Versa
Create Table with check constrating accept only characters no digits and vice versa.

I tried the following query but iam unable to execute

i.e it is accepting both digits and characters. The constraint is not satisfying.

CREATE TABLE 'mymysql' (field1 VARCHAR(30),field2 VARCHAR(40) CHECK (field1 REGEXP '[[:alpha:]]'))

'field1' only characters no digits
'field2' only digits no characters

View Replies !   View Related
How To Search For Multiple Entries, From Values In An Excel Spreadsheet?
This is my first entry! I'm so pumped. Ok I'm a novice when it comes to using MySQL, yet I feel compelled to grow deeper.

I have a table called "product" with a field called "name." There are 800 "name" entries in my product table. Each entry has a unique string value similar to below...

"00123BS-BLACK SNEAKERS"

I also have a Microsoft Excel spreadsheet with a single column list of ALL my product code numbers, similar to what i mentioned above "00123" but without the BS-BLACK SNEAKERS part (just numbers).

So my question is how can I do a major search inside MYSQL of ALL of my excel values? In MySQL I want to pull up every field->"name" entry that has any of the numbers in my excel column list.

View Replies !   View Related
Run Query From A File
I tried:

mysql> source 'file_name';

and

mysql> . 'file_name'

right now I'm running version 4.0.something on WinXP and I repeatedly get the following error:

Failed to open file 'file_name', error: 2

Any ideas?

View Replies !   View Related
Using Query File From Console
I need to run a query written in a file from inside mysql console, not shell prompt.

Anyone can help me?

View Replies !   View Related
How To Get Sql Query Result Into A File
can someone suggest me way to get large mysql select query into file? Is there a mysql built in function to do this? I know sybase have bcp to do this.

View Replies !   View Related
Making A Bat File That Has Load Query
How can I make a MYSQL query as a dump?

Say I have this query: ......

View Replies !   View Related
Query To Retrive File Names
Lets consider:

table1

col1
"sometext /a.jpg sometext /b.jpg sometext /c.jpg sometext..."
"sometextt2 /d.jpg sometextt /e.jpg sometextt /f.jpg sometextt..."
etc...

This query:
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX(col1,'.jpg', 1),'/', -1) from table1;

returns only file names:
a
d

but b(.jpg) , c(.jpg), e(.jpg) and f(.jpg) are not returned!

My desired result should look like this:

a
b
c
d
e
f

any suggestions about how to get all the other file names ?

View Replies !   View Related
How To Execute A Query From A File In OS X Leopard
I want to execute a query from within a file in OS X Leopard. The syntax (according to what I could find on the web) should be:

mysql> . /Users/peterv/bin/test.sql;

but it gives me this error:
ERROR:
Failed to open file '/Users/peterv/bin/test.sql;', error: 2

The file has the correct permissions.

View Replies !   View Related
Export Query Results To Csv File
Can you please tell me how to export query results in to a csv file?

just simple run a query and get results in a csv file..

View Replies !   View Related

Copyright © 2005-08 www.BigResource.com, All rights reserved