matlab-write-database

Write MATLAB table data to relational databases with transactions.

883|109|Updated Apr 3, 2026
One-click install
npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-write-database
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: matlab-write-database
Source: https://github.com/matlab/matlab-agentic-toolkit/tree/main/skills-catalog/reporting-and-database-access/matlab-write-database
Command: npx skills add https://github.com/matlab/matlab-agentic-toolkit --skill matlab-write-database

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill prevents slow, error-prone database export workflows by guiding you to write MATLAB tables and execute database operations reliably.

Core Features & Use Cases

  • Bulk and structured exports: Inserts MATLAB table data into relational database tables using sqlwrite, including schema creation when appropriate.
  • Safe updates and deletes: Updates existing rows with sqlupdate (R2023a+) and supports data modification patterns without resorting to brittle raw SQL strings.
  • Transactional and parameterized operations: Executes DDL/DML and stored procedures with execute or runstoredprocedure, and uses JDBC prepared statements (databasePreparedStatement + bindParamValues) with commit/rollback safety rules.

Quick Start

Ask the agent to connect to your database, insert a MATLAB table into a target table using sqlwrite, and wrap multi-statement writes in a transaction with commit/rollback.

Frequently Asked Questions about matlab-write-database

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I insert MATLAB table data into a relational database?▼

To insert MATLAB table data into a relational database, use the sqlwrite function to safely export structured table records and optionally auto-create the target schema during the bulk insertion process.

How do I safely execute multiple database writes in MATLAB?▼

To safely execute multiple database writes in MATLAB, wrap your operations in an atomic transaction by setting AutoCommit='off', then use commit to save successful changes or rollback to revert errors.

Can I use JDBC prepared statements in MATLAB to prevent SQL injection?▼

Yes, you can use JDBC prepared statements in MATLAB by creating a databasePreparedStatement object and binding parameters with bindParamValues to safely execute parameterized queries without hardcoded credentials.

What is the best way to update existing database rows from MATLAB?▼

The best way to update existing database rows from MATLAB is using the sqlupdate function (available in R2023a+), which safely modifies data without resorting to brittle raw SQL string execution.

How do I execute stored procedures from MATLAB?▼

To execute stored procedures from MATLAB, use the runstoredprocedure function to run parameterized database routines safely, ensuring your database connection is verified open with isopen before execution.

Why should I avoid hardcoded credentials when connecting MATLAB to databases?▼

Avoiding hardcoded credentials when connecting MATLAB to databases prevents security vulnerabilities; instead, establish verified connections using secure authentication methods before executing sqlwrite or execute operations.