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

