---
title: OBClient 版本低导致 source 命令不兼容函数中的除号-OceanBase数据库使用指南
description: 了解OceanBase数据库在实际应用中关于OBClient 版本低导致 source 命令不兼容函数中的除号相关的常见问题和使用技巧，帮助您快速解决OBClient 版本低导致 source 命令不兼容函数中的除号的难题。
image: https://mdn.alipayobjects.com/huamei_22khvb/afts/img/A*OSPzQ6GUQF4AAAAAQHAAAAgAeiGDAQ/original
---
[OceanBase AI 数据大会](https://www.oceanbase.com/conference2026 "OceanBase AI 数据大会")

## 体验新一代 AI 数据平台

[立即咨询](https://www.oceanbase.com/contactus) [免费试用 免费试用](https://www.oceanbase.com/free-trial)划线反馈

# OBClient 版本低导致 source 命令不兼容函数中的除号

更新时间：2026-08-06 07:36

内容类型：Troubleshoot  

本文介绍 OBClient 版本低导致 source 命令不兼容函数中的除号。

## 适用版本

OceanBase 数据库 V2.2.x、V3.1.x、V3.2.x 版本。

## 问题现象

通过 `source` 命令创建 function/procedure 报错。

![1](https://obbusiness-private.oss-cn-shanghai.aliyuncs.com/doc/img/knowledge-base/middleware_and_drivers/client/division-sign-in-obclient-lower-version-source-incompatible-function.png)

测试案例如下:

1. 创建函数 SQL 文件。

   ```shell
   cat test_divide.sql
   CREATE OR REPLACE PROCEDURE test_divide
   AS
   ln_ret NUMBER(22,6);
   BEGIN
   ln_ret := 1/2;
   END;

   /

   ```
 2. 查看 OBClient 版本。

   ```shell
   /u01/obclient/bin/obclient --version
   /u01/obclient/bin/obclient  Ver 2.2.1 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

   ```
 3. 连接数据库。

   ```shell
   obclient -hxxx.xxx.xxx.xxx -P2881 -uroot@sys -p -A

   ```

   ```shell
   Server version: OceanBase 3.2.3.3 (r107040032023032910-c59670fcc6f48d0f6d7ba107e85d43efe85e6615) (Built Mar 29 2023 10:50:14)

   Copyright (c) 2000, 2018, OceanBase and/or its affiliates. All rights reserved.

   Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

   ```
 4. 使用 `source` 命令创建 function/procedure 报错。

   ```shell
   obclient [ALVIN]> source test_divide.sql;

   ```

   ```shell
   ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '1' at line 5
   ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '2' at line 1
   ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near 'END' at line 1
   ORA-00900: You have an error in your SQL syntax; check the manual that corresponds to your OceanBase version for the right syntax to use near '/' at line 1

   ```

## 问题原因

`ln_ret := 1/2;` 中 `/` 与 `Delimter /` 冲突，将 `ln_ret := 1/2;` 修改为 `ln_ret := 12;` 就不报错。

```shell
obclient [ALVIN]> source test_divide.sql;
Query OK, 0 rows affected (0.020 sec)

```

## 解决方法

可以通过升级 OBClient 至 OBClient V2.2.3 以上版本解决。

1. 升级 OBClient。

   ```shell
   rpm -Uvh obclient-2.2.3-20230515141610.el7.x86_64.rpm
   Preparing...                          ################################# [100%]
   Updating / installing...
      1:obclient-2.2.3-20230515141610.el7################################# [ 50%]
   Cleaning up / removing...
      2:obclient-2.2.1-20221122151945.el7################################# [100%]

   ```
 2. 查看升级后 OBClient 版本。

   ```sehll
   /u01/obclient/bin/obclient --version
   /u01/obclient/bin/obclient  Ver 2.2.3 Distrib 10.4.18-MariaDB, for Linux (x86_64) using readline 5.1

   ```
 3. 升级后不报错。

   ```shell
   obclient [ALVIN]> source test_divide.sql
   Query OK, 0 rows affected (0.016 sec)

   ```

上一篇

[OBClient 上执行 status 命令后断连](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000210065)

下一篇

[OBClient 报错 error while load libncurses.so.5](https://www.oceanbase.com/knowledge-base/oceanbase-database-1000000000429364) ![有帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*y6ocSqN8cqsAAAAAAAAAAAAAARQnAQ)![无帮助](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*BG9IQJyLHF8AAAAAAAAAAAAAARQnAQ)![反馈](https://gw.alipayobjects.com/mdn/ob_asset/afts/img/A*eTWdQKCRKHwAAAAAAAAAAAAAARQnAQ) 咨询
