database

How .NET Transactions are working on Sql Server Database When conducted a small analysis

I did a simple test to understand how transactions work in .net Sample code on which my transaction test was done is _sqlHelper = new SqlHelper(true); try { _sqlHelper.ExecuteNonQuery(SpName.sp_UpdateRoomStatus.ToString() , Parameters.SqlParam<int?>("DepartmentId", this.DepartmentId, SqlDbType.Int) ); _sqlHelp...

Execute raw SQL after connect to database

How can I execute raw SQL after connect to database? I need to run script once, after connect to DB. Thanks. UPD: question is not how to run raw SQL. ...

Import database from File PROGRAMMATICALLY?

Hi guys!! Is there a way to programatically import an entire database from a file with SQL?? (either .CSV , .SQL and .DB files are fine) Thanks!! EDITED AFTER TO CLARIFY: I am interested in a solution that is Database independent (has to works with all types of databases (Mysql, SQL Server, PostGres, Oracle...) ...

mysql timestamp convertion

What is the correct way to convert from mysql timestamp (YYYY-MM-DD HH:MM:SS) to my own chosen format, something like "August 5, 2010"? iow how can I make the mysql timestamp php date() compatible? ...

Efficient (PHP?) Filtering from MySQL with 3 Big tables

Hello all, I am working on a filtering section with "large" tables and performance (for SELECT) is of great concern. table_1 has 710,000 records and looks like this: (PK) game_id param_1 param_2 param_3 table_2 has 42,218,503 records and looks like this: (PK) set_id value_1 value_2 table_3 has 56,312,204 records and looks lik...

Wait message for slow JSF page

I have a jsf page having a request scope bean. A slow database query is fired in the constructor of the request scope bean. Then, the results of the query are shown in a jsf data table on the web page. How do I display a wait message until the database query completes? I tried calling a javascript function for onLoad of tag. The metho...

How to update a database used as a source of data by an Android app

I have an app which uses a large amount of data which has been compiled outside the app (on my main PC). The app is for my personal use so there are no complications with having to distribute data updates to other users. However, I am currently following a very convoluted and time-consuming procedure each time I want to update the data, ...

MySQL query for rows at specific time intervals

Hi, I am having some confusion with a mysql query. Any help appreciated. My current query: SELECT r.name , r.network , i.name , d.dtime , d.input FROM router AS r INNER JOIN interface AS i ON r.rid = i.rid INNER JOIN 1273118400_1_60 AS d ON i.id = d.id AND dtime BETWEEN 1273152000 AND 1273153800 WHERE i.status = "active" Now I am ...

Synchronizing client-server databases

I'm looking for some general strategies for synchronizing data on a central server with client applications that are not always online. In my particular case, I have an android phone application with an sqlite database and a PHP web application with a MySQL database. Users will be able to add and edit information on the phone applicat...

Questions about orders table for mulltiple items with multiple options

I am making a new database for an online store and Am trying to figure out how to do the orders table. There are multiple products and each product has many options. I am just wondering the best way to keep track of all this. I keep coming back to a table with all the options for all the items. This seems like a bad thing though. Does an...

How can I write a SQL statement to update a column in a table from another column in the same table?

I have an oracle DB where a program is writing into two columns when it updates the table. The 2nd column is based on the value from the 1st column. Well over time people have hand edited the database and forgot to insert values into the 2nd column. I'd like to write a simple sql statement that updates all columns and syncs the 2nd co...

Database access abstraction classes

Currently, I have a database access class named DB, which uses PDO. I Then have a handful of sub-classes for accessing each table: Users Images Galleries Text Videos This was nice when I first started my project, but now I'm not sure if it's that great, as I have a method for each database query that I use within each of these classe...

Retrieving an entity from GAE datastore by key

If I have the google assigned key of an entity in my datastore, say ag1iYXRjaC1nZW5lcmljchcLEgxCYXRjaGVzTW9kZWwiBUpvYiAyDA, is there a way I can easily fetch the entity by this key? I've tried using .get_by_id(), .filter('__key__=', 'ag1iYXRjaC1nZW5lcmljchcLEgxCYXRjaGVzTW9kZWwiBUpvYiAyDA') and can't seem to find anything that works. Any ...

how to insert multiple checkbox list values into database in single column using c#

i use this to select one checkbox to isselected column how i convert this to multi checkboxlist to single column i use many ways more than 3 days without success private void BindCheckBoxList() { DataTable dt = new DataTable(); SqlConnection connection = new SqlConnection(GetConnectionString()); try ...

Python DBM Module for Windows?

Hello, I would like to use the dbm module on my Windows machine, but it is currently only supported on Unix. http://docs.python.org/library/dbm.html Does anyone know of a similar module with similar syntax or a workaround to get dmb functional on windows? Being able to access a database written to the hard drive much like how I code to ...

Where to find info on ODBC SQL dialect/grammar, incl. built-in functions/operators?

I'm looking into writing a C++ database library that will run on top of either ODBC or on top of another library that itself uses ODBC (possibly DTL, OTL, or SOCI). At this point I need to know what SQL functions (MIN, MAX, AVG, EXISTS, IN, etc.) and operators (+, -, /, *, etc.) I'll have available through the ODBC SQL dialect without n...

good database design: enum values: ints or strings?

I have a column in a table that will store an enum value. E.g. Large, Medium, Small or the days of the week. This will correspond to displayed text on a web page or user selection from a droplist. What is the best design? Store the values as an int and then perhaps have a table that has the enums/int corresponding string in it. Just st...

ruby on rails: export and merge databases

I am currently working on a ruby on rails project with a MySQL-Database. Is there a way to export the database and merge it with another one? ...

Help - Insert into MySQL Database Using PHP

I'm trying to allow users to register with the site I am creating, however the code I am using is not working and I need you're help. $registerquery = mysql_query("INSERT INTO users (Username, Password, EmailAddress) VALUES('".$username."', '".$password."', '".$email."'"); Database: I only want to store the Username, Password and Em...

How do I fetch the last record in a MySQL database table using PHP?

I'm wanting to fetch the last result in MySQL database table using PHP. How would I go about doing this? I have 2 Columns in the Table, MessageID(auto) & Message. EDIT: I'm connected to the database. ...