Schultz’s PowerBuilder Notes

Datawindow Retreive With Large In Clause


Our DBMS limits the number of Items in an “IN Clause” to 255. If you attempt to retrieve with an array of a larger size, the retrieve fails. One method of dealing with this constraint is to create a temp table, populate this with your retrieval arguments, and then have your datastore join to the temp table during the retrieve. Another way is to use a function similar to this: Continue reading

Advertisements

August 10, 2009 Posted by | 2. Datawindows, Uncategorized | , , , , , , | 1 Comment

Exporting Data


How do I write the contents of a DataWindow or datastore to an ASCII file?

Dw_1.SaveAs(“<file name>”, TEXT!, false) // Last parameter suppresses column headings.

May 25, 2008 Posted by | Datawindow PowerScript | , , , , | Leave a comment

DataWindow Ancestry


DataWindow, DWChild, and DataStore are all inherited from different places.

DataWindow

PowerObject

Application

Function

GraphicObject

WindowObject

DragObject

DataWindow

NonVisual Object

DataStore

Structure

DataWindowChild

Datastore

PowerObject

Application

Function

GraphicObject

NonVisual Object

DataStore

Structure

DataWindowChild

PowerObject

Application

Function

GraphicObject

NonVisual Object

Structure

DataWindowChild

May 9, 2008 Posted by | 2. Datawindows | , , , , , | Leave a comment

Class() and TypeOf()


Class()

The class is the name of an object. You assign the name when you save the object in its painter.

ls_class = Lower(adw.ClassName())

In the above script, the class name will be n_ds or u_dw, or n_ds_add_rows. Here is another sample script:

choose case adw_wrkr_tm.ClassName()

case “dw_mach_op”

ls_type = “Direct Time”

case “dw_handwork_press”

ls_type = “Press Handwork”

case “dw_handwork_finishing”

ls_type = “Finishing Handwork”

case “dw_indirect_labor”

ls_type = “Indirect Time”

end choose

TypeOf()

TypeOf reports an object’s built-in object type. The types are values of the Object enumerated data type, such as Window! or CheckBox!. ClassName reports the class of the object in the ancestor-descendant hierarchy.

choose case TypeOf(adw)

case datastore!

lv_rc = TRUE

case else

lb_rc = FALSE

enc choose

If adw is a descendant of datastore!, like n_ds, it is still of TypeOf datastore!

April 21, 2008 Posted by | Powerscript | , , , , , | 1 Comment