I have a trigger that executes a function on table insert or update. It looks like this:
CREATE OR REPLACE FUNCTION func_fk_location_area()
RETURNS "trigger" AS $$
BEGIN
IF EXISTS (
-- there was a row valid in area when location started
SELECT * FROM location
WHERE NOT EXISTS (
SELECT * FROM area...
I'm having an issue with a new application on the iPhone SDK using SQLite as the DB backend.
Occasionally, my app will stop loading data to my UITableViews and after downloading the device DB via the Organizer I can access the SQLite DB via the command line. I can query certain tables fine but not others without getting an "SQL error: ...
Hi Everyone,
Anyone know where sites like amazon and ebay get their product specifications from? Surely they don't all have a large database of specifications for every product.
I could do with one for cameras that I can plug into my site.
Thanks
...
Hi,
I am really struggling to normalise a Client Meeting form.
The details are as follows
Client_Name, Client_phone (Normalised)
Date, Time, Location, Person_met, location, key_notes, Staff (repeating groups)
In 1st NF, I know the Client_Name (given a client_ID key) would be the foreign key in the repeated group, but I don't know w...
Hello,
I'm completely new with Symfony and Doctrine. I have generated a project with a the Doctrine ORM, my database schema is fully well generated.
Now I just want to create basic services (in simple .php pages) that do some actions according to parameters in a HTTP POST request.
I tried to create an app through the generate:app comma...
I am extensively using H2 database for my project (lots of inserts and selects) and I have noticed that in the database directory appear binary files which have the name:
database.xx.log.db.corrupt, where xx - a number.
Does anybody know if there are possibility to understand what this file stands for and why it appears?
...
In general, is it better to store raw data with pre-calculated values in the database and concentrate on keeping the database up-to-date if I remove or delete a row while using the pre-calculated values for display to the user
OR
is it better to store the raw data and calculate the correct display values on-the-fly?
An example (whic...
Hi,
Javascript is not my forte, so excuse me if this is incredibly obvious.
I'm working on some code that creates a local database and table, retrieves an RSS feed, parses it, and adds information from each entry to the database.
$.ajax({
type: "GET",
url: feedurl,
dataType: "xml",
success: parseXml
});
function parse...
I am using Visual C# built in feature Settings to save some of my program's options.
I also want to store one password, but then it comes public... is it possible to encrypt the password before saving it using this settings method and then decrypt it back?
...
Hey all,
I've been struggling with a select statement for a bit now and I was hoping to get some help. I currently have a list IPs in a temporary table and I want to calculate how many times this IP acts as a server and how many times it acts as a client. No matter how I manipluate this select statement I always get the same error ...
Is there any way to execute more sql prepared statements at once? Or at least use something to achieve this result, can it be emulated with transactions?
pg_send_query can execute more statements (from php docs "The SQL statement or statements to be executed.")
but
pg_send_execute and pg_send_prepare can work only with one statement.
...
I am using a query like this:
SELECT * FROM table1 WHERE countries LIKE '%US%' OR countries LIKE '%ALL%';
This returns all the entries that have "US" or "ALL" in countries column, but I want it to return ONLY those rows that contains "US", and if non is found then use the next condition and return all that contains "ALL".
Is it possi...
Backstory
At work where we're planning on deprecating a Natural Key column in one of our primary tables. The project consists of 100+ applications that link to this table/column; 400+ stored procedures that reference this column directly; and a vast array of common tables between these applications that also reference this column.
The ...
Hello chaps,
Having a spot of bother trying to grab some data out of my database.
I have the following model:
function GetRestaurants($options = array())
{
// Qualification
if(isset($options['restaurantID']))
$this->db->where('restaurantID', $options['restaurantID']);
if(isset($options['restaura...
Furthering: http://stackoverflow.com/questions/3910250/database-design-for-dynamic-form-field-validation/
How would I model the database when a particular field can have 0 or more validations rules AND that each validation rule is "related" to another rule via AND or OR.
For example, say I have field1 that needs to be minimum of 5 char...
Hi all,
Assuming a schema structure as such.
-----------------------------------------
Stock (ID, Description, blah blah)
-----------------------------------------
StockBarcode (ID, StockID, Barcode, Price, blah blah)
-----------------------------------------
What is the optimal way of storing units of measure for your stock items? G...
Hi Guys,
I was wondering if anybody would have some input on how I could possibly optimize this MySQL query. I think I'm doing the right thing with indexes so don't think I can get this query any faster (it's currently taking more than 3 seconds to run) but would really love somebody with more experience to prove me wrong.
Here's the q...
Possible Duplicate:
Is there ever a time where using a database 1:1 relationship makes sense?
For the sake of simplicity, I'll ask the question straight out: should one-to-one relationships in database design be avoided or this acceptable?
I know all of the attributes of this "item" can be all hosted in ONE table, but I fee...
I'm trying to implement a live search for my website. One that identifies words, or parts of a word, in a given string. The instant results are then underlined where they match the query.
For example, a query of "Fried green tomatoes" would yield:
SELECT *
FROM articles
WHERE (title LIKE '%fried%' OR
title LIKE '%green%' OR
...
We have a huge Oracle database and I frequently fetch data using SQL Navigator (v5.5). From time to time, I need to stop code execution by clicking on the Stop button because I realize that there are missing parts in my code. The problem is, after clicking on the Stop button, it takes a very long time to complete the stopping process (so...