RE: linux and mysql socket

2003-06-19 Thread Kenneth Hylton
If it truly ran fine for a few days and then you couldn't run the client,
you may have another problem.

If you rebooted the box, mysqld may not have automatically started.

So, all of the sudden, the client can't connect to the socket since it is
not there as the server is not running.

You can check the my.cnf file until your are blue in the face, but, if the
server isn't running, then the socket file isn't anywhere to be found, no
matter what is in my.cnf.

By the way, I did this one to myself too!

Ken Hylton



-Original Message-
From: Dathan Vance Pattishall [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 3:45 PM
To: 'azamka'; [EMAIL PROTECTED]
Subject: RE: linux and mysql socket


Your client is configured to connect via UNIX sock on localhost. It
thinks the sock is on /tmp when it's probably /var/lib/mysql

Take a look at /etc/my.cnf and make the change there or at the command
line.

---Original Message-
--From: azamka [mailto:[EMAIL PROTECTED]
--Sent: Thursday, June 19, 2003 1:07 PM
--To: [EMAIL PROTECTED]
--Subject: linux and mysql socket
--
--I installed mysql manually on red hat 9. It worked fine couple days
but
--from
--yesterday i am getting a weird error when i tried to run the mysql.
the
--error
--statement is  Error 2002: Can't connect to local MySql server
through
--socket
--'/tmp/mysql.sock'(2).
--
--I am new user of Linux and I am unable to figure out why is this
--happening.
--Please help me.
--
--thanks in advance.
--Kamran
--
--
--

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




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

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



RE: help with query

2003-01-13 Thread Kenneth Hylton
From you example, not quite sure what you are trying to do (I could if, for
example generic tree was 0199, and 01 was tree and last two characters were
color or something like that)

At any rate, you can use string functions to pull data from portions of
fields to build whatever you want to search on.

refer to http://www.mysql.com/doc/en/String_functions.html

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261


-Original Message-
From: Leonardo Javier Belen [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 13, 2003 2:10 PM
To: [EMAIL PROTECTED]
Subject: help with query


Hi all!
I would like to build a query that I can use to search hierichally from
an char(4) id composed as followed
2positions for the class of plant (for example)
and 2 positions for the type of flower (for example)

if someone give me the id that means red rose tree, and I know there is
another clasifications of tree and another colors for the rose, does anyone
knows how to retrieve them.

0100 - Rose tree
0101 - pink rose tree
0102 - red rose tree
0103 - rococo rose tree
0200 - generic tree

Thanks in advance
Leonardo J. Bel?n.



query mysql sql blah!



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Question or Wish feature

2003-01-07 Thread Kenneth Hylton
Refer to http://www.mysql.com/doc/en/LOAD_DATA.html for doc on LOAD DATA
INFILE command and syntax.

-Original Message-
From: Gman [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 07, 2003 10:45 AM
To: [EMAIL PROTECTED]
Subject: Question or Wish feature


How easy is it to import a CSV file into MySQL and when it is done does
MySQL or the program that does that automatically create a field to
match the fields in my CSV file? If not is this something that could be
easily implemented?

George Flatman


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Performance over a network

2002-10-25 Thread Kenneth Hylton
I just got done playing with this same scenario. 

If the task finishes locally OK, but totally dogs on the network, then you
may have a network issue, NOT a MySQL issue.

1) Make sure that the switch and boxes are set to full duplex operation.
This will eliminate collisions.  Make sure that everything is REALLY running
full duplex.  Don't assume that it just is.

2) Make sure that your switch has a high enough internal bandwidth to handle
the full duplex traffic.  Many older switches do not have the internal
backplane bandwidth between ports to support a lot of 100 Mbit traffic even
though they will accept 100 Mb full duplex connections on all ports.  They
may have only a backplane bandwidth of 200-300 Mb and you can fill that up
with e-mail, internaet, etc. and leave nothing left over for server to
server traffic.

3) Put the servers on a VLAN if possible to avoid other network traffic.

Symptoms of these problems are slow processing with none of your boxes
loaded up.  top will show them idle and the completion time for your
processing will be painfully long.  It will run fine locally, but, just
crater over the network.

Sound familiar?

When I made the above changes, I was able to change network throughput from
12 Mb/sec between application server box and database server box to 160
Mb/sec of traffic.  top then showed the application boxes as totally busy
with no idle time.  The MySQL box was never really taxed even at that
throughput level.

Also, you can look to optimize your SQL (i.e.: multiple records inserted per
INSERT SQL command - see web for syntax) but that may not be your issue if
it worked OK on the local box.

I found that stringing several Athlon XP1800+ boxes together (my test
environment) I was able to max out the boxes before I maxed out the network
@ a true 100 Mb full duplex.

Hope this helps!

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-Original Message-
From: [EMAIL PROTECTED] [mailto:hooker;rave.iinet.net.au]
Sent: Thursday, October 24, 2002 7:45 PM
To: [EMAIL PROTECTED]
Subject: Performance over a network


Hi,

I'm running MySQL 3.23.51 on a Debian Linux server, and I've got a
performance question.

I have a perl application which builds up data in memory (in a hash) and
every 30 seconds forks and writes the data to a database. When both perl
script and MySQL server are on the same machine, the script manages to
finish writing to the database before the next child appears (*most* of
the time :-) ). However, if the script and MySQL server are on different
machines, separated by an uncongested 100 Mbs ethernet network, the
child always fails to write to the database within the 30 second window.

So, my questions are ...


*   Is there a measure of the expected difference between these two
scenarios?

*   Is there any explicit tuning which can be done to speed up access 
over the network (short of adding gig-ethernet cards which isn't
likely) ?

The reason for not just leaving everything on the same machine is that
the expected growth over the next 6 months will mandate more than one
server to handle the incoming data, so the separation between script and
database engine is going to have to happen anyway.

Hopefully ...


Paul Wilson
Chime Communications Ltd


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Mysql arbitrarily rounds large floats

2002-10-22 Thread Kenneth Hylton
I didn't see anyone else reply, so I will give you my thoughts.

I thought one of the list gurus would give you a much better answer than I
could so I waited.

Assuming that with two decimal places, you are doing something monetary.
But this applies whenever you want fixed decimal places, too.

I NEVER use float or double to store values like you appear to be doing.  I
always used DECIMAL so that they are stored as strings and you do not have
problems associated with what you see here.  I then have complete control
over what is stored and the precision associated with it.

I then pull the decimals out and either work with them CAREFULLY as double
items (or you could use variant, I suppose) or extended math functions to
add, etc. strings of infinite precision.

Then, convert back to strings and store as DECIMAL items in MySQL.  

That my be overkill, but, I don't get bit doing it that way. I usually use
DECIMAL(16,6) to store my monetary stuff.

Also note that although MySQL will allow you to do something like DECIMAL
column name = DECIMAL column name + 0.15 if you are beyond the precision
of a double, it will truncate the result incorrectly and oddly.  I played
with it when I first started using MySQL and it appears that internally
MySQL does it's math as doubles when working with DECIMAL items.

If you stay within the range of a double, it appears that using DECIMAL data
types works OK.

Also, I think that you have a misunderstanding of how you are defining your
float.  Doesn't the first 8 mean bytes to store the float in NOT decimal
places?  IF you defined it as a DECIMAL type of item, then (8,2) would yield
a maximum of 99.99 like it appears that you want.  I don't think that is
true with float items.  Check the web doc to make sure.

