Showing posts with label syntax. Show all posts
Showing posts with label syntax. Show all posts

Thursday, March 22, 2012

Calling Oracle Stored Procedure

Hi all

I am trying to call oracle stored procedure from SRSS 2005. I am using the syntax { Call s_test_rcur()} .

I am getting following error.

Any suggestions?

Thanks in advance

Mvr

An error occurred while retrieving the parameters in the query.
ORA-00911: invalid character
ORA-06512: at "SYS.DBMS_UTILITY", line 68
ORA-06512: at line 1

ADDITIONAL INFORMATION:

ORA-00911: invalid character
ORA-06512: at "SYS.DBMS_UTILITY", line 68
ORA-06512: at line 1
(System.Data.OracleClient)

Here is the Oracel stored proc.

TYPE rc_test IS REF CURSOR;

PROCEDURE s_test_rcur (
po_test_rc OUT rc_test, -- returns a record set
po_error OUT INTEGER
)
IS

BEGIN
g_err_level := 1;

OPEN po_test_rc FOR
SELECT a.ssn_id,
TO_CHAR (a.acad_yr) || TO_CHAR (a.acad_yr + 1) acad_yr,
RPAD (NVL (last_name, ' '), 30, ' ') last_name,
RPAD (NVL (first_name, ' '), 30, ' ') first_name,
NVL (middle_initial, ' ') middle_initial
from test_table
order by last_name;

po_error := 0;
EXCEPTION
WHEN OTHERS
THEN
po_error := -1;
g_error_code := SQLCODE;
g_error_msg :=
'Err level :' ||
TO_CHAR (g_err_level) ||
' ' ||
SUBSTR (SQLERRM, 1, 250);

END;

You may want to read the following related thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=356162&SiteID=1

Basically, you need to write a wrapper stored procedure that has only one OUT REF cursor and no other OUT parameters.

-- Robert

Thursday, March 8, 2012

Callind Stored Proc from Stored Proc

I am trying to call a stored proc from within a stored proc as below, but it
throws a syntax error.
SELECT COUNT(*) FROM (EXEC spName)
I have no access to "spName" to make any amends, currnetly it returns a
large recordset of customers.
Anyone any ideas how to do this?Billy
INSERT INTO #tmp EXEC spName --Make sure that number of columns in the
#tmp should be match to the output from the SP
SELECT COUNT(*) FROM #tmp
"Billy" <Billy@.discussions.microsoft.com> wrote in message
news:26DC8B64-FF85-4BE0-8913-B84A021C2D40@.microsoft.com...
>I am trying to call a stored proc from within a stored proc as below, but
>it
> throws a syntax error.
> SELECT COUNT(*) FROM (EXEC spName)
> I have no access to "spName" to make any amends, currnetly it returns a
> large recordset of customers.
> Anyone any ideas how to do this?
>|||Try using "select @.@.rowcount" immediately after executing the proc.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Callind Stored Proc from Stored Proc

I am trying to call a stored proc from within a stored proc as below, but it
throws a syntax error.
SELECT COUNT(*) FROM (EXEC spName)
I have no access to "spName" to make any amends, currnetly it returns a
large recordset of customers.
Anyone any ideas how to do this?
Billy
INSERT INTO #tmp EXEC spName --Make sure that number of columns in the
#tmp should be match to the output from the SP
SELECT COUNT(*) FROM #tmp
"Billy" <Billy@.discussions.microsoft.com> wrote in message
news:26DC8B64-FF85-4BE0-8913-B84A021C2D40@.microsoft.com...
>I am trying to call a stored proc from within a stored proc as below, but
>it
> throws a syntax error.
> SELECT COUNT(*) FROM (EXEC spName)
> I have no access to "spName" to make any amends, currnetly it returns a
> large recordset of customers.
> Anyone any ideas how to do this?
>
|||Try using "select @.@.rowcount" immediately after executing the proc.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .

Friday, February 24, 2012

Calculations involving fields from different tables

Is it possible to perform a calculation with fields from different tables on
the same report? If so, what syntax is used to reference each field?
DavidYou need to reference the scope in the field. so, like
First(Fields!FieldName.Value, "DatasetName") or Sum(Fields!
FieldName.Value, "DataSetName")
>--Original Message--
>Is it possible to perform a calculation with fields from
different tables on
>the same report? If so, what syntax is used to reference
each field?
>David
>.
>

Friday, February 10, 2012

calculated members WHERE statement?

i am trying to figure out how to use MDX and a WHERE statement in the calculated member expression textbox. Every time i try i get a syntax error, and can't seem to find an example anywhere. Is it even possible?

I am trying to make a calculated member (measure) but I need to filter on only a few values of a DIM. I have seen how to write an MDX query and do this, but I need a permenant calculated measure.

Any insights? Thanks

Please keep in mind the difference between an MDX expression (used in defining a calculated member) and an MDX query (which can include a WHERE clause). You can try using Filter() in your MDX expression instead.|||i could never get that to work, i went down the road of making a named calculation and using that in my calculated measure