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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:56:06+00:00 2026-06-13T01:56:06+00:00

I want to save database file in Documents Directory instead of /Library/Private Documents folder

  • 0

I want to save database file in Documents Directory instead of /Library/Private Documents folder using Titanium APIs.

var database = Titanium.Database.install('/db/Database.sqlite',DatabaseHandler.DB_NAME);

And it is getting saved into

iPhone Simulator/5.0/Applications/B750AD49-5879-4ABD-B903-C76A03833BE4/Library/Private Documents/Database.sql

whereas we are requiring it in

iPhone Simulator/5.0/Applications/B750AD49-5879-4ABD-B903-C76A03833BE4/Documents/dbDir/Database.sql

or

iPhone Simulator/5.0/Applications/B750AD49-5879-4ABD-B903-C76A03833BE4/Documents/Database.sql

The basic requirement is, we don’t want the user’s data lost on new app updates. On new app updates from App Store, only document directory data is saved, and rest all data is deleted.

And if I am manually moving db file with :

if(Ti.Platform.osname === 'iphone'){
  var dbFile = database.file;
  var filePath = String.format('%s/%s.sql',dbDir.resolve(),DatabaseHandler.DB_NAME);
  Ti.API.info(filePath);
  var result = dbFile.move(filePath);
  Ti.API.info(result);   
}

Then on running application, I am getting issue with message :

message = “invalid SQL statement. Error Domain=com.plausiblelabs.pldatabase Code=3 \”An error occured parsing the provided SQL statement.\” UserInfo=0x9c14ed0 {com.plausiblelabs.pldatabase.error.vendor.code=1, NSLocalizedDescription=An error occured parsing the provided SQL statement., com.plausiblelabs.pldatabase.error.query.string=SELECT * FROM UserProfile, com.plausiblelabs.pldatabase.error.vendor.string=no such table: UserProfile} in -[TiDatabaseProxy execute:] (TiDatabaseProxy.m:186)”

  • 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-13T01:56:07+00:00Added an answer on June 13, 2026 at 1:56 am

    How are you opening the database?

    If you are using Ti.Database.open(‘MyDatabase’) since you moved it to another location, it is creating a blank database called ‘MyDatabase’ in the default location. The location your original install of the database occurred. From what I understand this is the default functionality of Ti.Database.open. If the database isn’t there, then create it. Since this database is new and has no tables in it, it is going to say that the table UserProfile doesn’t exist.

    I don’t know if there is a way for you to qualify the location of the database in the Ti.Database.open call. For example, I don’t know if

    Ti.Database.open('/iPhone Simulator/5.0/Applications/B750AD49-5879-4ABD-B903-C76A03833BE4/Documents/dbDir/MyDatabase')
    

    will work or not. You need to tell the open call where the database is located, since you moved it from the location it expects to find it. Perhaps this isn’t the case, but your example code doesn’t show your usage of the database, rather it shows how you managed the moving of the file around.

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

Sidebar

Related Questions

I want to save data from my database into xml file. I am using
I want to save a pdf and mp3 file(s) to a SQL Server database
I want to save my currently database on localhost to file. I am trying
I want to save records fetched from database in an XML file, take x
I want to save many pictures into a SQL Server database file. How can
I want to save some specific records from a database to a file, thus:
I have a url which I want to save into the MySQL database using
I want to save Image in Database with JSON web service .without image data
i want to save current date+time into database and also want to retrieve it.
I want to save my countries local time(new zealand) in my database. I am

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.