Opening .mwb file without MySql

2012-12-13 Thread Fred G
Hi all--

I googled around a bunch but couldn't find a good answer to this question.
 How do I open the ERD diagram I made in MySQL WorkBench 5.2CE, which is a
.mwb file-- on another computer that does not have MySQL on it?  I want to
be able to print out the file and so I need to be able to open it on the
other computer.

Would greatly appreciate any help you can provide.

Thanks!


Re: DECIMAL datatype automatically makes blank become 0

2012-08-06 Thread Fred G
Thanks for the response.  I'm not sure that is exactly what is happening
for me.

I tried an example where I created a dummy database and a dummy table. If I
create a column with decimal datatype and insert 2 different rows, one
blank and one null, they both are treated as nulls.  This is what I would
like, but it does not work this way when I try to import a csv.

When I try to import a csv file with either null or blank values for a
decimal datatype, they both get treated as 0.00 (if we are using
DECIMAL(12,2)).

I think the issue has to do with the way MySQL 5.2 Workbench imports csv
values.  I experimented with a few different tests, but I haven't found a
way to successfully treat null decimal values being imported from a csv as
nulls in the database without just making the whole column a VARCHAR(255)
datatype, which does seem to allow for nulls, but just seems like the wrong
way to solve the problem.

On Sun, Aug 5, 2012 at 9:53 AM, Hassan Schroeder hassan.schroe...@gmail.com
 wrote:

 On Sat, Aug 4, 2012 at 8:14 PM, Fred G bayespoker...@gmail.com wrote:

  But I'm sure that I must be missing something here. Is there a way to
 use a
  DECIMAL-like operator that treats blanks as blanks?

 A DECIMAL column is either going to contain a decimal number or
 NULL; 'blank' isn't a term that even makes sense in this context.

 If you want NULL rather than 0 for a non-specified value, insert it
 that way.

 --
 Hassan Schroeder  hassan.schroe...@gmail.com
 http://about.me/hassanschroeder
 twitter: @hassan



Re: DECIMAL datatype automatically makes blank become 0

2012-08-06 Thread Fred G
Thanks! I'll create a temp table to handle it as well.

On Mon, Aug 6, 2012 at 2:13 PM, Stillman, Benjamin 
bstill...@limitedbrands.com wrote:

 Meant to add:

 My workaround was to set the column as varchar then convert it to decimal
 after the import. When adding to the table, I use a temp table to import to
 as varchar, convert the column, the just select from temp table into prod
 table.



 -Original Message-
 From: Stillman, Benjamin [mailto:bstill...@limitedbrands.com]
 Sent: Monday, August 06, 2012 2:05 PM
 To: 'Fred G'
 Cc: mysql@lists.mysql.com
 Subject: RE: DECIMAL datatype automatically makes blank become 0

 I don't believe this is limited to Workbench. I saw the same behavior
 using LOAD INFILE and a pipe-delimited file. There's a bug report that's
 been open since November of 2006 about this:
 http://bugs.mysql.com/bug.php?id=23212


 -Original Message-
 From: Fred G [mailto:bayespoker...@gmail.com]
 Sent: Monday, August 06, 2012 9:48 AM
 To: Hassan Schroeder
 Cc: mysql@lists.mysql.com
 Subject: Re: DECIMAL datatype automatically makes blank become 0

 Thanks for the response.  I'm not sure that is exactly what is happening
 for me.

 I tried an example where I created a dummy database and a dummy table. If
 I create a column with decimal datatype and insert 2 different rows, one
 blank and one null, they both are treated as nulls.  This is what I would
 like, but it does not work this way when I try to import a csv.

 When I try to import a csv file with either null or blank values for a
 decimal datatype, they both get treated as 0.00 (if we are using
 DECIMAL(12,2)).

 I think the issue has to do with the way MySQL 5.2 Workbench imports csv
 values.  I experimented with a few different tests, but I haven't found a
 way to successfully treat null decimal values being imported from a csv as
 nulls in the database without just making the whole column a VARCHAR(255)
 datatype, which does seem to allow for nulls, but just seems like the wrong
 way to solve the problem.

 On Sun, Aug 5, 2012 at 9:53 AM, Hassan Schroeder 
 hassan.schroe...@gmail.com
  wrote:

  On Sat, Aug 4, 2012 at 8:14 PM, Fred G bayespoker...@gmail.com wrote:
 
   But I'm sure that I must be missing something here. Is there a way
   to
  use a
   DECIMAL-like operator that treats blanks as blanks?
 
  A DECIMAL column is either going to contain a decimal number or NULL;
  'blank' isn't a term that even makes sense in this context.
 
  If you want NULL rather than 0 for a non-specified value, insert it
  that way.
 
  --
  Hassan Schroeder  hassan.schroe...@gmail.com
  http://about.me/hassanschroeder
  twitter: @hassan
 

 

 Notice: This communication may contain privileged and/or confidential
 information. If you are not the intended recipient, please notify the
 sender by email, and immediately delete the message and any attachments
 without copying or disclosing them. LBI may, for any reason, intercept,
 access, use, and disclose any information that is communicated by or
 through, or which is stored on, its networks, applications, services, and
 devices.

 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql




