Use stored proc result set from another stored proc without temp table?

2009-12-09 Thread Bryan Cantwell
I have a stored proc I need to call from yet another stored proc, which then needs to use the results from the called proc ... I could probably use temp table but really dont want to do that unless absolutely required. I cant use OUT parameters, because the called stored proc returns multiple

Re: Search based where claused and stored proc

2009-03-29 Thread Arthur Fuller
An approach that has worked for me in the past and may work for you. Declare as many parms as you can possibly need and then code the statement like this: SELECT * FROM someWhere WHERE @parm1 = 123 OR @parm1 IS NULL AND @parm2 = 345 OR @parm2 IS NULL -- etc. This has the desired effect and elimi

RE: Search based where claused and stored proc

2009-03-27 Thread Gary Smith
f equality. This gets me closer, but not exactly there yet. From: Martin Gainty [mgai...@hotmail.com] Sent: Friday, March 27, 2009 1:58 PM To: b...@wisper-wireless.com; mysql@lists.mysql.com Subject: RE: Search based where claused and stored proc Ben-

RE: Search based where claused and stored proc

2009-03-27 Thread Martin Gainty
; To: mysql@lists.mysql.com > Subject: RE: Search based where claused and stored proc > Date: Fri, 27 Mar 2009 13:43:51 -0500 > > > > Ben Wiechman > Network Administrator > Wisper High Speed Internet > Office: 866.394.7737 > Direct: 320.256.0184 > C

RE: Search based where claused and stored proc

2009-03-27 Thread Ben Wiechman
ts.mysql.com > Subject: [MySQL] Search based where claused and stored proc > > I'm working on a small project of re-implementing all of the sql for a > web site. The task is pretty trivial but overall there are some minor > things that I'm trying to code through. >

Search based where claused and stored proc

2009-03-27 Thread Gary Smith
This works well since there isn't much inject attack possibility on these. Now I have one query left, which allows for an arbitrary number of search parameters, all using AND. Has anyone accomplished coverting something like this to a stored proc in mysql? Logically I could pass in the

Re: Stored proc - dynamic sql in cursor

2008-10-17 Thread Olaf Stein
fficial business > of Sender. This transmission is of a confidential nature and Sender does not > endorse distribution to any party other than intended recipient. Sender does > not necessarily endorse content contained within this transmission. > > >> > Date: Thu, 16 Oct 2008

Re: Stored proc - dynamic sql in cursor

2008-10-16 Thread Olaf Stein
tes to the official business > of Sender. This transmission is of a confidential nature and Sender does not > endorse distribution to any party other than intended recipient. Sender does > not necessarily endorse content contained within this transmission. > > >> > Date: Thu, 16

Re: Stored proc - dynamic sql in cursor

2008-10-16 Thread Olaf Stein
Oct 16, 2008 at 12:31 PM, Olaf Stein > <[EMAIL PROTECTED]> wrote: >> Hi all, >> >> I am running into some issues with what I am trying to do in a stored proc. >> Basically I am trying to find records related to certain individuals in >> other tabl

Re: Stored proc - dynamic sql in cursor

2008-10-16 Thread Olaf Stein
lates to the official business > of Sender. This transmission is of a confidential nature and Sender does not > endorse distribution to any party other than intended recipient. Sender does > not necessarily endorse content contained within this transmission. > > >> >

Re: Stored proc - dynamic sql in cursor

2008-10-16 Thread Rob Wultsch
On Thu, Oct 16, 2008 at 12:31 PM, Olaf Stein <[EMAIL PROTECTED]> wrote: > Hi all, > > I am running into some issues with what I am trying to do in a stored proc. > Basically I am trying to find records related to certain individuals in > other tables in the databases and if t

Re: Stored proc - dynamic sql in cursor

2008-10-16 Thread Olaf Stein
ontent contained within this transmission. > > >> > Date: Thu, 16 Oct 2008 15:31:23 -0400 >> > Subject: Stored proc - dynamic sql in cursor >> > From: [EMAIL PROTECTED] >> > To: mysql@lists.mysql.com >> > >> > Hi all, >> > >

Stored proc - dynamic sql in cursor

