在PB之外的环境中实现Blob类型数据输出?

tanye 2001-11-06 11:54:06
利用Pb可以把任意类型的文件通过Blob /bin /image /text 等类型的字段存入数据库中
但是,
问题来了,非PB客户端上,怎样通过其他工具把这些文件从数据库中还原出来了?

例如:使用Power Dynamo脚本把文件恢复?
...全文
118 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
killerdanny 2001-11-09
  • 打赏
  • 举报
回复
Description
The function reads the contents of the named file, and returns the result as a LONG BINARY value.

The filename is relative to the starting directory of the database server.

The function can be useful for inserting entire documents or images stored in files into tables. If the file cannot be read, the function returns NULL.

Example
The following statement inserts an image into a column named picture of the table t1 (assuming all other columns can accept NULL):

INSERT INTO t1 ( picture)
SELECT xp_read_file( 'portrait.gif' )
//这是他自己的帮助!
killerdanny 2001-11-09
  • 打赏
  • 举报
回复
SQL ANYWHERE 7.0的系统函数。你装一套,就可以直接调了!
tanye 2001-11-09
  • 打赏
  • 举报
回复
killerdanny(danny) :
xp_write_file
xp_read_file
在哪个数据库中有?
我好像没有看到,如果是自定义的,可以发一份给我吗
感谢感谢!!
killerdanny 2001-11-09
  • 打赏
  • 举报
回复
ASE一定有这个函数的 !SYBASE桌面数据库ASA都有,ASE一定有的,其他数据库就不好说了!
SQLSERVER7,我没有用过BLOB!
tanye 2001-11-09
  • 打赏
  • 举报
回复
MSSQL / Sybase 这些数据库该怎么办?
iamxia 2001-11-08
  • 打赏
  • 举报
回复
U P
killerdanny 2001-11-08
  • 打赏
  • 举报
回复
SELECT xp_write_file( filename, picture)
FROM t1
这个是写文件的语法例子!
killerdanny 2001-11-08
  • 打赏
  • 举报
回复
///以下是ASA的语法
CREATE TABLE pictures
( c1 INT DEFAULT AUTOINCREMENT PRIMARY KEY,
filename VARCHAR(254),
picture LONG BINARY )
//INSERT一个GIF文件
INSERT INTO pictures (filename, picture)
VALUES ( 'portrait.gif',
xp_read_file( 'portrait.gif' ) )
//xp_read_file 是ASA的系统函数。
你把这些做成BAT文件,不就行了!
//BAT的语法例子
DBISQLC -c DSN=emotor;UID=dba;PWD=sql INSERT INTO pictures (filename, picture)
VALUES ( 'portrait.gif',
xp_read_file( 'portrait.gif' ) )
//其他数据库,估计也有类似的语法。查查吧!
tanye 2001-11-08
  • 打赏
  • 举报
回复
upupup

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