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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:10:56+00:00 2026-06-11T18:10:56+00:00

I have a table with the following column structure: sqlite> create table stocks(stockticker varchar(4),

  • 0

I have a table with the following column structure:

sqlite> create table stocks(stockticker varchar(4), tradedate date, open double, high double, low double, close double, volume integer, adjclose double);

What I want to do is save daily stock data for a group of stocks into this one table but populate it with whatever historical data that currently exists. So I saved the historicals for XLI from yahoo/finance into a file called XLI.csv

In mySQL I use to be able to do the following:

sqlite> LOAD DATA INLINE 'XLI.csv'
   ...> INTO TABLE stocks
   ...> FIELDS TERMINATED BY ','
   ...> LINES TERMINATED BY '\n'
   ...> IGNORE 1 LINES
   ...> (@tradedate, open, high, low, close, volume, adjclose)
   ...> SET stockticker = 'XLI',
   ...> tradedate = STR_TO_DATE(@tradedate, '%m/%d/%Y');
Error: near "LOAD": syntax error
sqlite>

Now I understand SQLITE has many differences but I am a newbie and all the examples I have found typically have the following command structure:

sqlite> .import <filename> <table>

This does not help me because I need to also set the ‘stockticker’ field, ignore the first line (headers) and ensure the date is imported correctly. I haven’t found any examples in the documentation or on the internet that shows something like what I want to do.

I would kindly appreciate your help.

  • 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-11T18:10:57+00:00Added an answer on June 11, 2026 at 6:10 pm

    import the raw data into a staging table, then select the contents into the tick table (add a where condition to ignore the values from the first line)

    to convert the date string, you can create a valid sqlite date string (e.g.: yyyy-mm-dd) by re-arranging the original date string and insert that into the destination date column.

    insert into tick (stockticker, tradedate, open, high, low, close, volume, adjclose)
      select stockticker, (substr(date, 7) || '-' || substr(date, 1, 2) || '-' || substr(date, 4, 2)),
      open, high, low, close, volume, adjclose from stage
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an sqlite table with the following structure: String CREATE_ACHIEVEMENTS_TABLE = CREATE TABLE
I have a table structure like the following: table a: id int name varchar
I have a table in Oracle 10 with following structure Create Table Bookmarks( BOOKMARKID
I have another rather curious problem. I have the following structure: CREATE TABLE [dbo].[Event]
I have one web application, having one table in oracle10g having following structure: Column
I have the following database structure: CREATE TABLE `author` ( `id` int(10) unsigned NOT
I am using MySQL 5.0. I have table with following structure and data. CREATE
I have following table structure there is column vid in that i want entry
I have a hierarchical (tree structure) SQL Server table TEmployee with following columns Id
i have a table that has following column Type -------- type 1 type 2

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.