Financial Data Mining in MySQL

2012-08-04 Thread Fred G
What are the best ways to conduct financial data mining in MySQL? From
browsing the World Wide Web, it looks like using R to access MySQL and
using some pre-built R financial data analysis packages is the way to go.

Is there anything built-in to MySQL 5.2 Workbench, or, any other
possibilities that might be better than R? Python is another option I
suppose...

Much thanks in advance!


DECIMAL datatype automatically makes blank become 0

2012-08-04 Thread Fred G
Hi--

I'm using MySQL 5.2 Workbench, and when I import a csv into MySQL, blank
values become 0 when I define the datatype to be a DECIMAL (in our case
(DECIMAL(12,2)). Since there is the potential for values to be 0, this
poses a problem for us. I initially wanted to make all the DECIMAL values
become VARCHAR(255), because I can still do inequality queries on this
column if it is a VARCHAR, and VARCHAR does not mind blanks. It keeps them
as is.

But I'm sure that I must be missing something here. Is there a way to use a
DECIMAL-like operator that treats blanks as blanks? If not, is there a
better strategy then making the relevant column a VARCHAR?

Much thanks!


Re: Exporting to CSV. Error Code: 2013. Lost connection to MySQL server during query

2012-08-01 Thread Fred G
Hi Monty,

First of all, thanks so much for responding to my question! I am using
MySQLworkbench 5.2.37CE.  I'm pretty sure the issue has to do with
something on the administrator side of things. We managed to get it so that
I can click the icon to export the file, but he's still working on getting
it so that we can write an sql query to do this. So for all practical
purposes on my end, the question is being resolved.

But I don't understand how clicking the icon after running a select query
works for exporting, but the command to outfile in a sql query would not
work.

Thanks again

On Tue, Jul 31, 2012 at 5:36 AM, Michael Widenius mo...@askmonty.orgwrote:


 Hi!

  Fred == Fred G Fred writes:

 Fred Thanks Dhaval.  Putting the join condition before INTO outfile
 doesn't seem
 Fred to work, either.

 Fred When I try to use the same outfile name 'test123.csv' I get Error
 Code:
 Fred 1086 File 'test123.csv' already exists.  But then when I try to find
 the
 Fred csv file on my computer, there is a folder with that name, but weird
 files
 Fred in it, none of which are a csv-- and certainly not in the location
 that I
 Fred thought it would be (the same directory that the .sql query is in).

 It's the mysqld server that is writing the .csv file. This means that
 the path is related to the mysql data directory and not to where your
 .sql file is.

 When using select into outfile it's always best to give a full path!


 Fred  Additionally, when I try to identify a different path, such as
 'C:\\' etc,
 Fred I get an error.  This error is: Error Code: 1. Can't create/write to
 file
 Fred C:\test123.csv(Errocde: 2).

 This probably means that you don't have write access to C:\


 Fred I tried running the query outputting to a different named .csv file,
 but it
 Fred is still just running... and seems like it was like yesterday
 where after
 Fred 10 minutes I will get the Error that the MySQL connection was lost.

 The reason that your connection is lost are ether:
 - There is timeout in the client you are using
   (The server never gives a timeout for running queries).
 - The mysqld server died (not likely but possible).
 - Some process in your system is killing quries that runs too long.

 One way to quickly check that things are working are by adding LIMIT 1
 to the query.

 Fred Does anyone have an idea of what is going on?

  The query without exporting the file works fine, in about 12 sec/77
 sec.
  I
  read online how to export MySQL queries into csv's, and I'm not sure
 what
  I
  am doing wrong.  I keep getting the error:
  Error Code: 2013.  Lost connection to MySQL server during query, where
 the
  duration/fetch values are 600.547 sec (~10 minutes).

 What is the exact error message?
 Which client are you using to do the query?

 It's strange that the query works fine when you are not using select
 into outfile.

 What MySQL version are you using

 Regards,
 Monty
 Creator of MySQL and MariaDB



Re: Exporting to CSV. Error Code: 2013. Lost connection to MySQL server during query

2012-07-26 Thread Fred G
Thanks Dhaval.  Putting the join condition before INTO outfile doesn't seem
to work, either.

When I try to use the same outfile name 'test123.csv' I get Error Code:
1086 File 'test123.csv' already exists.  But then when I try to find the
csv file on my computer, there is a folder with that name, but weird files
in it, none of which are a csv-- and certainly not in the location that I
thought it would be (the same directory that the .sql query is in).
 Additionally, when I try to identify a different path, such as 'C:\\' etc,
I get an error.  This error is: Error Code: 1. Can't create/write to file
C:\test123.csv(Errocde: 2).

I tried running the query outputting to a different named .csv file, but it
is still just running... and seems like it was like yesterday where after
10 minutes I will get the Error that the MySQL connection was lost.

Does anyone have an idea of what is going on?

On Wed, Jul 25, 2012 at 9:22 PM, Dhaval Jaiswal dhaval.jais...@via.comwrote:

 SELECT * FROM test INTO OUTFILE '/home/test.csv' FIELDS TERMINATED BY ','
 ENCLOSED BY '' LINES TERMINATED BY '\n'

 as above give your join condition before INTO OUTFILE.



 On Thu, Jul 26, 2012 at 1:32 AM, Fred G bayespoker...@gmail.com wrote:

 Hi--

 I'm trying to do the following:
 SELECT db.emp.emp_fname, db.emp.emp_fname, db.sale.sale_date,
 db.sale.sale_no, db.sale.sale_total_amt
 into outfile 'test123.csv'
 FIELDS terminated by ','
 FROM db.emp
 LEFT OUTER JOIN db.sale
 ON db.sale.emp_id = db.emp.emp_id;

 The query without exporting the file works fine, in about 12 sec/77 sec.
  I
 read online how to export MySQL queries into csv's, and I'm not sure what
 I
 am doing wrong.  I keep getting the error:
 Error Code: 2013.  Lost connection to MySQL server during query, where the
 duration/fetch values are 600.547 sec (~10 minutes).

 I'm wondering:
 a) What is going on?
 b) How do I fix it?

 Thanks so much!!




 --

 [image: Inline image 2] http://www.via.com/

 *Dhaval* | Database  System

 *E:* dhaval.jais...@via.com ra...@via.com| *T:* 080 4043 3000 | *M:* +91
 - 8095 397 843

 [image: all-icon.jpg] http://www.via.com/




