Subject | Re: [Firebird-Java] Re: JCA DOESN'T WORK - sample code |
---|---|
Author | Sanjay Amatya |
Post date | 2002-04-25T02:31:20Z |
Roman, here's the metadata:
/* To run the script, make sure that the isql.exe is on the
* command line. If you also have MS SQL 7 on your system,
* you might invoke the wrong isql! To make sure you call
* the correct isql, modify the path with the following
* command:
*
* path=c:\progra~1\borland\interbase\bin;%path%
*
* Use the correct directory for the InterBase folder! This
* sample is just the default.
*
* At last, to invoke the script, use the following syntax:
*
* isql -i script.sql
*
* TODO: Customize the following command before running
* this script:
*/
CREATE DATABASE 'C:\testjava\testing.gdb'
USER 'sysdba' PASSWORD 'masterkey';
CREATE DOMAIN GUID CHAR(38)
;
CREATE TABLE test (
ID INTEGER NOT NULL,
a VARCHAR(50),
b VARCHAR(50)
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'adsfa',
'asdf',
1
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'asdf',
'asdf',
2
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'asdf',
'asdfasdf',
3
)
;
ALTER TABLE test
ADD PRIMARY KEY (
ID
)
;
CREATE GENERATOR G_testIDGen0
;
SET GENERATOR G_testIDGen0 TO 4
;
CREATE TRIGGER GetNextG_testIDGen0 FOR test
BEFORE INSERT
AS
BEGIN
NEW.ID = GEN_ID(G_testIDGen0, 1);
END
;
--- rrokytskyy <rrokytskyy@...> wrote:
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
/* To run the script, make sure that the isql.exe is on the
* command line. If you also have MS SQL 7 on your system,
* you might invoke the wrong isql! To make sure you call
* the correct isql, modify the path with the following
* command:
*
* path=c:\progra~1\borland\interbase\bin;%path%
*
* Use the correct directory for the InterBase folder! This
* sample is just the default.
*
* At last, to invoke the script, use the following syntax:
*
* isql -i script.sql
*
* TODO: Customize the following command before running
* this script:
*/
CREATE DATABASE 'C:\testjava\testing.gdb'
USER 'sysdba' PASSWORD 'masterkey';
CREATE DOMAIN GUID CHAR(38)
;
CREATE TABLE test (
ID INTEGER NOT NULL,
a VARCHAR(50),
b VARCHAR(50)
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'adsfa',
'asdf',
1
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'asdf',
'asdf',
2
)
;
INSERT INTO test (
a,
b,
ID
) VALUES (
'asdf',
'asdfasdf',
3
)
;
ALTER TABLE test
ADD PRIMARY KEY (
ID
)
;
CREATE GENERATOR G_testIDGen0
;
SET GENERATOR G_testIDGen0 TO 4
;
CREATE TRIGGER GetNextG_testIDGen0 FOR test
BEFORE INSERT
AS
BEGIN
NEW.ID = GEN_ID(G_testIDGen0, 1);
END
;
--- rrokytskyy <rrokytskyy@...> wrote:
> > Here's the code roman:__________________________________________________
>
> I had no problem with your code if my table is defined:
>
> create table tblcat (id integer);
> insert into tblcat values(1);
> insert into tblcat values(2);
> insert into tblcat values(3);
> insert into tblcat values(4);
>
> I get in stdout:
>
> 1
> 2
> 3
> 4
>
> So, could you please post database metadata that are related to this
> table. I tried to create table "tblcat;" or "tblcat" but then I had
> message "Table ... unknown". That's error code -204, not -901.
>
> So, please post your metadata and the server (build version) you use
> (maybe this is somewhere in previos messages, but I would be very
> grateful if I do not need to seach them ;)).
>
> Best regards,
> Roman Rokytskyy
>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/