Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
How to insert multiple data in SqlLite with react native?

I tried to insert multiple data in my sqlLite table, but it does not work as intended.

This is my Create function:

function Create() {
    console.log("DBITEMS CREATED")
    db.transaction(tx => {
      tx.executeSql("CREATE TABLE IF NOT EXISTS DBITEMS(ID INTEGER PRIMARY KEY NOT NULL, DATE TEXT, HEURE TEXT, MINUTES TEXT)")
    });
  }

This is my Insert function:

function Insert(date) {

    let d = new Date(date)
    console.log('\nDATE:',date)

    var dString = d.toISOString().split('T')[0].toString()
    let heure = d.getHours().toString()
    let minutes = d.getMinutes().toString()

    db.transaction(tx => {
      tx.executeSql("INSERT INTO DBITEMS(DATE,HEURE,MINUTES) VALUES(?,?,?)", [dString,heure,minutes],(tx,result)=>{
        if (result.rows.length > 0) {
          console.log('Data Inserted Successfully...',date)
        } else console.log('Failed...')
      })
    })
  }

This is the console output:

DATE: 2022-03-15T16:35:36.626Z
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!