queries

Linking individual queries in a unbound listbox in ACCESS 2007

I have created a unbound listbox. I have the box showing a list of queries I want the use to be able to select. My problem is I don't understand how to get the submit button to select the currently selected query and run it. So how do I link the submit button to the listbox and have each item in the box submit its own query. ...

Are Hibernate named HQL queries (in annotations) optimised?

A new colleague has just suggested using named HQL queries in Hibernate with annotations (i.e. @NamedQuery) instead of embedding HQL in our XxxxRepository classes. What I'd like to know is whether using the annotation provides any advantage except for centralising quueries? In particular, is there some performances gain, for instance ...

In MYSQL is it better to have one big table or many smaller tables

Hi All, I am making a database of my client's customers to send email promotions to. The database will include all about 12 of my clients and each of them has an average of 2100 customers. I was wondering if it would be better to have a table in the db for each one of my clients that contains a list of their customers or if I should jus...

Mixing JPA annotations and XML configuration

I have a fairly large (new) project in which we have annotated many domain classes with JPA mappings. Now it is time to implement many named queries -- some entities may have as many as 15-20 named queries. I am thinking that writing these named queries in annotations will clutter the source files and therefore am considering putting t...

One to many too much data returned - MySQL

I have 2 related MySQL tables in a one to many relationship. Customers: cust_id, cust_name, cust_notes Orders: order_id, cust_id, order_comments So, if I do a standard join to get all customers and their orders via PHP, I return something like: Jack Black, jack's notes, comments about jack's 1st order Jack Black, jack's notes, comm...

Best way to optimize queries like this in Django

I am trying to lower the amount of queries that my django app is using, but I am a little confused on how to do it. I would like to get a query set with one hit to the database and then filter items from that set. I have tried a couple of things, but I always get queries for each set. let's say I want to get all names from my DB, b...

SQL Query to select count = 0

OK, I need a T-SQL guru for this one. I have a table called PackageStoreEvents that has a packageid, storecode and an eventcode field. I want to return the packageid values for storecode 2406 where the count for the eventcode = 6 is 0. How would I do that? I'm stuck on this one. Thanks for the help ...

Join two Oracle queries

I've to query from two tables and want one result.. how can i join these two queries? First query is querying from two tables and the second one is only from one. select pt.id,pt.promorow,pt.promocolumn,pt.type,pt.image,pt.style,pt.quota_allowed,ptc.text,pq.quota_left from promotables pt,promogroups pg ,promotablecontents ptc ,promo...

Calculate value from two field in third field

I'm trying to create a query, that will calculate sum of products on invoice. I have 3 tables : Product (with product's price) Invoice (with invoice id) Products on invoice (with invoice id, product id and number of particular products) So in my query I take invoice_id (from invoice), price (from product),number of products sold an...

how to effectively run two inequality filters on queries in app engine

I'm aware that app engine has the restriction of "Inequality Filters Are Allowed On One Property Only" as described here: http://code.google.com/appengine/docs/python/datastore/queriesandindexes.html#Introducing_Indexes However is there some way to essentially run two filters, or is this simply not possible? For instance, if I had an e...

Can you monitor SQL server to tell exactly what queries it has been running?

Can you monitor SQL server to tell exactly what queries it is running? We have an application that is exhausting the application pool. A server administrator has sent us a report from Debug Diag [http://www.microsoft.com/downloads/details.aspx?FamilyID=28bd5941-c458-46f1-b24d-f60151d875a3&displaylang=en][1] which shows threads runni...

Mysql Stored Procedures Dynamic Queries

Hi guys, I've had quite a few problems and know that I can get some good answers here! Ok kinda 2 part question. Part 1 I'm doing some really big updating of data, kind rejiging the tables mostly. so the question is should I be using a mysql stored procedure or mysql/php like normal. I'm currently on the stored producure frame of mind. ...

mysql Number of SQL Queries

Hi I just converted an Access Db to mysql (using Access as frontend, mysql as backend) It is a simple, 4 table database I have a Master table, and 3 linked tables to it So an Access form displays has data from: Master table (mainform) Details1 table (subform) Details2 table (subform) Details3 table (subform) The master table w...

Nesting queries in CF

I'm using this code to display a list of platforms. If a platformID was specified upon entering the page, I would like to create a list of genres underneath the specified platform. browse.cfm was accessed via a link that specified a platformID of 1 browse.cfm will list all available platforms browse.cfm will now list all available gen...

Transferring data from one field in a table in a database to another field in a different table but same database in VB.NET

I am creating a database in VB.NET for a movie rental place. I currently have three forms; Member Information DVD Information Borrow DVDs What I would like to do is when I am viewing a member's details, if I click a button 'Borrow DVD for Member', the member's ID number transfers over to the Borrow DVDs table in the Member ID which a...

Is 154 MySQL Queries in 0.543 seconds a horrible thing?

I'm writing a wordpress newspaper theme. Because the theme makes use of multiple loops, it generates a lot of queries. Plus, I have to make many options dynamic because the theme will be released to the public (so I can't hardcode a lot of stuff). On the front page, with a typical setup (a top story area, five newsboxes [that's five wo...

C Socket Programming, 2 client queries at the same time

How can my client send two queries (in two different terminals) to the server at the same time? When i try it, only one works, the other closes socket. main () { readData (); int serverFd, clientFd, clientFd2,serverLen, clientLen; struct sockaddr_un serverAddress;/* Server address */ struct sockaddr_un clientAddress;...

Identify which queries an Access 1997 report is using to generate?

I am updating an Microsoft Access 1997 mdb. I want to find out how one of the reports are generated and I am not sure which queries the program uses to generate the report. I am only able to access the design and preview mode or the report. Is there an easy way to identify how the report is generated? Specifically which queries, tables...

How to get over limitations of the Hibernate Criteria and Example APIs?

I'm in a position where our company has a database search service that is highly configurable, for which it's very useful to configure queries in a programmatic fashion. The Criteria API is powerful but when one of our developers refactors one of the data objects, the criteria restrictions won't signal that they're broken until we run ou...

Xpath: find an element value from a match of id attribute to id anchor

Hi, I would like to find the value of an element matched on id attribute for which I only have the ref - the bit with #, the anchor. I am looking for the value of partyId: < party id="partyA" > < partyId >THEID< /partyId > but to get there I only have the href from the following < MyData > < MyReference href="#partyA" /> ...