Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to deal with the problem of null when mysql migrates to sybase ase

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article will explain in detail how to deal with the problem of null in the migration of mysql to sybase ase. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

[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 (an int,b int)

Query OK, 0 rows affected (0.65 sec)

Mysql > insert into t values (1Jing 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 quotation') as a minute if null (brecorder') 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-Please payment *-SASE-w999

1 > use tempdb

2 > go

1 > create table t (an 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 >

This is the end of the article on "how to deal with the null problem of mysql migrating to sybase ase". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, please share it out for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report