1

I'm calling a Sybase Stored Proc X that returns data that is used by a servlet.

Within Stored Proc X, Stored Proc get_business_day is called in the following manner:

exec get_business_day @CBDate, -1, @prevBusDay output

So, the result of calling this (in DBArtisan) is:

6/25/2010 12:00:00.000 AM
1 row(s) affected.

The issue is that I do not need this above row to be outputted when executing X, as the output I get (in DBArtisan) is:

6/25/2010 12:00:00.000 AM
-2817773441.669999

This will obviously affect the results obtained by the servlet as it expects only the value -2817773441.669999.

Is there any way to suppress the output of get_business_day appearing when calling X?

Thx Agnyata

skaffman
  • 398,947
  • 96
  • 818
  • 769
Chapax
  • 171
  • 2
  • 2
  • 7

2 Answers2

1

here is the what you want to do:

main proc:

...
create table #tmp(
    CBDate datetime
)
EXEC get_business_day @CBDate, -1

select CBDate from #tmp
-- use it

drop table #tmp
-- before end

get_business_day:

create table #tmp(
    CBDate datetime
)
go
create proc get_business_day
as

-- find the value to be inserted into @day
insert into #tmp select @day

go

drop table #tmp
go
Burcin
  • 973
  • 1
  • 9
  • 25
-1

try capturing the result set in a temp table, something like this:

CREATE TABLE #BadResultSet (DateOf datetime)

INSERT INTO #BadResultSet (DateOf)
EXEC get_business_day @CBDate, -1, @prevBusDay output
KM.
  • 101,727
  • 34
  • 178
  • 212
  • does not work ... Iget the below message: 20:43:20.546 DBMS -- Number (156) Severity (15) State (2) Server Incorrect syntax near the keyword 'exec'. – Chapax Aug 31 '10 at 15:13
  • try this: [How can I get data from a stored procedure into a temp table ?](http://stackoverflow.com/questions/166080/how-can-i-get-data-from-a-stored-procedure-into-a-temp-table), I don't have sybase to actually try these out on, but I did this all the time (over ten years ago, so I don't remember it exactly) – KM. Aug 31 '10 at 15:46
  • Thx KM ... I think this cannot be done in Sybase as per the above thread. – Chapax Aug 31 '10 at 15:50
  • if you put data to temp table in get_business_day, then you have to remove "output" keyword after @prevBusDay – Burcin Aug 31 '10 at 18:14