Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F7609
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Authored By
stwalkerster
Jan 25 2017, 11:52 PM
2017-01-25 23:52:25 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
MariaDB [test]> create table mytable (
-> id varchar(50) not null,
-> name varchar(50) null default '',
-> primary key (id));
Query OK, 0 rows affected (0.26 sec)
MariaDB [test]> create view myview as
-> select id,name from mytable;
Query OK, 0 rows affected (0.05 sec)
MariaDB [test]>
MariaDB [test]> insert into mytable values ('1','aaa');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> insert into mytable values ('2','bbb');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> insert into mytable values ('3','ccc');
Query OK, 1 row affected (0.03 sec)
MariaDB [test]> select * from mytable;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
| 2 | bbb |
| 3 | ccc |
+----+------+
3 rows in set (0.00 sec)
MariaDB [test]> select * from myview;
+----+------+
| id | name |
+----+------+
| 1 | aaa |
| 2 | bbb |
| 3 | ccc |
+----+------+
3 rows in set (0.01 sec)
MariaDB [test]> prepare cmd from 'select id,name from mytable where id=?';
Query OK, 0 rows affected (0.00 sec)
Statement prepared
MariaDB [test]> set @param1 = '2';
Query OK, 0 rows affected (0.06 sec)
MariaDB [test]> execute cmd using @param1;
+----+------+
| id | name |
+----+------+
| 2 | bbb |
+----+------+
1 row in set (0.00 sec)
MariaDB [test]> deallocate prepare cmd;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]> prepare cmd from 'select id,name from myview where id=?';
Query OK, 0 rows affected (0.00 sec)
Statement prepared
MariaDB [test]> set @param1 = '2';
Query OK, 0 rows affected (0.01 sec)
MariaDB [test]> execute cmd using @param1;
ERROR 1615 (HY000): Prepared statement needs to be re-prepared
MariaDB [test]> deallocate prepare cmd;
Query OK, 0 rows affected (0.00 sec)
MariaDB [test]>
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
6693
Default Alt Text
(1 KB)
Attached To
Mode
P90 (An Untitled Masterwork)
Attached
Detach File
Event Timeline
Log In to Comment