Thread Subject: Run Stored Procedure

Subject: Run Stored Procedure

From: Izzy

Date: 16 Nov, 2009 13:31:28

Message: 1 of 2

Hi,

When i run the following:
resultset = runstoredprocedure(dbconn, 'mystoredprocedure',
{'stringParam1', 'stringParam2', 'stringParam3','stringParam4', 1},
{});
??? Error using ==> database.runstoredprocedure at 86
Procedure may return resultset. Use EXEC and FETCH

When i look at the exec docs, they mention the following:

Run a stored procedure with input parameters.
curs = exec(conn,'{call sp_name (parm1,parm2,...)}');

however using the following:

curs = exec(conn,'{call mystoredprocedure
('stringParam1','stringParam2','stringParam3','stringParam4', 1)}');
resultset = fetch(curs);

results in a syntax error.

Any idea on this?

Subject: Run Stored Procedure

From: Izzy

Date: 16 Nov, 2009 13:51:45

Message: 2 of 2

On Nov 16, 2:31 pm, Izzy <iskandarpr...@gmail.com> wrote:
> Hi,
>
> When i run the following:
> resultset = runstoredprocedure(dbconn, 'mystoredprocedure',
> {'stringParam1', 'stringParam2', 'stringParam3','stringParam4', 1},
> {});
> ??? Error using ==> database.runstoredprocedure at 86
> Procedure may return resultset.  Use EXEC and FETCH
>
> When i look at the exec docs, they mention the following:
>
> Run a stored procedure with input parameters.
> curs = exec(conn,'{call sp_name (parm1,parm2,...)}');
>
> however using the following:
>
> curs = exec(conn,'{call mystoredprocedure
> ('stringParam1','stringParam2','stringParam3','stringParam4', 1)}');
> resultset = fetch(curs);
>
> results in a syntax error.
>
> Any idea on this?

Cancel this one , found the solution :) needed to escape the
'''''''' :P

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com