火鸟垃圾场

发布于 2025-01-28 12:57:10 字数 1026 浏览 4 评论 0原文

我有一个数据库.gdb运行,​​带有firebird 3.0。

该数据库具有两个表:

  • Table1和
  • Table2。

每天我将记录添加到这些表中,完成工作后,我需要将两个表导出到另一个较新的数据库中。

我需要一个过程,将两个表转储到脚本中,以便使用脚本在较新的数据库中导入数据。

我只能创建一个始终具有相同记录数量的表脚本(每天都没有添加记录)。

该脚本应包括:

  1. 创建表
  2. 导出两个表的所有记录过程,

我不需要代码,而只是提示。我将研究如何自己编写代码。

我创建了一个手工脚本。

CREATE TABLE TABYEARS (
    ID     INTEGER NOT NULL,
    YEARS  INTEGER,
    /* Keys */
    PRIMARY KEY (ID)
);

CREATE TABLE TABCODE (
    ID     INTEGER NOT NULL,
    NAME   VARCHAR(50),
    CODE   VARCHAR(50),
    /* Keys */
    PRIMARY KEY (ID)
);
COMMIT;

INSERT INTO TABYEARS (ID, YEARS) VALUES (1, 2021);
INSERT INTO TABYEARS (ID, YEARS) VALUES (2, 2022);
INSERT INTO TABCODE (ID, NAME, CODE) VALUES (1, 'Robert', '10');
INSERT INTO TABCODE (ID, NAME, CODE) VALUES (2, 'Paul', '87');
COMMIT;

我不会经常将记录添加到这些表中。第一个每年只有一个记录。

如何创建(而不是手动)这样的脚本,但 每天我添加50个记录的两个桌子?

我可以使用弗拉梅宾蛋白或IBEXPERT或类似。

I have a database.gdb running with Firebird 3.0.

This database has two tables:

  • Table1 and
  • Table2.

Every day I add records to these tables and when I have finished my work I need to export the two tables to another newer database.

I need a procedure which dumps the two tables into a script so to import data in the newer database using the script.

I am only able to create a script of tables which have always the same number of records (no records added every day).

This script should include:

  1. CREATE TABLE
  2. Export all records procedure of the two tables

I do not need code but just a hint. I will study how to write code by myself.

I have created a handmade script.

CREATE TABLE TABYEARS (
    ID     INTEGER NOT NULL,
    YEARS  INTEGER,
    /* Keys */
    PRIMARY KEY (ID)
);

CREATE TABLE TABCODE (
    ID     INTEGER NOT NULL,
    NAME   VARCHAR(50),
    CODE   VARCHAR(50),
    /* Keys */
    PRIMARY KEY (ID)
);
COMMIT;

INSERT INTO TABYEARS (ID, YEARS) VALUES (1, 2021);
INSERT INTO TABYEARS (ID, YEARS) VALUES (2, 2022);
INSERT INTO TABCODE (ID, NAME, CODE) VALUES (1, 'Robert', '10');
INSERT INTO TABCODE (ID, NAME, CODE) VALUES (2, 'Paul', '87');
COMMIT;

I do not add records very often to these tables. The first one has just one record every year.

How to create (not manually) a script like this but regarding
two tables in which every day I add 50 records?

I can use FlameRobin or IBExpert or similar.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文