2008-10-16 Thread Olaf Stein
Hi all, I am running into some issues with what I am trying to do in a stored proc. Basically I am trying to find records related to certain individuals in other tables in the databases and if there are any, tell me how many. Instead of doing this for each of these tables individually I use a

Re: Debug Stored Proc

2008-05-06 Thread Antony T Curtis
Hi, Currently there is no way but there is a WorkLog for implementing such a feature, It may be possible to encourage someone to implement such a feature request. Regards, Antony. On 6 May 2008, at 14:58, Bryan Cantwell wrote: Is there no way to step thru a stored proc in order to

Debug Stored Proc

2008-05-06 Thread Bryan Cantwell
Is there no way to step thru a stored proc in order to debug it and see what it is doing? -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Replication error with stored proc and triggers

2007-12-03 Thread [EMAIL PROTECTED]
>Description: I am using MySQL server as backend database supporting a telecomm platform providing voice over ip services. tables involved: acc, cdr, account, location2 Partial processing flow: 1. When a phone call is started. A record will be inserted into table acc (method=INVITE). This will

Stored proc question

2007-08-21 Thread Olaf Stein
Hi all, My basic question is, is there a simple way of finding out if a select statement executed within a stored proc returns something. I could go ahead, do the fetch (the query is done with a cursor) and count how many records were returned but looping over the result. In below proc the

Another stored proc question

2007-02-28 Thread Gary W. Smith
This is a follow-up to the earlier stored proc question. I have a stored proc, with user level permissions for execute. If I drop the stored proc and then create it again, the user level execute permissions go away. What is the proper way to edit/alter a store proc without losing these

RE: Stored proc permissions question

2007-02-28 Thread Gary W. Smith
> Better add "SQL SECURITY DEFINER" to it. I noticed that it works with and without this. I have added it to the procedure. Another quick question though. Since I have added the end user that will execute the procedure it works fine, until I drop the procedure and recreate it then I have to rea

Re: Stored proc permissions question

2007-02-28 Thread Christian Hammers
On 2007-02-28 Gary W. Smith wrote: ... > If I'm understanding the docs correct (which I'm probably not), I should > create the procedure with [EMAIL PROTECTED] > > CREATE [EMAIL PROTECTED] PROCEDURE Better add "SQL SECURITY DEFINER" to it. .. > The next question is what permissions do I need t

RE: Stored proc permissions question

2007-02-28 Thread Gary W. Smith
> The next question is what permissions do I need to give > [EMAIL PROTECTED] to just access that one permission? The sound of that thump thump thump is my head hitting the wall. There is like a single small line in the GRANT section of the how to that mentioned "TABLE|PROCEDURE|FUNCTIO" but none

RE: Stored proc permissions question

2007-02-28 Thread Gary W. Smith
> Do you know about the "SQL SECURITY { DEFINER | INVOKER }" options to > CREATE PROCEDURE? With them it should be possible to > * deny selects to users on the tables > * allow selects to users to this procedure > * having the procedure itself working with the rights of root/definer I did not, but

Re: Stored proc permissions question

2007-02-28 Thread Christian Hammers
On 2007-02-28 Gary W. Smith wrote: > Basically, here is the stored proc. It works, but only for root. Is it > possible to allow user to execute this without having SELECT access to > the table users? If so, how? Do you know about the "SQL SECURITY { DEFINER | INVOKER }"

Stored proc permissions question

2007-02-28 Thread Gary W. Smith
I have a set of tables that contain sensitive user information. I need to use this data for validation BUT I don't want the end user to have access to read this data. In MSSQL I used to be able to create a stored proc to do the work (even though the user didn't have access to the tabl

RE: stored proc question.

2007-02-14 Thread Gary W. Smith
> I have a string ("word word bob jack") such that I want to pass to the > store proc as a single entity, > split it in the store proc, and do a specific action for each word. > Any > advice on how to do this? There is more going on that just that single > word so multiple calls isn't practical an

stored proc question.

2007-02-14 Thread Gary W. Smith
I have a string ("word word bob jack") such that I want to pass to the store proc as a single entity, split it in the store proc, and do a specific action for each word. Any advice on how to do this? There is more going on that just that single word so multiple calls isn't practical and they stri

Re: exiting out of a loop iteration in a stored proc

