PyODBC Stored proc calling

Discussion in 'Python' started by king kikapu, Jan 18, 2007.

  1. king kikapu

    king kikapu Guest

    Hi to all,

    can anyone give me a jump-start about how to call Stored Procedures
    from PyODBC ??
    I want to execute a very simple testing Stored Procedure on an Sql
    Server database.

    I started using PyODBC and code like the following

    cnxn = pyodbc.connect('DRIVER={SQL
    Server};SERVER=hercules;DATABASE=pubs;UID=sa;PWD=pwd'')

    for row in cnxn.execute("select au_fname from authors"):
    print row.au_fname
    cnxn.close()

    and based on this, i can now write more complex ad-hoc sql string to
    get/update data.
    But how i can actually call Stored Procedures and passing parameters to
    them ??

    Let's say i have the following SP:

    create procedure test_bed(@data varchar(100))
    as
    // do something here.


    Any help ??

    Thanks in advance
     
    king kikapu, Jan 18, 2007
    #1
    1. Advertising

  2. king kikapu

    king kikapu Guest

    No one is using pyodbc ?? :)
     
    king kikapu, Jan 19, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?RXJpYyBMYW5k?=
    Replies:
    1
    Views:
    763
    Chandra Sekhar
    Aug 7, 2004
  2. Jack Black
    Replies:
    3
    Views:
    2,804
    =?Utf-8?B?UGF1bA==?=
    Apr 20, 2005
  3. David Lozzi
    Replies:
    3
    Views:
    1,952
    David Lozzi
    Jun 1, 2005
  4. Michael Owings

    PyODBC Stored proc calling

    Michael Owings, Mar 26, 2008, in forum: Python
    Replies:
    0
    Views:
    375
    Michael Owings
    Mar 26, 2008
  5. Doug
    Replies:
    0
    Views:
    124
Loading...

Share This Page