Re: Exporting to CSV. Error Code: 2013. Lost connection to MySQL server during query

2012-07-26 Thread Fred G
Thanks!

On Thu, Jul 26, 2012 at 12:05 AM, h...@tbbs.net wrote:

  2012/07/26 06:52 +0530, Dhaval Jaiswal 
 SELECT * FROM test INTO OUTFILE '/home/test.csv' FIELDS TERMINATED BY ','
 ENCLOSED BY '' LINES TERMINATED BY '\n'

 as above give your join condition before INTO OUTFILE.
 
 Right: MySQL server writes into some directory where it is, not where
 MySQL client is. If less than a full path name is given, almost certainly
 the server will attempt to write into a directory to which it has no
 permission, and almost certainly also not into one that you want it to
 write into. If server and client run on separate machines with separate
 disks, there is no means through OUTFILE of there setting the output where
 the client is, only through client s standard output, where you get no
 choice of field separator, line separator, or field-quote character (there
 is none), although you can keep or skip the column names (-N for skipping
 them), and suppress the one-character escape character (-r), same as FIELDS
 ESCAPED BY ''. There is no means of skipping NULL or \N for nulls,
 which is not CSV format.

 And if your MySQL is under Windows, be sure to read all instructions about
 entering full pathnames. It is best to avoid the backslash (\), because
 that is a C-escape introduced (along with much other C-stuff) into SQL s
 original PL1.


 --
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:http://lists.mysql.com/mysql




Exporting to CSV. Error Code: 2013. Lost connection to MySQL server during query

2012-07-25 Thread Fred G
Hi--

I'm trying to do the following:
SELECT db.emp.emp_fname, db.emp.emp_fname, db.sale.sale_date,
db.sale.sale_no, db.sale.sale_total_amt
into outfile 'test123.csv'
FIELDS terminated by ','
FROM db.emp
LEFT OUTER JOIN db.sale
ON db.sale.emp_id = db.emp.emp_id;

The query without exporting the file works fine, in about 12 sec/77 sec.  I
read online how to export MySQL queries into csv's, and I'm not sure what I
am doing wrong.  I keep getting the error:
Error Code: 2013.  Lost connection to MySQL server during query, where the
duration/fetch values are 600.547 sec (~10 minutes).

I'm wondering:
a) What is going on?
b) How do I fix it?

Thanks so much!!


Reading in NA's into a column with Decimal datatype

2012-07-19 Thread Fred G
Hi guys--

I am having some trouble importing a csv file correctly as a table in my
new database.  In particular, there are 4 NA's in a column with 10,000+
other rows that have decimal values for that column.

How can I get MySQL to read in these NA's as some sort of null that is
accepted by the decimal datatype? I've read a few posts about this already,
but nothing has worked for me yet...

Much thanks in advance.