[DB-SIG] Stored Procedure problem

Josh cujdc@pen.eiu.edu
Mon, 19 Jun 2000 11:15:53 -0500


This is a multi-part message in MIME format.

------=_NextPart_000_001F_01BFD9DF.BB60A230
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello, I am trying to call a stored procedure from a sample database =
(NorthWind) that came with MSDE.  I am using SQL Server 7.0.  Here is =
what I am trying...
--------
import dbi
import odbc
myconn =3D odbc.odbc("SQLTEST") #SQLTEST is the alias
myc =3D myconn.cursor()

# this all seems to work, the next statement does not

myc.execute("EXEC CustOrderHist('ALFKI')")=20
-------
the interpreter tells me that there was an odbc error close to ALFKI.  =
CustOrderHist expects a 5 character string and ALFKI is a valid customer =
id.  Here is the error...

[Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax =
near 'ALFKI'

Please let me know if you have any information why this is not working.

Thanks,
Josh Castagno

------=_NextPart_000_001F_01BFD9DF.BB60A230
Content-Type: text/html;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content=3D"text/html; charset=3Diso-8859-1" =
http-equiv=3DContent-Type>
<META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=3D#c8e0d8>
<DIV><FONT face=3DArial size=3D2>
<DIV><FONT face=3DArial size=3D2>Hello, I am trying to call a stored =
procedure from=20
a sample database (NorthWind) that came with MSDE.&nbsp; I am using SQL =
Server=20
7.0.&nbsp; Here is what I am trying...</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>--------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>import dbi</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>import odbc</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>myconn =3D odbc.odbc("SQLTEST") =
#SQLTEST is the=20
alias</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>myc =3D myconn.cursor()</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2># this all seems to work, the next =
statement does=20
not</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>myc.execute("EXEC=20
CustOrderHist('ALFKI')</FONT><FONT face=3DArial size=3D2>") =
</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>-------</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>the interpreter tells me that there was =
an odbc=20
error </FONT><FONT face=3DArial size=3D2>close to ALFKI.&nbsp; =
CustOrderHist expects=20
a 5 character string&nbsp;and ALFKI is a valid customer id.&nbsp; Here =
is the=20
error...</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT color=3D#008080 size=3D2>[Microsoft][ODBC SQL Server =
Driver][SQL=20
Server]Line 1: Incorrect syntax near 'ALFKI'</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Please let me know if you have any =
information why=20
this is not working.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>Thanks,</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Josh=20
Castagno</FONT></DIV></FONT></DIV></BODY></HTML>

------=_NextPart_000_001F_01BFD9DF.BB60A230--