List:MySQL on Win32« Previous MessageNext Message »
From:rdo mail list address Date:August 2 2004 2:12pm
Subject:Re: [win32] USE statement in procedure
View as plain text  
Thanks, Shawn, I'll try the USE batabasename.tablename in a stored
procedure and see if that works.  

Section 20.1 of the MySQL manual specifically refers to using USE within a
stored procedure.

Again, thanks for the reply.

rdo

At 09:44 AM 8/2/2004 -0400, SGreen@stripped wrote:
>You do know that your *client* is not executing this procedure, the 
>*server* is.  To the server, the procedure physically resides in a 
>database and if you need to reference tables in another database, I would 
>just use the full "databasename.tablename" method of identification. You 
>are basically asking the server to change its execution environment, its 
>context, to another database (even if you are giving it the name of the 
>database it is already running in).  Would this be so that you could avoid 
>using the fully qualified table name to reference tables later on in the 
>SP?
>
>I don't know if this is an error in allowing the USE statement within SPs 
>or if it is an error in the SP engine to maintain the original table's 
>context after a context switch. I suspect it to be the first more than the 
>second.
>
>Shawn Green
>Database Administrator
>Unimin Corporation - Spruce Pine


Thread
[win32] USE statement in procedurerdo mail list address31 Jul
  • Re: [win32] USE statement in procedurerdo mail list address31 Jul
  • Re: [win32] USE statement in procedureSGreen2 Aug
  • Re: [win32] USE statement in procedurerdo mail list address2 Aug
    • Re: [win32] USE statement in procedureSGreen2 Aug
    • Re: [win32] USE statement in procedurerdo mail list address2 Aug
RE: [win32] USE statement in procedurePF: MySQL2 Aug
  • RE: [win32] USE statement in procedurerdo mail list address2 Aug