Subject | Re: [IBO] getting a view of the metadata of a IB6 table? |
---|---|
Author | Frank Ingermann |
Post date | 2001-06-15T17:26:07Z |
Hi Chuck,
Chuck Belanger wrote:
restore it with IB5.x. If you can't get IB6 up and running, you're out of
luck :((
- but there is light at the end of the tunnel <g>: i've just downloaded
the thing, i'll make a metadata extract and send it to you in private.
(two minutes later...)
taking a closer look, the gdb is so minimal that i just attached the script
with meta- and test data, this should do i hope!
hth,
fingerman
..now for the script:
/* SET SQL DIALECT 3; @fi: ok this wont work on ib5.x */
CREATE DATABASE 'C:\TESTIBO.GDB'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET NONE;
CREATE GENERATOR GEN_FORID;
SET GENERATOR GEN_FORID TO 402;
CREATE TABLE NEWTABLE (
ID SMALLINT NOT NULL,
PARENT SMALLINT,
DESCRIPTION VARCHAR(30) CHARACTER SET NONE,
FOLDER SMALLINT,
IMAGE SMALLINT);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (8, -1,
'Purchase Orders', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (2, 20,
'Jobs2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (3, -1,
'Orders', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (392, 3,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (393, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (5, 2,
'Early2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (20, 356,
'Customers', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (356, -1,
'Two', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (359, 20,
'One', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (394, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (395, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (154, -1,
'Two', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (10, -1,
'Shipments2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (396, -1,
'New', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (397, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (398, -1,
'New Folder', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (14, 2, 'On
Time', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (399, 398,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (400, 399,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (401, 400,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (402, -1,
'New Folder', 1, 2);
COMMIT WORK;
ALTER TABLE NEWTABLE ADD CONSTRAINT PK_NEWTABLE PRIMARY KEY (ID);
SET TERM ^ ;
CREATE TRIGGER NEW_TRIGGER FOR NEWTABLE
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.ID IS NULL ) then new.id = GEN_ID(GEN_FORID,1);
end
^
SET TERM ; ^
Chuck Belanger wrote:
> Based on my previous post, re: getting access to some sample data thati'm afraid all you can do is back up the gdb on a running IB6 server and then
> comes with the TestProject of IB_VTree, how do I access IB6 data
> structures, data? I cannot load IB6 itself, I just need the data
> structure, then I can recreate the sample data if need be, all so I can
> run this demo and see what is happening. Any utilities, etc that would
> allow this?
restore it with IB5.x. If you can't get IB6 up and running, you're out of
luck :((
- but there is light at the end of the tunnel <g>: i've just downloaded
the thing, i'll make a metadata extract and send it to you in private.
(two minutes later...)
taking a closer look, the gdb is so minimal that i just attached the script
with meta- and test data, this should do i hope!
hth,
fingerman
..now for the script:
/* SET SQL DIALECT 3; @fi: ok this wont work on ib5.x */
CREATE DATABASE 'C:\TESTIBO.GDB'
USER 'SYSDBA' PASSWORD 'masterkey'
PAGE_SIZE 4096
DEFAULT CHARACTER SET NONE;
CREATE GENERATOR GEN_FORID;
SET GENERATOR GEN_FORID TO 402;
CREATE TABLE NEWTABLE (
ID SMALLINT NOT NULL,
PARENT SMALLINT,
DESCRIPTION VARCHAR(30) CHARACTER SET NONE,
FOLDER SMALLINT,
IMAGE SMALLINT);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (8, -1,
'Purchase Orders', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (2, 20,
'Jobs2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (3, -1,
'Orders', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (392, 3,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (393, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (5, 2,
'Early2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (20, 356,
'Customers', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (356, -1,
'Two', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (359, 20,
'One', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (394, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (395, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (154, -1,
'Two', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (10, -1,
'Shipments2', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (396, -1,
'New', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (397, -1,
'New', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (398, -1,
'New Folder', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (14, 2, 'On
Time', 1, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (399, 398,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (400, 399,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (401, 400,
'New Item', 0, 2);
INSERT INTO NEWTABLE (ID, PARENT, DESCRIPTION, FOLDER, IMAGE) VALUES (402, -1,
'New Folder', 1, 2);
COMMIT WORK;
ALTER TABLE NEWTABLE ADD CONSTRAINT PK_NEWTABLE PRIMARY KEY (ID);
SET TERM ^ ;
CREATE TRIGGER NEW_TRIGGER FOR NEWTABLE
ACTIVE BEFORE INSERT POSITION 0
as
begin
if (new.ID IS NULL ) then new.id = GEN_ID(GEN_FORID,1);
end
^
SET TERM ; ^