Custom INSERT Scripts with Sequences and Constants

01 Sep 2025

Introduction

Welcome to our blog! Today, we’re excited to introduce a new enhancement to the Create INSERT Script feature in Hora. This update gives you more flexibility and control when generating INSERT statements for your tables.

How INSERT Scripts Were Created Previously

Until now, INSERT scripts were generated by scripting the data content of a table. You could adjust the output by:

  • Filtering rows with WHERE conditions to limit the data being scripted.

  • Hiding columns in the data grid to exclude their content from the export.

While these options worked well, some scenarios still required additional flexibility.

See how it works!

Explore possibilities of KeepTool.

i,g

What Was missing

Many customers asked for the ability to:

  • Populate primary key columns with values from a sequence instead of the original data.

  • Insert timestamps or dates using the current system date instead of existing values.

  • Define other constants or function calls directly in the INSERT script, rather than exporting table values.

This level of customization was not possible—until now.

The Solution: Fixed Values in the INSERT Script Dialog

In KeepTool 16.2.3, we’ve extended the INSERT Script dialog with a new “Fixed values” section.

This section provides a grid with two columns:

  1. Column Name – Select the target column (e.g., DEPARTMENT_ID).

  2. Fixed Value – Enter a value manually or choose one from a dropdown list.

You can use any constant or expression valid in an INSERT statement. Hora suggests common options such as:

  • CURRENT_TIMESTAMP

  • Date constants

  • Sequences from your Oracle schema

Example

Suppose you want to generate new primary key values instead of reusing exported ones.

  • Select DEPARTMENT_ID.

  • Set the value to DEPARTMENTS_SEQ.NEXTVAL.

Hora will then use the sequence to populate the primary key column automatically.

The Result

The generated INSERT script now assigns primary key values from a sequence rather than reusing existing table data.

This makes it much easier to prepare scripts for populating fresh datasets, testing environments, or initializing new tables.

Summary

With the new Fixed values feature, you can:

  • Generate INSERT scripts with dynamic or constant values.

  • Use sequences, functions, and expressions to replace original data.

  • Simplify the process of preparing reusable and flexible INSERT scripts.

This enhancement provides greater control and streamlines your workflow when working with INSERT statements in Hora.

Try KeepTool now!

KeepTool’s Oracle database tools have been developed for database application developers as well as database administrators and application support. Based on the feedback and requests of our customers, we have been continuously improving our tools for more than 20 years and strive to improve with each new release.

Download KeepTool