2006-10-25 Thread Waldemar Jankowski
On Wed, 25 Oct 2006, Paul DuBois wrote: At 17:33 -0400 10/25/06, Waldemar Jankowski wrote: Hello everyone, I'm wondering if there is a way to exit out of a REAPEAT/WHILE loop iteration in a stored procedure. I think LEAVE will get you out of the loop completely, but I looking for something l

Re: exiting out of a loop iteration in a stored proc

2006-10-25 Thread Paul DuBois
At 17:33 -0400 10/25/06, Waldemar Jankowski wrote: Hello everyone, I'm wondering if there is a way to exit out of a REAPEAT/WHILE loop iteration in a stored procedure. I think LEAVE will get you out of the loop completely, but I looking for something like "next" record. Perhaps you want ITER

exiting out of a loop iteration in a stored proc

2006-10-25 Thread Waldemar Jankowski
Hello everyone, I'm wondering if there is a way to exit out of a REAPEAT/WHILE loop iteration in a stored procedure. I think LEAVE will get you out of the loop completely, but I looking for something like "next" record. Thanks, Waldemar -- MySQL General Mailing List For list archives: http:/

Re: stored proc/func

2006-04-07 Thread Michael Louie Loria
> Hi! > Can I return a record set from a stored procedure/function in mysql? > Kind regards yes - stored procedures no - stored function Michael Louie Loria LoRz Technology Solutions http://www.lorztech.com signature.asc Description: OpenPGP digital signature

stored proc/func

2006-04-07 Thread [EMAIL PROTECTED]
Hi! Can I return a record set from a stored procedure/function in mysql? Kind regards Prueba el Nuevo Correo Terra; Seguro, RĂ¡pido, Fiable. -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Passing db names to a stored proc in MySQL 5

2006-02-12 Thread Peter Brawley
| DELIMITER ; PB - Martijn Tonies wrote: I have tried dynamically assigning a database name to a stored proc via its parameter list: CREATE STORED PROCEDURE testStoredProc (IN test_db_name CHAR) BEGIN SELECT * FROM test_db_name.test_table; END; MySQL does not resolve test_db_name to t

Re: Passing db names to a stored proc in MySQL 5

2006-02-11 Thread Peter Brawley
TECTED] wrote: > Rory McKinley <[EMAIL PROTECTED]> wrote on 02/09/2006 07:37:17 AM: > >> Hello List >> >> I have tried dynamically assigning a database name to a stored proc via >> its parameter list: > > Use a "prepared statement". Build y

Re: [SOLVED]Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Rory McKinley
You were so close! Try it more like this: SET sSQL=CONCAT('SELECT * FROM ', passed_in_db_name, '.sites WHERE site_name=?'); PREPARE query_statement from sSQL Yup - got it to work - but it is so much hassle that I might seriously reconsider having queries run across databases, as it works

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Rory McKinley
[EMAIL PROTECTED] wrote: You were so close! Try it more like this: SET sSQL=CONCAT('SELECT * FROM ', passed_in_db_name, '.sites WHERE site_name=?'); PREPARE query_statement from sSQL Doh! I cannot believe that I didn't think of that - seems I was being dense after all! Thanks Shawn wi

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread SGreen
Rory McKinley <[EMAIL PROTECTED]> wrote on 02/09/2006 03:06:41 PM: > [EMAIL PROTECTED] wrote: > > Rory McKinley <[EMAIL PROTECTED]> wrote on 02/09/2006 07:37:17 AM: > > > >> Hello List > >> > >> I have tried dynamically assigning a databa

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Rory McKinley
[EMAIL PROTECTED] wrote: > Rory McKinley <[EMAIL PROTECTED]> wrote on 02/09/2006 07:37:17 AM: > >> Hello List >> >> I have tried dynamically assigning a database name to a stored proc via >> its parameter list: > > Use a "prepared statement&q

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Martijn Tonies
> > I have tried dynamically assigning a database name to a stored proc via > > its parameter list: > > > > CREATE STORED PROCEDURE testStoredProc (IN test_db_name CHAR) > >BEGIN > >SELECT * FROM test_db_name.test_table; > >END; > >

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread SGreen
Rory McKinley <[EMAIL PROTECTED]> wrote on 02/09/2006 07:37:17 AM: > Hello List > > I have tried dynamically assigning a database name to a stored proc via > its parameter list: > > CREATE STORED PROCEDURE testStoredProc (IN test_db_name CHAR) >

