加入收藏 | 设为首页 | 会员中心 | 我要投稿 银川站长网 (https://www.0951zz.com/)- 云通信、基础存储、云上网络、机器学习、视觉智能!
当前位置: 首页 > 站长学院 > MySql教程 > 正文

mysql迁移到sybase ase中null问题怎么处理

发布时间:2023-09-14 13:30:05 所属栏目:MySql教程 来源:
导读:这篇文章将为大家详细讲解有关mysql迁移到sybase ase中null问题怎么处理,小编觉得挺实用的,因此分享给大家做个参考,希望大家阅读完这篇文章后可以有所收获。[root@testlihb ~]# su - mysql-bash-4.1$ mysql -uroo

这篇文章将为大家详细讲解有关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问题怎么处理”这篇文章就分享到这里了,希望以上内容可以对大家有一定的帮助,使各位可以学到更多知识,如果觉得文章不错,请把它分享出去让更多的人看到。

(编辑:银川站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章