Specific mysql Trigger question

2007-03-05 Thread Winn Johnston
mysql ver 5.0.26 standard

Can a trigger call a procedure that returns a result
set? 

I am trying to get around this error msg.
ERROR 1415 (0A000): Not allowed to return a result set
from a trigger

Thanks
-winn

Below is a more concise description of my issue and
logic pattern


when a record is updated a trigger and procedure must
be fired off.

if statements

if the NEW.total_amount donated by contact_id is less
then the current amount and the donation_id is not
equal to the current max donation_id then do nothing
to the max_donation table.

done

if the NEW.total_amount donated by contact_id is equal
to the current amount donated and the donation id is
not equal to current max donation then insert
NEW.donation_id and contact_id into the max_donation
table 

done

if the NEW.total_amount donated is greater then the
current max donation and the donation id does not
equal the current max donation_id then update the
max_donation table with the NEW.donation_id and amount

done

if the NEW.total_amount donated is less then the
current max donation and the donation_id is equal to
the current donation_id in the max donation table then
run a procedure to populate with the right information


not done

so i need a procedure i can call from an
after_update_trigger that will, when called search
though the donation_table for all donations made by
contact_id and return donation_id(s) of all records
that equal the max donation. For example if contact_id
makes 5 donations equal to 500.00 i need the procedure
to store all of the donation_id's = $500.00 for entry
into the max_donation table.





 

Don't pick lemons.
See all the new 2007 cars at Yahoo! Autos.
http://autos.yahoo.com/new_cars.html 

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



trigger

2007-02-21 Thread Winn Johnston
Any way to get this to work inside an after update
trigger?

insert into max_donations (donation_id, contact_id)
 select donation_id, contact_id
 from donation_test where conatct_id =
NEW.contact_id and total_amount = contact_max_amount;


thanks
winn


 

Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

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



Re: trigger

2007-02-21 Thread Winn Johnston
I keep getting this error

ERROR 1415 (0A000): Not allowed to return a result set
from a trigger

--- Rolando Edwards [EMAIL PROTECTED] wrote:

 insert into max_donations (donation_id, contact_id)
  select donation_id, contact_id
  from donation_test where conatct_id = (You
 missppelled contact_id)
 NEW.contact_id and total_amount =
 contact_max_amount;
 
 - Original Message -
 From: Winn Johnston [EMAIL PROTECTED]
 To: mysql@lists.mysql.com
 Sent: Wednesday, February 21, 2007 11:26:42 AM
 (GMT-0500) Auto-Detected
 Subject: trigger
 
 Any way to get this to work inside an after update
 trigger?
 
 insert into max_donations (donation_id, contact_id)
  select donation_id, contact_id
  from donation_test where conatct_id =
 NEW.contact_id and total_amount =
 contact_max_amount;
 
 
 thanks
 winn
 
 
  


 Have a burning question?  
 Go to www.Answers.yahoo.com and get answers from
 real people who know.
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
 
 
 



 

Have a burning question?  
Go to www.Answers.yahoo.com and get answers from real people who know.

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



Re: How can I detect if MySql is already installed?

2007-02-15 Thread Winn Johnston

--- Rolando Edwards [EMAIL PROTECTED] wrote:

 If you have root access, do 'mysqladmin -u... -h...
 ping'
 
 - Original Message -
 From: Daniel da Veiga [EMAIL PROTECTED]
 To: mysql@lists.mysql.com
 Sent: Thursday, February 15, 2007 1:08:49 PM
 (GMT-0500) Auto-Detected
 Subject: Re: How can I detect if MySql is already
 installed?
 
 On 2/15/07, Duncan Hill [EMAIL PROTECTED]
 wrote:
  On Thursday 15 February 2007 11:12:11 Juan Eduardo
 Moreno wrote:
   Linux :
  
   $ rpm -qa |grep -i mysql
  
   Regards,
   Juan
  
   On 2/14/07, Zsolt Csillag [EMAIL PROTECTED]
 wrote:
