MySQL Forums
Forum List  »  General

Re: Query using new schema but prepared statement using old schema
Posted by: No No
Date: October 27, 2020 01:20AM

This recreates the behavior (tips on formatting appreciated):

create schema test1;
create schema test2;

create table test1.preptest
(
id int primary key,
data varchar(255)
);

create table test2.preptest
(
id int primary key,
data varchar(255)
);

use test1;
select database();
prepare preptest_insert from
'insert into preptest (id, data) values (?, ?)';

set @id = 1;
set @data = 'something';
execute preptest_insert using @id, @data;

use test2;
select database();
execute preptest_insert using @id, @data;

Options: ReplyQuote




Sorry, only registered users may post in this forum.

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.