Adaptive Server Enterprise 用户教程
现在应该尝试在远程数据库中输入数据,然后将数据发送到统一数据库。下面仅提供概要信息。
将数据从远程数据库复制到统一数据库:
通过 Interactive SQL 连接到 field 数据库。
使用 INSERT 在远程数据库中插入一行。例如
INSERT INTO Customer (cust_key, name, rep_key)
VALUES ('cust3', 'North Land Trading', 'rep1')使用 COMMIT 提交该行。
COMMIT;
当 field.db 数据库正在运行时,运行 dbremote 以便将消息发送到统一数据库。
dbremote -c "eng=field;dbn=field;uid=DBA;pwd=SQL"
运行 ssremote 以便在统一数据库中接收消息:
ssremote -c "eng=server-name;dbn=hq;uid=sa;pwd=sysadmin"
连接到统一数据库并显示 Customer 表。该表现在包含三行:
SELECT * FROM Customer
| cust_key | name | rep_key |
|---|---|---|
| cust1 | Ocean Sports | rep1 |
| cust2 | Sports Plus | rep2 |
| cust3 | North Land Trading | rep1 |
在这一简单示例中,没有采取相应的措施来避免重复主键值条目。SQL Remote 确实提供了这种保护。有关信息,请参见有关 SQL Remote 设计的章节。
SQL Anywhere Studio 9.0.2
版权所有 © 1989–2005 Sybase, Inc. 部分版权所有 © 2001–2005 iAnywhere Solutions, Inc. 保留所有权利。