Have Fun!

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261





-Original Message-
From: Lonny Byrd [mailto:lonny;bakecrafters.com]
Sent: Tuesday, October 22, 2002 1:18 PM
To: [EMAIL PROTECTED]
Subject: Mysql arbitrarily rounds large floats


Description:
Mysql arbitrarily rounds large floats
How-To-Repeat:
create table temp (
id int unsigned not null auto_increment primary key,
amount float(8,2)
);
insert into temp(amount) values(244409.29);
insert into temp(amount) values(09.29);
insert into temp(amount) values(777409.29);
insert into temp(amount) values(999409.29);
select * from temp;
++---+
| id | amount|
++---+
|  1 | 244509.30 |
|  2 | 444509.28 |
|  3 | 777509.31 |
|  4 | 999509.31 |
++---+
4 rows in set (0.00 sec)
Fix:
Not Known


Submitter-Id:  submitter ID
Originator:Lonny Byrd
Organization: Bake Crafters
 organization of PR author (multiple lines)
MySQL support: none
Synopsis:   Mysql arbitrarily rounds large floats
Severity:  serious
Priority:   high
Category:  mysql
Class: sw-bug
Release:   mysql-3.23.42 (Source distribution) AND mysql 3.23.53

Environment:
machine, os, target, libraries (multiple lines)
System: FreeBSD secure.bakecrafters.com 4.4-RELEASE FreeBSD 4.4-RELEASE #8:
Mon
Apr  1 09:00:21 GMT 2002
[EMAIL PROTECTED]:/usr/src/sys/compile/SERVERBERT  i386
Also tried on System: Linux squiggle.kianta.com 2.4.9-31 #1 Tue Feb 26
07:11:02 EST 2002 i686 unknown
running mysql  Ver 11.18 Distrib 3.23.53, for pc-linux-gnu (i686) and got
identical results

Some paths:  /usr/bin/perl /usr/bin/make /usr/local/bin/gmake /usr/bin/gcc
/usr/
bin/cc
GCC: Using builtin specs.
gcc version 2.95.3 20010315 (release) [FreeBSD]
Compilation info: CC='cc'  CFLAGS='-O -pipe '  CXX='c++'
CXXFLAGS='-O -pipe  -f
elide-constructors -fno-rtti -fno-exceptions'  LDFLAGS=''
LIBC:
-r--r--r--  1 root  wheel  1205382 Sep 18  2001 /usr/lib/libc.a
lrwxrwxrwx  1 root  wheel  9 Jan 23  2002 /usr/lib/libc.so - libc.so.4
-r--r--r--  1 root  wheel  572876 Sep 18  2001 /usr/lib/libc.so.4
Configure command:
./configure  --localstatedir=/var/db/mysql --without-perl --w
ithout-debug --without-readline --without-bench --with-mit-threads=no --with
-lib
wrap --with-low-memory --enable-assembler --with-berkeley-db --prefix=/usr/l
ocal
 i386--freebsd4.4
Perl: This is perl, version 5.005_03 built for i386-freebsd


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/  

RE: mediumint(6) problem

2002-09-11 Thread Kenneth Hylton

Mediumint refers to the fact that it is three bytes long rather than a
regular 4 byte, 32 bit integer.  It's range is like +/- 8,000,000 or so
(look it up for sure)

The 6 just has to do with how many digits will be displayed when you invoke
the MySQL client for the row - spacing will be a minimum of 6 characters
wide.

From the website:
http://www.mysql.com/doc/en/Numeric_types.html
As an extension to the ANSI/ISO SQL92 standard, MySQL also supports the
integer types TINYINT, MEDIUMINT, and BIGINT as listed in the tables above.
Another extension is supported by MySQL for optionally specifying the
display width of an integer value in parentheses following the base keyword
for the type (for example, INT(4)). This optional width specification is
used to left-pad the display of values whose width is less than the width
specified for the column, but does not constrain the range of values that
can be stored in the column, nor the number of digits that will be displayed
for values whose width exceeds that specified for the column. When used in
conjunction with the optional extension attribute ZEROFILL, the default
padding of spaces is replaced with zeroes. For example, for a column
declared as INT(5) ZEROFILL, a value of 4 is retrieved as 4. Note that
if you store larger values than the display width in an integer column, you
may experience problems when MySQL generates temporary tables for some
complicated joins, as in these cases MySQL trusts that the data did fit into
the original column width. 

So, MEDIUMINT(6) can contain +/-8,000,000 (more or less) and will display as
6 characters wide.

Don't feel bad, I had the same confusion on char and varchar fields and what
they can store/display.

