这篇文章将为大家详细讲解有关mysql迁移到sybase ase中null问题怎么处理,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。
[root@testlihb ~]# su - mysql
-bash-4.1$ mysql -uroot -p********* -h227.0.0.1 -P3306
mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| mysql |
| performance_schema |
| test |
+--------------------+
4 rows in set (0.00 sec)
mysql> use test
Database changed
mysql> create table t ( a int,b int);
Query OK, 0 rows affected (0.65 sec)
mysql> insert into t values (1,null);
Query OK, 1 row affected (0.09 sec)
mysql> insert into t values (null,1);
Query OK, 1 row affected (0.10 sec)
mysql> select * from t;
+------+------+
| a | b |
+------+------+
| 1 | NULL |
| NULL | 1 |
+------+------+
2 rows in set (0.00 sec)
mysql>
mysql> select ifnull(a,'') as a,ifnull(b,'') as b from t into outfile '/tmp/t.txt';
Query OK, 2 rows affected (0.00 sec)
mysql>
mysql>
mysql> ^DBye
-bash-4.1$
-bash-4.1$
-bash-4.1$ id
uid=27(mysql) gid=27(mysql) groups=27(mysql)
-bash-4.1$ logout
[root@testlihb ~]# su - sybase
[sybase@testlihb ~]$ isql -Usa -P**** -SASE -w999
1> use tempdb
2> go
1> create table t (a int null,b int null)
2> go
1> select * from tempdb..t
2> go
a b
----------- -----------
(0 rows affected)
[sybase@testlihb ~]$ bcp tempdb..t in /tmp/t.txt -Usa -SASE -P***** -c
Starting copy...
2 rows copied.
Clock Time (ms.): total = 117 Avg = 58 (17.09 rows per sec.)
[sybase@testlihb ~]$
[sybase@testlihb ~]$ isql -Usa -P***** -SASE -w999
1> select * from tempdb..t
2> go
a b
----------- -----------
1 NULL
NULL 1
(2 rows affected)
1>
2> select * from tempdb..t where b is null
3> go
a b
----------- -----------
1 NULL
(1 row affected)
1>
关于“mysql迁移到sybase ase中null问题怎么处理”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。