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
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
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-
; 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
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.
>
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
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
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
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
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.
>
>
>> >
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
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,
>> >
>
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
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
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]
>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
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
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
> 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
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
> 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
> 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
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 }"
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
> 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
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
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
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
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:/
> 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
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]
|
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
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
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
[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
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
[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
> > 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;
> >
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)
>
> 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
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
:
>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,
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
]
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
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
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
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,
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
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
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
>
>
50 matches
Mail list logo