Ask a Question related to Coldfusion Database Access, Design and Development.
-
jgladnick #1
Database UUID problems
I am modifying the GetSubscribers() function to pull people who have signed up
for specific categories. It works great when I manually put in which blog post
ID to check for, but when I try to use a variable it fails completely.
I have tried several different permutations, including:
WHERE (tblBlogEntries.id = '#localid#')
WHERE (tblBlogEntries.id = #localid#)
WHERE (tblBlogEntries.id = 'N#localid#')
WHERE tblBlogEntries.id = <cfqueryparam value="#arguments.id#"
cfsqltype="CF_SQL_VARCHAR">
Nothing will work. However, if I simply replace it with:
WHERE (tblBlogEntries.id = '975A03C3-B3B3-4221-990A7DC23DFB0545'), where that
string is one of the blog entry id?s, the whole thing works perfectly just as
it should.
Arguments.id IS getting sent to the function, my test emails that send raw
output are getting through. And passing the info correctly.
Am I missing something obvious???
------------code-----------
<cffunction name="getSubscribers" access="public"
returnType="query" output="false"
hint="Returns all people subscribed to a specific blog post.">
<cfargument name="id" type="string" required="true"
hint="The id of the blog entry.">
<cfset var getPeople = "">
<cfset var localid = arguments.id>
<!---<cfqueryparam value="#arguments.id#"
cfsqltype="CF_SQL_VARCHAR">--->
<cfquery name="getPeople"
datasource="#instance.dsn#">
SELECT tblBlogSubscribers.email, tblBlogSubscribers.token
FROM tblBlogSubscribers INNER JOIN
tblBlogSubscriberAssociation ON tblBlogSubscribers.token
= tblBlogSubscriberAssociation.SubscriberID LEFT OUTER JOIN
tblBlogEntriesCategories INNER JOIN
tblBlogEntries ON tblBlogEntriesCategories.entryidfk =
tblBlogEntries.id ON
tblBlogSubscriberAssociation.CategoryID =
tblBlogEntriesCategories.categoryidfk
WHERE (tblBlogEntries.id = '#localid#')
</cfquery>
<cfmail from="test@test.com"
to="jgladnick@pma.com" subject="raw output">
You should get this:
<cfloop query="getpeople">
#email#, #token#
</cfloop>
recordcount: #getpeople.recordcount#
arguement id: #arguments.id#
localid: #localid#
</cfmail>
<cfreturn getPeople>
</cffunction>
jgladnick Guest
-
When to use UUID
I use MYSQL, but I think this is a general database design question: <b>Is it a good idea to use UUIDs to generate unique indexes and primary keys... -
Cant delete a row using a UUID as the PK
I'm trying to delete a row - that uses the datatype unique identifyer...(SQL2000) I get an error, I've tried using cfquerypqram (both the varchar... -
Using CHAR to store UUID in SQL Server
Hi, In SQL Server, I use CHAR to store UUID as primary for all my tables. Is there any performance disadvantage when performing linking with... -
generationg an UUID
Hi, Is it possible to generate an UUID (GUID) in PHP? An unique id like: "BF127074-8A15-4A32-A7B3-BEF9A2DBB65C" Thanks -
ADO 2.8 UUID (for use with ASP on Windows 2003)
What is the UUID associated with ADO 2.8? The most current one I've found for use with ASP is: <!--METADATA TYPE="typelib"... -
reenaroy #2
Re: Database UUID problems
Hi,
Can you please show me the whole code where you are using this function getSubscribers().
reenaroy Guest
-
BKBK #3
Re: Database UUID problems
Nothing will work.
That is probably because the id column in tblBlogEntries has a UUID datatype,
and UUID's may sometimes not work in a comparison operator (=) in a
where-clause. To check if that is the case, temporarily change the datatype to
varchar(35).
BKBK Guest



Reply With Quote

