Hi, I have two tables both containing data under the same column headings and types, code and name. The name column is a unique index with an insert and update constraint.
I am trying to insert data from table2 to table1 when the data does not already exist in table1 but am getting a unique key...
Hi there, I have a table with 8 integer columns and I want to return the average value for each column in a single query.
I can do it easily enough with 8 columns but I would like the query to contain only two columns, 'columnName' and 'average'.
Is this possible?
Thanks, dom
How can you set static variables in enterprise manager? I think 'static variables' is the correct term. Basically, I would like to do something like:
SELECT blah
FROM tableBlah
WHERE blahID = @@myStaticBlahID
Can I create and set these @@ variables in EM?
Thanks in advance
DT
We have setup an online shop for a client and are using a SQL server database for all their stock, etc. They receive a monthly stock update from there main supplier which is stored in an access db on their pc's at their bricks and mortar shop.
I am looking to the most efficient way of updating...
Not sure which to use and am finding the results they produce a little confusing.
They are being used to search fields in a database. The fields are title, author and publisher.
At present, using both freetext and contains, i put in a search for the title 'What on earth' and each time the...
Hi there,
In javascript, I can automatically submit a form like so:
document.myForm.submit();
Is there a way to do this in Coldfusion? I am assuming not as I cant find even any questions on it let alone answers :p
I need to do this as I want to dynamically create a form and submit it to...
I have a site using CF that I want to use "fake" URLs to access dynamic content. The site is an online bookstore.
An example:
I would like the URL: www.shop.com/index.cfm?action=browse&categoryID=6
To be something like: www.shop.com/shop/#categoryName#6.htm
Now I understand that I need (or I...
I have a cfc which I create a session instance of. The cfc object represents a shopping basket and I create one instance of it in application.cfm:
<cfif not isDefined('session.Basket')>
<cfobject name="session.Basket" component="myApp.components.basket">
</cfif>
The object has functions to...
I have a cfc, with some member variables and methods. I create an instance of it in application.cfm cos I need it to be application wide, I declare it like so:
<cfif not isdefined('request.myObject)>
<cfobject name="request.myObject" component="components.myObject">
</cfif>
This works fine...
The setup:
----------
I have several different queries that return recordsets from stored procedures on my SQL database. The data that each query returns contains the same fields and I want to display them in the same way. Each query has a different cfprocreturn name so that they can be...
I have a table of products that are all categorised. Each product has a categoryID which is a foreign key linked with the Primary Key in the Category table (category.cat_ID).
Each category can also have a parent Category so that a tree like structure is created. The levels deep for this tree is...
I have a problem using freetexttable and my only foreseeable solution is this:
I have Stored Procedure 1 (SP1) which calls SP2, SP3 and SP4.
SP2, SP3 and SP4 are all select queries and so return a record set (tho Im not sure where, which is my first question really).
In SP1, after calling the...
UNION selects unique items from two or more SELECT queries, and UNION ALL selects all items from two or more select queries.
Question: Is there a way to use UNION to select records ONLY when they appear in ALL SELECT queries?
thanks
dt
Ok, having got over the irritation of SQL throwing an error when the search string passed to FREETEXT contains only noise words, I want to be able to handle that error so that my application does not receive it.
I tried:
...
BEGIN TRANSACTION
SELECT * FROM myTable
INNER JOIN...
Damn, I was so pleased I solved my problem, now I have a new obstruction!
How can you make FREETEXT / FREETEXTTABLE search multiple columns in your table when you can only set one column per table for Full text indexing? I thought you could create a new catalog for each column you wanted to...
Hi there,
I am setting up a search functionality on my database. The search will be used to search products. We have a products table with full text searchable fields 'description' and 'title'.
I can set up a search query to search these fields using FREETEXTTABLE no problem.
I also have a...
Hey there, quick question:
Can you set default values for parameters in stored procedures so that if you dont set a parameter when you call the procedure, it gets given the default value?
I assume you can't as I havn't been able to find any info on it...
thanks again
DT
The usage I have seen for INNER JOIN is when using a condition on cross table references to select data from one table. Yet the book I am using suggests in its intro to IJ that you can select data from multiple tables using INNER JOIN. Is this correct?
What I would like is the optimal solution...
Hello there,
I am writing a stored procedure that is a simple select query. I want the calling code to supply a maximum number of rows to be returned but I cannot get the code to work using this parameter. Here is my code:
CREATE PROCEDURE dbo.selFeaturedItems
@maxItems int
AS
SELECT TOP...
Hi there, I have a 80 GB disk, partitioned in two, 10MB and 70MB and when using FDISK, only these two partitions are displayed. Partition 1 for OS, other for the rest. Heres the thing, there appears to be three partitions, one of which displays the error when I try to access it in windows:
"H:\...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.