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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T02:55:06+00:00 2026-06-05T02:55:06+00:00

I am using phonegap to access the phone database. But my create process calls

  • 0

I am using phonegap to access the phone database. But my create process calls everytime the error routine with error code: 5 and message: non an error?

Isn’t it possible to execute multiple sql statements in one transaction?

SQLite Expert couldnt find an syntax error…

createDB: function(error, success) {
        if(typeof error != 'function') error = this.errorDB;
        if(typeof success != 'function') success = this.successDB;
        sql = "DROP TABLE IF EXISTS `boiler`; "
            +"CREATE TABLE IF NOT EXISTS `boiler` ( "
            +" `id` int NOT NULL, `object` int NOT NULL, `number` varchar(100) NOT NULL, "
            +" `volume` double DEFAULT NULL, `brand` varchar(100) DEFAULT NULL, `year` year(4) DEFAULT NULL, "
            +" `price_before` float NOT NULL DEFAULT '0', `price_after` float NOT NULL DEFAULT '0',  `description` TEXT DEFAULT NULL, "
            +" `img1` varchar(200) DEFAULT NULL, `img2` varchar(200) DEFAULT NULL, `img3` varchar(200) DEFAULT NULL, "
            +" `img4` varchar(200) DEFAULT NULL, `img5` varchar(200) DEFAULT NULL,  `img6` varchar(200) DEFAULT NULL, "
            +" `img7` varchar(200) DEFAULT NULL, `img8` varchar(200) DEFAULT NULL, `img9` varchar(200) DEFAULT NULL, "
            +"PRIMARY KEY (`id`)); "

            +"DROP TABLE IF EXISTS `counter`; "
            +"CREATE TABLE IF NOT EXISTS `counter` ( "
            +" `number` varchar(100) NOT NULL, `object` int NOT NULL, `type` tinyint NOT NULL DEFAULT '0', "
            +" `value` double DEFAULT NULL, `access` varchar(100) DEFAULT NULL, "
            +"PRIMARY KEY (`number`)); "

            +"DROP TABLE IF EXISTS `link`; "
            +"CREATE TABLE IF NOT EXISTS `link` ( "
            +" `id` int NOT NULL, `boiler` int NOT NULL, `name` varchar(100) DEFAULT NULL, "
            +" `units` tinyint DEFAULT NULL, `price` float NOT NULL DEFAULT '0', "
            +"PRIMARY KEY (`id`)); "

            +"DROP TABLE IF EXISTS `manager`; "
            +"CREATE TABLE IF NOT EXISTS `manager` ( "
            +" `id` int NOT NULL, `company` varchar(100) DEFAULT NULL, `name` varchar(100) NOT NULL, "
            +" `phone` varchar(15) DEFAULT NULL, "
            +"PRIMARY KEY (`id`)); "

            +"DROP TABLE IF EXISTS `object`; "
            +"CREATE TABLE IF NOT EXISTS `object` ( "
            +" `id` int NOT NULL,  `state` tinyint NOT NULL DEFAULT '0', `user` varchar(50) DEFAULT NULL, "
            +" `date` char(15) DEFAULT NULL,  `street` varchar(100) DEFAULT NULL, `number` varchar(16) DEFAULT NULL, "
            +" `zip` char(5) DEFAULT NULL, `city` varchar(100) DEFAULT NULL, `manager` int NOT NULL DEFAULT '0', "
            +" `units` int NOT NULL DEFAULT '0', "
            +"PRIMARY KEY (`id`));";
        console.log(sql);
        this.DB.transaction(function (tx) { tx.executeSql(sql); }, error, success);
    },
  • 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-05T02:55:07+00:00Added an answer on June 5, 2026 at 2:55 am

    don’t know the error code: 5 but you can execute the multiple sql statements

             // Wait for PhoneGap to load
    
                document.addEventListener("deviceready", onDeviceReady, false);
    
                // PhoneGap is ready
    
                function onDeviceReady() {
                    var db = window.openDatabase("Database", "1.0", "PhoneGap Demo", 200000);
                    db.transaction(populateDB, errorCB, successCB);
                }
    
                // Populate the database 
    
                function populateDB(tx) {
                     tx.executeSql('DROP TABLE IF EXISTS DEMO');
                     tx.executeSql('CREATE TABLE IF NOT EXISTS DEMO (id unique, data)');
                     tx.executeSql('INSERT INTO DEMO (id, data) VALUES (1, "First row")');
                     tx.executeSql('INSERT INTO DEMO (id, data) VALUES (2, "Second row")');
            //here you can do  multiple sql statements.
                }
    
                // Transaction error callback
    
                function errorCB(err) {
                    alert("Error processing SQL: "+err);
                }
    
                // Transaction success callback
    
                function successCB() {
                    alert("success!");
                }
    

    link here

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

Sidebar

Related Questions

I made a database using phonegap[cordova 1.7.0] sqlite on IOS5. But I now want
I want to build a phone app using phonegap that can access data on
I have created sqlite database using phonegap. I am able to access that databse
How can I get access to the iPhone clipboard whilst using PhoneGap? I cannot
I'm using phonegap to get an accelerometer's value and print it, but I'm not
I am using phoneGap framework to create mobile application . and i am putting
I'm using PhoneGap to develop a Windows Phone 7 app. I'm trying to call
I am looking at using phonegap to create a mobile app that accesses a
I'm using PhoneGap 1.4.1 to create an iPhone application. I can successfully perform the
I'm using PhoneGap + Xcode to create an app. Is there any way I

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.