You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to issue a SQL statement like INSERT INTO t1(id, name) values (?,'Jack'); in Proxy session to insert data record with keys generate automatically by key generator. id is not only sharding key, but also PRIMARY KEY. How can I achieve that ?
I have tried the following methods, but none of them works :
INSERT INTO t1(name) values ('Jack');
INSERT INTO t1 values (null, 'Jack');
First issue ALTER TABLE t1 MODIFY id INT PRIMARY KEY AUTO_INCREMENT; , then issue the two statement above .
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want to issue a SQL statement like
INSERT INTO t1(id, name) values (?,'Jack');
in Proxy session to insert data record with keys generate automatically by key generator.id
is not only sharding key, but also PRIMARY KEY. How can I achieve that ?I have tried the following methods, but none of them works :
INSERT INTO t1(name) values ('Jack');
INSERT INTO t1 values (null, 'Jack');
ALTER TABLE t1 MODIFY id INT PRIMARY KEY AUTO_INCREMENT;
, then issue the two statement above .在 Proxy 会话中,我想在 SQL 语句中使用键生成器自动生成的键向逻辑表插入数据,通过路由按分片规则自动存储到对应数据源。请问应该如何操作?
Beta Was this translation helpful? Give feedback.
All reactions