SkillAgentSearch skills...

Excel2SQL

generate insert sql from excel file

Install / Use

/learn @rzh0001/Excel2SQL
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Excel2SQL

This script will generate insert sql accroding to the config and data in the excel file

Requirements

  • Python
  • xlrd (pip install xlrd)

Usage

python excel2SQL.py excel_file sheet_index

args| description ----|---- excel_file| if excel file and excel2SQL.py are in the same directory excel file path, it can be excel file name, otherwise it should be absolute path sheet_index| excel worksheet index

Excel config

config
Line 1: TABLE_NAME
Line 2: COLUMN_NAME
Line 3: COLUMN_TYPE

type | value | result in sql ----|---- | ---- string| grettygirl| values ('grettygirl') int | 28 | values (28) float | 12.1 | values (12.1) function | fn_get_data_id | select fn_get_data_id from dual

Line 4: data

Example

  1. COLUMN_TYPE config contain 'function'
INSERT TB_USER (USER_ID, NAME, AGE, EMAIL, ADDRESS, SCORE, BIRTHDAY, DATA_ID )  
SELECT 'golden_three_fat', '金三胖', 28, 'rzh0001@qq.com', 'Nanjing', 12.1, '19900416', fn_get_data_id FROM DUAL;
  1. COLUMN_TYPE config do not contain 'function'
INSERT TB_USER (USER_ID, NAME, AGE, EMAIL, ADDRESS, SCORE, BIRTHDAY )   
VALUES ('golden_three_fat', '金三胖', 28, 'rzh0001@qq.com', 'Nanjing', 12.1, '19900416' );
View on GitHub
GitHub Stars6
CategoryData
Updated5mo ago
Forks1

Languages

Python

Security Score

82/100

Audited on Oct 6, 2025

No findings