Re: Get the schema name from inside a stored-procedure
Do you actually have a problem? (Or is my test case flawed?)
mysql> use try;
Database changed
mysql> create table f617674 (x int);
Query OK, 0 rows affected (0.06 sec)
mysql> delimiter //
mysql> create procedure p617674 (arg int)
-> begin
-> insert into f617674 (x) VALUE (arg);
-> end;
-> //
Query OK, 0 rows affected (0.06 sec)
mysql> delimiter ;
-- ---------------------------
mysql> use test;
Database changed
mysql> create table f617674 (x int);
Query OK, 0 rows affected (0.05 sec)
mysql> delimiter //
mysql> create procedure p617674 (arg int)
-> begin
-> insert into f617674 (x) VALUE (arg);
-> end;
-> //
Query OK, 0 rows affected (0.00 sec)
mysql> delimiter ;
-- ---------------------------
mysql> use try;
Database changed
mysql> call test.p617674(1234);
Query OK, 1 row affected (0.00 sec)
mysql> SELECT * FROM try.f617674;
Empty set (0.00 sec)
mysql> SELECT * FROM test.f617674; -- want insert to show here
+------+
| x |
+------+
| 1234 |
+------+
1 row in set (0.00 sec)
If you want to edit/run that test case, here it is:
use try;
create table f617674 (x int);
delimiter //
create procedure p617674 (arg int)
begin
insert into f617674 (x) VALUE (arg);
end;
//
delimiter ;
-- ---------------------------
use test;
create table f617674 (x int);
delimiter //
create procedure p617674 (arg int)
begin
insert into f617674 (x) VALUE (arg);
end;
//
delimiter ;
-- ---------------------------
use try;
call test.p617674(1234);
SELECT * FROM try.f617674;
SELECT * FROM test.f617674; -- want insert to show here
Subject
Views
Written By
Posted
4648
July 18, 2014 11:39AM
1714
July 19, 2014 09:19AM
Re: Get the schema name from inside a stored-procedure
1832
July 19, 2014 12:16PM
1909
July 20, 2014 05:45PM
1507
July 20, 2014 07:42PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.