import MySQLdb

from ..LibraryOperation import LibraryOperation
from MySQLdb.connections import Connection
from ..SQLExpression import SQLExpression
from ..SQLParameter import SQLParameter
from ..SQLFunctionCall import SQLFunctionCall
from ..Guid import Guid

class StoredProcedureOperation (LibraryOperation):
	def get_sp_name(self):
		return ''

	def get_sp_parameters(self):
		return []

	def build_query(self):
		query = "CALL " + self.get_sp_name() + "("
		parms = self.get_sp_parameters()
		query += SQLExpression.array_to_string(parms)
		
		query += ")"
		return query

