e股脑电脑教程网
  • 首 页
  • 操作系统
  • 应用软件
  • 下载工具
  • 影音视频
  • 办公软件
  • 媒体制作
  • 网站建设
  • 平面设计
  • 数据库
  • 程序开发
  • 视频教程
编辑推荐: | 文章搜索:
您现在的位置: e股脑 >> 程序开发 >> PowerBuilder教程 >> 如何存取二进制大对象(BLOBs) >> 教程正文
 
教程搜索
 
 
相关教程
  • 在PowerBuilder中利用Dat
  • 什么是“pbcat表?
  • 修改PB6的PBL,使之在PB5中
  • 使用日期格式时的一些问题
  • 如何存取二进制大对象(BL
  • 关于PowerBuilder的补丁包
  • 如果在isql中建立表或者增
  • PB高级开发环境配置
  • 动态设置Win95和NT的缺省
  • PowerBuilder6.0运行环境
  • PowerBuilder、InfoMaker
  • PB API调用原型
  • 如何用VC创建可在PB中调用
  • PB应用技巧——数据窗口自
  • 为PB加入具有布局功能的容
  • PB7.0通用选字段查询窗口
 
 
赞 助 商
 
 
如何存取二进制大对象(BLOBs)
  • 来源:e股脑
  • 点击次数:
  • 更新时间:2007-8-9

Dynamically Setting a Default Printer on Win95 and NT (32 bit only)

SUMMARY: This document contains information on working with binary large objects (BLOBS). Document ID: 44008 Last Revised: 01/29/96 Topic: Database Admin Document Type: TechNote Product: PowerBuilder Version: 4; 3 Platform: PC Operating System: Not Operating System Specific

Document:

Working with Binary Large Objects (BLOBs) (Pre-, PB 5.0)

When do I want to use Powerscript's BLOB datatype?

There are several reason's why you would want to use the BLOB datatype. For Example:

You need to store OLE objects in your database

You need to store large binary objects in your database

You are storing text larger than that easily handled by normal functions

You need to access a variable type that PowerBuilder does not support. For example, in SQLBase the longvarchar datatype is not a supported datatype, but can be manipulated through use of blob functions.

ls_key = String variable containing the registry path to the printer information.

What datatype on my DBMS can work as BLOB in Powerscript?

It's best to consult your database documentation, as well as the Appendix of your PowerBuilder database interface guide to determine this. Listed below are some supported databases and the corresponding datatypes.


DBMS

Datatypes

Watcom SQL

long binary, long varchar

Oracle longraw

SQL Server

Image, Text

Informix

Text

MDI Gateway DB/2

Long varchar

SQLBase

longvarchar

AllBase

longvarchar

DB2/2

N/A

I. OLE columns - DataWindows only:

(for further reference see the PowerBuilder 3.0 User's Guide pages 790 - 798)

Before creating on OLE column in a datawindow you must meet a few requirements:.

1. The table that will contain the OLE column must:

a) have a column defined as the local data type which maps onto the Binary Large Object (i.e., Long Binary in Watcom, Image in SQL Server, Long Raw in Oracle, etc...)

b) be defined to allow nulls.

c) have a primary key

2. In the PowerBuilder development environment, if you are using SQLServer you must set AUTOCOMMIT to TRUE (set the AUTOCOMMIT option to in Preferences to 1).

3. In the Datawindow Painter create a datawindow. The column previously defined to store the binary (BLOB) data must not be included in the data source.

4. Add an OLE column by going to the Objects menu and selecting OLE Database Blob.You will be presented with the Database Binary/Text Large Object window.

Name: This specifies the name for the blob column, if you will need one. You don't need to name it, but if you do then you will be able to refer to it in scripts. This example is named 'sound_blob'. Clients Class:

This is the name of the class that is used if your application is referenced by the OLE server. Here it is the default class of 'Datawindow' Client Name: This is the name OLE servers will use when referring to your application. Here we have left the default name of 'untitled' Table: This secifies the table that contains the blob column. In this case the table is 'soundblob'. Large Binary/Text Columns: This selection is the column that contains the actual blob. In this case the 'soundblob' column is selected to store the OLE object. Key Clause: This specifies the WHERE criteria that allows PowerBuilder to select and update the correct row. This will default to the primary key of the table. In this case, blobkey is the primary key and the select and update statement will have a where clause of "... where blobkey =: blobkey" File Template: Specify a file name, if you wish to start each object based on a common template. In our example, the sound bit storage, we are starting with an empty file each time, but if you were storing Word documents for example you might want to always start out with a specific .DOC file. OLE Class: Description (Only Class is used) : If you are not using a file template, you will need to specify the class of application that you wish to use . In this case, since we are recording soundbits, we set the class equal to SoundRec. You will be given the option of setting this to any of the classes defined in

[1] [2] [3] [4] 下一页

  • 上一篇教程: 关于PowerBuilder的补丁包
  • 下一篇教程: 使用日期格式时的一些问题
  •  

    关于本站 | 广告联系 | 版权声明 | 使用帮助

    Copyright © 2004-2008 www.egunao.com All rights reserved.