stored procedures with sqlAlchemy

后端 未结 7 1441
醉梦人生
醉梦人生 2020-12-01 07:17

How can I call stored procedures of sql server with sqlAlchemy?

相关标签:
7条回答
  • 2020-12-01 08:12

    Just execute procedure object created with func:

    from sqlalchemy import create_engine, func
    from sqlalchemy.orm import sessionmaker
    
    engine = create_engine('sqlite://', echo=True)
    print engine.execute(func.upper('abc')).scalar() # Using engine
    session = sessionmaker(bind=engine)()
    print session.execute(func.upper('abc')).scalar() # Using session
    
    0 讨论(0)
提交回复
热议问题