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 7767381
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T15:39:45+00:00 2026-06-01T15:39:45+00:00

I am creating table like this: CREATE TABLE foobar (id uniqueidentifier, foo text, bar

  • 0

I am creating table like this:

CREATE TABLE foobar (id uniqueidentifier, foo text, bar text, PRIMARY  KEY (id))

How to insert or generate value for id field in table foobar?

  • 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-01T15:39:46+00:00Added an answer on June 1, 2026 at 3:39 pm

    You can argue that SQLite doesn’t support data types at all. In SQLite3, you can do this, for example.

    sqlite> create table test (id wibblewibble primary key);
    

    SQLite will happily create a column with the “data type” wibblewibble. SQLite will also happily create columns with the “data types” uuid, guid, and SuperChicken.

    The crucial point for you is probably how to automatically generate a uid. SQLite can’t help you much there.

    You can leave it entirely up to the client program. If you’re programming in python, use the uuid module. In ruby, you have the SecureRandom.uuid function. Other languages have similar features or workarounds.

    You can write your own uid-generating function in C. (See Create or Redefine SQL Functions.) I’d call this a relatively extreme approach.

    You can store it in either binary or text format.


    Other conversations online suggest that there’s a widespread misunderstanding about what a UUID is. A UUID is not simply a 128-bit random number. A UUID has structure and rules. See RFC 4122.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating a table with: CREATE TABLE movies ( id INT AUTO_INCREMENT PRIMARY KEY,
I am creating a temp table with a query like this: CREATE TEMPORARY TABLE
So I am creating a table from a view right now like this: CREATE
I'm creating two tables like this: CREATE TABLE abc ( id INTEGER NOT NULL
I'm creating a table that looks something like this. CREATE TABLE packages ( productCode
Let's say I'm creating a table foo with a column bar that should be
My code for creating the data table looks like this: myDataTable = new YAHOO.widget.ScrollingDataTable(
I've got a MySQL table that looks like this: CREATE TABLE my_facts ( `id`
I have two already-existing tables which look (in part) roughly like this: CREATE TABLE
I've a table which is defined like this CREATE TABLE [dbo].[MyTable]( [MyTableId] [bigint] IDENTITY(1,1)

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.