Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Re: SQL Stored procedure

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-06-17 : 08:01:28
Santosh writes "Hi
I am calling a stored procedure from my java program and passing a dynamic where clause of more than 56KB . (Very big where clause).

How do I pass such a big String data to a Stored Procedure?
Now I am using nvarchar(4000) datatype and is working fine for small where claue.
Now if change it to varchar(8000) I am getting error as
"Cannot convert parameter '@statement' to ntext/nchar/nvarchar data type expected by procedure"
Even if I make it to work it may not solve my problem as I need to pass a very big Where clause.
What is the solution for this?

Please help me in this regard,


Here is my stored procedure -


CREATE Procedure AlarmDetsCount

@Where varchar(8000)
as
set nocount on

declare @SQL varchar(8000)
select @SQL = 'select count(*) FROM production_stop_record INNER JOIN point ON production_stop_record.point_number = point.point_number '+@where
exec sp_executesql @SQL

Basically this is not working. First I need to make this to work and then think about passing data more than 8000 chars.




Thanks,
Santosh"

rrb
SQLTeam Poet Laureate

1479 Posts

Posted - 2003-06-17 : 19:30:29
Hi Santosh

Can you give us a "cut-down" example of your where clause? Perhaps this can be solved by other means, alternatively you may have to insert your "where clause" into a table, and refernce that record in your stored procedure....

(Perhaps you could post the SP code, or at least a description of what it is you're trying to do).

--
I hope that when I die someone will say of me "That guy sure owed me a lot of money"
Go to Top of Page
   

- Advertisement -