Ask a Question related to Coldfusion Database Access, Design and Development.
-
kabbi~thkek #1
db query/design problem
Hello
I have a question about my database design, and how to query.
I Made an extra table in my database design in where I put the type of
devices(table: type). It has to be possible to add and delete type of devices
in this table.
If you look at my code
(<cfset typenr = "30">
<cfquery name="nr" datasource="testdb">
SELECT MAX(nummer) AS hoogste_nummer FROM device WHERE type = #typenr#
</cfquery>
<cfset nieuwnummer = IncrementValue(nr.hoogste_nummer)>
<cfif
IsDefined("FORM.serial")><cfoutput>#FORM.serial#</cfoutput><cfelse>test</cfif>")
you see:
SELECT MAX(nummer) AS hoogste_nummer FROM device WHERE type = #typenr#
This means that there already has to be a type in the device table of my
database for a specific typenr.
When you want to put in a device for a specific type(you select a type from
the type table) and it's the first record to put in for that type, then the
typenumber cannot be found in the type database field of the device table where
everything has to be stored. It's not there......
I could put in the database a value for each type manually so that for each
type there will be a typenumber in the database already which he know can find
and compares.
But then it would not be possible to dynamically add another type in the type
table....
Hopefully my explanation is understandable....
Does anyone has an Idea how I could fix this?
kabbi~thkek Guest
-
Design query: Space Before or After?
In speaking to a production vendor today, she mentioned that a provided prototype was set up with Space After attributes on the body paragraphs with... -
Newbie 'structure' design query
I am trying to design a database to hold company names, company contacts, individuals etc. I'm new to databases, have read until my head hurts, but... -
database design and query problem
Hi, I'm looking at creating a database which will contain over 1.2 million telephone numbers, however after putting them all in one table the... -
Design problem
Hi All, This could be a classic design problem, but as I am using PHP, I thought I would seek help in this NG. I have built a small application in... -
Query on Query and CF casting problem
I am using a custom tag in MX7 that was working fine in 5 that renders a table. The input to the custom tag is a query and it's columns along with...



Reply With Quote

