Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8972735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T18:17:17+00:00 2026-06-15T18:17:17+00:00

I am trying to import an excel spreadsheet into Oracle using Toad. The gotcha

  • 0

I am trying to import an excel spreadsheet into Oracle using Toad. The gotcha is that the table I am importing into has a primary key field that I use a “sequence”.nextval to populate in a normal stored procedure insert.

Using the Toad import wizard, I tried putting in ‘table_seq.nextval’ as an expression but when I execute the wizard at the end I get the error: Could not convert variant of type (UnicodeString) into type (Double).

So is it possible to import Excel data using sequence.nextval with the Toad import wizard or is there a better way?

I also gave some thought to just letting Excel generate the key by starting the seed beyond what is currently in the table. But being new to Oracle, would this mess-up the sequence I have setup for the table? For example, if before the insert, the next available ID is say 500 and the inserts from Excel inserted rows from 500 to 5000, would the next execution of a stored procedure for that table’s sequence try to use 500?

Thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T18:17:18+00:00Added an answer on June 15, 2026 at 6:17 pm

    Yes, the sequence will remain at 50, and you’ll get primary key violated exception when using stored procedure.

    That’s because sequences are not linked to tables in any way. And cannot be linked. They are separated objects.

    The best approach I see is to use a trigger on insert for each row which will set the id to nextval.

    Code example:

    CREATE OR REPLACE TRIGGER trg_table_name_set_id
      BEFORE INSERT 
      ON table_name
      FOR EACH ROW
    BEGIN
    
      SELECT table_seq.nextval INTO :new.id FROM DUAL; --id would be the id column in your table
    
    --or, if you are on 11g, simply
    --:new.id := table_seq.nextval;
    
    END trg_table_name_set_id;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to import an excel file into a data table using GemBox
I am using VS2005 C#, I am trying to import an excel filesheet into
I am trying to import data from excel into a datatable using c#. Here
I have a table that contains data that I am trying to import into
I'm trying to import data from an excel spreadsheet into a SQL Server 2008
I'm trying to import an excel file Excel97-2003 (the first sheet only) into an
I am trying to import data from excel file (.xlsx) into sql database, my
im trying to import html table data to an excel file and have succeeded
I'm trying to use SqlBulkCopy as per the example in Import Excel Spreadsheet Data
I'm trying to import a spreadsheet to our database using SSIS. For some reason

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.