Search Results

Search found 31356 results on 1255 pages for 'database backups'.

Page 131/1255 | < Previous Page | 127 128 129 130 131 132 133 134 135 136 137 138  | Next Page >

  • sqlite error :/* SQL error or missing database */

    - by user262325
    Hello everyone I have a project in which I stored sqlite database file "data.sqlite3" to 'Group'&files'-'resource' Below are my viewcontroller source codes //-myviewcontroller.h #import "sqlite3.h" #define kFilename @"data.sqlite3" //myviewcontroller.m -(NSString *)dataFilePath { NSArray *paths = NSSearchPathForDirectoriesInDomains( NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; return [documentsDirectory stringByAppendingPathComponent:kFilename]; } -(void)f { if (sqlite3_open([[self dataFilePath] UTF8String],&database)!=SQLITE_OK) //dataFilePath returns ///Users/interdev/Library/Application Support/iPhone Simulator/User/Applications/095C6E05-4EAE-4817-883E-A72E39D439E0/Documents/data.sqlite3 { sqlite3_close(database); NSAssert(0,@"Failed to open database");//no problem } NSString *query = @"SELECT * FROM table1 ORDER BY ROW";//table1 is table name sqlite3_stmt *statement; NSInteger v=sqlite3_prepare_v2( database, [query UTF8String], -1, &statement, nil); NSString *zs= [NSString stringWithFormat:@"%d",v]; NSLog(@" The buttontitile is %@ ",zs); if ( v == SQLITE_OK) { // ... } I checked value of v in log, it always is 1 #define SQLITE_ERROR 1 /* SQL error or missing database */ I do not know why this happened.

    Read the article

  • How can I efficiently retrieve a large number of database settings as PHP variables?

    - by Steven
    Currently all of my script's settings are located in a PHP file which I 'include'. I'm in the process of moving these settings (about 100) to a database table called 'settings'. However I'm struggling to find an efficient way of retrieving all of them into the file. The settings table has 3 columns: ID (autoincrements) name value Two example rows might be: 1 admin_user john 2 admin_email_address [email protected] The only way I can think of retrieving each setting is like this: $result = mysql_query("SELECT value FROM settings WHERE name = 'admin_user'"); $row = mysql_fetch_array($result); $admin_user = $row['value']; $result = mysql_query("SELECT value FROM settings WHERE name = 'admin_email_address'"); $row = mysql_fetch_array($result); $admin_email_address = $row['value']; etc etc Doing it this way will take up a lot of code and will likely be slow. Is there a better way? Thanks.

    Read the article

  • Can it be a good idea to create a new table for each client of a webapp?

    - by Will
    This is semi-hypothetical, and as I've no experience in dealing with massive database tables, I have no idea if this is horrible for some reason. On to the situation: Imagine a web based application - lets say accounting software - which has 20,000 clients and each client has 1000+ entries in a table. That's 20 million rows which I know can certainly slow down complex queries. In a case like this, does it make more sense to create a new table in the database for each client? How do databases react to having 20k (or more!) tables?

    Read the article

  • Example of user-defined integrity rule in database systems?

    - by Pavel
    Hey everyone. I'm currently preparing for my exams and would like to know some examples of user-defined integrity rule in database systems. As far as I understand, it means that I can set up certain conditions for the columns and when data is inserted it needs to fulfill these conditions. For example: if I set up a rule that an ID needs to consist of 5 integers ONLY then when I insert a row with ID which is made up of integers and some chars then it won't accept it and return an error. Could someone confirm and give me some opinion on that? Thank you very much in advance!

    Read the article

  • How does Google store search trends in backend?

    - by Achshar
    Google trends shows what query has been searched how many times and some other properties of the said query. But how is this data stored in a database? Storing a new row for every search does not seem right. They also tell the query on a time graph, so they must have some way to look for individual searches made by users, but the number of queries they get every day, it does not feel right that they would store every search in a database row along with a time-stamp. This does not apply to just Google trends or Google in general but any other big site that gets awful number of queries and then has tools to see them in depth. I am not an expert on this but I am interested to know some high level structure of how things work behind the scenes.

    Read the article

  • How do I display and calculate numbers from a database on iPhone?

    - by JoshD
    I am new to designing apps and have a basic understand of Ob-C and how everything works. What I would like to do is have two tabs, one is a home screen that displays numbers and percentages that are entered on the second tab. The user will be able to store that information and refer back to it and update it. What is the best way to complete that math from the database to the "home screen"? Any tutorials, advice is great! Thanks.

    Read the article

  • How to migrate Django models from mysql to sqlite (or between any two database systems)?

    - by Daphna Shezaf
    I have a Django deployment in production that uses MySQL. I would like to do further development with SQLite, so I would like to import my existing data to an SQLite database. I There is a shell script here to convert a general MySQL dump to SQLite, but it didn't work for me (apparently the general problem isn't easy). I figured doing this using the Django models must be much easier. How would you do this? Does anyone have any script to do this?

    Read the article

  • Dynamic access to tables from another database inside an user function

    - by Alberto Martinez
    I have an user defined table function in SQL Server that aggregate data from several tables including a couple of tables of another database. That is done hardcoding the name of the database in the queries, but we want to make the database name configurable (because our databases usually share the server with the databases of other applications). I tried to construct a dynamic query string inside the function using the database name that is stored in a configuration table, but: When I tried exec(@sqlStatement) SQL Server said that execute string is not allowed inside a function. Then I tried exec sp_executesql @sqlStatement and the function was created, but when you execute it SQL Server says that inside a function you can only run extended functions and procedures. So the question is: is possible create a function or stored procedure that access a table in another database without having to recreate the function when the database name is different? TIA.

    Read the article

  • One Database or Ten?

    - by merrillaldrich
    In my career to date I’ve worked as a DBA for mainly “buy don’t build” scenarios. One advantage - and hair-graying problem, if I am honest - has been that I think I’ve seen upward of one or two hundred different ISV-provided applications’ SQL Server databases. It’s a great learning opportunity, as I can see successes and failures in a large variety of designs, and sort of “fast-forward” to version five or eight of a given design pattern to see things like whether it scales, or has storage problems,...(read more)

    Read the article

  • How to design a database schema for storing text in multiple languages?

    - by stach
    We have a PostgreSQL database. And we have several tables which need to keep certain data in several languages (the list of possible languages is thankfully system-wide defined). For example lets start with: create table blah (id serial, foo text, bar text); Now, let's make it multilingual. How about: create table blah (id serial, foo_en text, foo_de text, foo_jp text, bar_en text, bar_de text, bar_jp text); That would be good for full-text search in Postgres. Just add a tsvector column for each language. But is it optimal? Maybe we should use another table to keep the translations? Like: create table texts (id serial, colspec text, obj_id int, language text, data text); Maybe, just maybe, we should use something else - something out of the SQL world? Any help is appreciated.

    Read the article

  • database independent coding framework options?

    - by statirasystems
    Background: I have not programmed in a while besides doing VBA and a little VB.NET. So please forgive my language use. I'm green and have a head cold. I am reading all I can now, but I have no programming circles to draw from. The information I am providing is to help guide you to what I am looking for. I am not confident I can ask the question properly. Story: I have four different projects that I am starting. Obviously I won't be working on all at the same time however they each will have similar needs and be inter related. They are as follows: Desktop Environment/System User Interface - basically a product that runs on major computers via mono or .net that unifies the look and functions. In the context of the up coming question it would be able to directly access data of various types. It would work in tandum with my office suite, system manager, and network application framework. Office Suite - technically it would not be a suite since I will be doing it from one interfacel except for the Communications Application. As far as the question, it will need to be able to link to various data sources for storing files and using, manipulating, and presenting information. System Manager - an intellegent system to manage and administer the entire network and all equipment. As far as the question, needs to be able to access data for archiving and and for accessing it's own settings stored in various formats, sql or xml. Network Application Framework - A complete system that can be used for ERP, CRM, CMS, Errata, File Management, and so on. As to the question to be able to access it's own or interlink with existing applications. Requirement: C#, Simplifies and reduces coding, use the same code to access diffent databases(ie MySQL, MS SQL, ACCESS, XML, ...), Mono would be nice but not a must, Question: What librarys, frameworks, or other options would be able to help with this? Is there a good resource to guide me? I don't want arguing over what is best, just information to help me further understand and make an educated decision.

    Read the article

  • PHP class data implementation

    - by Bakanyaka
    I'm studying OOP PHP and have watched two tutorials that implement user login\registration system as an example. But implementation varies. Which way will be more correct one to work with data such as this? Load all data retrieved from database as array into a property called something like _data on class creation and further methods operate with this property Create separate properties for each field retrieved from database, on class creation load all data fields into respective properties and operate with that properties separately? Then let's say I want to create a method that returns a list of all users with their data. Which way is better? Method that returns just an array of userdata like this: Array([0]=>array([id] => 1, [username] => 'John', ...), [1]=>array([id] => 2, [username] => 'Jack', ...), ...) Method that creates a new instance of it's class for each user and returns an array of objects

    Read the article

  • Normalize database or not? Read only MyISAM table, performance is the main priority (MySQL)

    - by hello
    I'm importing data to a future database that will have one, static MyISAM table (will only be read from). I chose MyISAM because as far as I understand it's faster for my requirements (I'm not very experienced with MySQL / SQL at all). That table will have various columns such as ID, Name, Gender, Phone, Status... and Country, City, Street columns. Now the question is, should I create tables (e.g Country: Country_ID, Country_Name) for the last 3 columns and refer to them in the main table by ID (normalize...[?]), or just store them as VARCHAR in the main table (having duplicates, obviously)? My primary concern is speed - since the table won't be written into, data integrity is not a priority. The only actions will be selecting a specific row or searching for rows that much a certain criteria. Would searching by the Country, City and/or Street columns (and possibly other columns in the same search) be faster if I simply use VARCHAR?

    Read the article

  • Designing a hierarchical structure with lots of reads and writes?

    - by JD01
    I am in the process of working on a video on demand system part of it involves the management of a hierarchical tree structure (think windows explorer) which allows users to upload videos, move folders around, create new folders etc. User action will be allowed depending on which permissions they have. In addition to managing the structure (creating folders and uploading videos), subscribers will be viewing content (read access). The number of reads will be significantly more than the writes. My question (and it is big one) is should I store the data in a database (for the writes) and also have some sort of cache which will be used for the reads? or do I use two databases? or is there a better solution? Also I will have to resolve concurrency issues which I think optimistic locking on the database will resolve. I have a fair bit about CQRS over the last few months but not sure if this is the way to go. Any ideas?

    Read the article

  • MySQL Access in Php to a database created in C-Panel

    - by Rhys Drury
    Basically, i'm having trouble connecting to a mysql database using a php web page. I created the database in C-panel using the wizard i'm connecting like this $db_host = "localhost"; //your host Database address $db_username = "xxxx"; //your account username $db_pass = "xxxxx"; //your account password $db_name = "xxxxx"; //your database name @mysql_connect("$db_host","$db_username","$db_pass") or die ("could not connect to mysql"); @mysql_select_db("$db_name") or die ("no database"); But all my page seems to do is trigger the " could not connect to mysql" my page does have wordpress installed at the minute but I'm planning to get rid of it as I'm creating my site myself. I'm just baffled why it can't connect, because in Phpmyadmin ( a feature on C-panel) it says the database is in localhost.

    Read the article

  • (database) im trying to create a form in access 2007 with 2 drop down boxes to view a report by state or name

    - by jeff orris
    im an intern at a database mngmt company and the boss is training me in access...i took the access tutorials and were definitely not enough info involved to do a what seems a simple task.my problem is this: i have a simple table with contact info with 16 colums (Local_Utility, Requested_User_Type, First_Name, Last_Name, Address 1, Address 2, Country, State, City, Zip, Phone_Number, Username\Email, Password, Confirm Password, and Parcel_Number), with 6 rows of names (keep in mind this is just a test to help me from the boss) I created a form and with 2 drop down boxes (Last Name and State) and im trying to create a view button to view an individual report for a query i made for just simple contact info with 6 colums (Last_Name, First_Name, Address1, City, State, and Phone_Number) Problem1 is that i can view the query with the view by name or state button but cant view a simple individual report from the query using the button Problem2 is that for criteria on the query i put Forms!frmMyparamForm!txtMyStateParamField for the state drop box it works, but when i use Forms!frmMyparamForm!txtMyNameParamField it doesnt and that annoying parameter box pops up Problem3 is that after i close the query, all the states and names in my dropdown box on the form disappear Im a beginner at this please help me

    Read the article

  • Time for creation of database on site

    - by slo2ols
    Hi. When and where would you create database to develop web site using ASP.NET MVC 2 and Entity Framework 4 (CreateDatabase method). I think about first run of web site and redirect on welcome page, when controller creates database from model. But I doubt about details: 1. Where? In HttpModule, but request of any image or css will check that database exist. In custom RouteHandler, but then anybody need to know that need to use this handler when to add route. In BaseController, but then code will look like SomeController(..., IDatabase database) : base(database). 2. When? Better create database on first run by any url or may be on deployment of site (additional tool which create ObjectContext and invoke CreateDatabase)? Thanks.

    Read the article

  • Is there any reason I shouldn't do database calls from the destructor?

    - by ryeguy
    I want to create a sort of datamapper library, where you'd do something like this: $users = Users::getTable(); $users->add($newUser1); $users->add($newUser2); Now $users contains 2 user records, but they aren't yet persisted to the database. To be efficient, I'd like to flush them all at once. I would like to have a flush() method to do this (not an issue), but I'd also like for it to happen implicitly when the $users table reference falls out of scope. Is there any reason I shouldn't do this in the destructor?

    Read the article

  • How do database servers decide which order to return rows without any "order by" statements?

    - by Chris
    Kind of a whimsical question, always something I've wondered about and I figure knowing why it does what it does might deepen my understanding a bit. Let's say I do "SELECT TOP 10 * FROM TableName". In short timeframes, the same 10 rows come back, so it doesn't seem random. They weren't the first or last created. In my massive sample size of...one table, it isn't returning the min or max auto-incrementing primary key value. I also figure the problem gets more complex when taking joins into account. My database of choice is MSSQL, but I figure this might be an interesting question regardless of the platform.

    Read the article

  • how to make a simple database app in android?

    - by Iakovl
    i am not an android developer, prefer C# but i want to play with andorid a bit since i have a android device, apologize in advance for it. i want to make a simple app in android with the basic CRUD functions (create, read, update and delete) while the basic option is to use SQLiteOpenHelper i've seen DAO generators (like greenDAO) that make life more simple as i see it. so the first question is what DAOgenerator to use (if it all)? next is how to properly show it, while i know i need listview i still don't figure out exactly how to bind the database to it and to the querys i'll make for proper display each time i make a new query from a "search" screen, to the main "list display" screen

    Read the article

< Previous Page | 127 128 129 130 131 132 133 134 135 136 137 138  | Next Page >