2012年2月16日星期四

Any facility to hold string data of length more than 8000 characters?

Hi,
I have a typical scenario in one of our application.
In a Stored Procedure, I need to get values from different fields and form a
select statement.
The problem here is each field may be upto a length of 8000. So after
forming the final query it will exceed length of 8000. How to concatenate
these field values to form a query which will have length of more than 8000
characters? Is there any data type allows this or is there array concept?
Please provide a solution. Help of any sort is highly appreciated.
Thanks,
Su ManSu,
You concatenate them right at the execution statement:
EXEC(@.str1 + @.str2 + ...)
Ilya
"Su Man" <subu501@.yahoo.com> wrote in message
news:d89f1u$neq$1@.news.mch.sbs.de...
> Hi,
> I have a typical scenario in one of our application.
> In a Stored Procedure, I need to get values from different fields and form
a
> select statement.
> The problem here is each field may be upto a length of 8000. So after
> forming the final query it will exceed length of 8000. How to concatenate
> these field values to form a query which will have length of more than
8000
> characters? Is there any data type allows this or is there array concept?
> Please provide a solution. Help of any sort is highly appreciated.
> Thanks,
> Su Man
>|||But we do not know how many fields to be concatenated. They are dynamic
"Ilya Margolin" <ilya_no_spam_@.unapen.com> wrote in message
news:u8uM#YPbFHA.2288@.TK2MSFTNGP14.phx.gbl...
> Su,
> You concatenate them right at the execution statement:
> EXEC(@.str1 + @.str2 + ...)
> Ilya
> "Su Man" <subu501@.yahoo.com> wrote in message
> news:d89f1u$neq$1@.news.mch.sbs.de...
form
> a
concatenate
> 8000
concept?
>|||Su,
What is you statement? Every statement has an end.
Ilya
"Su Man" <subu501@.yahoo.com> wrote in message
news:d89g2r$rfc$1@.news.mch.sbs.de...
> But we do not know how many fields to be concatenated. They are dynamic
> "Ilya Margolin" <ilya_no_spam_@.unapen.com> wrote in message
> news:u8uM#YPbFHA.2288@.TK2MSFTNGP14.phx.gbl...
> form
> concatenate
> concept?
>|||It seems to me, although I am not an expert, that when one has to do
something like this, there is a major flaw in the data model.
"Ilya Margolin" <ilya_no_spam_@.unapen.com> wrote in message
news:%231HD4fPbFHA.3932@.TK2MSFTNGP12.phx.gbl...
> Su,
> What is you statement? Every statement has an end.
> Ilya
> "Su Man" <subu501@.yahoo.com> wrote in message
> news:d89g2r$rfc$1@.news.mch.sbs.de...
>|||"Robin Tucker" <idontwanttobespammedanymore@.reallyidont.com> wrote in
message news:d89hcb$evf$1$8300dec7@.news.demon.co.uk...

> It seems to me, although I am not an expert, that when one has to do
> something like this, there is a major flaw in the data model.
I couldn't agree more!|||Ilya,
Eevery statement will not have end.
Statement1 may be - select a,c,h,j,e from gggjjjh
Statement2 may be - where t1.a = t2.b
Statement3 may be - group by g,k,l
Statement4 may be - having s = 'value'
Statement5 may be - Order by w,k
The above are just indcative and each statement may be upto a lengh of 8000.
Considering the above,
Statement1+Statement2+Statement3+Stateme
nt4+Statement5 may sum up to 40000
and which data type can hold the string.
Or is there any concept of array where I can hole all individula statements
and finall concatenate to execute.
Please reply.
Thanks,
Su man
"Ilya Margolin" <ilya_no_spam_@.unapen.com> wrote in message
news:#1HD4fPbFHA.3932@.TK2MSFTNGP12.phx.gbl...
> Su,
> What is you statement? Every statement has an end.
> Ilya
> "Su Man" <subu501@.yahoo.com> wrote in message
> news:d89g2r$rfc$1@.news.mch.sbs.de...
and
after
than
>

没有评论:

发表评论