cancel
Showing results for 
Search instead for 
Did you mean: 

Stored Procedure Call from XMII

Former Member
0 Kudos

Hi, I am facing the following problem.

My SQL Stored Procedure has one input parameter,and it returns three values.

I want to know the syntax for calling this stored procedure ie. syntax in fixed query in XMII.

Thanks.

Accepted Solutions (0)

Answers (2)

Answers (2)

0 Kudos

Hi,

You have to use "FixedQuerywithOutput" and then use the word CALL instead of EXEC before stored procedure name.

Hope this helps.

Regards

Khaleel

Former Member
0 Kudos

Khaleelurrehman,

the query mode you have to use depends on the database you are working with. Mode "FixedQuerywithOutput" is only used for Oracle DBs. You can use it to retrieve for example the values delivered by a Ref Cursor.

For calling a SQL Server, you would use the mode "FixedQuery" to retrieve data with the EXECUTE or EXEC statement.

I suppose that Adam is using the SQL Server.

Regards

Michael

Former Member
0 Kudos

@Michael

Yes , my stored procedure is in SQL server.

Former Member
0 Kudos

Hi,

Syntax for executiong SP in MII is:

execute stored_procedure_name '[Param.1]'

.

You can use Parameters tab in Query template.

Go throufg this link:

http://help.sap.com/saphelp_xmii115/helpdata/en/Connectors/IDBCConnector.htm

-Suresh

Edited by: Suresh Hiremath on Aug 27, 2009 1:40 PM

Former Member
0 Kudos

No, its still not working.It gives following error.SQL Error .Procedure expects parameter@value.

Should I also define :output results as variables

Former Member
0 Kudos

Hi,

Give parameter value. To do this go to Parameters tab in query template, set the value of your input parameter.

-Suresh

Former Member
0 Kudos

Check the data type of variable and just assign the value under Fixed Query.

EXECUTE STOREDPROC_NAME 'value'

or go in Parameters tab and assign the value ( Like if it is integer put '20' as a parameter value and then execute below statement)

EXECUTE STOREDPROC_NAME 'http://Param.1'

sidnooradarsh
Contributor
0 Kudos

Hi Adam,

I assume that you are using MSSQL server stored procedure which outputs 3 values.

Say that you are inputting 1 integer @inval and returning 3 integer values @outval1, @outval2, @outval3 from Stored Procedure

Then perform the following in Query Template


DECLARE @val1 INT
DECLARE @val2 INT
DECLARE @val3 INT

EXEC StoredProcedureName 
    @inval = 10,
    @outval1 = @val1 OUTPUT,
    @outval2 = @val2 OUTPUT,
    @outval3 = @val3 OUTPUT

SELECT @val1,@val2,@val3

Use FixedQuery mode

Regards,

Adarsh

Edited by: Adarsh Sidnoor on Aug 27, 2009 7:46 PM

Edited by: Adarsh Sidnoor on Aug 27, 2009 7:47 PM