This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 48693 - Grab and Recreating Table doesn't work for 100%
Summary: Grab and Recreating Table doesn't work for 100%
Status: CLOSED DUPLICATE of bug 18144
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 4.x
Hardware: PC Linux
: P3 blocker (vote)
Assignee: Radko Najman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-08 15:37 UTC by dmladek
Modified: 2006-03-24 10:09 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Grabed table structure on DB2 81 (I think it's binary file) (1.48 KB, application/octet-stream)
2004-09-08 15:44 UTC, dmladek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dmladek 2004-09-08 15:37:28 UTC
Product Version       = NetBeans IDE Dev (Build
200409071800)
  Operating System      = Linux version
2.4.22-1.2115.nptl running on i386
  Java; VM; Vendor      = 1.5.0-rc; Java
HotSpot(TM) Client VM 1.5.0-rc-b63; Sun
Microsystems Inc.
  Java Home             = /usr/local/java/jdk1.5.0/jre
  System Locale; Encod. = cs_CZ (nb); ISO-8859-2
  Home Dir; Current Dir = /usr/local/home/delphym;
/usr/local/forte/forte3/NBdev-last/netbeans/bin
  IDE Install; User Dir =
/usr/local/home/delphym/NBdev-last/platform4;
/usr/local/home/delphym/.netbeans/dev

DB2 8.1 on W2K,
jdbc driver "db2java.zip" shipped with that DB.
Drive Class: COM.ibm.db2.jdbc.net.DB2Driver
-------------------------------------------------------------------------------

I've created Table with settings a primary key and
index on some column using IDE-DB GUI (not SQL
command). I had turned on debugging, so it printed
out the SQL commands:


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
create table "DB2ADMIN"."Title"
(
	"ID" SMALLINT not null,
	"MSET" SMALLINT not null,
	"TITLE" VARCHAR(50),
	"TYPE" SMALLINT,
	"USEDMEDIA" SMALLINT,
	"DESCRIPTION" VARCHAR(500),
	primary key (ID, MSET)
)
 
create  index "Title_TITLE_idx" on "DB2ADMIN"."Title"
(
	"TITLE"
)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Table was succesfuly created with one primary key
and with one index.
So far good.


Then I grabed table structure and save it on the
disk. (this "Title.grab" file I'm attaching)


Then I wanted to recreate the table.
In JFileCHooser I selected Title.grab file and
open it.
From the first sign the SQL commands in the table
script little differs from  the previously
executed which successfuly created table + PK + index

I change Name: from Title to zzzzTitle and
executed it.
But command's execution failed.
Here is the SQL command reconstructed from the
GRAB file:

create table "DB2ADMIN"."zzzzTitle"
(
	"ID" SMALLINT not null primary key,
	"MSET" SMALLINT not null primary key,
	"TITLE" VARCHAR(50),
	"TYPE" SMALLINT,
	"USEDMEDIA" SMALLINT,
	"DESCRIPTION" VARCHAR(500)
)



primary keys are diffined just after column names.
I don't know SQL specification nor even DB2
differencies from that, but I guess, that reusing
GRAB structure on the same DB type and version
should work because of this GRAB file is not
simply stored SQL command in TXT format, but it
contains some binary data which I guess are (or
should be)related to the type of DB on which it
was created.
Comment 1 dmladek 2004-09-08 15:44:07 UTC
Created attachment 17492 [details]
Grabed table structure on DB2 81 (I think it's binary file)
Comment 2 dmladek 2004-09-08 16:21:18 UTC
hmmm, it is not related to any spec. DB I would say.
With ORA there is same problem too.
Comment 3 Radko Najman 2004-09-17 14:04:31 UTC

*** This issue has been marked as a duplicate of 18144 ***
Comment 4 dmladek 2004-09-17 14:47:03 UTC
Good catch Radko :-)