database

How can I create an email newsletter by taking objects from a database?

Well, I'm trying to create a newsletter, that will send emails to users in a database. The newsletter itself would draw "events" and other activities from a database. Whats the best way to take that list, and put them in an email? I was thinking about putting them into an html page, then sending an html email, but not all emails support...

Magento - get list of items from orders for specific date range

Magento database name convention is not trivial. How to get these fields below for last 7 days? Last Name First Name Address City State Zip Phone Email Amount Order # Item # ...

PDO::PARAM for type decimal?

I have 2 database fields `decval` decimal(5,2) `intval` int(3) I have 2 pdo queries that update them. The one that updates the int works ok $update_intval->bindParam(':intval', $intval, PDO::PARAM_INT); but I can't update the decimal field. I've tried the 3 ways below, but nothing works $update_decval->bindParam(':decval', $decval...

Comparison of databases on the performance of Ruby on Rails

It is well-known that Ruby on Rails offers a list of choice on database adapters, like MySQL, PostgreSQL, Sqlite, MSSQL, Oracle, DB2. All of them offers the same basic set of SQL on CRUD. Is there any comparison on their performance when running a typical Ruby on Rails application? ...

creating large database 10gb for informix

creating large database 10gb for informix ...

How to determine Delphi DBGrid Row Count

I have a DBGrid that shows a filtered view of a dBASE table. DBGrid has a property called RowCount but is marked private. How do I determine the row count? All I really need to know, is whether the count is more than zero. Using delphi Turbo Professional ...

SQL for Opening Hours

Hi, In my shops database I need to have the opening hours. Do you have an idea how i can implement this in my dB? The opening hours are from Monday to Sunday, each day can have 2 opening windows (ex 09:00-12:00, 16:00-19:00) ...

mysql PDO how to bind LIKE

In this query select wrd from tablename WHERE wrd LIKE '$partial%' I'm trying to bind the variable '$partial%' with PDO. Not sure how this works with the % at the end. Would it be select wrd from tablename WHERE wrd LIKE ':partial%' where :partial is bound to $partial="somet" or would it be select wrd from tablename WHERE w...

MySQL slow query

SELECT items.item_id, items.category_id, items.title, items.description, items.quality, items.type, items.status, items.price, items.posted, items.modified, zip_code.state_prefix, zip_code.city, books.isbn13, books.isbn10, books.authors, books.publisher FROM ( ( items LEFT JOIN bookitems ON items.item_id = bookitems.ite...

How to check the existance of multiple IDs with a single query

Hey there I'm trying to find a way to check if some IDs are already in the DB, if an ID is already in the DB I'd naturally try to avoid processing the row it represents Right now I'm doing a single query to check for the ID, but I think this is too expensive in time because if I'm checking 20 id's the script is taking up to 30 seconds ...

NHibernate : delete error

Hi, Model: I have a model in which one Installation can contain multiple "Computer Systems". Database: The table Installations has two columns Name and Description. The table ComputerSystems has three columsn Name, Description and InstallationId. Mappings: I have the following mapping for Installation: <?xml version="1.0" encoding=...

Action Controller: Exception - ID not found

Hi Everyone, I am slowly getting the hang of Rails and thanks to a few people I now have a basic grasp of the database relations and associations etc. You can see my previous questions here: http://stackoverflow.com/questions/2714621/rails-database-relationships I have setup my applications models with all of the necessary has_one and...

JavaDB/Derby Error 08006

In the article Using Java DB in Desktop Applications the Address Book demo have a method disconnect which have a try-catch block that catch and ignores the exception. If you add a printStackTrace you can see that the exception always occur. What's wrong here? The JavaDB should not throw this exception, or they should fix something in th...

MYSQL update query php

I am trying to use an update query to change values held in a database, the new values I am trying to store are held in php variables. I'm not sure what it is I'm doing wrong. mysql_query("UPDATE user SET status='full' WHERE user_id = '$user_id'")or die(mysql_error()); here is the error message Duplicate entry '91317691' fo...

make field a dropdown in access 2007

I'm creating a HR database in access 2007 I have a main table of employee info and several tables that relate to that table ( education for example) that list the acceptable elements that can populate that cell in that row When i create a form it was created as just a plain text field which is constrained but I wanted to create a dropd...

Where are all the native revisioned databases?

I've read all the SO questions, the Coding Horror articles, and Googled my brains off searching for the best ways to revision control data. They all work and they all have their appropriate implementations based on use cases and so on. What I really want to know is why hasn't a database been written to natively support revisioning on the...

How do I add a one-to-one relationship in MYSQL?

+-------+-------------+------+-----+---------+-------+ | Field | Type | Null | Key | Default | Extra | +-------+-------------+------+-----+---------+-------+ | pid | varchar(99) | YES | | NULL | | +-------+-------------+------+-----+---------+-------+ 1 row in set (0.00 sec) +-------+---------------+------+-----+...

how can I save/keep-in-sync an in-memory graph of objects with the database?

Question - What is a good best practice approach for how can I save/keep-in-sync an jn-memory graph of objects with the database? Background: That is say I have the classes Node and Relationship, and the application is building up a graph of related objects using these classes. There might be 1000 nodes with various relationships be...

Why does Schema Compare in Visual Studio 2010 show differences when there are none?

I had hoped that Visual Studio 2010 would have brought some improvements to the Schema Comparison function. I suspect there are some, but I can't get something basic working. I've sucked in a schema from a SQL Server 2005 database. Then to assure things were working, I did a schema compare choosing the database as the source and my sc...

Porting join from Oracle to Postgres

INSERT INTO MISSION_OBJECTIVE( MSN_INT_ID, MO_INT_ID, MO_MSN_CLASS_NM, MO_MSN_CLASS_CD, MO_MSN_TYPE, MO_PRIORITY, MO_COMMENT, MO_START_DT, MO_END_DT, ASP_AIRSPACE_NM, MO_OBJ_LOCATION, MO_ALO_LEG_ID, MO_ALO_ARRIVE_LOC) SELECT '1025', '1', 'AIRDROP', 'ADP', 'LAPES', NULL, COALESCE( NULL, ' '), TO_TIMESTAMP( '1002260900', 'YYMMDDHH24MI'), T...