Have Fun,

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-Original Message-
From: Paul DuBois [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 11, 2002 4:53 PM
To: Jan Kudrman; [EMAIL PROTECTED]
Subject: Re: mediumint(6) problem


At 23:05 +0200 9/11/02, Jan Kudrman wrote:
Hi all,

I have a small problem - I have the following table with numetic type. In
my
table is mediumint(6), but I can to insert value 11223344. I thougth the
maximum value for mediumint(6) is 99.

Why?


Do you have some idea what I should to do to be able insert value 99 as
a maximum for my field?

My table:
CREATE TABLE `table` (
   `id_a` mediumint(6) unsigned NOT NULL default '0',
   `id_b` mediumint(6) unsigned NOT NULL default '0',
   `id_c` mediumint(6) unsigned NOT NULL default '0',
   `area` char(2) NOT NULL default '',
   `group` tinyint(3) unsigned NOT NULL default '0',
   PRIMARY KEY  (`id_a`,`id_a`,`id_b`)
) TYPE=MyISAM

Background:
MySQL version 3.23.49 on Red Hat Linux 7.3.

Thank tou very much for your help.

Regards,
Jan


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: JAMES KADEH mysql !

2002-08-28 Thread Kenneth Hylton

also wrote back and asked if he thought I was a complete idiot...

Unfortunately, you may be.

Now he has your e-mail address.

As my father always sez, smooth move Ex-Lax


-Original Message-
From: Mary Stickney [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 10:12 AM
To: John Wards; [EMAIL PROTECTED]
Subject: RE: JAMES KADEH mysql !



I reported him already... to [EMAIL PROTECTED]
[EMAIL PROTECTED]
and several others..

also wrote back and asked if he thought I was a complete idiot...


-Original Message-
From: John Wards [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 28, 2002 9:49 AM
To: [EMAIL PROTECTED]
Subject: Re: JAMES KADEH mysql !


wow...do you think this is real.we could all be rich!...:-P
- Original Message -
From: James Kadeh [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, August 28, 2002 3:34 PM
Subject: JAMES KADEH mysql !


 mysql ,

 My dear,

 Good day, I wish to introduce myself   to you.  I am Lt. Col. James Kadeh,
(rtd.).I  am the  personal assistant to President Laurent Kabila of
Democratic Rep. of Congo.  I got your contact information from your
country's information directory over the internet during my desperate search
for a reliable person that will assist me personally in moving some funds.
Please I have not disclosed this to any other person, and if you cannot do
it for me , do not disclose it to any other persons

 I humbly wish to notify you of my intention to use your name and address
in the lifting out of the some of $18.6m currently deposited with a finance
company here in South Africa to a finance  security in Europe.
 This fund was deposited by me on behalf of President Laurent Kabila before
he met his untimely death through a bloody assassination by one of his body
guards at the height of the political crisis that swept through our country.
 This fund was meant for the purchase of arms and ammunition for defending
his regime against the Rebel forces in dare need to over throw his regime.
I was lucky to escape with copies of the documents covering the funds
deposited with the security company  to South Africa in other to save my
dear life and that of my family.  Presently, we are here without any
reasonable source of livelihood.
 And there has not been any trace of this fund or its location up to date,
since the new regime as I am solely in possession of the documents guiding
it.
 This is actually what I want you to do for me:
 To help me clear and accommodate this fund when it gets to Europe's
 To assist me in managing this fund in good and profitable venture in your
country , where I will also come and settle down.

 I highly hoped that my request will be granted and viewed with favor.
Please I anticipate your urgent response to this very request and also
emphasize that you keep every bit of this transaction strictly to yourself
alone, bearing in mind its nature and the confidentiality it requires.
  Thank you.
  Best Regards,
  Lt. Col. James Kadeh (rtd.).



 -
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail [EMAIL PROTECTED]
 To unsubscribe, e-mail
[EMAIL PROTECTED]
 Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: MySQL vs. Oracle (not speed)

2002-08-16 Thread Kenneth Hylton

Our experience has been totally the opposite.  

We recently ported a Delphi application from MS-SQL to MySQL.

The MySQL server was a less powerful box than MS-SQL was running on.

I will not go into great detail because some of the software is proprietary
and we make $$$ providing the service.

But here are out times:

Process #1 (heavy inserts, few updates) MS-SQL 9 hours MySQL 90 minutes
Process #2 (heavy updates, few inserts) MS-SQL 17 hours MySQL 2.5 hours

The databases were tuned to get maximum performance from MS-SQL (you can see
why) and NO changes were made to optimize
for MySQL, as we didn't need to.

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-Original Message-
From: Mary Stickney [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 8:53 AM
To: Francisco; Elizabeth Bogner; [EMAIL PROTECTED]
Subject: RE: MySQL vs. Oracle (not speed)



I have been doing speed tests  the same query ran on MYSQL took 45
minutes
on MS-SQL  it took 11 minutes..

yes you do get what you pay for

-Original Message-
From: Francisco [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 8:47 AM
To: Mary Stickney; Elizabeth Bogner; [EMAIL PROTECTED]
Subject: RE: MySQL vs. Oracle (not speed)


Hi,

I am beging using MySQL for quite a while and it is a
very good choice if you don't really need stored
procedures. MySQL provides a pretty good
implementation of a subset of MySQL-92, performance is
great, it is cross-platform, provides transactions,
and its price... well is free.

Hope it helps.
--- Mary Stickney [EMAIL PROTECTED] wrote:

 It doesn't suport alot of differnt things
 it dosent have store procedures , dosent have a
 complete SQL command set...

 I am using it becasue I am being forced to...



 -Original Message-
 From: Elizabeth Bogner
 [mailto:[EMAIL PROTECTED]]
 Sent: Thursday, August 15, 2002 9:25 PM
 To: [EMAIL PROTECTED]
 Subject: MySQL vs. Oracle (not speed)



 A company I work with is in the process of upgrading
 its databases from
 some
 motheaten system to something current. My impression
 is that they
 want to go with Oracle, and I'm not sure if this is
 based on anything
 other than being impressed with the size and
 presumed quality support
 of Oracle. I'd like to encourage them to at least
 seriously consider
 using
 MySQL instead.

 I don't think that speed is a huge factor here; we
 do a lot of XML
 publishing
 and content management, but at most we'd have
 several gigabytes of
 data and several dozen simultaneous users, so well
 within the
 capabilities
 of MySQL. I've looked at various things I could
 find, like the benchmarks
 pages (probably not relevant) and the MySQL myths
 page, which was
 somewhat helpful, but I couldn't find anything more
 along the lines of
 How to Convince my Management to go with MySQL. I
 don't even know
 what to expect from them, but I'm imagining they'll
 say, But MySQL
 doesn't support sub-selects, to which I can reply,
 But you can write
 most of those as joins anyway, so it won't matter
 because the software
 will all be written from scratch. Etc.

 Are there pointers anyone can give me?

 E. Bognewitz



-
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list
 archive)

 To request this thread, e-mail
 [EMAIL PROTECTED]
 To unsubscribe, e-mail

[EMAIL PROTECTED]
 Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php



-
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list
 archive)

 To request this thread, e-mail
 [EMAIL PROTECTED]
 To unsubscribe, e-mail
 [EMAIL PROTECTED]
 Trouble unsubscribing? Try:
 http://lists.mysql.com/php/unsubscribe.php



__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Definition of structure MYSQL

2002-08-13 Thread Kenneth Hylton

It should be in mysql.h

Check your installation and make sure it was installed.

Our sysadmin originally installed MySQL without it - after all, he didn't
need it so it must not have been important ;)

Also, you will need to be sure and install the libmysqlclient and link with
it.

Regards,

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261


-Original Message-
From: Brian Phillips [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 11:47 AM
To: [EMAIL PROTECTED]
Subject: Definition of structure MYSQL


I have just installed mySQL - I have tried versions 3.23.51 win and 
4.0.1 alpha win - but I cannot find a definition of MYSQL in any of the 
include or other files.   Obviously, as a result, no client that I try 
to write in C will even compile.

I have looked at the manual, and I have also bought the book 'mySQL' by 
Widenius, but I can find nothing of help on this point.

If anyone can point me in the right direction I would be extremely 
grateful.

Thanks

Brian Phillips


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: stupid question

2002-06-11 Thread Kenneth Hylton

I am assuming this is not a MySQL question since MySQL interacts with SQL
commands that are all in characters.

try using strstream.  You can poke just about anything into it and get a
string out.

If you must have a char*, then use the c_str() function of the string class.

The best implementation of this I've found is www.boost.org.

They have something called lexical_cast that works real cool.  It throws
exceptions if you feed it garbage.





-Original Message-
From: adelpfe [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, June 11, 2002 8:39 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: stupid question




  do you know any fonction that convert int to char*
  thantks

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Length Limit

2002-05-10 Thread Kenneth Hylton

The real answer, yes.  It has a limit of several GB, depending on your OS.
It can take a huge string containing MBytes of BLOB data.

Just for grins, I loaded several MB of image data this way just to prove to
myself that you could do it.

The practical answer is then pretty much no.  (Probably would run into a
TCP/IP message length limitation first)

I'm pretty sure the on-line documentation spells that out, or it is in the
MySQL New Riders book, or the MySQL O'Reilly book.

Also, If your are going to load lots of binary data, you need to be sure and
use mysql_escape_string() to pass your data before building sending the
query, and look at using mysql_real_query() rather than mysql_query().  It
takes a length argument and is supposed to be faster, although I haven't
personally looked at speed differences.


Ken


-Original Message-
From: Edilson Vasconcelos de Melo Junior
[mailto:[EMAIL PROTECTED]]
Sent: Friday, May 10, 2002 3:41 PM
To: MYSQL
Subject: Length Limit


Hi,

Using the C API, does the sql parameter in the mysql_query function a length
limit?

Thank u very much,
Edilson.

Edilson Vasconcelos de Melo Junior
www.jrsoftwares.com.br
[EMAIL PROTECTED]
Fone: (19) 3256-3577

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.361 / Virus Database: 199 - Release Date: 7/5/2002


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Any ideas how to speed this up?

2002-05-03 Thread Kenneth Hylton

What version of the ODBC Drivers are you using?  

I had a VB app using the 3.5x versions of the ODBC driver manipulating very
small tables and it was absolutley painful to run.

I stepped back to the version 2.x drivers (2.9, I think - anyhow, the driver
information is available on the web site) drivers and the thing screamed.

So, before looking for SQL based solutions, try using the 2.x drivers first,
if you can.

Regards,

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261





-Original Message-
From: Alexander Shaw [mailto:[EMAIL PROTECTED]]
Sent: Friday, May 03, 2002 2:28 PM
To: MySQL List
Subject: Any ideas how to speed this up?


Hi,

I'm currently developing an application with an Access 2000 front end and
MySQL back end. I have coded in updates to a table (based on selections in a
list box) with a work around for the lack of support for sub selects using a
temporary table.

The problem is that already with quite small amounts of data in the tables
(already indexed) things are pretty sluggish and there is huge amounts of
reading and writing to the database.

Does anyone have suggestions of ways I could speed this up please? I have
included the code from the after update event of the list box in question.

Alex

Private Sub lstSimilarFrameNo_AfterUpdate()

Dim strSQL As String
Dim rstCurrentSimilars As DAO.Recordset

Set rstCurrentSimilars = Recordset

strSQL = SELECT FilmID,FrameID FROM Frames WHERE FilmID =  
cboSimilarFilmNumber   

Set rstCurrentSimilars = CurrentDb.OpenRecordset(strSQL)

Do
If rstCurrentSimilars.BOF = True Then Exit Do
CurrentDb.Execute INSERT INTO CurrentSimilars (FrameID, FilmID,
SimilarID) VALUES (  txtFrameID  ,   rstCurrentSimilars!FilmID  , 
 rstCurrentSimilars!FrameID  ), dbFailOnError
rstCurrentSimilars.MoveNext
Loop Until rstCurrentSimilars.EOF = True

rstCurrentSimilars.Close
Set rstCurrentSimilars = Nothing

CurrentDb.Execute DELETE SimilarsForFrames.* FROM SimilarsForFrames LEFT
JOIN CurrentSimilars ON
SimilarsForFrames.SimilarID=CurrentSimilars.SimilarID WHERE
SimilarsForFrames.FrameID=  txtFrameID   AND
SimilarsForFrames.SimilarID=CurrentSimilars.SimilarID, dbFailOnError

CurrentDb.Execute DELETE CurrentSimilars.* FROM CurrentSimilars WHERE
(CurrentSimilars.FilmID=  cboSimilarFilmNumber  ) AND
(CurrentSimilars.FrameID=  txtFrameID  )

Me.Dirty = False

Dim i As Integer
For i = 0 To lstSimilarFrameNo.ListCount - 1
If lstSimilarFrameNo.Selected(i) = True Then
CurrentDb.Execute INSERT INTO SimilarsForFrames
(SimilarID,FrameID) VALUES (  lstSimilarFrameNo.ItemData(i)  , 
Me!FrameID  )
End If
Next

End Sub
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.346 / Virus Database: 194 - Release Date: 10/04/2002


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: One field or numerous datatype-specific tables?

2002-04-17 Thread Kenneth Hylton

Howdy - 

Am I missing something?  Why would you have to create all of your columns as
BIGINT?

Whether the has pool column is a TINYINT, BIGINT, or whatever, the SELECT
statement would be the same, wouldn't it?

Won't SELECT blah blah blah FROM HOMES WHERE HasPool = 1; return houses
with pools regardless of the underlying column type for HasPool?

Even if you absolutely have to create the HasPool column as a BIGINT, you
waste 7 bytes.  Unless you are talking about a database of all houses in
North America, I would really rethink worrying about the wasted space,
anyhow.  Especially versus the complexity of a multiple table solution.


Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261


-Original Message-
From: Rob Emerick [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 5:15 PM
To: [EMAIL PROTECTED]
Subject: One field or numerous datatype-specific tables? 


I am having a problem determining the best SQL DB schema to use. I have a
table
which stores attributes on homes, attributes such as  square footage,
price, or includes pool. Now the problem I am having is how to store the
actual value of the attributes. An attribute like square footage or
price can simply be stored as a BIGINT. However, an attribute like
includes pool is a boolean and I don't want to make a bloated table by
storing a 1 or 0 in a BIGINT field.

Plan 1
CREATE TABLE homes (id BIGINT UNSIGNED not null , fkey_attrib BIGINT
UNSIGNED not null , value BIGINT UNSIGNED not null , PRIMARY KEY (id), INDEX
(id), UNIQUE (id))

Let's say I wanted to show all properties that had a price of less than
$200,000. Let's say that the price attribute is attribute number 32. I
would execute the following: SELECT id FROM homes WHERE (fkey_attribid=32
 value20)

Now let's say I wanted to show all properties that had a pool and the
includes pool attribute was attribute number 12.
SELECT id FROM homes WHERE(fkey_attribid=12  value=1)


The problem I am having is in defining the field value. Since it is going
to store numbers that will be larger than the ranger for UNSIGNED INT, I
have to use a BIGINT datatype. It just seems like a waste to me, however, to
have a BIGINT datatype used for boolean attributes (such as includes
pool).


Plan 2
The alternative I came up with is to make the field value be relational. I
would create several other tables such as:

CREATE TABLE homes (id BIGINT UNSIGNED not null PRIMARY KEY (id), INDEX
(id), UNIQUE (id))

CREATE TABLE homes_bigint(id BIGINT UNSIGNED not null , fkey_attrib BIGINT
UNSIGNED not null , value BIGINT UNSIGNED not null , fkey_homes BIGINT
UNSIGNED, PRIMARY KEY (id), INDEX (id), UNIQUE (id))

CREATE TABLE homes_boolean(id BIGINT UNSIGNED not null , fkey_attrib BIGINT
UNSIGNED not null , value TINYINT UNSIGNED not null , fkey_homes BIGINT
UNSIGNED, PRIMARY KEY (id), INDEX (id), UNIQUE (id))

Now it would fall on the responsibility of my script (which I am fine with)
to determine which attribute pairs up with which table. Let's say I wanted
to show all properties that had a price of less than $200,000. Let's say
that the price attribute is attribute number 32. I would execute the
following:
SELECT id FROM homes AS h LEFT JOIN homes_bigint AS hb ON homes USING
hb.fkey_homes=h.id WHERE (hb.fkey_attribid=32  hb.value20)

Now let's say I wanted to show all properties that had a pool and the
includes pool attribute was attribute number 12.
SELECT id FROM homes AS h LEFT JOIN homes_boolean AS hb ON homes USING
hb.fkey_homes=h.id WHERE (hb.fkey_attribid=32  hb.value=1)


So the question I am debating is if I should put everything in just one
table (in which case boolean values would be stored in the same field as
BIGINT values) or if I should have separate tables that are streamlined to
particular datatypes. Would having everything in one table be faster? Or
could I simply optimize the numerous datatype-specific tables in plan 2 and
be just as fast?


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Deleting Duplicated Records

2002-04-10 Thread Kenneth Hylton

You are 100% correct.  

Since MySQL does not support cursors, I always put an auto_increment
column in my tables for just this purpose.

(This is what other DBMS' do, they just do it behind your back)

Unfortunately, the way MySQL really handles result sets doesn't lend itself
to simply adding a hidden auto_increment field to each row to act as a
cursor and allow updating of rows in result sets.

If it did, then I'm sure they would have put cursor support in the product
already.

Ken




-Original Message-
From: Jeffrey Flowers [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 11:16 AM
To: [EMAIL PROTECTED]
Subject: Deleting Duplicated Records


I am new to MySQL and I have a test database that I am playing with. Through
an accident while playing around, I ended up with two identicle records in
the database. I did a filter to try and change just one of them but both
would come up, so I couldn't see how I was supposed to delete just one of
the two records.

In the end, I deleted both records and re-input the one I needed but I know
that there must be a better way of doing this. Perhaps having a column in my
database with a serialized, unique record number would be a way to prevent
this in the future?


Thanks,

Jeff Flowers


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: MySQL on Cobalt Raq2

2002-04-10 Thread Kenneth Hylton

Well, I haven't kept up on the Cobalt product line, but, I wasn't aware that
they had intel based offerings.

I thought they were all RISC chip based.

That probably explains why I86 binaries won;t install..

If they don't have a binary for Cobalt Cube/RaQ systems, it's compile
time.

Ken


-Original Message-
From: Richard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 10, 2002 2:04 PM
To: [EMAIL PROTECTED]
Subject: MySQL on Cobalt Raq2


Trying to install version mysql version 3.23.49a rpm.

This is the Linux OS on my Cobalt. Kernel 2.0.34C2_SK. I have been trying
to install the rpm for intel, but it says that the package is for a
different architecture.

  Should I try the tar package or is this hardware a Sparc  platform? RPM is
on the box and other packages from the Cobalt site that are rpm's have
worked.

  Cobalt OS Release 4.0
  RaQ2-All-Security Release 4.0.1-10750
  RaQ2-All-Security Release 4.0.1-13453
  RaQ2-All-Security Release 4.0.1-9769
  RaQ2-All-System Release 4.0.1-7-9925
  RaQ2-en-OSUpdate Release 4.0

  Thanks in advance,

  Richard




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Using DECIMAL Types for Huge Numbers

2002-04-03 Thread Kenneth Hylton

Howdy All - 

I am using MySQL 3.23.46-Max under Red Hat 7.2

I am trying to use DECIMAL type columns to work with huge numeric (monetary)
values.

I figured out how to get large numbers into DECIMAL types by passing them as
strings:

mysql insert into khtest set k1=1,t1=123456789012345678.10;
Query OK, 1 row affected (0.00 sec)
mysql insert into khtest set k1=2,t1=123456789012345678.10;
Query OK, 1 row affected (0.00 sec)

mysql select * from khtest;
++---+
| k1 | t1|
++---+
|  1 | 123456789012345678.10 |
|  2 | 123456789012345678.10 |
++---+
2 rows in set (0.00 sec)

But, I cannot update them correctly using either strings or numbers:

mysql update khtest set t1 = t1 + .15 where k1 = 1;
Query OK, 1 row affected (0.05 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql update khtest set t1 = t1 + .15 where k1 = 2;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql select * from khtest;
++---+
| k1 | t1|
++---+
|  1 | 123456789012345680.00 |
|  2 | 123456789012345680.00 |
++---+
2 rows in set (0.00 sec)

Yes, I RTFM (and also this list's archives) and I know that DECIMAL columns
are limited in range to doubles, but, I was wondering:

1) If anyone out there has worked with huge numbers before and run into this
issue?
2) What solution did you use to get around this?
3) Does anyone know of a good inexpensive library to handle huge number
math?  (Rogue Wave has one, but it is expensive)
4) Does anyone know of a clone for the MS currency type variable? (that
would work, too)

I looked on the internet, but didn't have much luck finding anything useful.


TIA for your help!

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Password function

2002-04-02 Thread Kenneth Hylton

Okay, here's a hint...

4.2.9 in the manual  (;o)

Basically, if you encrypt the password, then you have to look it up using
the password function, too.

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-Original Message-
From: Ramiro Varandas Jr [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, April 02, 2002 10:49 AM
To: [EMAIL PROTECTED]
Subject: Password function


 I think that this question might be kinda of stupid for all of you but I 
couldn't find a good answer... When we use the MySQL internal function - 
Password('string') - MySQL inserts that string codified into the database,
so 
that people that look for that doesn't know the real password. But i have a 
client that have a website and in the table of customers I'd like to use
that 
function to make it more secure, but when I do that, I can't authenticate
the 
user anymore, because if i write:

  SELECT user_id FROM user WHERE user_pass = 'my_var'

 It doesn't return me a user... but it's there, registered...
 Is there a way to do that or no... if there is, something give me a hint...
 My client's website is running in a Windows 2000 server but the MySQL
server 
is runnig in a linux machine.

  Regards,
  Ramiro Jr.

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: C API Question

2002-03-20 Thread Kenneth Hylton

multiple commands Not as far as I know, you need to open your file, read
the commands and process them one at a time.

The C API is not magic and has no more capability than you do setting down
and typing in the commands yourself.

What you can do is build one HUGE insert command from lots of individual row
inserts, but you need to do that
programatically, too.

If you have loads of inserts to perform, it may be better to bulk load the
data from a file made of the inserts' data than a record at a time if speed
is an issue.

I'd sure try the simple way first, though.

Ken

-Original Message-
From: Javier [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 5:35 AM
To: [EMAIL PROTECTED]
Subject: C API Question


Hi,

I have a text file , with several MySQL instructions (CREATE TABLE, INSERT,
SET @var, etc.).

 I want to execute all these instructions from a C program , using the API.

It is possible to use the function mysql_query(), to execute all the
instructions contained in the file in a single call to this function? , Can
I execute several MySQL instructions in one only call to mysql_query()
function?

If it is possible, which is the best way to do this?

Thanks in advance

Javier Diaz
IT Developer


 - Scanned for all known viruses by Messagelabs --

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: queries and functions

2002-03-18 Thread Kenneth Hylton

I don't think MySQL has a mechanism for doing any sort of stored procedure,
but, I just saw this earlier today and went adn looked at it.

It may help you, but I know nothing about it and con offer no further
advice.

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261



-Original Message-
From: Natividad Castro [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 1:29 PM
To: [EMAIL PROTECTED]
Subject: queries and functions


Hi to all,
does mysql have a type of libraries where you can keep queries or functions.
For example if I need to run a query everyday, but I don't want to type the
same query everytime I need it. How can I store that query  in one place and
call it every time I need it?

Is this possible??

Thanks in advanced
Nato


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Server Databases Clash

2002-03-15 Thread Kenneth Hylton

I read your article and found it to be interesting and overall, quite
accurate.

I do have one bone to pick with you however.

I know the MySQL staffer who worked the MySQL portion of the test.  I had
occasion to meet him and talk briefly about the PC Magazine test in Houston
the week following the test.

From my discussions with him, I also believe that the MySQL folks asked if
they could use a Linux based platform instead of Win2K and were told no.

That's fine in that it makes the comparisons fair for all vendors.

Frankly, I was surprised that MySQL did as well as it did under Win2K!

My problem is that you then published numbers for MS SQL Server running in a
non-standard configuration from the rest of the test!

... As an extra data point, we also rewrote the benchmark in ASP .Net and,
due to time constraints, tested just SQL Server on this platform. We stress
that the results of this test are not comparable to the Java benchmark
results because the ASP .Net test used a different Web server (Internet
Information Services 5.0), different application engine (ASP .Net) and
different database driver (OLE DB). 
However, our results do provide evidence that this all-Microsoft software
stack can produce excellent performance, peaking at just under 870 pages per
second ...
This leads one to believe that SQL Server and an all Microsoft solution is
better than the 600 pages per second that MySQL and Oracle were able to
serve up.
At least that would have been the conclusion that I would have drawn from
your article, not knowing the the test environment was supposedly fixed for
all competitors.
If you want to let SQL Server turn in it's highest numbers by running on a
native platorm, that's fine.  Just let the rest of the competitors do the
same.
Yes, I know that everyone would be interested in .Net performance, but I
just don't think it should have been presented in a way that appears
misleading.

Ken Hylton
Programmer Analyst IV
LEC Systems  Programming

Billing Concepts, Inc.
7411 John Smith Drive
San Antonio, Texas 78229-4898
(210) 949-7261

sql, query

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: problem in telent to mysql server

2002-03-14 Thread Kenneth Hylton

Howdy - 

You are trying to telnet to the MySQL server.

3306 is the MySQL Server default port, not the telnet port.

If you are trying to run the MySQL client, then:

1) telnet mysqlserverhostname
2) run the Mysql client within your telnet session (mysql -uroot -proot, for
example)

If you are trying to access the MySql server programatically, then you need
to have your code
go the libmysqlclient or whatever library and use the appropriate API.

Regards,

Ken


-Original Message-
From: Jianping Zhu [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 14, 2002 1:58 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: problem in telent to mysql server


I use: 
telnet mysqlserverhostname 3306

and get following response:
 
 Host 'mylocalcomputer' is not allowed to connect to this MySQL server
What does this mean? and how to fix the problem?

Thanks


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




C API BLOB type field lengths returned

2002-03-07 Thread Kenneth Hylton

Howdy - 
I've posted this twice before - third time might be the charmer...
Can anybody help me?
I am using the C API and am returning a result set from a table with a BLOB
type item in it.
When I populate the BLOB fields initially (with all the same data) the
length is returned properly when I issue SELECT * FROM table and decode
the result set column metadata.
Meaning, that if I put , This Blob's for you! in the column, the value of
MYSQL_FIELDS.length = 65535 (max of BLOB type) and MYSQL_FIELDS.max_length =
21.  
When I update a few rows and put, That's OK man, but you still can't have
my BLOB! in a few columns, the values for the length of the fields are
returned funny, or at least, I don't understand why they are returning they
way they are.
Meaning the value of the new column length are all set to
MYSQL_FIELDS.length = 65535 (again, max of BLOB type) and
MYSQL_FIELDS.max_length = 49.  Problem is, this is even on the unchaged
rows!  Yuk!
A little experimentation showed that if I select on only unchanged rows, the
length is returned as 21.  But, if the result set has one of the changed
rows in it, the length of all blob fields is returned as 49, when (at least
to me) it should be 21 or 49.
In other words, it returns as the BLOB max_length value the value of the
longest blob in the result set, NOT the max_length of each row.  I inserted
(and updated) some records in the table with BLOB contents It's all about
the BLOB and I see the same result.  It returns not the length of the BLOB
for the row, but the length of the longest BLOB field in the result set.  
We are running MySQL 3.23.46-Max on RedHat 7.2 Question:
1)  How do I get the actual length of the BLOB column in the row,
without storing a separate column to maintain BLOB length manually?
2)  If this is not a problem because there is some other way to tell
where the BLOB buffer ends, please let me know.


 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: how can I use 'C' programs accessing a MySql

2002-03-05 Thread Kenneth Hylton


The best book for c programming I found is the O'Reilly book, MySQL  mSQL
.  It has a good example of using the C API and even builds some simple C++
classes.

The book, MySQL by Paul DuBois is the best overall MySQL book I found.
Plus, Paul is a regular responder to this list, so I would buy his book,
too.

As far as creating tables (or just about anything else) the thing to
remember that about all the C API does is pass the command you want to the
SQL interpreter and then execute your command.

So, if you want to create a table, you would pass a CREATE statement into
mysql_query (or mysql_real_query) EXACTLY like you would have entered it
into the mysql client.

These is lots is some contributed software out there for the C/C++ API, but
they all have problems when it comes to inserting and updating records.  The
issues is in understanding exactly how MySQL returns stuff in the result
set.

I have attached some C++ classes (and a test program) to this document that
should get you started.  They deal with the type saftey issue, updating
different data types and different size strings, etc.

You will also need to go to boost.org and get some code to install something
called lexical_cast, too.


Zip file removed to post to list.  Email me if you want the classes



Hello MySQL employees - 

If you want to post this zip file on your contributed software section, you
have my permission to do so.  These would have saved me months of effort and
I know someone else can use them, too.


 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-Original Message-
From:   [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]] mailto:[mailto:[EMAIL PROTECTED]] 
Sent:   Tuesday, March 05, 2002 9:01 AM
To: [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]

Subject:how can I use 'C' programs accessing a MySql

The following form was submitted via MySQL.com feedback
engine: 
  Name: Alexandre Adam
  E-mail address: [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
  Company: sansoft informatica
  Position/Title: user
  Type of interest: for personal use
  State or province: SP
  Country: Brazil
  Support contract: no

  Enter Your Questions, Comments, Feedback or Your Message
here:


I'm trying to understand how can I use 'C' programs
accessing a MySql

DataBase, please, could you send me a small program or
so that creates
a 
Table or two and make some changes on them. 
I read so many examples but all of them only contain
parts of the
code.
please... help...what library I must include... 

Sincerely
Alexandre Adam
Sao Paulo - SP - BRAZIL

I wrote some code but nothing works... please read it
below.

#include /usr/include/mysql/mysql.h
# include stream.h

int main () {  
{ Printf (Initializing...\n); }
if (mysql_create_db (mysql, DB_TEST)) {
fprintf (stderr, Failed to create
DataBase, ERR!
%x\n, mysql_error( 
mysql));
}
return 0;
}
   


-
Before posting, please check:
   http://www.mysql.com/manual.php
http://www.mysql.com/manual.php(the manual)
   http://lists.mysql.com/ http://lists.mysql.com/
(the list archive)

To request this thread, e-mail
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
To unsubscribe, e-mail
[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]
 
Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php
http://lists.mysql.com/php/unsubscribe.php 

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: 

C API BLOB type field lengths returned

2002-03-05 Thread Kenneth Hylton

Howdy - 

I am using the C API and am returning a result set from a table with a BLOB
type item in it.

When I populate the BLOB fields initially (with all the same data) the
length is returned properly when I issue SELECT * FROM table and decode
the result set column metadata.
Meaning, that if I put , This Blob's for you! in the column, the value of
MYSQL_FIELDS.length = 65535 (max of BLOB type) and MYSQL_FIELDS.max_length =
21.  
When I update a few rows and put, That's OK man, but you still can't have
my BLOB! in a few columns, the values for the length of the fields are
returned funny, or at least, I don't understand why they are returning they
way they are.
Meaning the value of the new column length are all set to
MYSQL_FIELDS.length = 65535 (again, max of BLOB type) and
MYSQL_FIELDS.max_length = 49.  Problem is, this is even on the unchaged
rows!  Yuk!
A little experimentation showed that if I select on only unchanged rows, the
length is returned as 21.  But, if the result set has one of the changed
rows in it, the length of all blob fields is returned as 49, when (at least
to me) it should be 21 or 49.
In other words, it returns as the BLOB max_length value the value of the
longest blob in the result set, NOT the max_length of each row.  
I inserted (and updated) some records in the table with BLOB contents It's
all about the BLOB and I see the same result.  It returns not the length of
the BLOB for the row, but the length of the longest BLOB field in the result
set.  
We are running MySQL 3.23.46-Max on RedHat 7.2 Question:
1)  How do I get the actual length of the BLOB column in the row,
without storing a separate column to maintain BLOB length manually?


 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




FW: C API BLOB type field lengths returned

2002-03-04 Thread Kenneth Hylton


 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-Original Message-
From:   Kenneth Hylton [mailto:[EMAIL PROTECTED]]
mailto:[mailto:[EMAIL PROTECTED]] 
Sent:   Sunday, March 03, 2002 1:19 PM
To: '[EMAIL PROTECTED]'
Subject:C API BLOB type field lengths returned

Howdy - 
I am using the C API and am returning a result set from a table with a BLOB
type item in it.
When I populate the BLOB fields initially (with all the same data) the
length is returned properly when I issue SELECT * FROM table and decode
the result set column metadata.
Meaning, that if I put , This Blob's for you! in the column, the value of
MYSQL_FIELDS.length = 65535 (max of BLOB type) and MYSQL_FIELDS = 21.
When I update a few rows and put, That's OK man, but you still can't have
my BLOB! in a few columns, the values for the length of the fields are
returned funny, or at least, I don't understand why they are returning they
way they are.
Meaning the value of the new column length are all set to
MYSQL_FIELDS.length = 65535 (again, max of BLOB type) and MYSQL_FIELDS = 49.
EVEN ON THE UNCHANGED ROWS!  Yuk!
A little experimentation showed that if I select on only unchanged rows, the
length is returned as 21.  But, if the result set has one of the changed
rows in it, the length of all blob fields is returned as 49, when (at least
to me) it should be 21 or 49.
In other words, it returns as the BLOB max_length value the value of the
longest blob in the result set, NOT the max_length of each row.
I inserted (and updated) some records in the table with BLOB contents It's
all about the BLOB and I see the same result.  It returns not the length of
the BLOB for the row, but the length of the longest BLOB field in the result
set.
We are running MySQL 3.23.46-Max on RedHat 7.2
Question:
1)  How do I get the actual length of the BLOB column in the row,
without storing a separate column to maintain BLOB length manually?


 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED]  
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 
mailto:[EMAIL PROTECTED]
mailto:[EMAIL PROTECTED]  

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: [NEWBIE] Problems with the RESULT Class. Please Help :(

2002-03-03 Thread Kenneth Hylton

Hi Justin - 

I have run into the same issues and have given up on using MySQL++ interface
for that reason, plus it doesn't have the ability to update tables
dynamically.

That is, if you need to update anything, you have to define the table to a
macro at compile time!  Change a table, recompile everything!  NOT GOOD.

If all you want to do is to read result sets, then there are some classes
that work (sort of) in the contributed software under C++ interfaces called
MyDAO that sort of work.

I started writing my own classes (based on some ADO classes I wrote to work
with MS SQL Server) and then found these and based what I was doing off of
them as we had the same idea in mind.

They have some problems, but will work for retrieval of everything, but the
updating doesn't work right under all circumstances.

They have the virtue of loading table data at run time so they are dynamic,
too.

Some things to note, everything is returned as a string.  This means that if
you store a float in the database, you won't get a pointer back to for bytes
storing the actual float, you will get a string with the value of the float
(i.e.: 123.45).  It does data conversion for you. 

Likewise, the meanings of a few of the fields seems odd and getting the
table metadata for inserting is trickier than it seems.

Anyhow, take a look at those MyDAO classes.  If you just want retrieval,
they should work.

If you want update and insert capability, let me know and I'll send you my
expanded versions which are type safe, handle insert and update, and handle
binary data (blob and text) data types.

I'd send them to you know, but I am working on them this weekend to get them
touched up a bit and add documentation for doxygen to pick up.  They should
be done some time Monday afternno and I can send them to you then if you
want.

I have some connection and result set classes that are based on some virtual
base classes that invoke the same methods for MySQL and ADO data sources. 

There is also some wrappers for MySQL at sourceforge.net, but, I didn't like
them as much as I did my own.



 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-Original Message-
From:   Pure Krome [mailto:[EMAIL PROTECTED]]
Sent:   Friday, March 01, 2002 6:52 PM
To: [EMAIL PROTECTED]
Subject:[NEWBIE] Problems with the RESULT Class.
Please Help :(

Hello All.
I'm trying to make a Class, that incorporates the MySQL++
code.  I'm trying
to do this, so i don't have to have so much of the same
code, but instead
re-use a common public function.

This way, i can do something like this  in my c++ code...
Result res = Database.ReturnRecordSet (SELECT * FROM
tbl_Table);
Result res = Database.ReturnRecordSet (SELECT ID FROM
tbl_Table);
etc..

so when i do this ...  blnResult =
Database.DatabaseTablesExists ();
it goes into that public member function, which calls the
ReturnRecordSet public member function to return a RESULT.
A RESULT is returned, but when i leave the function, it
crashes.  I assume it's trying to destroy the local instance of the RESULT
class...

Could i PLEASE have some help ?  I'm so confussed to why it
is crashing,
when i'm basically copying the code straight from the
MYSQL++ examples. :(


Thank you kindly to anyone that helps.
Regards - Justin Adler-

++
#define DATABASE_CC

#include sqlplus.hh
#include Configuration.h
#include Database.h
#include Player.h
#include Types.h
#include String.h




CDatabase::CDatabase ()
{
// Create the Database Connection
try {
con = new Connection (use_exceptions);
con-connect (DB_CONN_STRING);

query = new Query (con-query () );
  }

catch (BadQuery er) {
HandleBadQuery (er);
   }
catch (BadConversion er) {
HandleBadConversion (er);
  }
#ifdef USE_STANDARD_EXCEPTION
catch (exception er) {
cerr  [Exception] Error:   er.what()  endl;
  }
#endif
}


CDatabase::~CDatabase ()
  

column level grants

2002-02-28 Thread Kenneth Hylton

Howdy - 

I have looked online and also in MySQL by Paul DuBois, plus the O'Reilly
book and can't find an example of how to do column level security.

We are running 3.23.46-Max on Red Hat 7.2

Here is what I am trying:

mysql GRANT ALL  (BatchControlUri, IndustryId, UpdateId) ON
dbEngine.BatchControlMaster TO test3kwh IDENTIFIED BY 'stinky';

And I get back:

ERROR 1064: You have an error in your SQL syntax near '(BatchControlUri,
IndustryId, UpdateId) on dbEngine.BatchControlMaster TO test3k' at line 1

I have tried several variation on this theme but can't find the magic to do
column level security.

TIA!

Ken Hylton




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




INSERT blob data in C

2002-02-28 Thread Kenneth Hylton

Howdy - 

I looked in the doc @ mysql.com and the New Riders and O'Reilly MySQL books.

Plus, I consulted the archives as best I could and did not see an answer for
this:

How do you insert binary data using the C API?

I know you need to use mysql_real_query method and pass length, but how do
you delimit the blob field?

INSERT INTO some_table (key_field,blob_field) VALUES ( 'A', 'binary
data');
INSERT INTO some_table SET key_field = 'A', blob_field = 'binary data';

Both have the issue of having the single quote appear in the data.

These fields I'm storing are between 10 and 2000 bytes long and there are
millions of them so I can't store them as separate files and then use the
file name like I would for a graphic or downloadable file on a web page.

TIA!

 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: INSERT blob data in C

2002-02-28 Thread Kenneth Hylton

Thanks for your quick response!

That's just what I needed.  

The secret is using mysql_escape_string to change the data such that it will
not cause problems with delimiters!

Thank You!


 Have A Great Scouting Day
 Ken Hylton
 7826 Falcon Ridge Drive
 San Antonio, Texas 78239-4032
 210-646-9508 (home)
 210-949-7261 (work)
 210-949-7254 (fax)
 210-287-6756 (cell)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] 
 [EMAIL PROTECTED]
mailto:[EMAIL PROTECTED] 


-Original Message-
From:   paradoxix [mailto:[EMAIL PROTECTED]]
Sent:   Thursday, February 28, 2002 3:04 PM
To: Kenneth Hylton
Cc: [EMAIL PROTECTED]
Subject:Re: INSERT blob data in C

just some code I did some time ago:

/* */

#include stdio.h
#include stdlib.h
#include unistd.h
#include fcntl.h
#include sys/fcntl.h

#include mysql/mysql.h

MYSQL dbcon;

int main(int argc, char *argv[])
{
  int i;
  char *tmpQ=malloc(2*1024*1024);
  char *end;
  int file;
  int size;
  char *mem;
  char tmpstr[1024];

  mysql_init(dbcon);

  mysql_real_connect(dbcon, NULL, username, password,
dbname,0,/tmp/mysql.sock,0);

  for(i=1;iargc;i++) {
file = open(argv[i], O_RDONLY);
lseek(file, 0, SEEK_SET);
size = lseek(file, 0, SEEK_END);
lseek(file, 0, SEEK_SET);

mem = malloc(size);
read(file,mem,size);

printf(inserting: %s\n,argv[i]);

end = (char *) strmov(tmpQ,INSERT INTO image values();
*end++ = '\'';
sprintf(tmpstr,%i,i);
end = strmov(end, tmpstr);
*end++ = '\'';
*end++ = ',';
*end++ = '\'';
sprintf(tmpstr,%i,i);
end = strmov(end, tmpstr);
*end++ = '\'';
*end++ = ',';
*end++ = '\'';
end += mysql_escape_string(end, mem, size);
*end++ = '\'';
*end++ = ')';

mysql_real_query(dbcon, tmpQ, (unsigned int) (end -
tmpQ));
free(mem);
close(file);
  }
  mysql_close(dbcon);
  exit(0);
  return 0;
}

Kenneth Hylton wrote:

 Howdy -

 I looked in the doc @ mysql.com and the New Riders and
O'Reilly MySQL books.

 Plus, I consulted the archives as best I could and did not
see an answer for
 this:

 How do you insert binary data using the C API?

 I know you need to use mysql_real_query method and pass
length, but how do
 you delimit the blob field?

 INSERT INTO some_table (key_field,blob_field) VALUES (
'A', 'binary
 data');
 INSERT INTO some_table SET key_field = 'A', blob_field =
'binary data';

 Both have the issue of having the single quote appear in
the data.

 These fields I'm storing are between 10 and 2000 bytes
long and there are
 millions of them so I can't store them as separate files
and then use the
 file name like I would for a graphic or downloadable file
on a web page.

 TIA!

  Have A Great Scouting Day
  Ken Hylton
  7826 Falcon Ridge Drive
  San Antonio, Texas 78239-4032
  210-646-9508 (home)
  210-949-7261 (work)
  210-949-7254 (fax)
  210-287-6756 (cell)
  [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]


-
 Before posting, please check:
http://www.mysql.com/manual.php   (the manual)
http://lists.mysql.com/   (the list archive)

 To request this thread, e-mail
[EMAIL

RE: get instance variable

2002-02-19 Thread Kenneth Hylton

Hi Robert - 

The only way I have found to get this sort of stuff (as well as security
info) out is to use mysql_query (or mysql_real_query) and issue the query
just like you would at the mysql client.

Then you can interpret the results that are returned.

I am having to do that with column level grants by user ID to implement
views of the data in a C++ environment and it's the only way that I could
find to do it.

There are not a lot of C API things that are specific to getting data column
metadata and other configuration data.  IT is mostly for obtaining
connections, results sets, and manipulating result sets.

It appears that the way they want you to get stuff out using the C API is
not with lots of specific calls, but by just issuing the command yourself
and interpreting the result set.  

I found the best way is to write a simple program to issue a call and the
cout the result set information.  Be sure and do that because sometimes the
returned data will surprise you a little bit

I have some working C++ connection and result set classes if you would like
them, plus a test program you can use.

Ken Hylton


-Original Message-
From:   Li, Robert [mailto:[EMAIL PROTECTED]]
Sent:   Monday, February 18, 2002 9:07 PM
To: '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject:get instance variable

Hi, all MySQL team

Here is another question.
I want to get individual MySQL instance's variable(like
datadir, tmpdir etc)
using C API. Is there any function can do this? 
I know that use mysqladmin and use query show variables 
can do this.

Thanks and regards


Robert Li
Computer Associates 
RD Centre Beijing , China 
Tel:+86 10 6561 1136 ext 852 (O) 
Fax:+86 10 8529 8979 
E-mail: [EMAIL PROTECTED]


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail
[EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




RE: Probably OT - SQL join help needed

2002-02-13 Thread Kenneth Hylton

Hi Robert - 

Not an MySQL expert, but, I think what you are describing is a perfect use
of MERGE tables.  They take up basically no space (except to contain the
names of the tables that are merged) and allow for you to merge these two
tables logically and then just do whatever queries you want against them.

Regards,

Ken Hylton



-Original Message-
From:   DL Neil [mailto:[EMAIL PROTECTED]]
Sent:   Wednesday, February 13, 2002 2:51 AM
To: [EMAIL PROTECTED]; Robert Cross
Subject:Re: Probably OT - SQL join help needed

Hello Robert,

 Hello experts, I've got a small problem with an sql query
here that's got
 me completely stuck.

 In my MySQL database I've got two tables here that have
identical design,
 e.g.
 table 'detail' - columns sales-order, quantity,
part-number, price,
 date-sent
 and
 table 'archived'  - columns sales-order, quantity,
part-number, price,
 date-sent.

 Detail is for 'active' orders, and Archived is for
fulfilled orders.

 Now some genius here wants to see all the records that
reference a
 particular part number,
 irrespective of whether in archived or detail.

 My current approach is to create a temporary table with
all the suitable
 records from
 detail, add in any suitable records from archived, and
then do a select *
 query from this
 temporary table, before dropping it.

 Now it strikes me that this isn't a very smart way to do
this, and it's
 probably achievable
 via joins but, try as I might, I can't get the system to
do it. Anyone got
 any bright ideas/suggestions?


If the tables are identical then UNION may be what you're
looking for: 6.4.1.2  UNION Syntax (MySQL 4.0).

For every user genius who forgets to put something in the
spec up-front, there's a computer guy who's smarter!

Regards,
=dn




-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail
[EMAIL PROTECTED]
To unsubscribe, e-mail
[EMAIL PROTECTED]
Trouble unsubscribing? Try:
http://lists.mysql.com/php/unsubscribe.php

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php