Get the App
SLTechnology News&Howtos  ›  Database  › 

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

Shulou Source: shulou.com Published: 2022-05-31 15:29:26 09月14日 Update

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.

Tags: Articles questions handling more good practical content articles knowledge reference help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Xiaomi OPPO Reno macOS Huawei MariaDB