powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Запись из BLOB в DBF файл
3 сообщений из 3, страница 1 из 1
Запись из BLOB в DBF файл
    #33910907
sunches
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
PB9
DBF файл хранится в таблице. Надо записать его в файл.
Делаю так
li_FileNum = FileOpen(sPATH_FILE, StreamMode!, Write!, Shared!, Replace!)
SELECTBLOB DBF_FILE into :bl from dbf_blob where ....;
FileWrite(li_FileNum, bl)


Пишет только 32 к Подскажите как правильно разбить BLOB и записать по частям
Спасибо
...
Рейтинг: 0 / 0
Запись из BLOB в DBF файл
    #33911071
Фотография AIZ
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Смотри PFC

Код: plaintext
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.
31.
32.
33.
34.
35.
36.
37.
38.
39.
40.
41.
42.
43.
44.
45.
46.
47.
48.
49.
50.
51.
52.
53.
54.
55.
//////////////////////////////////////////////////////////////////////////////
//	Public Function:  of_FileWrite
//	Arguments:		as_FileName				The name of the file to write to.
//						ablb_Data				The data to be written to the file.
//						ab_Append				True - append to the end of the file,
//													False - overwrite the existing file.
//	Returns:			Integer
//						 1  if successful, - 1  if an error occurrs.
//	Description:	Open, write from a blob, and close a file.  Handles blobs >  32 , 765  bytes.
//////////////////////////////////////////////////////////////////////////////
//	Rev. History:	Version
//						 5 . 0    Initial version
//////////////////////////////////////////////////////////////////////////////
//	Copyright ©  1996 - 1999  Sybase, Inc. and its subsidiaries.  All rights reserved.  Any distribution of the 
// PowerBuilder Foundation Classes (PFC) source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//////////////////////////////////////////////////////////////////////////////
integer li_FileNo, li_Writes, li_Cnt
long ll_BlobLen, ll_CurrentPos
blob lblb_Data
writemode lwm_Mode

If ab_Append Then
	lwm_Mode = Append!
Else
	lwm_Mode = Replace!
End if

li_FileNo = FileOpen(as_FileName, StreamMode!, Write!, LockReadWrite!, lwm_Mode)
If li_FileNo <  0  Then Return - 1 

ll_BlobLen = Len(ablb_Data)

// Determine the number of writes required to write the entire blob
If ll_BlobLen >  32765  Then
	If Mod(ll_BlobLen,  32765 ) =  0  Then
		li_Writes = ll_BlobLen /  32765 
	Else
		li_Writes = (ll_BlobLen /  32765 ) +  1 
	End if
Else
	li_Writes =  1 
End if

ll_CurrentPos =  1 

For li_Cnt =  1  To li_Writes
	lblb_Data = BlobMid(ablb_Data, ll_CurrentPos,  32765 )
	ll_CurrentPos +=  32765 
	If FileWrite(li_FileNo, lblb_Data) = - 1  Then
		Return - 1 
	End if
Next

FileClose(li_FileNo)

Return  1 
...
Рейтинг: 0 / 0
Запись из BLOB в DBF файл
    #33912747
sunches
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
AIZ, спасибо огромное!
...
Рейтинг: 0 / 0
3 сообщений из 3, страница 1 из 1
Форумы / PowerBuilder [игнор отключен] [закрыт для гостей] / Запись из BLOB в DBF файл
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]