Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE » How To » AUTO_INCREMENT PK Column for Oracle Table
AUTO_INCREMENT PK Column for Oracle Table [message #2151] Tue, 23 June 2009 10:10 Go to next message
ajwid01 is currently offline  ajwid01
Messages: 26
Registered: June 2009
Location: UK
Junior Member
Hi,

I am trying to get a table's specification to implement an auto-increment field based on a sequence lookup.

As I understand it, the pre-requisites for this to be auto-established during the DB Dictionary Import routines is to:

A) Have the PK specified on a numeric column.
B) Have a sequence available following the naming convention <Table_name>_SEQ.

Both these requirements are met, but the table_name.dict.inc does not appear to specify the column as recognised for auto_increment when exported.

Am I doing something wrong?

Best regards,

- Tony.
Re: AUTO_INCREMENT PK Column for Oracle Table [message #2152 is a reply to message #2151] Tue, 23 June 2009 13:58 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2368
Registered: April 2006
Location: Surrey, UK
Senior Member
I have tested his feature on my system using the following:
CREATE TABLE test_autoincrement (
  id number(10) NOT NULL,
  field1 varchar2(40) default NULL,
  field2 varchar2(255) default NULL,
  PRIMARY KEY  (id)
);
CREATE SEQUENCE test_autoincrement_seq;

REVOKE ALL ON test_autoincrement FROM PUBLIC;
GRANT SELECT,INSERT,DELETE,UPDATE ON test_autoincrement TO PUBLIC;
REVOKE ALL ON test_autoincrement_seq FROM PUBLIC;
GRANT SELECT,ALTER ON test_autoincrement_seq TO PUBLIC;

I then imported this new table, imported the columns, after which I examined the ID column and noted that the autoincrement property was set correctly. When I exported the table details the dict.inc file showed 'auto_increment' => 'y' on the key field.

Are you sure that you are following the instructions at http://www.tonymarston.net/php-mysql/oracle.html#auto.increm ent


Re: AUTO_INCREMENT PK Column for Oracle Table [message #2153 is a reply to message #2151] Wed, 24 June 2009 04:00 Go to previous message
ajwid01 is currently offline  ajwid01
Messages: 26
Registered: June 2009
Location: UK
Junior Member
Got it!

My PK was just specified as a NUMBER in the Oracle table definition (because I am always too lazy to bother specifying any precisions), and when imported - this column was being set to FLOAT in Radicore.

Dumping the table contents, modifying column definition to NUMBER(10), reimporting data and then reimporting table columns to Radicore allowed the column to be picked up as Auto Increment.

Smile

Many thanks.

T.
Previous Topic: LIST2 Pattern Problem
Next Topic: _cm_ListView_header
Goto Forum:
  


Current Time: Sat Nov 23 19:50:13 EST 2024

Total time taken to generate the page: 0.03346 seconds