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

  • Home
  • SEARCH
  • 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 8815077
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T04:17:07+00:00 2026-06-14T04:17:07+00:00

Here’s a simple question about how to create a sequence with variables. I wanna

  • 0

Here’s a simple question about how to create a sequence with variables.
I wanna create a sequence using a combination of system time as it’s start value. How should I do that.

Here’s what I wrote:

DECLARE
  SQS number :=(sysdate - to_date('01-JAN-1970','DD-MON-YYYY')) * (864000);
  sql_stmt varchar2(200);
BEGIN
  sql_stmt := 'create SEQUENCE XXXX_id_seq MINVALUE  100000 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH :1 CACHE 500 NOORDER CYCLE';
  EXECUTE IMMEDIATE sql_stmt using SQS;
END;

but it says invalid num.
I know it’s a noobie question. but I really need help here.

  • 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-14T04:17:08+00:00Added an answer on June 14, 2026 at 4:17 am

    You can’t bind variables in DDL statements (I ain’t got doc or a good reason why, but quite a few references mentioning the fact), you’ve got to concatenate all in one.

    DECLARE
      SQS number :=(sysdate - to_date('01-JANV.-1970','DD-MON-YYYY')) * (864000);
      sql_stmt varchar2(200);
    BEGIN
      sql_stmt := 'create SEQUENCE XXXX_id_seq MINVALUE  100000 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH '||SQS||' CACHE 500 NOORDER CYCLE';
      EXECUTE IMMEDIATE sql_stmt ;
    END;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here are some facts about my app followed by a question My app has
Here a simple question : What do you think of code which use try
Here is the code: create table `team`.`User`( `UserID` bigint NOT NULL AUTO_INCREMENT , `Username`
Here is the script I'm using, copied directly from Google: <script type=text/javascript> var _gaq
Here is my SQL script CREATE TABLE tracks( track_id int NOT NULL AUTO_INCREMENT, account_id
I am reading a book about Javascript and jQuery and using one of the
Here is the code I'm using http://jsbin.com/evike5/edit When the jQuery UI dialog is fired
Here is a great article about GC may occur at unexpected point of code
Here is the code I'm using inside my AsyncTask DefaultHttpClient httpClient = new DefaultHttpClient();
Here's my procedure: DROP PROCEDURE IF EXISTS `couponExpires`$$ CREATE DEFINER=`root`@`localhost` PROCEDURE `couponExpires`(IN couponID BIGINT,

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.