Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What does the zero mean? '0#userID#'

Status
Not open for further replies.

markbanker

Programmer
Mar 6, 2001
37
US
The application that I am evaluating has many instances of something similar to this: 'A.userID = 0#userID#'

So, 'A' is an alias for a copy of the table that contains userID, but what does the zero signify? Is it saying that the userID I'm comparing to is a parsed value, not a value from a table?

Thanks for any light you can shed on this for me.

Mark
 
Information that may be relevant:

1. This is within a SQL statement that is going to a SQL 7.0 db.

2. The single quotes don't actually exist in code. The value is an INT, not a String.
 
all that code is doing is prepending a 0 to the userID variable..



------------------------------------------------------------------------------
brannonH
if( !succeed ) try( );
 
I was thinking that, but why? Is it representing a bit to specify either positive or negative? When I look at the values in the db, they don't begin with a zero.

Thanks again,

Mark
 
Consider this code, somewhere in the page where you can see it.

Code:
<CFOUTPUT><PRE>&quot;0#userID#&quot;</PRE></CFOUTPUT>

It did just occurr to me that the parsed value might be forming an sql sub string and if the string was...

Code:
<cfset userIDs=&quot;5,7,3&quot;>

And they ran a replace..

Code:
<CFSET userID=replace(userIDs,&quot;,&quot;,&quot; OR a.UserID =&quot;,&quot;ALL&quot;)>

That would make userID =

Code:
&quot;5 or a.userID=7 or a.userid=3&quot;

Then suppose they prefixed to kill that...

Code:
<CFSET userID=&quot; or a.userID=&quot; & userID>

That would give us

Code:
&quot; or a.userID=5 or a.userID=7 or a.userID=3&quot;

So... Where a.userID=0#userID#

would evaluate to

Code:
&quot;Where a.userID=0 or a.userID=5 or a.userID=7 or a.userID=3

or something along those lines

ALFII.com
---------------------
If this post answered or helped to answer your question, please reply with such so that forum members with a similar question will know to use this advice.
 
Thats the what, the why is as simple as ... the &quot;0&quot; would be there to complete the WHERE clause in case the UserID list was ''. faster, easier, and simpler than checking the lenght of the list.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top