CREATE PROCEDURE MY_PROC
@empID char(10),
@oldEmpList XML,
@newEmpList XML,
@Status INT OUTPUT
AS
-- sp body
SET @Status = 1
RETURN
GOt = text('EXEC MY_PROC :empID, :oldEmpList, :newEmpList, :Status',
bindparams=[bindparam('empID', type_=String, value='1234'),
bindparam('oldEmpList', type_=TEXT, value='<emp><id>1</id><id>2</id>'),
bindparam('newEmpList', type_=TEXT, value='<emp><id>e01</id><id>e02</id>'),
bindparam('Status', type_=Integer, value=0, isoutparam=True)])
result = CMS_DBSession.execute(t)
print result.out_parameters--
You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sqlalchemy+...@googlegroups.com.
To post to this group, send email to sqlal...@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
CREATE PROCEDURE MY_PROC
@empID char(10),
@oldEmpList XML,
@newEmpList XML,
@Status INT OUTPUT
AS
CREATE TABLE #table_temp(advisory_id INT);
INSERT INTO #table_temp
SELECT Tbl.record.value('.','INT')
FROM @oldEmpList.nodes('/emp/id') AS Tbl(record);
SELECT * FROM #table_temp;
RETURN
GO
SELECT Tbl.record.value('.','INT')
FROM @oldEmpList.nodes('/emp/id') AS Tbl(record);
--
You received this message because you are subscribed to a topic in the Google Groups "sqlalchemy" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sqlalchemy/tbW_RVIRkGk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sqlalchemy+...@googlegroups.com.
Thanks for reply. I checked the link & it says if stored procedure end with select statement, it will solve problem.In my stored procedure, I am passing XML data, getting all values from that xml & put into temp table.CREATE PROCEDURE MY_PROC
@empID char(10),
@oldEmpList XML,
@newEmpList XML,
@Status INT OUTPUT
AS
CREATE TABLE #table_temp(advisory_id INT);
INSERT INTO #table_temp
SELECT Tbl.record.value('.','INT')
FROM @oldEmpList.nodes('/emp/id') AS Tbl(record);
SELECT * FROM #table_temp;
RETURN
GOThe above code get me error. If I just put select statement without inserting anything likeSELECT Tbl.record.value('.','INT')
FROM @oldEmpList.nodes('/emp/id') AS Tbl(record);It gives me only first record. My guess is this is because of cursor.
Is there any workaround for this?