471,873 Members | 1,825 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,873 software developers and data experts.

ASP variable Oracle query

I'm trying to do a simple query of an Oracle 10g database within some vbscript code.

<%
'Get protocol information to display in dropdown list
%>
<!--#include file="dbconnect2.inc"-->
<%
sql= "select DISTINCT PROTOCOLNAME FROM GPL_PPDB.VW_IVRS_INFO_2 WHERE SPONSORNAME = '" & Sponsor & "' ORDER BY PROTOCOLNAME ASC"
Set RS = Conn.Execute(sql)
%></span>
</font><span style="font-size: 9pt"><b><a href="new_capa_form.asp">Select a
different Sponsor?</a></b></span></td>
<td>
<p style="margin-top: 0; margin-bottom: 0">
<font color="#000000" style="font-size: 9pt"><b>Protocol:</b></font></td>
<td>
<p style="margin-top: 0; margin-bottom: 0">
<Select name="Protocol" onchange="Submit()" size="1" tabindex="3" style="font-size: 9; color: #000000">
<option>Select...</option>

<%
Do Until RS.eof
%>
<option>
<%
Response.write RS("PROTOCOLNAME")
%>
</option>
<%
RS.movenext
loop
RS.close
Set RS = nothing
Conn.close
Set Conn = Nothing
%>

</Select>
Problem is that for some reason the query will not compare the values in the SPONSORNAME column to the vbscript variable Sponsor. I don't get any errors, just no values are populated. If I change the query to use an actual sponsor name instead of the variable then the query returns values so it appears just to be a problem with the comparison of the Oracle 10g column info to a vbscript variable (which is definitely not null).

Any help would be appreciated.
Oct 28 '06 #1
1 2686
Figured it out. I just needed to trim the vbscript variable. There must have been spaces added by the people entering the data so this was causing the values to not match.
Oct 28 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

4 posts views Thread by francis70 | last post: by
11 posts views Thread by Markus Breuer | last post: by
reply views Thread by YellowAndGreen | last post: by
reply views Thread by zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.