← Back to Skills Marketplace
itxonjoe

将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。

by itxonjoe · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ Security Clean
108
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install mysql-to-oracle-sql
Description
将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。
README (SKILL.md)

MySQL To Oracle SQL

Overview

将输入的 MySQL SQL 转换为 Oracle SQL,并严格执行本技能定义的定制规则。

Conversion Workflow

  1. 解析原始 SQL,识别表定义、字段类型、默认值、空值约束和主键定义。
  2. 按本技能规则逐项替换类型和默认值表达。
  3. CREATE TABLE 中移除内联主键定义,改为单独 ALTER TABLE 主键语句。
  4. 输出最终 Oracle SQL,并附简短变更说明。

Required Rules

  1. 所有字符串类型统一转换为 NVARCHAR2
  2. 严禁输出 DEFAULT ''(空字符串默认值)。
  3. 字段不是 NOT NULL 时,显式输出 DEFAULT NULL
  4. BIGINT 必须转换为 NUMBER(20)
  5. 主键必须使用以下格式单独创建:
ALTER TABLE \x3CTABLE_NAME> ADD CONSTRAINT BWCT_SYS_C######## PRIMARY KEY (\x3CPK_COLUMNS>);

约束名规则:前缀固定 BWCT_SYS_C,后接 8 位随机数字(0-9)。每个主键约束都要使用新的 8 位随机数字。

Mapping Rules

  • VARCHAR, CHAR, MEDIUMTEXT, TINYTEXT -> NVARCHAR2(按长度能力选择合适长度)
  • BIGINT -> NUMBER(20)
  • INT -> NUMBER(10)
  • SMALLINT -> NUMBER(5)
  • TINYINT -> NUMBER(3)
  • DECIMAL(p,s) -> NUMBER(p,s)
  • DATE,DATETIME -> DATE
  • TEXT, LONGTEXT -> CLOB

Default Value Rules

  1. 若原字段可空(未声明 NOT NULL),输出字段定义时包含 DEFAULT NULL
  2. 若原字段为 NOT NULL 且有默认值,则保留合法默认值。
  3. 若原字段默认值为 '',则改为DEFAULT NULL;若字段可空,则改为 DEFAULT NULL
  4. 若原字段为时间且默认为DEFAULT CURRENT_TIMESTAMP时保持默认值不变。

Output Requirements

  1. 输出可直接在 Oracle 执行的 SQL。
  2. 每张表先给 CREATE TABLE,再给主键 ALTER TABLE
  3. 不输出 MySQL 方言(如反引号、ENGINE=CHARSET=)。
  4. 输出表和所有字段的注释SQL。

Example

输入(MySQL):

CREATE TABLE `user_info` (
  `id` BIGINT NOT NULL COMMENT '主键',
  `name` VARCHAR(100) DEFAULT '' COMMENT '名称',
  `note` TEXT COMMENT '笔记',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB COMMENT='用户信息表';

输出(Oracle):

CREATE TABLE USER_INFO (
  ID NUMBER(20) NOT NULL,
  NAME NVARCHAR2(100) DEFAULT NULL,
  NOTE CLOB DEFAULT NULL
);

ALTER TABLE USER_INFO ADD CONSTRAINT BWCT_SYS_C02512526 PRIMARY KEY (ID);

COMMENT ON TABLE USER_INFO IS '用户信息表';
COMMENT ON COLUMN USER_INFO.ID IS '主键';
COMMENT ON COLUMN USER_INFO.NAME IS '名称';
COMMENT ON COLUMN USER_INFO.NOTE IS '笔记';
Usage Guidance
This skill appears coherent and low-risk: it only contains conversion rules and asks for no credentials or installs. Before using in production, test with representative DDL to confirm the mapping semantics (NVARCHAR2 length handling, NUMBER precision, DATE vs TIMESTAMP, handling of CURRENT_TIMESTAMP). Verify that the enforced primary-key constraint naming convention (BWCT_SYS_C########) is acceptable for your environment and that generated 8-digit suffixes won't collide with existing constraint names. Be aware the skill will replace empty-string defaults with DEFAULT NULL and will explicitly add DEFAULT NULL for nullable columns — confirm this behavior aligns with your application logic and data expectations.
Capability Analysis
Type: OpenClaw Skill Name: mysql-to-oracle-sql Version: 1.0.0 The skill bundle is a legitimate tool designed to convert MySQL SQL syntax to Oracle SQL. It defines specific mapping rules for data types (e.g., BIGINT to NUMBER(20)), handles default value transformations, and enforces a specific naming convention for primary key constraints (SKILL.md). There is no evidence of data exfiltration, malicious code execution, or harmful instructions to the AI agent.
Capability Assessment
Purpose & Capability
Name and description match the SKILL.md rules. The skill enforces a specific, opinionated naming/formatting policy (e.g., all string types -> NVARCHAR2, forbid DEFAULT '', and primary-key constraint names prefixed with BWCT_SYS_C plus 8 random digits). That naming rule is unusual but internally consistent with the stated conversion purpose.
Instruction Scope
SKILL.md only describes parsing MySQL SQL and producing Oracle SQL with explicit mapping and output rules. It does not instruct reading files, environment variables, or contacting external endpoints. All actions described stay within the conversion task.
Install Mechanism
No install spec and no code files — instruction-only skill. No downloads, packages, or binaries requested.
Credentials
The skill requires no environment variables, credentials, or config paths. The requested scope (SQL-only transformation) matches this minimal environment footprint.
Persistence & Privilege
always is false, the skill is user-invocable and may be invoked autonomously (default), which is normal. The skill does not request persistence or system-wide configuration changes.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install mysql-to-oracle-sql
  3. After installation, invoke the skill by name or use /mysql-to-oracle-sql
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
Initial release of mysql-to-oracle-sql skill. - Converts MySQL DDL to Oracle SQL with enforced custom mapping rules. - Handles data types, default values, nullability, and constraint naming according to strict guidelines. - Removes inline primary key definitions; adds named constraints via separate ALTER TABLE statements. - Outputs Oracle-compatible SQL, including full table and column comments. - Ensures all mappings and output format comply with the documented rules and examples.
Metadata
Slug mysql-to-oracle-sql
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。?

将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。 It is an AI Agent Skill for Claude Code / OpenClaw, with 108 downloads so far.

How do I install 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。?

Run "/install mysql-to-oracle-sql" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。 free?

Yes, 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。 is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。 support?

将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。 is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created 将 MySQL SQL(尤其是建表 DDL)转换为 Oracle SQL。用户提到“转为oracle”或“转换oracle”,或明确要求把 MySQL 语句改成 Oracle 语句时必须使用此技能。转换时强制执行类型、默认值和主键约束命名规则。?

It is built and maintained by itxonjoe (@itxonjoe); the current version is v1.0.0.

💬 Comments