|
|
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
Запрос из PHP для MSSQL выдает не полностью поле типа TEXT. В чем проблема. Поиск по форуму ничего не дает, срывается. Заранее спасибо за ответы. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.05.2002, 09:18:09 |
|
||
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
Попробуй предварительно выполнить "set textsize 2147483647". ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.05.2002, 09:35:48 |
|
||
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
Это ничего не дало ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 23.05.2002, 11:21:16 |
|
||
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
выдает не полностью поле типа TEXT Я бы предварительно проверил (в QA например) code:select datalength(поле) from ... а потом сравнил с длинной возвращаемого Запрос из PHP для MSSQL IMHO а может там и нет его полностью ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.05.2002, 05:37:40 |
|
||
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
В том и дело, что все там есть Нашел идиотский выход: разбивать в процедуре значение поля text на кусочки и выводить в табличке ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.05.2002, 13:30:21 |
|
||
|
Срочно! Как достать TEXT???
|
|||
|---|---|---|---|
|
#18+
poprobyi etot script , ia ego ispol"zyu contentlemmes - col_name otkyda ti xochech" vitashit" text ; url - table name ; urlid - Primary key dlia table url ; call sp : get_text @urlid=14 -- Proc get_text does READTEXT in a loop to read chunks of text -- no larger than 200, or the column size or @@TEXTSIZE, and -- produces as many rows as necessary to store the text column -- as a series of sequenced varchar(200) rows CREATE PROC get_text @urlid char(4) AS DECLARE @mytextptr varbinary(16), @totalsize int, @lastread int, @readsize int -- Use a TRAN and HOLDLOCK to ensure textptr and text are -- constant during the iterative reads BEGIN TRAN SELECT @mytextptr=TEXTPTR(contentlemmes), @totalsize=DATALENGTH(contentlemmes), @lastread=0, -- Set the readsize to the smaller of the @@TEXTSIZE setting, -- 200, and the total length of the column @readsize=CASE WHEN (200 < DATALENGTH(contentlemmes)) THEN 200 ELSE DATALENGTH(contentlemmes) END FROM url (HOLDLOCK) WHERE urlid=@urlid -- If debugging, uncomment this to check values ----SELECT @mytextptr, @totalsize, @lastread, @readsize -- Do READTEXT in a loop to get next 200 characters until done IF @mytextptr IS NOT NULL AND @readsize > 0 WHILE (@lastread < @totalsize) BEGIN -- If read size would go beyond end, adjust read size IF ((@readsize + @lastread) > @totalsize) SELECT @readsize = @totalsize - @lastread -- If debugging, uncomment this to check values --- SELECT 'valid ptr?'=textvalid('url.contentlemmes', --- @mytextptr), 'totalsize'=@totalsize, --- 'lastread'=@lastread, 'readsize'=@readsize READTEXT Url.contentlemmes @mytextptr @lastread @readsize IF (@@error <> 0) BREAK -- Break out of loop if an error on read -- Change offset to last char read SELECT @lastread=@lastread + @readsize END COMMIT TRAN GO ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 24.05.2002, 17:34:59 |
|
||
|
|

start [/forum/topic.php?fid=46&msg=32031100&tid=1822581]: |
0ms |
get settings: |
8ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
42ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
39ms |
get tp. blocked users: |
1ms |
| others: | 199ms |
| total: | 322ms |

| 0 / 0 |
