SQL Server 6.5 Select statements with a When In clause on Stored Procedures?

SQL Server 6.5 Select statements with a When In clause on Stored Procedures?

Post by Tito Burgo » Fri, 01 Aug 1997 04:00:00



This is a multi-part message in MIME format.

------=_NextPart_000_01BC9DB8.A2EF5B30
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

I have the following Stored procedure:
-------------------------------------------

select something
from sometable


GO
----------------------------------------------

In SQL server Query tool I type the following: GetBbairs '"58245","25698"'
(I put the whole thing in apostrophes to send it as one string)
The query returns no rows however the print statement at the bottom of the
procedure returns:
"58245","25698"
Which is exactly what it should be.  
The numbers are valid and they are characters.  I don't understand why SQL

the WHERE clause.  It seems to be reading it fine on the PRINT statement.

I do not see what I'm doing wrong and would appreciate any help.

Thanks in advance.
--
Tito Burgos

email me.
Bank of Tokyo - Mitsubishi Information Systems Group
------=_NextPart_000_01BC9DB8.A2EF5B30
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial">I have the following Stored =
procedure:<br>-------------------------------------------<br>CREATE =


In SQL server Query tool I type the following: GetBbairs =
'&quot;58245&quot;,&quot;25698&quot;' &nbsp;(I put the whole thing in =
apostrophes to send it as one string)<br>The query returns no rows =
however the print statement at the bottom of the procedure =
returns:<br>&quot;58245&quot;,&quot;25698&quot;<br>Which is exactly what =
it should be. &nbsp;<br>The numbers are valid and they are characters. =
&nbsp;I don't understand why SQL Server is not finding them or how is it =

reading it fine on the PRINT statement.<br><br>I do not see what I'm =
doing wrong and would appreciate any help. <br><br>Thanks in advance. =
<br>-- <br>Tito Burgos<br><font =

color=3D"#000000"> &nbsp;- Please remove .nospam before attempting to =
email me.<br>Bank of Tokyo - Mitsubishi Information Systems Group</p>
</font></font></font></body></html>
------=_NextPart_000_01BC9DB8.A2EF5B30--

 
 
 

SQL Server 6.5 Select statements with a When In clause on Stored Procedures?

Post by Shura Bajenof » Sat, 02 Aug 1997 04:00:00


--------------B9820E9C965E7DA8892F6742
Content-Type: text/plain; charset=koi8-r
Content-Transfer-Encoding: 7bit

Tito

You must see BOL on EXEC statement with string...

I think you may try



> I have the following Stored procedure:
> -------------------------------------------

> select something
> from sometable


> GO
> ----------------------------------------------

> In SQL server Query tool I type the following: GetBbairs
> '"58245","25698"'  (I put the whole thing in apostrophes to send it as
> one string)
> The query returns no rows however the print statement at the bottom of
> the procedure returns:
> "58245","25698"
> Which is exactly what it should be.
> The numbers are valid and they are characters.  I don't understand why

> variable in the WHERE clause.  It seems to be reading it fine on the
> PRINT statement.

> I do not see what I'm doing wrong and would appreciate any help.

> Thanks in advance.
> --
> Tito Burgos

> email me.
> Bank of Tokyo - Mitsubishi Information Systems Group

--------------B9820E9C965E7DA8892F6742
Content-Type: text/html; charset=koi8-r
Content-Transfer-Encoding: 8bit

<HTML>
<BODY BGCOLOR="#FFFFFF">
Tito

<P>You must see BOL on EXEC statement with string...
<BR>?

<P>I think you may try


+ ')')
<BR>?
<BR>?
<BR>?
<BR>?

<BLOCKQUOTE TYPE=CITE>?

<P><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>I have the following
Stored procedure:</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>-------------------------------------------</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>CREATE PROCEDURE

<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>select something</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>from sometable</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>where CHAR_NUMBER


<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>GO</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>----------------------------------------------</FONT></FONT></FONT>

<P><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>In SQL server
Query tool I type the following: GetBbairs '"58245","25698"'? (I put the
whole thing in apostrophes to send it as one string)</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>The query returns
no rows however the print statement at the bottom of the procedure returns:</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>"58245","25698"</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>Which is exactly
what it should be.</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>The numbers
are valid and they are characters.? I don't understand why SQL Server is

clause.? It seems to be reading it fine on the PRINT statement.</FONT></FONT></FONT>

<P><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>I do not see
what I'm doing wrong and would appreciate any help.</FONT></FONT></FONT>

<P><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>Thanks in advance.</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>--</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>Tito Burgos</FONT></FONT></FONT>

- Please remove .nospam before attempting to email me.</FONT></FONT></FONT>
<BR><FONT FACE="Arial"><FONT COLOR="#000000"><FONT SIZE=-1>Bank of Tokyo
- Mitsubishi Information Systems Group</FONT></FONT></FONT></BLOCKQUOTE>
?
</BODY>
</HTML>

--------------B9820E9C965E7DA8892F6742--

 
 
 

SQL Server 6.5 Select statements with a When In clause on Stored Procedures?

Post by Jacek Pagac » Tue, 12 Aug 1997 04:00:00


Of course it will not work.

select statement will look for a record with CHAR_NUMBER of value
"58245","25698" ( as a whole ),
that I think do not exists.

It will work if You will rewrite Your statement to somethink like this:
exec( 'select something from sometable ' +

Jacek Pagacz



I have the following Stored procedure:
-------------------------------------------

select something
from sometable


GO
----------------------------------------------

In SQL server Query tool I type the following: GetBbairs '"58245","25698"'
(I put the whole thing in apostrophes to send it as one string)
The query returns no rows however the print statement at the bottom of the
procedure returns:
"58245","25698"
Which is exactly what it should be.  
The numbers are valid and they are characters.  I don't understand why SQL

the WHERE clause.  It seems to be reading it fine on the PRINT statement.

I do not see what I'm doing wrong and would appreciate any help.

Thanks in advance.
--
Tito Burgos

email me.
Bank of Tokyo - Mitsubishi Information Systems Group
----------