database

Databases and DVCS

Hi Guys, I've recently asked a question about how suitable a DVCS is for the corporate environment, and that has sparked another question for me. One of the plus sides to a DVCS seems to be that you can easily branch and try out new things. My problem starts when I begin to think about database changes. I've always found it tricky to ...

Is there an database connectivity framework or library for PHP?

I wonder if there's a useful library or lightweight framework only for database connectivity. What I need is something that lets me use a MySQL database with prepared statements in a secure way, without thinking a lot about gcc_magic_quotes and stuff like that. Something object oriented would be nice to have, with some convenience when f...

Update a single object across multiple process in java

A couple of Relational DB tables are managed by a single object cache that resides in a process. When the cache is committed the tables are updated. The DB relational tables are updated by regular SQL queries and not anything more fancier like hibernate. Eventually, other processes got into the business of modifying this object without ...

How can I connect to an external database from a sql statement or a stored procedure?

When running a SQL statement or a stored procedure on a database, can you connect to an external database and pull data from there? something like: SELECT a.UserID, b.DataIWantToGet FROM mydb.Users as a, externaldb.Data as b ...

How to organize a database in Django with multiple, distinct apps?

I'm new to Django (and databases in general), and I'm not sure how to structure the following. The sources of data I'll have for my site are: a blog for a few different games: a high score list user-created levels If I were storing the data in ordinary files, I'd just have one file for each of the above. In Django, ideally (I think...

Storing UTF8 data in MySQL

When storing data in mysql using the UTF8 charset, does it make sense to escape entity characters when the data is being input or is it better to store it in raw form and transform it when pulling out? For instance, let's say someone enters a bullet () character into a text box. When saving that data, should it be converted to • b...

Comparison of database column types in MySQL, PostgreSQL, and SQLite? (Cross-Mapping)

I am trying to find some way to relate column types across the the most used Databases: MySQL, PostgreSQL, and SQLite. Here is what I have so far, but I'm afraid it's not done and I need some people with more experience to help me finish any missing types. MySQL PostgreSQL SQLite TINYINT SMA...

Most Executed Stored Procedure?

We created so many inefficient stored procedure in our application, we always postpone to make it more efficient until we have serious problem with database performance. Now, I am thinking to fix it one by one order by most often executed stored procedure. What is the best way to figure out which stored procedure is the most executed? ...

Can I also create new tables or edit table structures with ADOdb?

Does anyone know if this is possible when I use ADOdb? I need to create new tables and edit table structures programmatically (i.e. adding new columns or modifying existing columns). I'm going to use MySQL for sure. ...

matching fields in a database, ASP.net (VB)

In a table I have news posts with these fields: Title Content OwnerID And a users table ID Name Surname The OwnerID relates to the ID in the users table, how can I get the name of the user who's ID matches the OwnerID? I'm writing a website in ASP.net (VB). ...

How to format "time with time zone" in Postgres?

I have a database field of type time with time zone. How can I query this field in EST5EDT time zone with the output format hh:mm:ss? All I can find is using multiple calls to EXTRACT: SELECT EXTRACT(HOUR FROM TIME WITH TIME ZONE '20:38:40-07' AT TIME ZONE 'EST5EDT'); [Edit:] To be clear, this query: SELECT TIME WITH TIME ZONE '...

Sqlite3 Database versus populating Arrays

hi, I am working on a program that requires me to input values for 12 objects, each with 4 arrays, each with 100 values. (4800) values. The 4 arrays represent possible outcomes based on 2 boolean values... i.e. YY, YN, NN, NY and the 100 values to the array are what I want to extract based on another inputted variable. I previously ...

Do I need an ORM for simple related queries in PHP/CI?

I started my app very simply following the documentation videos for Codeigniter. I have the following tables: Account account_id name details Contact contact_id account_id name address Order order_id account_id contact_id date description Item item_id order_id description ...

Update doesn't work as should be in MySQL

echo $totalprice; echo "<br/>"; echo $shortfall; echo "<br/>"; echo $unitprice; echo "<br/>"; I got 24 80 0.3 Then the following command was executed. // update query However, only total_price was changed(became 0.00) while other values like unit_price stay unchanged. But other values like unit_price sh...

SQLAlchemy query

Hi there, I'm working on a web app and an db which deals with the following entities: computers, computer containers (computer_sets) and rules. It a firewall management tool. I'm having some troubles dealing with computer objects, because those computers stored within a computer_set are not the same objects as those computers not contain...

Use the same Django models across two different databases in the same app

I have a set of Django models that are used in two databases (i.e. syncdb was run against two databases from the same app). Both databases are for production services (one database contains on-demand "sandbox" build information and the other contains nightly build information). The problem is that I want to have one Django app that dis...

Getting current system time in SQL Server

how do i get current system time stamp in SQL Server. ...

Repositioning columns in DBGrid in Delphi

I need to dynamically change position of certain column in DBGRid. Let's say I need to place column number 21 on position 10. I use: DBGrid.Columns[21].Index:=10; But, this also changes the array itself, that means, that next time I want to access this column, I will need to write DBGrid.Columns[10], this makes it a little unclean, I ...

Database: Best practice - old data?

I have a database of automobile classified listings. After 90 days, the classified listing is no longer valid to be displayed (the listing expires); however, I want to retain the listing for archive purposes. Question: From a database design best practice perspective as well as query performance, is it better to keep the old listing A)...

How do you save data in MFC ?

I still remember in Delphi, developer can just make the UI(textbox, listbox...) directly connect to database, and then when user click a button, just call the post action, then the data will be saved automatically. What I want to know is that is there any similar mechanism in MFC? Or I can use GetDlgItem(...).Text and then use this v...