|
|
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
Как работать с BLOB полем в виде картинки из Дельфи через SQL-запрос (Insert, Update, Delete). СУБД Oracle. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 09:43 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
Хочешь сказать, что такого плана запрос не проходит? UPDATE ClobTable SET Name = :Name, Value = :Value WHERE Id = :Id попробуй так UPDATE ClobTable SET Name = :Name, Value = EMPTY_BLOB() WHERE Id = :Id RETURNING Value INTO :Value (сразу скажу, не знаю, через что ты работаешь) Дело в том, что в поле типа CLOB, хранится (если не углублятся) указатель на данные, а не сами данные. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 10:32 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
у нас в конторе используются компоненты DOA. так там работа с блобами не отличается от других полей. перед редактированием блоб поля переводишь его в едит режим через dataset.edit; потом делаешь datasetblobfieldname.clear(); datasetblobfieldname.loadfromfile(...); dataset.post; собственно и всё. если этого мало тогда подробнее код могу привести. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 10:43 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
да и еще. если уж работаете с блобам из делфи так не сильно уж и разгонитесь с sql запросами. при работе с блоб я думаю sql запросы не сильно подойдут. или может есть другие мнения у народа? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 10:48 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
4 блин: приведите код пожалста: dataset - это что Table или Query или что-то еще? я работаю через компонент TOCIQuery - они бесплатные ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 10:56 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
DOA тоже бесплатные. You need to insert new LOB data into a table in two situations: 1. You are inserting a new record. 2. You are updating a record where the old value of the LOB column is null. In this case, the record does not contain a LOB Locator that you can use to write data to. You must first insert/update an empty LOB Locator into the record. To do so, you can use the SQL function empty_blob() or empty_clob() in an insert or update statement. On the server, the LOB Locator will be initialized. The initialized LOB Locator can then be returned to the client in a variable by using the new Oracle8 returning clause. After this, you can start writing data to the LOB column. Note that you must use SetComplexVariable to set a LOB variable. The following is an example of an insert: var LOB: TLOBLocator; Buffer: array[0..99] of Byte; begin // insert into lobtable (id, lobcolumn) values (:id, empty_blob()) // returning lobcolumn into :lobcolumn with LOBQuery do begin SetVariable('id', 1); // Create a new BLOB (initially Null) LOB := TLOBLocator.Create(Session, otBLOB); // Assign it to the returning variable SetComplexVariable('lobcolumn', LOB); Execute; // After the insert, use the LOB Locator to write the data LOB.Write(Buffer, 100); LOB.Free; end; end; LOBQuery - TOracleQuiery. вообще я вам советую DOA - простая и мощная штука. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 11:22 |
|
||
|
Работа с BLOB полем (Delphi - Oracle)
|
|||
|---|---|---|---|
|
#18+
или вот такой еще вариант есть procedure TfrBiblio.actLoadExecute(Sender: TObject); begin odsBiblio.Edit; odsBiblioCONTENT.Clear; odsBiblioCONTENT.LoadFromFile(dlgOpen.FileName); odsBiblio.Post; end; procedure TfrBiblio.actSaveExecute(Sender: TObject); begin odsBiblioCONTENT.SaveToFile(dlgSave.FileName); end; odtsBiblio - TOracleDataSet ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 04.04.2003, 11:36 |
|
||
|
|

start [/forum/topic.php?fid=52&msg=32133381&tid=1991172]: |
0ms |
get settings: |
8ms |
get forum list: |
16ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
169ms |
get topic data: |
13ms |
get forum data: |
6ms |
get page messages: |
67ms |
get tp. blocked users: |
2ms |
| others: | 221ms |
| total: | 508ms |

| 0 / 0 |
