2

while executing stored procedure using pymssql getting error:

_mssql.MSSQLDatabaseException: (8144, b'Procedure or function GET_USER_DETAILS has too many arguments specified. DB-Lib error message 8144, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')

code snippet:

        connection = self.engine.raw_connection()
        cursor = connection.cursor()
        args= ('user')
        cursor.callproc("GET_USER_DETAILS", args)
        cursor.nextset()
        result = list(cursor.fetchone())
        cursor.close()
        connection.commit()
        print(result)

stored procedure GET_USER_DETAILS, accept only one parameter, thats user name.

2
  • cursor.callproc("GET_USER_DETAILS", (args,)) Commented Aug 17, 2017 at 8:20
  • wow, that worked..@BurhanKhalid Commented Aug 17, 2017 at 8:25

1 Answer 1

1

The below code is working.

        connection = self.engine.raw_connection()
        cursor = connection.cursor()
        args= ('user')
        cursor.callproc("GET_USER_DETAILS", (args,))
        cursor.nextset()
        result = list(cursor.fetchone())
        cursor.close()
        connection.commit()
        print(result)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.