Hello,
   
I would like to create a setup program for my
 demo version that uses
MySql database.
   
I need to detect if the target computer has
 already got the MySql
installed
because I don't want to ruin an existing
 database.
 
 
 Why do you need to detect if MySQL is already
 installed? You can
 simply but all files at another location (your
 program's folder) and
 write the my.ini/my.cnf file on the fly, changing
 the datadir and
 other options for it to work wherever your program
 will be located.
 You can also use sockets or named pipes instead of
 TCP/IP to ensure
 you won't block any port or mess with the network,
 starting your
 server without networking support.
 
  That only works for the limited case of
  * System supports RPM
  * Admin installed MySQL as an RPM
 
  Without knowing what platform you intend your demo
 to run on, giving an
  accurate answer will be hard.
 
  Furthermore, it's very possible to have multiple
 installs of MySQL on a server
  without conflict, so done correctly, you won't
 trash any other MySQL
  installs.
 
 Agreed completely.
 
 You simply can't bet someone is using a
 rpm/deb/portage based system
 and expect your consumers to deal with it... Also
 the OP never
 mentioned the OS, version of MySQL, etc, and that
 makes it VERY
 difficult to get an answer.
 
 -- 
 Daniel da Veiga
 Computer Operator - RS - Brazil
 -BEGIN GEEK CODE BLOCK-
 Version: 3.1
 GCM/IT/P/O d-? s:- a? C++$ UBLA++ P+ L++ E--- W+++$
 N o+ K- w O M- V-
 PS PE Y PGP- t+ 5 X+++ R+* tv b+ DI+++ D+ G+ e h+ r+
 y++
 --END GEEK CODE BLOCK--
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   
 http://lists.mysql.com/[EMAIL PROTECTED]
 

usally you can look in /var/lib/mysql and see all the
db's already created. But if you don't see it, there
is  no garentee that mysql is not installed. What
flavor of linux is on the server (debian, SuSe,
Redhat) and what version (SELS9 Fedora Core 4, Etch?)
To find out cat /etc/(name)-release

MySQL-server-standard-5.0.18-0.sles9
MySQL-devel-standard-5.0.18-0.sles9
MySQL-client-standard-5.0.18-0.sles9

Also you are going to have to figure out if you use
php if so you must check to see if it is installed as
well, and compiled with mysql support.


hope this helps


-winn johnston


 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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



Help with mysql triggers

2007-02-12 Thread Winn Johnston
Question.
I have two tables donation_test, and max_donation. The
max donation table is a summary table, used to keep
the max donation for each contact_id, by listing its
donation_id. We have decided to use database level
triggers to keep the summary table (max_donation)
table up to date. I have been looking at the looping
of a cursor syntax but am a little lost. Would someone
mind taking the time to show me how exactly the syntax
would look.

For example if i run an update on donation_id 126 and
change the amount equal to then 2000.00 then update
after trigger should search though all the donations
made by NEW.contact_id, figure the highest amount,
then insert that into the max_donation table, also,
and here is the tricky part, if there are two or more
donations with the same amount, they all must be
inserted into the max_donation table.

mysql select * from donation_test;
+-+++
| donation_id | contact_id |
donation_date|total_amount |
+-++-+--+
|   114 |   1 | 2007-02-05 00:00:00 | 2000.00  |
|   115 |   2 | 2007-02-05 00:00:00 | 2100.00  |
|   118 |   3 | 2007-02-05 00:00:00 | 1052.00  |
|   126 |   2 | 2007-02-07 00:00:00 | 2.00 |
+-++-+--+

mysql select * from max_donations;
++-+
| contact_id | donation_id |
++-+
|  1 | 114 |
|  3 | 118 |
|  2 | 126 |
++-+



Thanks very much in advance 
Winn Johnston



 

The fish are biting. 
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php

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



RE: mysql + LVS

2006-07-25 Thread Winn Johnston


--- Jimmy Guerrero [EMAIL PROTECTED] wrote:

 Hello,
 
 Just to make sure we separate the two...
 
  mysql cluster that preforms reads on all the
 slaves, and writes only on
 the master.
 
 The above can be used to describe a typical use case
 for MySQL Replication.
 
 In a MySQL Cluster there is no need to load-balance
 your reads and writes.
 
 Thanks,
 
 Jimmy Guerrero
 MySQL, Inc
 
  -Original Message-
  From: Winn Johnston
 [mailto:[EMAIL PROTECTED] 
  Sent: Monday, July 24, 2006 3:26 PM
  To: mysql@lists.mysql.com
  Subject: mysql + LVS
  
  How stable has it become to run an instance of
 mysql ontop of 
  a LVS cluster to produce a massively parrallel
 system to be 
  used for huge databases?
  
  Back in the day i remember tyring to do it with
 mosix, not 
  sure where they are now a days. but either way i
 am looking 
  for some current information on the subject.
  
  I know this differs from the idea that you can
 have a mysql 
  cluster that preforms reads on all the slaves, and
 writes 
  only on the master.
  
  thanks
  winn johnston

ok so LVS is not what i am looking for. I have been
reading about some software hacks that allow mysql to
use shared memory spread out over a few machines.

scenerio,

Huge database, over 7 million records. And a high
ratio of writes vs reads. Idealy i would like to have
the entire database in RAM. Does anyone have any
experience running a database this big? can anyone
offer a suitalbe setup? I have taken a look at the
wikipedia setup
http://meta.wikimedia.org/wiki/Wikimedia_servers#Overall_system_architecture

thanks
-winn johnston

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: mysql + LVS highjacked (mysql + NFS ramfs)

2006-07-25 Thread Winn Johnston


--- Winn Johnston [EMAIL PROTECTED] wrote:

 
 
 --- Jimmy Guerrero [EMAIL PROTECTED] wrote:
 
  Hello,
  
  Just to make sure we separate the two...
  
   mysql cluster that preforms reads on all the
  slaves, and writes only on
  the master.
  
  The above can be used to describe a typical use
 case
  for MySQL Replication.
  
  In a MySQL Cluster there is no need to
 load-balance
  your reads and writes.
  
  Thanks,
  
  Jimmy Guerrero
  MySQL, Inc
  
   -Original Message-
   From: Winn Johnston
  [mailto:[EMAIL PROTECTED] 
   Sent: Monday, July 24, 2006 3:26 PM
   To: mysql@lists.mysql.com
   Subject: mysql + LVS
   
   How stable has it become to run an instance of
  mysql ontop of 
   a LVS cluster to produce a massively parrallel
  system to be 
   used for huge databases?
   
   Back in the day i remember tyring to do it with
  mosix, not 
   sure where they are now a days. but either way i
  am looking 
   for some current information on the subject.
   
   I know this differs from the idea that you can
  have a mysql 
   cluster that preforms reads on all the slaves,
 and
  writes 
   only on the master.
   
   thanks
   winn johnston
 
 ok so LVS is not what i am looking for. I have been
 reading about some software hacks that allow mysql
 to
 use shared memory spread out over a few machines.
 
 scenerio,
 
 Huge database, over 7 million records. And a high
 ratio of writes vs reads. Idealy i would like to
 have
 the entire database in RAM. Does anyone have any
 experience running a database this big? can anyone
 offer a suitalbe setup? I have taken a look at the
 wikipedia setup

http://meta.wikimedia.org/wiki/Wikimedia_servers#Overall_system_architecture


after talking to a few people on the #mysql irc
someone suggested using NFS to create a ramfs to get
100GB+ RAM shared memory to load the entire database
into the RAM. Can anyone offer any Pros or Cons to
this setup, drawing from personal expierence?

thanks
-winn johnston

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



mysql + LVS

2006-07-24 Thread Winn Johnston
How stable has it become to run an instance of mysql
ontop of a LVS cluster to produce a massively
parrallel system to be used for huge databases?

Back in the day i remember tyring to do it with mosix,
not sure where they are now a days. but either way i
am looking for some current information on the
subject.

I know this differs from the idea that you can have a
mysql cluster that preforms reads on all the slaves,
and writes only on the master.

thanks
winn johnston

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



developing an interface

2005-02-04 Thread Winn Johnston
I have taken on a job replacing an old AS400 RPM
database with four thin clients. They really like the
feel of the thin client interface, no point and click,
no graphics, just green text on a black background. I
could use any suggestions on what to read, or where to
look to find a way to create a similar feel on the new
interface. I am leaning heavily to php, since it would
make the Internet port easier, but am not adversed to
changing my mind.
 
Thank You very much for your replies.
Winn Johnston




__ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

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



interface developing

2005-02-04 Thread Winn Johnston
i have taken on a job replacing an old AS400 RPM
database with four thin clients. They really like the
feel of the thin client interface, no point and click,
no graphics, just green text on a black background. I
could use any suggestions on what to read, or where to
look to find a way to create a similar feel on the new
interface. I am leaning heavily to php, since it would
make the Internet port easier, but am not adversed to
changing my mind.
 
Thank You very much for your replies.
Winn Johnston



__ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250

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



Re: developing an interface

2005-02-04 Thread Winn Johnston

--- [EMAIL PROTECTED] wrote:

 Winn Johnston [EMAIL PROTECTED] wrote on
 02/04/2005 10:30:54 AM:
 
  I have taken on a job replacing an old AS400 RPM
  database with four thin clients. They really like
 the
  feel of the thin client interface, no point and
 click,
  no graphics, just green text on a black
 background. I
  could use any suggestions on what to read, or
 where to
  look to find a way to create a similar feel on the
 new
  interface. I am leaning heavily to php, since it
 would
  make the Internet port easier, but am not adversed
 to
  changing my mind.
  
  Thank You very much for your replies.
  Winn Johnston
  
  
  
  
  __ 
  Do you Yahoo!? 
  Yahoo! Mail - You care about security. So do we. 
  http://promotions.yahoo.com/new_mail
  
 
 Sounds like you want to develop a console
 application using some kind of 
 TELNET daemon. I don't do that kind of development
 but it may be something 
 for you to research. My users tell me they prefer
 the point-and-click of 
 browser-based, thin client apps over their old
 terminal-type apps, sorry!
 
 Shawn Green
 Database Administrator
 Unimin Corporation - Spruce Pine
 

My users have expressed a distinct dislike for point
and click methods. They would rather use the keyboard
in the same way a ticket agent does when she is
looking for a flight :)

Winn Johnston


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



Re: developing an interface

2005-02-04 Thread Winn Johnston
lynx i like it   :)
thanks duncan, u the man

winn johnston

-- Duncan Hill [EMAIL PROTECTED] wrote:

 On Friday 04 February 2005 16:03, Winn Johnston
 might have typed:
 
  My users have expressed a distinct dislike for
 point
  and click methods. They would rather use the
 keyboard
  in the same way a ticket agent does when she is
  looking for a flight :)
 
 You can do this one of two ways.
 
 Give them shell logins on a *nix box (or port to
 win32) and write your 
 application in perl or php as a console app.
 
 Give them lynx and write your app in php as a web
 app, using style sheets etc.  
 They get a green screen (literally with the right
 lynx config) where tab etc 
 all behave (complete with 1 - 9 working as hotkeys
 for menus), but you can 
 migrate new users to the Firefox/IE interface :)
 
 -- 
 MySQL General Mailing List
 For list archives: http://lists.mysql.com/mysql
 To unsubscribe:   

http://lists.mysql.com/[EMAIL PROTECTED]
 
 




__ 
Do you Yahoo!? 
Meet the all-new My Yahoo! - Try it today! 
http://my.yahoo.com 
 


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