Re: Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Martijn Tonies
> I have tried dynamically assigning a database name to a stored proc via > its parameter list: > > CREATE STORED PROCEDURE testStoredProc (IN test_db_name CHAR) > BEGIN > SELECT * FROM test_db_name.test_table; > END; > > MySQL does not resolve test_db_name to the valu

Passing db names to a stored proc in MySQL 5

2006-02-09 Thread Rory McKinley
Hello List I have tried dynamically assigning a database name to a stored proc via its parameter list: CREATE STORED PROCEDURE testStoredProc (IN test_db_name CHAR) BEGIN SELECT * FROM test_db_name.test_table; END; MySQL does not resolve test_db_name to the value

Re: MySQL server Crashed while running a stored proc

2005-12-21 Thread Gleb Paharenko
: >hi all, >I am executing a stored proc that has a top level cursor to loop over a user >set, and then execute certain transactions for each user. After processing >about 5 users, it always generates: ERROR 2013 (HY000): Lost connection to >MySQL server during query. However,

MySQL server Crashed while running a stored proc

2005-12-21 Thread Sujay Koduri
hi all, I am executing a stored proc that has a top level cursor to loop over a user set, and then execute certain transactions for each user. After processing about 5 users, it always generates: ERROR 2013 (HY000): Lost connection to MySQL server during query. However, if I restart from the same

RE: can't call a stored proc from another stored proc?

2004-04-03 Thread Michael Pheasant
] Sent: Saturday, 3 April 2004 8:57 PM To: [EMAIL PROTECTED] Subject: can't call a stored proc from another stored proc? Hi, 1) Can a stored procedure call another stored procedure? Ie, can you do 'call someproc()' from within a stored procedure? 2) Also, will a function ever b

RE: can't call a stored proc from another stored proc?

2004-04-03 Thread Matt Chatterley
t is now confirmed that views will be in 5.1 rather than 5.0? :) I know, I know.. I keep harping on about views... Regards, Matt. -Original Message- From: Michael Pheasant [mailto:[EMAIL PROTECTED] Sent: 03 April 2004 11:57 To: [EMAIL PROTECTED] Subject: can't call a stored proc from

can't call a stored proc from another stored proc?

2004-04-03 Thread Michael Pheasant
Hi, 1) Can a stored procedure call another stored procedure? Ie, can you do 'call someproc()' from within a stored procedure? 2) Also, will a function ever be able to issue a SELECT query? I am using mysql-5.0.1-alpha (built froms ource) , winXP & win2k. The mysql daemon crashes without an er

Re: stored proc containing subquery crashes mysqld-nt.exe

2004-01-23 Thread Tobias Asplund
On Fri, 23 Jan 2004, Rob Kemmer wrote: > Hi, MySQL Team! > > I've downloaded and successfully installed v5.0 win2k, and am happily using stored > procs, but seem to be encountering problems with subqueries in stored procs. When I > run a stored proc containing a subquery,

stored proc containing subquery crashes mysqld-nt.exe

2004-01-22 Thread Rob Kemmer
Hi, MySQL Team! First this: Fantastic product. You are to be congratulated. Secondly: I've downloaded and successfully installed v5.0 win2k, and am happily using stored procs, but seem to be encountering problems with subqueries in stored procs. When I run a stored proc contain

Stored Proc

2002-10-18 Thread Pradana
OK, MySQL does not support the Stored Procedure ... yet. So how do I convert the following SQL as a Stored Proc into MySQL ? Assume I have the following Stored Proc : -- Start snippet CREATE PROCEDURE aTest AS BEGIN -- Select some columns from table and table b, -- then put them into a temp

Re: Stored Proc

2002-10-18 Thread Richard Clarke
I believe your only choice is to move this stored procedure into client side routines. Ric - Original Message - From: "Pradana" <[EMAIL PROTECTED]> To: "MySQL" <[EMAIL PROTECTED]> Sent: Thursday, October 17, 2002 8:37 PM Subject: Stored Proc > >