HomeForum
Welcome, Guest

Auto increment numbers...
(1 viewing) (1) Guest
  • Page:
  • 1
  • 2

TOPIC: Auto increment numbers...

Auto increment numbers... 10 months, 2 weeks ago #3125

  • Darwin
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Hello

Does Visual Importer ETL have the ability on import to auto increment numeric fields on import?

Thanks,
Darwin

Re: Auto increment numbers... 10 months, 2 weeks ago #3126

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2191
  • Karma: 12
Darwin

Yes, it is possible

Set mapping type to calculated and use the following expression
GetSystemVariable('LINENUMBER')

Have a look at the documentation part dedicated to calculations

Mike
Attachments:

Re: Auto increment numbers... 10 months, 2 weeks ago #3156

  • DarwinCam
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
This is the Darwin from the original question...I should be more specific...I don't know if it's possible to merge my user accounts...

I have a primary key in a table that contains existing data. Upon import I would like to auto increment from the max value in Auto_Num +1. I downloaded the Visual Importer, read the documentation but don't see how to accomplish this. We cannot use a system variable like rownum, it must be sequential in the Auto_Num column. Thanks.

Re: Auto increment numbers... 10 months, 2 weeks ago #3157

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2191
  • Karma: 12
It is possible as well

What is your target database type?

Can you publish here your table creation script please

Mike

Re: Auto increment numbers... 10 months, 2 weeks ago #3158

  • DarwinCam
  • OFFLINE
  • Fresh Boarder
  • Posts: 5
  • Karma: 0
Here's a sample table that I'm working with...this is just one of a couple different ones. The target database is Postgres 9.

I'm evaluating several databases and utilities in hopes of moving from Oracle. I'm looking at this utility to be a replacement for sqlloader....I'll frequently add 200K records at a shot.

CREATE TABLE "CTL"
(
"AUTO_NUM" numeric(10,0) NOT NULL,
"DB_USER" character varying(20),
"LAST_UPDATE" timestamp(6) without time zone,
"NEXT_UPDATE" timestamp(6) without time zone,
"LAST_SEQ_UPDATE" timestamp(6) without time zone,
"NEXT_SEQ_UPDATE" timestamp(6) without time zone,
"PLANTGDB_USER" character varying(20),
"PLANTGDB_UPDATE" timestamp(6) without time zone
)

Re: Auto increment numbers... 10 months, 2 weeks ago #3160

  • admin
  • OFFLINE
  • Moderator
  • Posts: 2191
  • Karma: 12
Make sure that you are using latest version 7.7.7.14

Created new lookup

Use this as a source

select count("AUTO_NUM") as I from "CTL"

Than in import script

set mapping type to calculated
and use this calculation StrToInt(GetSystemVariable('LINENUMBER'))+StrToInt(GetVariable('<Check Sql Value>'))

Create package

Add Sql Data check and use lookup as source
Add import script

Join them together

Run the package

Mike
Attachments:
  • Page:
  • 1
  • 2
Time to create page: 0.19 seconds

Testimonials

"This [Visual Importer ETL] is such a great help. As expected, it has paid for itself within one week!"

Phill Stive,
Oracle DBA, OU,
Newcaste

User Login

You only need to log in or register to use our support forum



Our customers

BP

BBC

HSBC


Databases we work with

Go to top