0% found this document useful (0 votes)
35 views43 pages

PowerBuilder FAQ: DataWindow & SQL

Use SyntaxFromSQL to get SQL syntax from a string and pass it to a DataWindow control's Create function to generate a runtime DataWindow object, which returns 1 on success or -1 if an error occurs.

Uploaded by

kanagu12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views43 pages

PowerBuilder FAQ: DataWindow & SQL

Use SyntaxFromSQL to get SQL syntax from a string and pass it to a DataWindow control's Create function to generate a runtime DataWindow object, which returns 1 on success or -1 if an error occurs.

Uploaded by

kanagu12
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 43

1. How can you generate runtime DataWindow object?

2. How can you open a UserObject or TabControl in a window?


3. What is garbage collection and what are the functions to set and get garbage time limit?
4. Give some example of function overloading.
5. Can you open a response window with OpenSheet function?
6. Can you open more that one response window at the same time? And why?
7. You can inherit the user object and window. So which one is preferable and why?
8. What is the return value of describe and modify function?
9. Can you copy data from one DataWindow to other? How?
10. Can you copy data from one buffer to other within the same DataWindow and how?
11. How can you move record from one DataWindow to other and one buffer to other?
12. How can you delete or filter the records with out sending them to buffer?
13. If the DataWindow update property is false and you applied a delete function to some records what
will happen?
14. How can you make sharing of DataWindow off?
15. What are the restrictions to share data between to DataWindow?
16. What are the four methods of dynamic SQL? Describe it.
17. What is the SQLSA?
18. What is the SQLDA?
19. What is the delegation?
20. What is the difference between computed column and computed field?
21. How ImportString function works? What is the argument to it?
22. What is the ImportFile function? Tell other functions related to it.
23. What are the arguments in SqlPreview event? When does it get triggered?
24. How many triggers are there in oracle and what they are?
25. What SetPosition function does?
26. What are the painters provided in the Power builder?
27. If the page size is go down or is less what error does Sybase gives?
28. Why are the user events not given on menu?
29. How is the package function in oracle calls in pb?
30. What is the object coupling?
31. What functions we generally use in CloseQuery event and what does it triggers?
32. What is the LookupDisplay function?
33. What does the pb.ini do?
34. For what the open event of application object is used?
35. How many events are there in application object? What they are?
36. From which pb object Error and Message object are inherited?
37. What are the global variables and objects in pb?
38. What are all the graph styles?
39. What are all DataWindow styles provided with pb?
40. Difference between DataWindow and DataStore.
41. What are the difference between DataSource and DataStore?
42. How can you get column level and row level item status?
43. What are the item statuses provided with pb?
44. What item status generates update statements?
45. How can you trap errors in pb?
46. What is the difference between PostEvent and TriggerEvent?
47. What are the differences between event and functions?
48. What are the scopes of variables? In which sequence does pb search for the variables?
49. What is the sequence for searching the files in pb applications?
50. What all functions you can not call in ItemChanged event? Why?
51. What are the return values of ItemChanged event?
52. If you want to call update function in ItemChanged event, what care you need to take?
53. How can you get values from original buffer?
54. What are all buffers present in pb?
55. What are the disadvantages of the triggers?
56. What are all the ddl (data definition language) statements?
57. Can you write commit in triggers? Why?
58. Can you write create statement in procedure?
59. How can you make DataWindow from procedure?
60. How can you update DataWindow created from procedure?
61. Can you modify the SQL of DataWindow runtime? How?
62. What is exception error handling in oracle?
63. How can you get SQL statement of the DataWindow objects?
64. How can you update multiple tables in a DataWindow?
65. How can you set attribute of DataWindow?
66. How can you get the attribute of the DataWindow?
67. If you pass only empty string with modify function what will happen?
68. How can we set item status of the DataWindows?
69. What are all the DataWindow styles and DataSources in pb?
70. How does pb implement oops concept?
71. What is a function overwriting?
72. What is the linkage service in PFC?
73. What is the DataWindow cashing service in pfc? What is the use of it?
74. What is the difference in parameter to functions by value and by reference?
75. What is the cursor? What are the types of cursor?
76. What are different joins?
77. What is the stored procedure? What is the use of it?
78. What is structure?
79. What is mean by table mutation?
80. What is the difference between delete and truncate statement?
81. Can you create multiple transaction objects in pb?
82. What is two tier and three tier architecture?
83. What is thin layer and thick layer database?
84. What is parsing in oracles?
85. What are the databases provided with Sybase?
86. What SQL does Sybase use?
87. What SQL does oracle use?
88. What is the minus of two tables?
89. How can you get the procedure definitions in oracle?
90. Write query to find second highest salary
91. Write query to get department having max employee.
92. What is full and incremental exe?
93. What is machine code exe?
94. How can you create pbd and dll with exe?
95. Can you create single pbd or dll .how?
96. What is the difference between pbd and dll?
97. What is pbr? What is the use of it? How will you create it?
98. Can you create exe with out pbd and dll?
99. What is check in and check out? What is use of it?
100. Can you update procedure definition through pb?
101. Can you set QueryMode to DataWindow which you are using in share data? What will happen?
102. Can you pass parameter to procedure dynamically?
103. What will happen if we write script in other event?
104. Difference between PB and VB.
105. What are the DataWindow object sources types?
106. For what the external DataWindow objects are used?
107. What is the difference between quick select and SQL select?
108. What is function OpenWithParm? What are the parameters to it?
109. Whet is the difference between popup and response window?
110. Difference between OpenSheet and Open function.
111. What is the alternative to store data temporarily?
112. Define DataWindow.
113. What will happen if you write MessageBox in ItemFocusChanged event? Why?
114. What are the different types of windows provided in pb?
115. What is the difference between pb5 and pb6?
116. What are the different types of DataWindow object style?
117. What are the events in application objects?
118. Can you inherit DataWindow objects?
119. What is the purpose of using user objects?
120. When does ItemFocusChanged event fires?
121. When does ItemError event triggers?
122. What are the methods of software engineering?
123. What are the steps in SDLC?
124. What are the different types of testing?
125. What is paroto diagram?
126. How can you estimate the time required to finish one job?
127. What values does any SQL will return?
128. If you do not write commit then what will happen?
129. Can you inherit user object?
130. What are the parameters in RetrieveStart, RetrieveEnd, RetrieveRow events?
131. What will happen if we delete rows from a DataWindow whose update property is false?
132. How can you move rows from one DataWindow to other and DataWindow to buffer?
133. What are the difference between Sybase and oracle?
134. What is thick and thin database structure?

Sr.N Question
o.
1 How can you generate runtime DataWindow object.
Ans Using syntaxfromsql function to get sqlsyntaxt for the passed sql string and then calling
function create

SyntaxFromSQL:

transaction.SyntaxFromSQL ( sqlselect, presentation, err )


Argument Description
transaction The name of a connected transaction object
sqlselect A string whose value is a valid SQL SELECT statement
presentation A string whose value is the default presentation style you want for the
DataWindow. The simple format is:Style(Type=presentationstyle)Values for presentationstyle
correspond to the styles in the New DataWindow dialog box in the DataWindow painter.
Keywords are:(Default) TabularGridForm (for freeform)GraphGroupLabelNupThe Usage
section lists the keywords you can use in presentation
err A string variable to which PowerBuilder will assign any error messages that occur
Return value
String. Returns the empty string ("") if an error occurs. If SyntaxFromSQL fails, err may
contain error messages if warnings or soft errors occur (for example, a syntax error). If any
argument's value is NULL, SyntaxFromSQL returns NULL.

Create:
dwcontrol.Create ( syntax {, errorbuffer } )
Argument Description
dwcontrol The name of the DataWindow control or DataStore in which PowerBuilder
will create the new DataWindow object
syntax A string whose value is the DataWindow source code that will be used to create the
DataWindow object
errorbuffer (optional) The name of a string that will hold any error messages that occur. If
you do not specify an error buffer, a message box will display the error messages
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
Create returns NULL.
2 How can you open a userobject or tabcontrol in a window?
Ans tabcontrolname.OpenTab ( userobjectvar, index )
Argument Description
tabcontrolname The name of the Tab control in which you want to open the user object as a tab
page
userobjectvar The name of the custom visual user object you want to open as a tab page. You
can specify a custom visual user object defined in the User Object painter (which is a user
object data type) or a variable of the desired user object data type. Open places a reference to
the opened custom visual user object in userobjectvar index. The number of the tab before
which you want to insert the new tab. If index is 0 or greater than the number of tabs, the tab
page is inserted at the end
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
OpenTab returns NULL.

windowname.OpenUserObject ( userobjectvar {, x, y } )
Argument Description
windowname The name of the window in which you want to open the user object
userobjectvar The name of the user object you want to display. You can specify a user object
defined in the User Object painter (which is a user object data type) or a variable of the desired
user object data type. Open places a reference to the opened user object in userobjectvar
x (optional) The x coordinate in PowerBuilder units of the user object within the window's
frame. The default is 0
y (optional) The y coordinate in PowerBuilder units of the user object within the window's
frame. The default is 0

3 What is garbage collection and what are the functions to set and get garbage time limit.
Ans What garbage collection does
The PowerBuilder garbage collection mechanism checks memory automatically for
unreferenced and orphaned objects and removes any it finds, thus taking care of most memory
leaks. You can use garbage collection to destroy objects instead of explicitly destroying them
using the DESTROY statement. This lets you avoid execution-time errors that occur when you
destroy an object that was being used by another process or had been passed by reference to a
posted event or function.

When garbage collection occurs


Garbage collection occurs:

¨ When a reference is removed from an object A reference to an object is any variable


whose value is the object. When the variable goes out of scope, or when it is assigned a
differenent value, PowerBuilder removes a reference to the object, counts the remaining
references, and destroys the object if no references remain.
¨ When the garbage collection interval is exceeded When PowerBuilder completes the
execution of a system-triggered event, it makes a garbage collection pass if the set interval
between garbage collection passes has been exceeded. The default interval is 0.5 seconds. The
garbage collection pass removes any objects and classes that cannot be referenced, including
those containing circular references (otherwise unreferenced objects that reference each other).
Posting events and functions When you post an event or function and pass an object reference,
PowerBuilder adds an internal reference to the object to prevent it from being garbage
collected between the time of the post and the actual execution of the event or function. This
reference is removed when the event or function is executed.

Exceptions to garbage collection

There are a few objects that are prevented from being garbage collected:

¨ Visual objects Any object that is visible on your sceen is not garbage collected because
when the object is created and displayed on your screen an internal reference is added to the
object. When any visual object is closed it is explicitly destroyed.
¨ Timing objects Any Timing object that is currently running is not garbage collected
because the Start function for a Timing object adds an internal reference. The Stop function
removes the reference.

¨ Shared objects Registered shared objects are not garbage collected because the
SharedObjectRegister function adds an internal reference. SharedObjectUnregister removes the
internal reference.

Controlling when garbage collection occurs

Garbage collection occurs automatically in PowerBuilder, but you can use the functions
GarbageCollect, GarbageCollectGetTimeLimit, and GarbageCollectSetTimeLimit to force
immediate garbage collection or to change the interval between reference count checks. By
setting the interval between garbage collection passes to a very large number, you can
effectively turn off garbage collection.
4 Give some example of function overloading.
Ans Messagebox(),Open(),opentab(),openuserobject() etc. all these functions are overloadded
because there are more than one function with same name in same class with different number
of parameter
5 Can you open a response window with OpenSheet function?
Ans Yes, we can open a response window with opensheet function but then that window will not
work as response.It will work as a main window.So Opening response windows Do not use the
OpenSheet function to open a response window
6 Can you open more that one response window at the same time? And why?
Ans No,you can not open multiple response windows at the same time because when you open one
response window It expect some input from user then only it proceed further.

7 You can inherit the user object and window so which one is preferable and why.
Ans User object is preferable because it takes less memory because in memory structure there are
two pool class pool and instance pool. Class pool maintain the class like window ,userobject
and instance pool which keeps all instances of the objects. To run a application atleast one
window should be open
So always there will be one window class in class pool. But in case of there is no need to keep
any user object in class pool when we do not need it.
8 What is the return value of describe and modify function?
Ans dwcontrol.Describe ( propertylist )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow for
which you want information about the structure
propertylist A string whose value is a blank-separated list of properties or Evaluate
functions. For a list of valid properties, see the DataWindow Reference
Return value
String. Returns a string that includes a value for each property or Evaluate function. A newline
character (~n) separates the value of each item in propertylist.
If the property list contains an invalid item, Describe returns an exclamation point (!) for that
item and ignores the rest of the property list. Describe returns a question mark (?) if there is no
value for a property.
When the value of a property contains a question mark (?), the value is returned in quotes so
that you can distinguish between it and a property with no value.

If any argument's value is NULL, Describe returns NULL.

9 Can you copy data from one datawindow to other? And how.
Ans Yes, we can copy data from one datawindow to other. To do so we can use functions
rowscopy.
dwcontrol.RowsCopy (startrow, endrow, copybuffer, targetdw, beforerow, targetbuffer )
Argument Description
dwcontrol The name of a DataWindow control, DataStore, or child DataWindow from
which you want to copy rows
startrow A long whose value is the number of the first row you want to copy
endrow A long whose value is the number of the last row you want to copy
copybuffer A value of the dwBuffer enumerated data type specifying the buffer from
which you want to copy the rows:¨ Primary!¨ Delete!¨ Filter!
targetdw The name of the DataWindow control or DataStore object to which you want
to copy the rows. Targetdw can be the same DataWindow (or DataStore) or another
DataWindow (or DataStore)
beforerow A long specifying the number of the row before which you want to insert the
copied rows. To insert after the last row, use any value that is greater than the number of
existing rows
targetbuffer A value of the dwBuffer enumerated data type specifying the target buffer for
the copied rows. Values are:¨ Primary!¨ Delete!¨ Filter!
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
RowsCopy returns NULL.

Usage

When you use the RowsCopy function, the status of the rows that are copied to the primary
buffer is NewModified!. If you issue an update request, PowerBuilder will send SQL INSERT
statements to the DBMS for the new rows.

When you use RowsCopy, data is not automatically retrieved for drop-down DataWindows in
the target DataWindow or DataStore, as it is when you call InsertRow. You must explicitly call
Retrieve for child DataWindows in the target.

Uses for RowsCopy include:

¨ Making copies of one or more rows so that the users can create new rows based on
existing data
¨ Printing a range of rows by copying selected rows to another DataWindow and
printing the second DataWindow

Buffer manipulation and query mode A DataWindow cannot be in query mode when you call
the RowsCopy function.
10 Can you copy data from one buffer to other within the same DataWindow and how?
Ans Yes, we can copy data from one datawindow to other. To do so we can use functions
RowsCopy.
dwcontrol.RowsCopy (startrow, endrow, copybuffer, targetdw, beforerow, targetbuffer )
Argument Description
dwcontrol The name of a DataWindow control, DataStore, or child DataWindow from
which you want to copy rows
startrow A long whose value is the number of the first row you want to copy
endrow A long whose value is the number of the last row you want to copy
copybuffer A value of the dwBuffer enumerated data type specifying the buffer from
which you want to copy the rows:¨ Primary!¨ Delete!¨ Filter!
targetdw The name of the DataWindow control or DataStore object to which you want
to copy the rows. Targetdw can be the same DataWindow (or DataStore) or another
DataWindow (or DataStore)
beforerow A long specifying the number of the row before which you want to insert the
copied rows. To insert after the last row, use any value that is greater than the number of
existing rows
targetbuffer A value of the dwBuffer enumerated data type specifying the target buffer for
the copied rows. Values are:¨ Primary!¨ Delete!¨ Filter!
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
RowsCopy returns NULL.

Usage

When you use the RowsCopy function, the status of the rows that are copied to the primary
buffer is NewModified!. If you issue an update request, PowerBuilder will send SQL INSERT
statements to the DBMS for the new rows.

When you use RowsCopy, data is not automatically retrieved for drop-down DataWindows in
the target DataWindow or DataStore, as it is when you call InsertRow. You must explicitly call
Retrieve for child DataWindows in the target.

Uses for RowsCopy include:

¨ Making copies of one or more rows so that the users can create new rows based on
existing data
¨ Printing a range of rows by copying selected rows to another DataWindow and
printing the second DataWindow

Buffer manipulation and query mode A DataWindow cannot be in query mode when you call
the Rowcopy function.
11 How can you move record from one datawindow to other and one buffer to other?
Ans Yes you can do so using rowsmove function.
dwcontrol.RowsMove ( startrow, endrow, movebuffer, targetdw, beforerow, targetbuffer )
Argument Description
dwcontrol The name of a DataWindow control, DataStore, or child DataWindow from
which you want to move rows
startrow A long whose value is the number of the first row you want to move
endrow A long whose value is the number of the last row you want to move
movebuffer A value of the dwBuffer enumerated data type specifying the buffer from
which you want to move the rows. Values are: ¨ Primary! ¨ Delete! ¨ Filter!
targetdw The name of the DataWindow control or DataStore to which you want to move
the rows. Targetdw can be the same DataWindow control (or DataStore) or a different
DataWindow control (or DataStore), but it cannot be a child DataWindow
beforerow A long specifying the number of the row before which you want to insert the
moved rows. To insert after the last row, use any value that is greater than the number of
existing rows
targetbuffer A value of the dwBuffer enumerated data type specifying the target buffer for
the moved rows. Values are:¨ Primary!¨ Delete!¨ Filter!
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
RowsMove returns NULL.

Usage

When you use RowsMove, the rows have the status NewModified! in the target DataWindow.

If you move rows between buffers in a single DataWindow control or DataStore, PowerBuilder
retains knowledge of where the rows came from and their status is changed accordingly. For
example, if you move unmodified rows from the primary buffer to the delete buffer, they are
marked for deletion. If you move the rows back to the primary buffer, their status returns to
NotModified!. Note, however, that if you move rows from one DataWindow control (or
DataStore) to another and back again, the rows' status is NewModified! because they came
from a different DataWindow.

When you use RowsMove, data is not automatically retrieved for drop-down DataWindows in
the target DataWindow, as it is when you call InsertRow. You must explicitly call Retrieve for
child DataWindows in the target.

Uses for RowsMove include:

¨ Moving several rows from the primary buffer to the delete buffer, instead of deleting
them one at a time
¨ Moving rows from the delete buffer to the primary buffer, to implement an Undo
capability in your application

Buffer manipulation and query mode A DataWindow cannot be in query mode when you call
the RowsMove function.

12 How can you delete or filter the records with out sending them to buffer.
Ans We can do so by using rowsdiscard function.
dwcontrol RowsDiscard (startrow, endrow, buffer )
Argument Description
dwcontrol The name of a DataWindow control or child DataWindow from which you
want to discard rows
startrow A long whose value is the number of the first row you want to discard
endrow A long whose value is the number of the last row you want to discard
buffer A value of the dwBuffer enumerated data type specifying the buffer containing the
rows to be discarded. Values are: ¨ Primary! ¨ Delete! ¨ Filter!
Return value

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
RowsDiscard returns NULL.

Usage

Use RowsDiscard when your application is finished with some of the rows in a DataWindow
control and you don't want an update to affect the rows in the database. For example, you can
discard rows in the delete buffer, which prevents the rows from being deleted when you call
Update.
To clear all the rows from a DataWindow control, use Reset.
13 If the datawindow update property is false and you applied a delete function to some records
Ans what will happen?
In this case deleted rows will not go to the delete buffer. This time delete work as RowsDiscard
function
14 How can you make sharing of datawindow off?
Ans You can do so using function sharedataoff.
dwcontrol.ShareDataOff ( )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow for
which you want to turn off data sharing
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If dwcontrol is NULL, ShareDataOff
returns NULL.
Usage
Two or more DataWindow controls (or DataStores) can share data. See ShareData for more
information about shared data buffers and primary and secondary DataWindows.
When you call ShareDataOff for a secondary DataWindow, that control no longer contains
data, but the primary DataWindow and other secondary controls are not affected. When you
call ShareDataOff for the primary DataWindow, all secondary DataWindows are disconnected
and no longer contain data.
15 What are the restrictions to share data between to datawindow?
Ans dwprimary.ShareData ( dwsecondary )
Argument Description
dwprimary The name of the primary DataWindow. The primary DataWindow is the owner
of the data. When you destroy this DataWindow, the data disappears. Dwprimary can be a
child DataWindow
dwsecondary The name of the secondary DataWindow; which is the control dwprimary will
share the data with. The secondary DataWindow cannot be a Crosstab DataWindow. It can be a
child DataWindow
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
ShareData returns NULL.
Usage
The columns must be the same for the DataWindow objects in the primary and secondary
DataWindow controls, but the SELECT statements may be different. For example, you could
share data between DataWindow objects with these SELECT statements:

SELECT dept_id from dept

SELECT dept_id from dept where dept_id = 200


SELECT dept_id from employee

WHERE clause in secondary has no effect. The WHERE clause in the DataWindow object in
the secondary DataWindow control has no effect on the number of rows returned. The number
of rows returned to both DataWindow controls is determined by the WHERE clause in the
primary DataWindow object.

You could also share data with a DataWindow object that has a script data source and a column
defined to be like the dept_id column.
To share data between a primary DataWindow and more than one secondary DataWindow
control, call ShareData for each secondary DataWindow control.
To turn off sharing in a primary or secondary DataWindow, call the ShareDataOff function.
When sharing is turned off for the primary DataWindow, the secondary DataWindows are
disconnected and the data disappears. However, turning off sharing for a secondary
DataWindow does not affect the data in the primary DataWindow or other secondary
DataWindows.

When you call functions in either the primary or secondary DataWindow that change the data,
PowerBuilder applies them to the primary DataWindow control and all secondary
DataWindow controls are affected. For example, when you call any of the following functions
for a secondary DataWindow control, PowerBuilder applies it to the primary DataWindow.
Therefore, all messages normally associated with the function go to the primary DataWindow
control. Such functions include:

DeleteRow
Filter
GetSQLSelect
ImportFile
ImportString
ImportClipboard
InsertRow
ReselectRow
Reset
Retrieve
SetFilter
SetSort
SetSQLSelect
Sort
Update

Computed fields in secondary DataWindow controls A secondary DataWindow control can


only have data which is in the primary DataWindow control. If you add a computed field to a
secondary control, it will not display when you run the application unless you also add it to the
primary control.

Query mode and secondary DataWindows When you are sharing data, you cannot turn on
query mode for a secondary DataWindow. Trying to set the QueryMode or QuerySort
properties results in an error.

To share data between a DataStore or DataWindow and a RichTextEdit control, use the
DataSource function.

Crosstab DataWindows You cannot use ShareData with Crosstab DataWindows.

Distributed applications You cannot share data between a DataWindow control in a client
application and a DataStore in a server application.

16 What are the four methods of dynamic sql? Describe it.


Ans Dynamic SQL syntax format 1: Use this format to execute a SQL statement that does not
produce a result set and does not require input parameters. You can use this format to execute
all forms of Data Definition Language (DDL).
Dynamic SQL Syntax format 2: Use this format to execute a SQL statement that does not
produce a result set but does require input parameters. You can use this format to execute all
forms of Data Definition Language (DDL).
Syntax

PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;

EXECUTE DynamicStagingArea USING {ParameterList} ;


Parameter Description
DynamicStagingArea The name of the DynamicStagingArea (usually SQLSA)If you need a
DynamicStagingArea variable other than SQLSA, you must declare it and instantiated it with
the CREATE statement before using it
SQLStatement A string containing a valid SQL statement. The string can be a string constant
or a PowerBuilder variable preceded by a colon (such as :mysql). The string must be contained
on one line and cannot contain expressionsEnter a question mark (?) for each parameter in the
statement. Value substitution is positional; reserved word substitution is not allowed
TransactionObject (optional) The name of the transaction object that identifies the database
ParameterList (optional)A comma-separated list of PowerScript variables. Note that
PowerScript variables are preceded by a colon (:)
Usage
To specify a NULL value, use the SetNull function.

Dynamic SQL syntax format 3: Use this format to execute a SQL statement that produces a
result set in which the input parameters and result set columns are known at compile time.
Syntax

DECLARE Cursor | Procedure DYNAMIC CURSOR | PROCEDURE FOR


DynamicStagingArea ;

PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;

OPEN DYNAMIC Cursor {USING ParameterList} ;

EXECUTE DYNAMIC Procedure {USING ParameterList} ;

FETCH Cursor | Procedure INTO HostVariableList ;

CLOSE Cursor | Procedure ;


Parameter Description
Cursor or Procedure The name of the cursor or procedure you want to use
DynamicStagingArea The name of the DynamicStagingArea (usually SQLSA)If you need a
DynamicStagingArea variable other than SQLSA, you must declare it and instantiate it with
the CREATE statement before using it
SQLStatement A string containing a valid SQL SELECT statement The string can be a string
constant or a PowerBuilder variable preceded by a colon (such as :mysql). The string must be
contained on one line and cannot contain expressions Enter a question mark (?) for each
parameter in the statement. Value substitution is positional; reserved word substitution is not
allowed
TransactionObject (optional) The name of the transaction object that identifies the database
ParameterList (optional)A comma-separated list of PowerScript variables. Note that
PowerScript variables are preceded by a colon (:)
HostVariableList The list of PowerScript variables into which the data values will be
retrieved
Usage
To specify a NULL value, use the SetNull function.
The DECLARE statement is not executable and can be declared globally.
If your DBMS supports formats of FETCH other than the customary (and default) FETCH
NEXT, you can specify FETCH FIRST, FETCH PRIOR, or FETCH LAST.
The FETCH and CLOSE statements in Format 3 are the same as in standard embedded SQL.
To declare a global, shared, or instance cursor or procedure, select Global Variables, Instance
Variables, or Shared Variables on the Declare menu of the PowerScript painter. To declare a
local cursor, click the Paint SQL button in the PainterBar.

For information about global, instance, shared, and local scope, see "Where to declare variables
".
Dynamic SQL syntax format 4: Use this format to execute a SQL statement that produces a
result set in which the number of input parameters, or the number of result-set columns, or both
are unknown at compile time.
Syntax
DECLARE Cursor | Procedure DYNAMIC CURSOR | PROCEDURE FOR
DynamicStagingArea ;

PREPARE DynamicStagingArea FROM SQLStatement {USING TransactionObject} ;

DESCRIBE DynamicStagingArea INTO DynamicDescriptionArea ;

OPEN DYNAMIC Cursor | Procedure USING DESCRIPTOR DynamicDescriptionArea ;

EXECUTE DYNAMIC Cursor | Procedure USING DESCRIPTOR


DynamicDescriptionArea ;

FETCH Cursor | Procedure USING DESCRIPTOR DynamicDescriptionArea ;

CLOSE Cursor | Procedure ;


Parameter Description
Cursor or Procedure The name of the cursor or procedure you want to use
DynamicStagingArea The name of the DynamicStagingArea (usually SQLSA)If you need a
DynamicStagingArea variable other than SQLSA, you must declare it and instantiate it with
the CREATE statement before using it
SQLStatement A string containing a valid SQL SELECT statement. The string can be a string
constant or a PowerBuilder variable preceded by a colon (such as :mysql). The string must be
contained on one line and cannot contain expressions Enter a question mark (?) for each
parameter in the statement. Value substitution is positional; reserved word substitution is not
allowed
TransactionObject (optional) The name of the transaction object that identifies the database
DynamicDescriptionArea The name of the DynamicDescriptionArea (usually SQLDA)If
you need a DynamicDescriptionArea variable other than SQLDA, you must declare it and
instantiate it with the CREATE statement before using it
Usage
The DECLARE statement is not executable and can be defined globally.
If your DBMS supports formats of FETCH other than the customary (and default) FETCH
NEXT, you can specify FETCH FIRST, FETCH PRIOR, or FETCH LAST.
To declare a global, shared, or instance cursor or procedure, select Global Variables, Instance
Variables, or Shared Variables on the Declare menu of the PowerScript painter. To declare a
local cursor, click the Paint SQL button in the PainterBar.

For information about global, instance, shared, and local scope, see "Where to declare variables
".
Accessing attribute information When a statement is described into a
DynamicDescriptionArea, this information is available to you in the attributes of that
DynamicDescriptionArea variable:
Information Attribute
Number of input parameters NumInputs
Array of input parameter types InParmType
Number of output parameters NumOutputs
Array of output parameter types OutParmType
Setting and accessing parameter values The array of input parameter values and the array of
output parameter values are also available. You can use the SetDynamicParm function to set
the values of an input parameter and the following functions to obtain the value of an output
parameter:

GetDynamicDate
GetDynamicDateTime
GetDynamicNumber
GetDynamicString
GetDynamicTime

For information about these functions, see GetDynamicDate, GetDynamicDateTime,


GetDynamicNumber, GetDynamicString, and GetDynamicTime.

Parameter values The following enumerated data types are the valid values for the input and
output parameter types:

TypeBoolean!
TypeDate!
TypeDateTime!
TypeDecimal!
TypeDouble!
TypeInteger!
TypeLong!
TypeReal!
TypeString!
TypeTime!
TypeUInt!
TypeULong!
TypeUnknown!

Input parameters You can set the type and value of each input parameter found in the
PREPARE statement. PowerBuilder populates the SQLDA attribute NumInputs when the
DESCRIBE is executed. You can use this value with the SetDynamicParm function to set the
type and value of a specific input parameter. The input parameters are optional; but if you use
them, you should fill in all the values before executing the OPEN or EXECUTE statement.

Output parameters You can access the type and value of each output parameter found in the
PREPARE statement. If the database supports output parameter description, PowerBuilder
populates the SQLDA attribute NumOutputs when the DESCRIBE is executed. If the database
does not support output parameter description, PowerBuilder populates the SQLDA attribute
NumOutputs when the FETCH statement is executed.

You can use the number of output parameters in the NumOutputs attribute in functions to
obtain the type of a specific parameter from the output parameter type array in the
OutParmType attribute. When you have the type, you can call the appropriate function after the
FETCH statement to retrieve the output value.
17 What is the SQLSA
Ans DynamicStagingArea is a PowerBuilder data type. PowerBuilder uses a variable of this type to
store information for use in subsequent statements.

The DynamicStagingArea is the only connection between the execution of a statement and a
transaction object and is used internally by PowerBuilder; you cannot access information in the
DynamicStagingArea.

PowerBuilder provides a global DynamicStagingArea variable named SQLSA that you can use
when you need a DynamicStagingArea variable.

If necessary, you can declare and create additional object variables of the type
DynamicStagingArea. These statements declare and create the variable, which must be done
before referring to it in a dynamic SQL statement:

DynamicStagingArea dsa_stage1

dsa_stage1 = CREATE DynamicStagingArea


18 What is the SQLDA?
Ans DynamicDescriptionArea is a PowerBuilder data type. PowerBuilder uses a variable of this
type to store information about the input and output parameters used in Format 4 of dynamic
SQL.

PowerBuilder provides a global DynamicDescriptionArea named SQLDA that you can use
when you need a DynamicDescriptionArea variable.

If necessary, you can declare and create additional object variables of the type
DynamicDescriptionArea. These statements declare and create the variable, which must be
done before referring to it in a dynamic SQL statement:

DynamicDescriptionArea dda_desc1

dsa_desc1 = CREATE DynamicDescriptionArea


19 What is the deligation.
Ans In service type application architecture we will have requester and service providers in
delegation we have association and aggregation . aggregation means the service object can
work in association with requester only they can not work independently exa. Sort service,
filter service,serch service etc. and Association means service provider can work
independently. Exa. String and date objects
20 What is the difference between computed column and computed field?
Ans Computed column means the column defined at sql mode through compute option. And
computed field means we add control in to your datwindow object from control list.

21 How ImportString function works? What is the argument to it?


Ans Inserts data into a DataWindow control or DataStore from tab-delimited data in a string.
Controls
DataWindow controls, DataStore objects, and child DataWindows
Syntax

dwcontrol.ImportString ( string {, startrow {, endrow {, startcolumn {, endcolumn {,


dwstartcolumn } } } } } )
Argument Description
dwcontrol The name of the DataWindow control or DataStore to which you want to copy
data from the specified string
string A string from which you want to copy the data. The string should contain tab-delimited
columns with one row per line (see Usage)
startrow (optional) The number of the starting row of data in the string you want to
import. If the first row contains headings that you want to skip, set startrow to 2. The default is
1
endrow (optional) The number of the last row of data in the string that you want to
import. The default is all rows
startcolumn (optional) The number of the first column in the string that you want to import.
The default is 1
endcolumn (optional) The number of the last column in the string that you want to import.
The default is the rest of the columns
dwstartcolumn (optional) The number of the first column in the DataWindow control or
DataStore object that you want to receive data. The default is 1
ImportString may trigger an ItemError event.
Return value
Long. Returns the number of rows that were imported if it succeeds and one of the following
negative integers if an error occurs:

-1 startrow value supplied is greater than the number of rows in the string
-3 Invalid argument
-4 Invalid input
-9 PowerBuilder or the user canceled import because data failed validation

If any argument's value is NULL, ImportString returns NULL.

Usage

The format of the string is the same as if the data came from an ASCII file. The string must be
formatted in tab-delimited columns and each line must end with a carriage return and a newline
character (~r~n). If the string has four tab-delimited columns, one line might look like:

col1_data~t col2_data~t col3_data~t col4_data~r~n

For a DataWindow control or DataStore, the string should consist of rows of data. If the data
includes column headings or row labels, set the startrow and startcolumn arguments to skip
them. The data types and order of the DataWindow object's columns must match the columns
of data in the string.

The startcolumn and endcolumn arguments control the number of columns imported from the
string and the number of columns in the DataWindow that are affected. The dwstartcolumn
argument specifies the first DataWindow column to be affected. The following formula
calculates the last DataWindow to be affected.

dwstartcolumn + ( endcolumn - startcolumn )

If string data to be assigned to a single row and column has multiple lines (indicated by line
ending characters in the import string), you must quote the string data using ~". Do not use
single quotes.

This example of a valid import string assigns multiline values to each row in column 2:

ls_s = &

"1~t~"Mickey~r~nMinnie~r~nGoofy~" ~r~n" + &


"2~t~"Susan~r~nMary~r~nMarie~" ~r~n" + &
"3~t~"Chris~r~nBen~r~nMike~" ~r~n" + &
"4~t~"Mott~r~nBarber~r~nPicard~" "
22 What is the ImportFile function? Tell other functions related to it.
Ans Inserts data into a DataWindow control or DataStore from a file. The data can be tab-delimited
text or dBase format 2 or 3.
Controls
DataWindow controls, DataStore objects, and child DataWindows
Syntax

dwcontrol.ImportFile ( filename {, startrow {, endrow {, startcolumn {, endcolumn {,


dwstartcolumn } } } } } )
Argument Description
dwcontrol The name of the DataWindow control or DataStore to which you want to copy
data from the specified file
filename A string whose value is the name of the file from which you want to copy data.
The file must be an ASCII, tab-delimited file (TXT) or a dBase format 2 or 3 file (DBF).
Specify the file's full name, which must end in the appropriate extension.If filename is NULL,
ImportFile displays the File Open dialog box and allows the user to select a file
startrow (optional) The number of the first row in the file that you want to copy. If the
first row contains headings that you want to skip, set startrow to 2. The default is 1
endrow (optional) The number of the last row in the file that you want to copy. The
default is the rest of the rows
startcolumn (optional) The number of the first column in the file that you want to copy. The
default is 1
endcolumn (optional) The number of the last column in the file that you want to copy. The
default is the rest of the columns
dwstartcolumn (optional) The number of the first column in the DataWindow control or
DataStore that you want to receive data. The default is 1
ImportFile may trigger an ItemError event.
Return value
Long. Returns the number of rows that were imported if it succeeds and one of the following
negative integers if an error occurs:

0 End of file; too many rows


-1 No rows
-2 Empty file
-3 Invalid argument
-4 Invalid input
-5 Could not open the file
-6 Could not close the file
-7 Error reading the text
-8 Not a TXT file
-9 The user canceled the import
-10 Unsupported dBase file format (not version 2 or 3)

Usage

The file should consist of rows of data. If the file includes column headings or row labels, set
the startrow and startcolumn arguments to skip them. The data types and order of the
DataWindow object's columns must match the columns of data in the file.

The startcolumn and endcolumn arguments control the number of columns imported from the
file and the number of columns in the DataWindow that are affected. The dwstartcolumn
argument specifies the first DataWindow column to be affected. The following formula
calculates the last DataWindow to be affected.

dwstartcolumn + (endcolumn - startcolumn)

To let users select the file to import, specify a NULL string for filename. PowerBuilder
displays the Select Import File dialog box. A dropdown listbox lets the user select the type of
file to import.

Importing files into the ANSI and Unicode versions of PowerBuilder

The type of file that can be imported using the ImportFile function varies depending on the
file's format and the version of PowerBuilder you are running.
File type File format that can be imported
.TXT Only Unicode files can be imported into the Unicode version of PowerBuilder.
Unicode files cannot be imported into the ANSI version of PowerBuilder
.DBF Files created using either the ANSI or Unicode version of PowerBuilder can be
imported into both versions
Other file related functions are file exist, file open, file length, file close, file seek, file write,
file delete, getfileopenname, getfilesavename.
23 What are the arguments in SqlPreview event? When does it get triggered?
Ans Occurs immediately before a SQL statement is submitted to the DBMS. Functions that trigger
DBMS activity are Retrieve, Update, and ReselectRow.
Arguments:- request SQLPreviewFunction by value (the function that initiated the database
activity)Values are:¨ PreviewFunctionReselectRow! — ReselectRow function¨
PreviewFunctionRetrieve! — Retrieve function¨ PreviewFunctionUpdate! — Update
function
sqltype SQLPreviewType by value (the type of SQL statement being sent to the DBMS)Values
are:¨ PreviewDelete! — A DELETE statement¨ PreviewInsert! — An INSERT
statement¨ PreviewSelect! — A SELECT statement¨ PreviewUpdate! — An
UPDATE statement
sqlsyntax String by value (the full text of the SQL statement)
buffer DWBuffer by value (the buffer containing the row involved in the database activity)
Values are:¨ Delete! — The delete buffer (data that has been deleted from the
DataWindow)¨ Filter! — The filter buffer (data that has been filtered out)¨ Primary! —
The primary buffer (data that has not been deleted or filtered out)
row Long by value (the number of the row involved in the database activity, that is, the row
being updated, selected, inserted, or deleted)
Return value
Long. Return code choices (specify in a RETURN statement):

0 Continue processing
1 Stop processing
2 Skip this request and execute the next request

Usage

Obsolete functions Information formerly provided by GetSQLPreview and GetUpdateStatus is


available in the arguments sqlsyntax, row, and buffer.

Some uses for the sqlsyntax argument are:

¨ Changing the SQL to be executed (you can get the value of sqlsyntax, modify it, and
call SetSQLPreview)
¨ Keeping a record (you can write the SQL statement to a log file)

GetSQLPreview and binding When binding is enabled for your database, the SQL returned in
the GetSQLPreview event may not be complete—the input arguments are not replaced with the
actual values. For example, when binding is enabled, GetSQLPreview might return the
following SQL statement:

INSERT INTO "cust_order" ( "ordnum", "custnum",

"duedate", "balance" ) VALUES ( ?, ?, ?, ? )

When binding is disabled, it returns:

INSERT INTO "cust_order" ( "ordnum", "balance",

"duedate", "custnum" ) VALUES ( '12345', 900,

'3/1/94', '111' )

If you require the complete SQL statement for logging purposes, you should disable binding in
your DBMS.

For more information about binding, see Connecting to Your Database.

If the row that caused the error is in the Filter buffer, you must unfilter it if you want the user to
correct the problem.
Reported row number The row number stored in row is the number of the row in the buffer,
not the number the row had when it was retrieved into the DataWindow object
24 How many triggers are there in oracle and what they are?
Ans There are 11 triggers used in oracle and they are –
On insert,update,delete
Before insert,update,delete
After insert,update,delete
On statement and on row.
25 What SetPosition function does?
Ans For controls in a window, specifies the position of a control in the front-to-back order within a
window. For a window, specifies whether it always displays on top of other open windows.
Controls
A control within a window or a window
Syntax

Objectname.SetPosition ( position {, precedingobject } )


Argument Description
Objectname The name of a control for which you want to specify a location in the front-to-
back order within the window, or the name of a window for which you want to specify whether
it will always display on top. Objectname cannot be a child window or a sheet
positionA SetPosType enumerated data type. The values you can specify depend on whether
objectname is a control or a window.For controls, values are:¨ Behind! — Position
objectname behind precedingobject in the order¨ ToTop! — Position objectname on top of all
other controls¨ ToBottom! — Position objectname behind all other controlsFor windows,
values are:¨ TopMost! — Always display objectname on top of all other open windows¨
NoTopMost! — Do not always display objectname on top of all other open windows
precedingobject (optional) The name of the object you want to position objectname
behind. Precedingobject is required if position is Behind!
Return value
Integer. Returns 1 when it succeeds and -1 if an error occurs. If any argument's value is NULL,
Set Position returns NULL.
Usage
The front-to-back order for controls determines which control covers another when they
overlap. If a control completely covers another control, the control that is in back becomes
inaccessible to the user.
When you specify TopMost! for more than one window, the most recently executed
SetPosition function controls which window displays on top.

26 What are the painters provided in the Power builder?


Ans There are 14 painters in pb. They are –
Application,window,userobject,menu, functions,structure,datawindow, library,
project,,report,database,table,query,pipeline.
27 If the page size is go down or is less what error does Sybase gives?
Ans Low pges size error will come.
28 Why are the user events not given on menu?
Ans Events of menu are mapped with windows menu event which we can not modify through the
power builder.
29 How the package function in oracle calls in pb.
Ans Through RPC call.

30 What is the object coupling?


Ans This is nothing but delegation which includes aggregation & association.
31 What functions we generally use in CloseQuery event and what does it triggers?
Ans CloseQuery occurs before the close event, so we can give an overriding message whether the
user wants to save before closing.
32 What is the LookupDisplay function?
Ans Obtains the display value in the code table associated with the data value in the specified
column.

Syntax

LookupDisplay ( column )
Argument Description
column The column for which you want the code table display value
Return value
String. Returns the display value when it succeeds and the empty string ("") if an error occurs.
Usage
If a column has a code table, a buffer stores a value from the data column of the code table, but
the user sees a value from the display column. Use LookupDisplay to get the value the user
sees.
Code tables and data values and graphs When a column that is displayed in a graph has a code
table, the graph displays the data values of the code table by default. To display the display
values, call this function when you define the graph data.
33 What does the pb.ini do?
Ans When you run power builder it goes through the pb.ini which contains information about the
various painters, database profiles and many things and set the properties accordingly. If you
make any changes like created new profile the entry for that will be done in pb.ini.
34 For what the open event of application object is used?
Ans This event is getting called when the application starts so we can use this event to open first
frame window as well as making connection with the database or whatever operations you
want to do when the application starts.
35 How many events are there in application object? What they are?
Ans There are six events for the application object. they are –
Open, Close, System Error, Idle, ConnectionBegin, and ConnectionEnd.
36 From which pb object Error and Message object are inherited?
Ans PowerObject is the base object for all powerbuilder objects.
37 What are the global variables and objects in pb?
Ans Error, Message, SQLCA, SQLSA, SQLDA.
38 What are all the graph styles?
Ans Area, Bar, Column, Line, Pie, Scatter, 3D area, 3D Bar, 3D Column, 3D Line, 3D Pie,
Stacked Bar, Stacked Column, Solid Bar, Solid Column, Solid Stacked Column, Solid Stacked
Bar.
39 What are all DataWindow styles provided with pb?
Ans Composite, Freeform, N-Up, Tabular, Grid, Group, Label, CrossTab, Graph, OLE, RichText.
40 Difference between DataWindow and DataStore.
Ans A DataWindow is a visual object whereas a datastore is a non visual object. A datawindow
cannot be explicitly destroyed while a datastore can be destroyed. A datastore is basically used
for background processing inplace of cursors.
41 What are the difference between DataSource and DataStore?
Ans A datasource is the method used to populate data into a datawindow. While a datastore is a non
visual datawindow.
42 How can you get column level and row level item status?
Ans The second parameter to the getItemStatus function decides which status is being asked for. If
the second parameter is 0 then a row status is returned whereas if a no .(1,2,3 ..) is given then
the status for that column is returned.

Syntax

dwcontrol.GetItemStatus ( row, column, dwbuffer )


Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow in
which you want to obtain the status of a row or a column in a row
row A long identifying the row for which you want the status
column The column for which you want the status. Column can be a column number (integer)
or a column name (string). Specify 0 to get the status of the whole row
dwbuffer A value of the dwBuffer enumerated data type identifying the DataWindow
buffer that contains the row: ¨ Primary! — The data in the primary buffer (data that has not
been deleted or filtered out)¨ Delete! — The data in the delete buffer (data deleted from the
DataWindow object)¨ Filter! — The data in the filter buffer (data that was filtered out)
Return value

A value of the dwItemStatus enumerated data type. Returns the status of the item at row,
column of dwcontrol in dwbuffer. If column is 0, GetItemStatus returns the status of row. If
any argument's value is NULL, GetItemStatus returns NULL.

Usage

The values of the dwItemStatus enumerated data type are:

¨ NotModified! — The information in the row or column is unchanged from what was
retrieved.
¨ DataModified! — The information in the column or one of the columns in the row has
changed since it was retrieved.
¨ New! — The row is new but no values have been specified for its columns. (Applies to
rows only, not to individual columns.)
¨ NewModified! — The row is new, and values have been assigned to its columns. In
addition to changes caused by user entry or the SetItem function, a new row gets the status
NewModified! when one of its columns has a default value. (Applies to rows only, not to
individual columns.)

Use GetItemStatus to understand what SQL statements will be generated for new and changed
information when you update the database.

For rows in the primary and filter buffers, Update generates an INSERT statement for rows
with NewModified! status. It generates an UPDATE statement for rows with DataModified!
status. Only columns with DataModified! Status are included in the UPDATE statement.

For rows in the delete buffer, Update does not generate a DELETE statement for rows whose
status was New! or NewModified! Before being moved to the delete buffer.
43 What are the item statuses provided with pb?
Ans There are four Item Status. – NotModified!, DataModified!, New!, NewModified!.
44 What item status generates update statements?
Ans NewModified & DataModified.
45 How can you trap errors in pb?
Ans In the SystemError event, DB Error Event, ItemError Event.
46 What is the difference between PostEvent and TriggerEvent?
Ans Post event is placed at the end of the windows message object queue where as a triggerevent is
executed immediately.
TriggerEvent and PostEvent are useful for preventing duplication of code. If two controls
perform the same task, you can use PostEvent in one control's event script to execute the
other's script, instead of repeating the code in two places. For example, if both a button and a
menu delete data, the button's Clicked script can perform the deletion and the menu's Clicked
event script can post an event that runs the button's Clicked event script.
47 What are the differences between event and functions?
Ans An event can be extended but not overridden & overloaded whereas a function can be.
If an event is called dynamically then even if the event is not there at runtime it only returns a –
1 while in similar case a function will fire an error.
48 What are the scopes of variables? In which sequence does pb search for the variables?
Ans There are four scopes local, shared, global and instance and pb search variables in the same
order
49 What is the sequence for searching the files in pb applications?
Ans While running application from which directory application is running it will search in that
folder and then it follows windows sequence.
50 What all functions you can not call in ItemChanged event? Why?
Ans If you call any of the following function in item change event it will go in indefinite loop
because these functions call the item change event again. These events are –
Accept text all scroll functions, set row, set column
51 What are the return values of ItemChanged event?
Ans There are three return values in this event
Occurs when a field in a DataWindow control has been modified and loses focus (for example,
the user presses enter, the tab key, or an arrow key or clicks the mouse on another field within
the DataWindow). ItemChanged can also occur when the AcceptText or Update function is
called for a DataWindow control or DataStore object.
Event ID
Event ID Objects
pbm_dwnitemchange DataWindow control or DataStore
Arguments
Argument Description
row Long by value (the number of the row containing the item whose value has been
changed)
dwo DWObject by value (a reference to the column containing the item whose value has
been changed. Dwo is a reference to the column object, not the name of the column)
data String by value (the new data the user has specified for the item)
Return value
Long. Return code choices (specify in a RETURN statement):

0 (Default) Accept the data value


1 Reject the data value and don't allow focus to change
2 Reject the data value but allow the focus to change

Usage

The ItemChanged event does not occur when the DataWindow control itself loses focus. If the
user clicks on an Update or Close button, you will need to write a script that calls AcceptText
to see if a changed value should be accepted before the button's action occurs.

Obsolete techniques Information formerly provided by the GetText function is available in the
data argument.

Instead of calling SetActionCode, use a RETURN statement with a return code.


52 If you want to call update function in ItemChanged event, what care you need to take?
Ans When you call the update function in item change event we need to accept the value of lastly
modified column.but we can not call the accept text function in the item change event so we
need to set the value to that column using set text function.
53 How can you get values from original buffer?
Ans Gets data whose type is String from the specified buffer of a DataWindow control or DataStore
object. You can obtain the data that was originally retrieved and stored in the database from the
original buffer, as well as the current value in the primary, delete, or filter buffers.

Controls

DataWindow controls, DataStore objects, and child DataWindows


Syntax

dwcontrol.GetItemString ( row, column {, dwbuffer, originalvalue } )


Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow in
which you want to obtain the string data contained in a specific row and column
row A long identifying the row location of the data
column The column location of the data. The data type of the column must String. Column can
be a column number (integer) or a column name (string).To gets the contents of a computed
field, specify the name of the computed field for column. Computed fields do not have
numbers
dwbuffer (optional) A value of the dwBuffer enumerated data type identifying the
DataWindow buffer from which you want to get the data: ¨ Primary! — (Default) The
data in the primary buffer (data that has not been deleted or filtered out)¨ Delete! — The data
in the delete buffer (data deleted from the DataWindow)¨Filter! — The data in the filter buffer
(data that was filtered out)
originalvalue (optional) A boolean indicating whether you want the original or current values
for row and column: ¨ True — Return the original values (the values initially retrieved from
the database)¨ False — (Default) Return the current valuesIf you specify dwbuffer, you must
also specify originalvalue
Return value
String. Returns NULL if the column value is NULL. Returns the empty string ("") if an error
occurs. If any argument's value is NULL, GetItemString returns NULL.
Usage
Use GetItemString to get information from the DataWindow's buffers. To find out what the
user entered in the current column before that data is accepted, use GetText. In the
ItemChanged or ItemError events, use the data argument.
To access a row in the original buffer, specify the buffer that the row currently occupies
(primary, delete, or filter) and the number of the row in that buffer. When you specify TRUE
for originalvalue, the function gets the original data for that row from the original buffer.

Mismatched data types An execution error occurs when the data type of the DataWindow
column does not match the data type of the function, in this case String.
54 What are all buffers present in pb?
Ans Besically there are three buffers provided with the pb datawindows. They are given below-
Primary buffer,delete buffer, filter buffer.there is one more buffer called as original buffer that
is when we retrieve the datawindow data will be in original buffer.
55 What are the disadvantages of the triggers?
Ans First major disadvantage is that user will not have any control over process as the trigger fire
automatically on certain operations. Also user can not come to know that some thing has
happen on his operation as trigger fire in the background automatically.
56 What all are the ddl (data definition language) statements?
Ans All create statement are the ddl. As well as all grant and revoke statements are ddl
57 Can you write commit in triggers? Why?
Ans No we can not write commit in trigger because in triggers fire automatically on certain
operation. And if two users are using the same application and doing same operation on the
operation of one user commit will fire and some invalid data may get save.
58 Can you write create statement in procedure?
Ans Ans : Yes
58 How can you call procedure in pb
Ans Ans: There is a three ways from which you can call procedure in PB.
First is through the embeded sql, second is through the procedure datasource for making
datawindow objects and last is using RPC call through the transaction object.
59 How can you make datawindow from procedure?
Ans You can do so by using procedure type datasource for creating new datawindow object.
60 How can you update datawindow created from procedure?
Ans You need to do so from some other procedure Or through the explicit embedded update
statement.
61 Can you modify the SQL of DataWindow runtime? How?
Ans Yes we can modify the sql of the datawindow.
Specifies the SQL SELECT statement for a DataWindow control or DataStore.

Controls

DataWindow controls, DataStore objects, and child DataWindows

Syntax

dwcontrol.SetSQLSelect ( statement )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow for
which you want to change the SELECT statement
Statement A string whose value is the SELECT statement for the DataWindow object.
The statement must structurally match the current SELECT statement (that is, it must return the
same number of columns, the columns must be the same data type, and the columns must be in
the same order)
Return value
Integer. SetSQLSelect returns 1 if it succeeds and -1 if the SELECT statement cannot be
changed. If any argument's value is NULL, SetSQLSelect returns NULL.
Usage
Use SetSQLSelect to dynamically change the SQL SELECT statement for a DataWindow
object in a script.
If the DataWindow is updatable, PowerBuilder validates the SELECT statement against the
database and DataWindow column specifications when you call the SetSQLSelect function.
Each column in the SQL SELECT statement must match the column type in the DataWindow
object. The statement is validated only if the DataWindow object is updatable.

You must use the SetTrans or SetTransObject function to set the transaction object before the
SetSQLSelect function will execute.
If the new SELECT statement has a different table name in the FROM clause and the
DataWindow object is updatable, then PowerBuilder must change the update information for
the DataWindow object. PowerBuilder assumes the key columns are in the same positions as in
the original definition. The following conditions will make the DataWindow not updatable:

¨ There is more than one table in the FROM clause.


¨ A DataWindow update column is a computed column in the SELECT statement.

If changing the SELECT statement makes the DataWindow object not updatable, the
DataWindow control cannot execute an Update function call for the DataWindow object in the
future.

Limitations to using SetSQLSelect Use SetSQLSelect only if the data source for the
DataWindow object is a SQL SELECT statement without retrieval arguments and you want
PowerBuilder to modify the update information for the DataWindow object:

dw_1.Modify("DataWindow.Table.Select='select...'")

Modify will not verify the SELECT statement or change the update information, making it
faster but more susceptible to user error. Although you can use Modify when arguments are
involved, it is not recommended because of the lack of checking.
62 What is exception error handling in oracle?
Ans
63 How can you get SQL statement of the datawindow objects?
Ans Reports the SQL SELECT statement associated with a DataWindow if its data source is one
that accesses an SQL database (such as SQL Select, Quick Select, or Query).

Controls

DataWindow controls, DataStore objects, and child DataWindows

Syntax

dwcontrol.GetSQLSelect ( )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow for
which you want to obtain the current SELECT statement
Return value
String. Returns the current SQL SELECT statement for dwcontrol. GetSQLSelect returns the
empty string ("") if it cannot return the statement. If dwcontrol is NULL, GetSQLSelect
returns NULL.
Usage
When you want to change the SQL SELECT statement for a DataWindow or DataStore during
execution, you can use GetSQLSelect to save the current SELECT statement before making the
change.
When you define a DataWindow, PowerBuilder stores a PowerBuilder SELECT statement
(PBSELECT) with the DataWindow. If a database is connected and SetTransObject has been
called for the DataWindow, then GetSQLSelect returns the SQL SELECT statement.
Otherwise, GetSQLSelect returns the PBSELECT statement.

You can also use Describe to obtain the SQL SELECT statement. The DataWindow object's
Table.Select property holds the information.

64 How can you update multiple tables in a datawindow?


Ans We can update multiple table by updating one table by calling update function and then calling
describe and modify function to set database table and updatable column and reset the modify
flag to update next table.
65 How can you set attribute of DataWindow?
Ans We can set the attribute of DataWindow using modify function as well as using
datawindow.object.column.atribute = some valid value.and dot notation
66 How can you get the attribute of the datawindow?
Ans We can get the atribute of the datawindow by using describe function.
67 If you pass only empty string with modify function what will happen?
Ans Modifies a DataWindow object by applying specifications, specified as a list of instructions
that change the DataWindow object's definition. You can change appearance, behavior, and
database information for the DataWindow object by changing the values of properties. You can
add and remove objects from the DataWindow object by providing specifications for the
objects.

For lists and explanations of DataWindow object properties, see the DataWindow Reference.

Controls

DataWindow controls, DataStore objects, and child DataWindows

Syntax

dwcontrol.Modify ( modstring )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow you
are modifying
modstring A string whose value is the specifications for the modification. See Usage for
appropriate formats
Return value
String. Returns the empty string ("") if it succeeds and an error message if an error occurs. The
error message takes the form "Line n Column n incorrect syntax". The columns are counted
from the beginning of the compiled text of modstring. If any argument's value is NULL,
Modify returns NULL.
Usage
Modify lets you make many of the same settings in a script that you would make in the
DataWindow painter. Typical uses for Modify are:

¨ Changing colors, text settings, and other appearance settings of objects


¨ Changing the update status of different tables in the DataWindow so that you can
update more than one table
¨ Modifying the WHERE clause of the DataWindow object's SQL SELECT statement
¨ Turning on Query mode or Prompt For Criteria so users can specify the data they want
¨ Changing the status of Retrieve Only As Needed
¨ Changing the data source of the DataWindow object

¨ Controlling the Print Preview display


¨ Deleting and adding objects (such as lines or bitmaps) in the DataWindow object

Each of these uses is illustrated in the Examples for this function.

You can use three types of statements in modstring to modify a DataWindow object.
Statement type Use to
CREATE object (settings) Adds object to the DataWindow object (such as text,
computed fields, and bitmaps). Settings is a list of properties and values using the format you
see in exported DataWindow syntax. To create an object, you must supply enough information
to define it.Object cannot be an OLE object. You cannot add an OLE object to a DataWindow
using the Modify function
DESTROY [COLUMN] object Removes object from the DataWindow object. When object is
a column name, specify the keyword COLUMN to remove both the column and the column's
data from the buffer
objectname.property=value Changes the value of property to value. Properties control the
location, color, size, font, and other settings for objectname. When objectname is DataWindow,
you can also set properties for database access. The DataWindow Reference has lists of objects
in a DataWindow, their properties, and values.Depending on the specific property, value can
be:¨ A constant¨ A quoted constant¨ An expression that consists of a default value
followed by a valid DataWindow expression that returns the appropriate data type for the
property. Expressions are described below
Object names

The DataWindow painter automatically gives names to columns and column labels. Other
objects that you add to the DataWindow object are named with a cryptic string of numbers
unless you give them names. (Describe will report the cryptic names, but you can't see them in
the painter.) To easily describe and modify properties of an object, give the object a name.

Expressions for Modify

When you specify an expression for a DataWindow property, the expression has the format:

defaultvalue~tDataWindowpainterexpression
Defaultvalue is a value that can be converted to the appropriate data type for the property. It is
followed by a tab (~t). DataWindowpainterexpression is an expression that can use any
DataWindow painter function. The expression must also evaluate to the appropriate data type
for the property. When you are setting a column's property, the expression is evaluated for each
row in the DataWindow, which allows you to vary the display based on the data. A typical
expression uses the If function:

'16777215 ~t If(emp_status=~~'A~~',255,16777215)'

To use that expression in a modstring, specify the following (entered as a single line):

modstring = "emp_id.Color='16777215 ~t

If(emp_status=~~'A~~',255,16777215)'"

Not all properties accept expressions. For details on each property, see the DataWindow
Reference.

Quotes and tildes

Because Modify's argument is a string, which can include other strings, you need to use special
syntax to specify quotation marks. To specify that a quotation mark be used within the string
rather than match and end a previously opened quote, you can either specify the other style of
quote (single quotes nested with double quotes) or precede the quotation mark with a tilde (~).
For another level of nesting, the string itself must specify ~", so you must specify ~~ (which
specifies a tilde) followed by ~" (which specifies a quote). For example, another way to type
the modstring shown above is (entered as a single line):

modstring = "emp_id.Color=~"16777215 ~t

If(emp_status=~~~"A~~~",255,16777215)~""

For more information about quotes and tildes, see "Standard data types".

Building a modstring with variables

To use variable data in modstring, you can build the string using variables in your program. As
you concatenate sections of modstring, make sure quotes are included in the string where
necessary. For example, the following code builds a modstring similar to the one above, but the
default color value and the two color values in the If function are calculated in the script.
Notice how the single quotes around the expression are included in the first and last pieces of
the string:

red_amount = Integer(sle_1.Text)

modstring = "emp_id.Color='" + &

String(RGB(red_amount, 255, 255)) + &

"~tIf(emp_status=~~'A~~'," + &

String(RGB(255, 0, 0)) + &

"," + &

String(RGB(red_amount, 255, 255)) + &


")'"

The following is a simpler example without the If function. You don't need quotes around the
value if you are not specifying an expression. Here the String and RGB functions result in a
constant value in the resulting modstring:

modstring = "emp_id.Color=" + &

String(RGB(red_amount, 255, 255))

You can set several properties with a single call to Modify by including each property setting
in modstring separated by spaces. For example, assume the following is entered on a single line
in the script editor:

rtn = dw_1.Modify("emp_id.Font.Italic=0

oval_1.Background.Mode=0

oval_1.Background.Color=255")

However, it is easier to understand and debug a script in which each call to Modify sets one
property.

Debugging tip If you build your modstring and store it in a variable that is the argument for
Modify, you can look at the value of the variable in Debug mode. When Modify's error
message reports a column number, you can count the characters as you look at the compiled
modstring.

Modifying a WHERE clause For efficiency, use Modify instead of SetSQLSelect to modify a
WHERE clause. Modify is faster because it does not verify the syntax and does not change the
update status of the DataWindow object. However, Modify is more susceptible to user error.
SetSQLSelect modifies the syntax twice (when the syntax is modified and when the retrieve
executes) and affects the update status of the DataWindow object.

PowerBuilder already includes many functions for modifying a DataWindow. Before using
Modify, check the list of DataWindow functions in Objects and Controls to see if a function
exists for making the change. Many of these functions are listed below in See also.

Modify is for modifying the properties of a DataWindow object. You can set properties of the
DataWindow control that contains the object using standard dot notation. For example, to put a
border on the control, specify:

68 How can we set item status of the DataWindows?


Ans Changes the modification status of a row or a column within a row. The modification status
determines the type of SQL statement the Update function will generate for the row.

Controls

DataWindow controls, DataStore objects, and child DataWindows

Syntax

dwcontrol.SetItemStatus ( row, column, dwbuffer, status )


Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow in
which you want to set the status of an item at a specified row and column
row A long identifying the row location in which you want to set the status
column The column location in which you want to set the status. Column can be a column
number (integer) or a column name (string). To set the status for the row, enter 0 for column
dwbuffer A dwBuffer enumerated data type identifying the DataWindow buffer that
contains the row:¨ PRIMARY! — The data in the primary buffer (the data that has not
been deleted or filtered out)¨ DELETE! — The data in the delete buffer (data deleted from
the DataWindow object)¨ FILTER! — The data in the filter buffer (data that was filtered
out)
status A dwItemStatus enumerated data type representing the new status:¨ NotModified!
¨ DataModified!¨ New!¨ NewModified!For definitions of the values of dwItemStatus,
see GetItemStatus
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
SetItemStatus returns NULL.
Usage
How statuses are set
There are four DataWindow item statuses, two of which apply only to rows:
Status Applies to
New! Rows
NewModified! Rows
NotModified! Rows and columns
DataModified! Rows and columns
When data is retrieved When data is retrieved into a DataWindow, all rows and columns
initially have a status of NotModified!.
After data has changed in a column in a particular row, either because the user changed the
data or the data was changed programmatically, such as through the SetItem function, the
column status for that column changes to DataModified!. Once the status for any column in a
retrieved row changes to DataModified!, the row status also changes to DataModified!.

When rows are inserted When a row is inserted into a DataWindow, it initially has a row
status of New!, and all columns in that row initially have a column status of NotModified!.
After data has changed in a column in the row, either because the user changed the data or the
data was changed programmatically, such as through the SetItem function, the column status
changes to DataModified!. Once the status for any column in the inserted row changes to
DataModified!, the row status changes to NewModified!.

When a DataWindow column has a default value, the column's status does not change to
DataModified! until the user makes at least one actual change to a column in that row.
When Update is called
A row's status flag determines what SQL command the Update function uses to update the
database. INSERT or UPDATE is called depending upon the following row statuses:
Row status SQL statement generated
NewModified! INSERT
DataModified! UPDATE
A column is included in an UPDATE statement only if the following two conditions are met:

¨ The column is on the updatable column list maintained by the DataWindow object

For more information about setting the update characteristics of the DataWindow object, see
the PowerBuilder User's Guide.

¨ The column has a column status of DataModified!

The DataWindow control includes all columns in INSERT statements it generates. If a column
has no value, the DataWindow attempts to insert a NULL. This causes a database error if the
database does not allow NULLs in that column.

Changing statuses using SetItemStatus

Use SetItemStatus when you want to change the way a row will be updated. Typically, you do
this to prevent the default behavior from taking place. For example, you might copy a row from
one DataWindow to another. After the user modifies the row, you want to issue an UPDATE
statement instead of an INSERT statement.

Changing column status You use SetItemStatus to change the column status from
DataModified! to NotModified!, or vice versa.

Change column status when you change row status Changing the row status will change the
status of all columns in that row to NotModified!, so if the Update function is called, no SQL
update is produced. You must change the status of columns to be updated after you change the
row status.

Changing row status Changing row status is a little more complicated. The following table
illustrates the effect of changing from one row status to another:
Original status Specified status
New! NewModified! DataModified! NotModified!
New! - Yes Yes No
NewModified! No - Yes New!
DataModified! NewModified! Yes - Yes
NotModified! Yes Yes Yes -
In the preceding table, Yes means the change is valid. For example, issuing SetItemStatus on a
row that has the status NotModified! to change the status to New! does change the status to
New!.
No means that the change is not valid and the status is not changed.
Issuing SetItemStatus to change a row status from NewModified! to NotModified! actually
changes the status to New!. Issuing SetItemStatus to change a row status from DataModified!
to New! actually changes the status to NewModified!.

Changing a row's status to NotModified! or New! causes all columns in that row to be assigned
a column status of NotModified!. Change the column's status to DataModified! to ensure that
an update results in a SQL UPDATE.
Changing the status of a retrieved row from NotModified! to New! If you change the status of
a retrieved row to New! and then make a change to data in a column, all the columns in that
row will change status to DataModified! All the columns change status because the Update
function generates a SQL INSERT command that includes the changed data as well as the data
that already existed in the other columns.

Changing status indirectly


When you cannot change to the desired status directly, you can usually do it indirectly. For
example, change New! to DataModified! to NotModified!.
Resetting status for the whole DataWindow object
To reset the update status of the entire DataWindow object, use the ResetUpdate function. This
sets all status flags to NotModified! except for New! status flags which remain unchanged.
69 What are all the DataWindow styles and DataSources in pb?
Ans Data window styles – grid, group, n-app, label, tabular, cross tab, composite, graph, ole,
ritchtext, free form.
Datasource – Query, Quick Select, Stored Procedures, External, SQL Select
70 How does pb implement oops concept?
Ans Basically OOP s includes inheritance, Polymorphism and encapsulation. And pb implements
these all through the objects like window, user objects.
71 What is a function overwriting?
Ans Suppose you have a object having one function and you have inherited another object from the
existing one and define the same function with same signature the function will get overwrite
this is call the function overwriting.
72 What is the linkage service in PFC?
Ans The PFC linkage service helps you to create master/detail windows and other types of windows
that require coordinated processing.
The linkage service contains the following features:
Linkage style Controls whether detail DataWindows retrieve rows, filter rows, or scroll to the
appropriate row
Update style Controls how the linkage service updates DataWindows (top-down, bottom-up,
top-down then bottom-up, bottom-up then top-down, or a developer-specified custom update)
Confirm on row change When the master changes rows, this option displays a confirmation
dialog if modifications made to detail DataWindows will be lost
Confirm on delete Displays a confirmation dialog when the user deletes rows
Cascading key changes The linkage service automatically updates detail DataWindows when
you change a key value on the master
Delete style When you delete a master row, this option specifies whether the linkage service
deletes detail rows, discards detail rows, or leaves them alone
|Extended update Allows you to integrate other controls (such as ListViews, TreeViews, and
DataStores) into the default save process
The linkage service is completed integrated with n_cst_luw and with the w_master pfc_Save
process.
PFC enables the linkage service through the n_cst_dwsrv_linkage user object.
Usage
You can use the linkage service to coordinate any type of processing among DataWindows.
However, the most common use is for master/detail processing.
vTo enable the linkage service:
|Call the u_dw of_SetLinkage function:
dw_emplist.of_SetLinkage(TRUE)
U_dw destroys the service automatically when the DataWindow is destroyed.
vTo use the linkage service to coordinate Master/Detail processing:
1Enable the linkage service for both the master and detail DataWindows by calling the u_dw
of_SetLinkage function, once for each DataWindow:
dw_master.of_SetLinkage(TRUE)
dw_detail.of_SetLinkage(TRUE)
2Call the u_dw of_SetTransObject function to establish the Transaction object for the master
and detail DataWindows:
dw_master.inv_linkage.of_SetTransObject(SQLCA)
3Link the detail to the master by calling the of_SetMaster function in the detail DataWindow:
dw_detail.inv_linkage.of_SetMaster(dw_master)
4Register the related columns by calling the of_Register function:
dw_detail.inv_linkage.of_Register &
("emp_id","emp_id")
5(Optional) Specify that the service updates DataWindows from the bottom of the linkage
chain on up (the default is to update top down):
dw_detail.inv_linkage.of_SetUpdateStyle &
(dw_detail.inv_linkage.BOTTOMUP)
6Establish the action taken by the detail when a row changes in the master by calling the
of_SetStyle function.
This example specifies that the detail DataWindow retrieves a row whenever the master
changes:
dw_detail.inv_linkage.of_SetStyle &
(dw_detail.inv_linkage.RETRIEVE)
7Call the master DataWindow's of_Retrieve function:
IF dw_master.of_Retrieve( ) = -1 THEN
MessageBox("Error","Retrieve error")
ELSE
dw_master.SetFocus( )
END IF
Previous steps can be in one script
You can code the previous steps in a single event, such as the window Open event.
8Add retrieval logic to the master DataWindow's pfc_Retrieve event:
Return this.Retrieve( )
Retrieving rows
If the linkage service refreshes detail rows via retrieval, you only need to code a Retrieve
function for the master DataWindow. With the filter and scroll options, you must also code
Retrieve functions in detail DataWindows.
vTo enable confirm on row change (retrieval style only):
1Call the of_SetUpdateOnRowChange function for the detail DataWindow:
dw_detail.inv_linkage.of_SetUpdateOnRowChange(TRUE)
2Call the of_SetConfirmOnRowChange function for the detail DataWindow:
dw_detail.inv_linkage.of_SetConfirmOnRowChange &
(TRUE)
vTo enable confirm on delete:
1Call the of_SetUpdateOnRowChange function for the detail DataWindow:
dw_detail.inv_linkage.of_SetUpdateOnRowChange(TRUE)
2Call the of_SetConfirmOnDelete function for the detail DataWindow:
dw_detail.inv_linkage.of_SetConfirmOnDelete(TRUE)
vTo enable cascading key changes:
|Call the of_SetSyncOnKeyChange function for every DataWindow in the linkage chain:
dw_master.inv_linkage.of_SetSyncOnKeyChange(TRUE)
dw_detail.inv_linkage.of_SetSyncOnKeyChange(TRUE)
vTo specify deletion style:
|Call the of_SetDeleteStyle function for all master DataWindows in the linkage chain:
dw_master.inv_linkage.of_SetDeleteStyle &
(dw_cust.inv_linkage.DISCARD_ROWS)
vTo enable extended update:
|Call the of_SetOtherSaveObjects function to add other controls to the default save process:
PowerObject lpo_objs[ ]

// This example adds the lv_salesinfo ListView


// to the save process.
lpo_objs[1] = lv_salesinfo
dw_master.inv_linkage.of_SetOtherSaveObjects &
(lpo_objs)
73 What is the datawindow cashing service in pfc? What is the use of it?
Ans The DataWindow caching service buffers data for DataWindow objects. By keeping rows in
memory, the DataWindow caching service helps to reduce database access, optimizing
application performance. The DataWindow caching service supports the following data
sources:
lDataWindow object (using either data retrieved from the database or data stored with the
DataWindow object)
lSQL statement
lDataWindow control
lDataStore control
lRows from an array
lA file
The DataWindow caching service uses PowerBuilder DataStores to buffer data.
PFC enables DataWindow caching through the n_cst_dwcache user object.
PFC code is in ancestor-level objects
This book always refers to extension-level objects (such as n_cst_dwcache). All PFC code is
actually in ancestor-level objects (such as pfc_n_cst_dwcache).
Usage
Use DataWindow caching to minimize database access and optimize performance.
vTo enable DataWindow caching:
|Call the n_cst_appmanager of_SetDWCache function:
gnv_app.of_SetDWCache(TRUE)
vTo use DataWindow caching:
1Cache data by calling the of_Register function, passing different arguments depending on the
data to be cached:
lTo cache rows retrieved from the database via a DataWindow object, pass an identifier, a
Transaction object, the DataWindow object name, and arguments if any
lTo cache rows retrieved from the database via a SQL statement, pass an identifier, a
Transaction object, and the SQL statement
lTo cache rows in an array, pass an identifier, the DataWindow object name, and the data
lTo cache rows from a DataWindow control, pass an identifier and the DataWindow control
lTo cache rows from a DataStore, pass an identifier and the DataStore instance
lTo cache rows from a file, pass an identifier and the filename
2To determine if a DataWindow object is already registered with the caching service, call the
of_IsRegistered function, passing the object's identifier.
3To access cached data from, call the of_GetRegistered function. This example assumes an
ids_datastore instance variable:
gnv_app.inv_dwcache.of_GetRegistered &
("d_emplist", ids_datastore)
ids_datastore.ShareData(dw_emplist)
4To reretrieve data for a cached DataWindow, call the of_Refresh function.
5To stop caching, call the of_UnRegister function.
6(Optional) Disable the DataWindow caching service by calling the n_cst_appmanager
of_SetDWCache function:
gnv_app.of_SetDWCache(FALSE)
In most cases, you do not disable DataWindow caching explicitly. PFC destroys
n_cst_dwcache automatically when your application shuts down.
74 What is the difference in parameter to functions by value and by reference?
By value means it creates its own copy to work and if we make the changes in any thing it will
affect in copy not in actual objects. But parameter by reference means variable keeps the
reference of the object and there will not be any copy whatever changes we will do will takes
place in the actual objects value.
75 What is the cursor? What are the types of cursor?
Ans: cursor is the pointer which point to a record and allow us to do row by row manipulations.

A cursor is a symbolic name that is associated with a Transact-SQL select statement through a
declaration statement. It consists of the following parts:

·cursor result set - the set (table) of rows resulting from the execution of a query associated
with the cursor

·cursor position - a pointer to one row within the cursor result set

The cursor position indicates the current row of the cursor. You can explicitly modify or delete
that row using delete or update statements with a clause naming the cursor. You change the
current cursor position through an operation called a fetch. A fetch moves the current cursor
position one or more rows down the cursor result set.

A cursor behaves much like a file pointer to a series of file records, where the cursor acts as a
pointer to the query results. However, cursors only support forward (or sequential) movement
through the query results. Once you fetch several rows, you cannot backtrack through the
cursor result set to access them again. This process allows you to traverse the query results row
by row, similar to how a programming language can access one file record at a time.

After you declare the cursor, it is in one of two states:

·Closed - The cursor result set does not exist, so you cannot read information from it. Cursors
are initially in this state. You must explicitly open the cursor before you can use it. Once it is
opened, you can explicitly close it when you are finished. SQL Server can implicitly close a
cursor for several reasons described later in this chapter.

·Open - The rows within the cursor result set are available for reading or updating.

You can close a cursor and then reopen it. Reopening a cursor recreates the cursor result set
and positions the cursor right before the first row. This allows you to process through a cursor
result set as many times as needed. You can close the cursor at any time; you do not have go
through the entire result set.

All cursor operations like fetching or updating the row are accomplished in reference to the
current cursor position. Updating cursor rows involves changing data in the row or deleting the
row completely. You cannot use cursors to insert rows. All updates through a cursor affects the
corresponding base tables included in the cursor result set.
76 What are different joins?
Ans Joining two or more tables is a process of comparing the data in specified fields and using the
comparison results to form a new table from the rows that qualify. A join statement specifies a
column from each table, compares the values in those columns row by row, and combines rows
with qualifying values into new rows. The comparison is usually for equality-values that match
exactly-but other types of joins can be specified. If a join is to have meaningful results, the
columns being compared must have similar values-values that are comparable because they
have the same or similar datatypes.

The join operation has a jargon all its own. The word "join" is used both as a verb, and as a
noun, referring to the operation itself, to the query, or to its results.

There are several varieties of joins-equijoin, natural join, outer join, and so

77 What is the stored procedure? What is the use of it?


Ans Stored procedures are collections of SQL statements and control-of-flow language. An
execution plan is prepared when a procedure is run, so that subsequent execution is very fast.
Stored procedures can:

·Take parameters

·Call other procedures

·Return a status value to a calling procedure or batch to indicate success or failure, and the
reason for failure

·Return values of parameters to a calling procedure or batch

·Be executed on remote SQL Servers

The ability to write stored procedures greatly enhances the power, efficiency, and flexibility of
SQL. Compiled procedures dramatically improve the performance of SQL statements and
batches. In addition, stored procedures on other SQL Servers can be executed if your server
and the remote server are both set up to allow remote logins. You can write triggers on your
local SQL Server that execute procedures on a remote server whenever certain events, such as
deletions, updates or inserts, take place locally.

Stored procedures differ from ordinary SQL statements and from batches of SQL statements in
that they are pre-compiled. The first time you run a procedure, SQL Server's query processor
analyze it and prepare an execution plan that is ultimately stored in a system table.
Subsequently, the procedure is executed according to the stored plan. Since most of the query
processing work has already been performed, stored procedures execute almost
instantaneously.

SQL Server supplies a variety of stored procedures as convenient tools for the user. These
stored procedures are called system procedures.

You create stored procedures with the create procedure command. To execute a stored
procedure, either a system procedure or a user-defined procedure, use the execute command.
Or you can use the name of the stored procedure alone, as long as it is the first word of a
statement or batch.

The syntax for creating a simple stored procedure, without special features such as parameters,
is:

create procedure procedure_name

as SQL_statements

Stored procedures are database objects, and their names must follow the rules for identifiers.

Any number and kind of SQL statements can be included with the exception of create
statements.
78 What is structure?
Ans: A structure is a collection of one or more related variables of the same or different data
types grouped under a single name. In some languages, such as Pascal and COBOL, structures
are called records. Structures allow you to refer to related entities as a unit rather than
individually. For example, if you define the user's ID, address, access level, and a picture
(bitmap) of the employee as a structure called user_struct, you can then refer to this collection
of variables as user_struct.
There are two kinds of structures:
·Object-level structures, which are associated with a particular type of object such as a window
or menu. These structures can always be used in scripts for the object itself. You can also
choose to make the structures accessible from other scripts.
·Global structures, which are not associated with any object in your application. You can
directly reference these structures anywhere in your application.
79 What is mean by table mutation?
Ans
80 What is the difference between delete and truncate statement?
Ans Delete statement can be used to delete specific no. of records where as truncate will delete all
the records at a time. Delete statement make entry in to database log so that it is slower than
truncate also you can not get back the records which are truncated but we can in case of delete.
81 Can you create multiple transaction objects in pb?
Ans Yes you can create multiple transaction objects using create statement.
82 What is two tier and three tier architecture?
Ans Two tire architecture means there will be only front end and back end and we write our
business process in back end or front end. In case of three tires architecture there is one more
layer in between in which we write our business processes. Two tire is faster and economical
as compare to three tire. If in future some conversion take place or some changes has been
taken place in the business process in case of three tire architecture things goes smoothly while
in two tire architecture creates complications.
83 What is thin layer and thick layer database?
Ans
84 What is parsing in oracles?
Ans
85 What are the databases provided with Sybase?
Ans There are four system database and one sample database when you install the sybase on your
machine they are Master, Model, sybsystemproc, temparory database and the pub2 is the
sample database.
86 What SQL does Sybase use?
Ans Sybase uses T SQL means transact sql which is the extention to SQL.
87 What SQL does oracle use?
Ans Oracle uses SQL Plus which is the extension to SQL.
88 What is the minus of two tables?
89 How can you get the procedure definations in oracle?
90 Write query to find second highest salary
91 Write query to get department having max emp.
92 What is full and incremental exe?
93 What is machine code exe?
Ans : Machine code is nothing but DLL
94 How can you create pbd and dll with exe?
If you select machine code option and select the pbd option for pbls while creating the exe will
generate dlls and without selecting machincode you can generates pbd.
95 Can you create single pbd or dll .how?
Ans: Yes, by selecting only that pbl.
96 What is the difference between pbd and dll?
DLL : 1. It takes much time to create the EXE
2. Faster than the PBD.
PBD 1. It not takes much time to create the EXE
2. Slower than the DLL
97 What is pbr? What is the use of it? How will you create it?
Ans: PowerBuilder Resource (PBR) file that includes resources that are assigned dynamically
in scripts for the application. The name of each object must exactly match the name used to
reference the object in scripts (if the name is fully qualified in the script it must be fully
qualified in the PBR file).
98 Can you create exe with out pbd and dll?
Ans : Yes
99 What is check in and check out? What is use of it?
Check in – now any user having access to it can use that object.
Check out – now some body is using that object and no body can use that object.
This provides security and control over maintianing versions.
100 Can you update procedure definition through pb?
No.
101 Can you set QueryMode to DataWindow which you are using in share data? What will
happen?
No. if you do so it will raise runtime error.
102 Can you pass parameter to procedure dynamically?
Yes. While executing the procedure dynamically.
103 What will happen if we write script in other event?
Ans: Occurs when a system message occurs that is not a PowerBuilder message. You should
avoid using it (it slows performance while it checks every Windows message).
104 Difference between Pb And VB.
Pb follows OOPs concept while Vb does not. There is a facility called datawindow through
which we can present data from database directly which is not in VB.
105 What are the datawindow object sources types?
Ans: 1. Quick Select 2. Sql Select 3. Query 4. External 5. Store Procedure
106 For what the external DataWindow objects are used?
Ans: When we have to write the complicated query or joins then we used external
datawindow. And basically we use external datawindow for reports purpose. If we are not
using any DBMS or RDBMS.
107 What is the difference between quick select and SQL select?
Ans: In the Quick Select dialog box, you can choose columns from one table or from multiple
tables if they are joined through foreign keys. You can not sort and group the columns and
specify retrieval criteria and you can not add computed column. Which all are possible in sql
select.

108 What is function OpenWithParm? What are the parameters to it?


Ans: Opens a window object of a known data type. OpenWithParm displays the window and
makes all its properties and controls available to scripts. It also stores a parameter in the
system's Message object.

OpenWithParm ( windowvar, parameter {, parent } )

Windowvar The name of the window you want to display. You can specify a window
object defined in the Window painter (which is a window data type) or a variable of the desired
window data type. Open places a reference to the open window in windowvar

ParameterThe parameter you want to store in the Message object when the window is opened.
Parameter must have one of these data types:¨ String¨ Numeric¨ PowerObject
parent (child and popup windows only) (optional) The window you want make the
parent of the child or popup window you are opening. If you open a child or popup window
and omit parent, PowerBuilder associates the window being opened with the currently active
window

Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
OpenWithParm returns NULL.
109 Whet is the difference between popup and response window?
Ans: Child A window that is dependent on a main window and can only exist within the main
(parent) window.
Main: A standalone overlapped window that can be independent of all other windows.
MDI: An MDI frame without a MicroHelp status bar.
MDIHelp: An MDI frame with a MicroHelp status bar.
Popup: A window that displays usually in response to an event within a window, but can exist
outside of the window and, in some cases, after the window that opened it is closed.
Response: A window that displays to obtain information from the user and cannot lose focus or
be closed until the user responds.
110 Difference between OpenSheet and Open function.
Ans: open: Opens a window object of a known data type. Open displays the window and
makes all its properties and controls available to scripts.
Open ( windowvar {, parent } )
OpenSheet : Description
Opens a sheet within an MDI (multiple document interfaces) frame window and creates a menu
item for selecting the sheet on the specified menu.

OpenSheet ( sheetrefvar {, windowtype }, mdiframe {, position {, arrangeopen } } )

Argument Description
sheetrefvar The name of any window variable that is not an MDI frame window.
OpenSheet places a reference to the open sheet in sheetrefvar
windowtype (optional) A string whose value is the data type of the window you want to open.
The data type of windowtype must be the same or a descendant of sheetrefvar
mdiframe The name of an MDI frame window
position (optional) The number of the menu item (in the menu associated with the sheet)
to which you want to append the names of the open sheets. Menu bar menu items are numbered
from the left, beginning with 1. The default value of 0 lists the open sheets under the next-to-
last menu item
arrangeopen (optional) A value of the ArrangeOpen enumerated data type specifying how you
want the sheet arranged in the MDI frame in relation to other sheets when it is opened:¨
Cascaded! — (Default) Cascade the sheet relative to other open sheets, so that its title
bar is below the previously opened sheet¨ Layered! — Layer the sheet so that it fills the
frame and covers previously opened sheets¨ Original! — Open the sheet in its original size
and cascade it

Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
OpenSheet returns NULL.
111 What is the alternative to store data temporarily?
Ans: We can cache the data in the datastore object temporarily.
112 Define datawindow.
Ans: You place DataWindow controls in a window or user object and then specify the
DataWindow object you want to use within them to display and manipulate data in the
window.
A DataWindow object allows users to display, manipulate, and update database or other
information. You build DataWindow objects in the DataWindow painter.
It has five datasource and Eleven Styles to display the data.
113 What will happen if you write MessageBox in ItemFocusChanged event? Why?
Message will display once and then nothing will happened because when we loose the focus
from one object to other item focus change never triggers .
114 What are the different types of windows provided in pb?
Ans : Child, Main, MDI, MDI help, Popup, Response
115 What is the difference between pb5 and pb6
116 What are the different types of datawindow object style?
Ans : Composite, Compose, Grid, Graph, Crosstab, N-up, Tabular, Freeform, OLE, Label,
RichText
117 What are the events in application objects?
Ans: Open, Close, ConnectionBegin, ConnectionEnd, idel, systemerror
118 Can you inherit datawindow objects?
Ans: We can not directly inherit the datawindow object but indirectly we can do that by using
user Object.
119 What is the purpose of using user objects?
Ans: For the memory Management and applying oops concepts.
120 When does ItemFocusChanged event fires?
Ans: Occurs when the current item in the control changes.
121 When does ItemError event triggers?
Ans: Occurs when a field has been modified, the field loses focus (for example, the user
presses enter, tab, or an arrow key or clicks the mouse on another field in the DataWindow),
and the data in the field does not pass the validation rules for its column. ItemError can also
occur when a value imported into a DataWindow control or DataStore does not pass the
validation rules for its column.
122 What are the methods of software engineering?
123 What are the steps in SDLC?
Ans : WaterFall
Conception
Initiation
Analysis
Design
Coding
Testing
Implementation
124 What are the different types of testing?
Basically there are four type of testing
Unit testing – done by programmer
Integration testing – when the entire module get integrated.
System testing –
User level testing –

Top down testing, bottom up testing, black box testing, white box testing.
125 What is paroto diegram.
126 How can you estimate the time required to finish one job?
127 What values does any SQL will return?
Sqlcode –
Sqlnrows -
Sqlerrtext -
128 If you do not write commit then what will happen?
Ans: When you write the commit statement then only dada is permanently stored in database.
When you close the ORACLE session the oracle automatically committed the data that is in
buffer.
129 Can you inherit user object?
Ans: Yes.
130 What are the parameters in RetrieveStart, RetrieveEnd, RetrieveRow events?

131 What will happen if we delete rows from a datawindow whose update property is false?
These deleted rows will not go to the delete buffer it will work as RowsDiscard function.
132 How can you move rows from one datawindow to other and datawindow to buffer?
RowsMove()
133 What are the difference between Sybase and oracle?
134 What is thick and thin database structure?
138 What is for ResetUpdate function is used.
139 What is dde
Dynamic data exchange.
140 What all functions fire on calling update function?
Ans: Updates the database with the changes made in a DataWindow control or DataStore.
Update can also call AcceptText for the current row and column before it updates the database.
dwcontrol.Update ( { accept {, resetflag } } )
Argument Description
dwcontrol The name of the DataWindow control, DataStore, or child DataWindow that
contains the information you want to use to update the database
accept (optional) A boolean value specifying whether the DataWindow control or
DataStore should automatically perform an AcceptText prior to performing the update:¨
TRUE — (Default) Perform AcceptText. The update is canceled if the data fails
validation¨ FALSE — Do not perform AcceptText
resetflag (optional) A boolean value specifying whether dwcontrol should automatically
reset the update flags:¨ TRUE — (Default) Reset the flags¨ FALSE — Do not reset the
flags
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
Update returns NULL.

Update may trigger these events:


DBError
SQLPreview
UpdateEnd
UpdateStart
If AcceptText is performed, it may trigger these events:
ItemChanged
ItemError
141 What is encapsulation, inheritance, and polymorphism and give at least one example of each
one of them.
142 What the describe will return if you do not pass any expression.
Ans: String. Returns a string that includes a value for each property or Evaluate function. A
newline character (~n) separates the value of each item in propertylist.
If the property list contains an invalid item, Describe returns an exclamation point (!) for that
item and ignores the rest of the property list. Describe returns a question mark (?) if there is no
value for a property.
When the value of a property contains a question mark (?), the value is returned in quotes so
that you can distinguish between it and a property with no value.
If any argument's value is NULL, Describe returns NULL.
143 Can you open multiple response windows at the same time?
Ans: No, When the one Response window gets close then only second window is open.
144 What are the registry related functions provided with pb.

145 What is the difference between SetTrans and SetTransObject?


Ans: In most cases, use the SetTransObject function to specify the transaction object. It is more
efficient and allows you to control when changes to the database get committed.
SetTrans copies the values from a specified transaction object to the internal transaction object
for the DataWindow control or DataStore. When you use SetTrans in a script, the DataWindow
uses its internal transaction object and automatically connects and disconnects as needed; any
errors that occur cause an automatic rollback. With SetTrans, you do not specify SQL
statements, such as CONNECT, COMMIT, and DISCONNECT. The DataWindow control
connects and disconnects after each Retrieve or Update function.
Use SetTrans when you want PowerBuilder to manage the database connections automatically
because you have a limited number of available connections or will be use the application from
a remote location. SetTrans is appropriate when you are only retrieving data and do not need to
hold database locks on records the user is modifying. However, for better performance, you
should use SetTransObject.
146 How can you call the external function from dll.
147 What all application services provided with the pfc.
148 What all window services provided with the pfc.
149 What all are the datawindow services provides with the pfc.
150 How many layers of pbls are in pfc and what they are?
151 What is deligation.
152 What is the difference between operator overloading and polymorphism.
153 Write down query to find out duplicate rows.
Ans :
154 If four records with same data in all columns are there how can you delete two of it in oracle?
155 What all tables get updated when you create a procedure?
156 What is the advantage of the procedure?
Ans : procedure is stored in database . So it is faster than any other Query.
157 Where can you get the definition of sp in oracle?
Ans : There is a one table from which we can get the defination of SP.
158 In joins and subquery which one is preferable and why.
159 Can you have the script of any function in ancestor in the descendent object function? If not
how can you get it.
160 What is yield function?
Ans: Yields control to other graphic objects, including objects that are not PowerBuilder
objects. Yield checks the message queue and if there are messages in the queue, it pulls them
from the queue.
Return value
Boolean. Returns TRUE if it pulls messages from the message queue and FALSE if there are
no messages.
Usage
Include Yield within a loop so that other processes can happen. For example, use Yield to
allow end users to interrupt a loop. By yielding control, you allow the user time to click on a
cancel button in another window. Then code in the loop can check whether a global variable's
status has changed. You can also use Yield in a loop in which you are waiting for something to
finish so that other processing can take place, in either your or some other application.
161 What is the cluster and non cluster index in sybase.
162 What is the cluster in oracle.
163 What is the sequence and what is the use of it in oracle.
164 What will happen if I call one event in other and other in first event.
165 Why we should write cursor in sp not directly.
166 What is the exception and error handeling.
167 What is the function of setredraw function.
Ans : Controls the automatic redrawing of an object or control after each change to its
properties.
Objectname.SetRedraw ( boolean )
Argument Description
Objectname The name of the object or control for which you want to change the redraw
setting. Objectname can be a child DataWindow, but cannot be a menu
boolean A boolean value that controls whether PowerBuilder redraws an object automatically
after a change.
Values are:¨ TRUE — Automatically redraw the object or control after each change to its
properties¨ FALSE — Do not redraw after each change
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If boolean is NULL, SetRedraw
returns NULL.
168 How can we get column modified.
169 Can you open response window using opensheet function if yes what will happen.
170 What are the functions to set and get garbage collection time limit.
171 What is for setforegroundwindow is used.
172 What for setformat function used.
Ans : Specifies a display format for a column in a DataWindow control or DataStore.
DataWindow controls, DataStore objects, and child DataWindows
Syntax
dwcontrol.SetFormat ( column, format )
Argument Description
Dwcontrol The name of the DataWindow control, DataStore, or child DataWindow in
which you want to specify the display format
Column: The column for which you are specifying the display format. Column can be a
column number (integer) or a column name (string)
Format : A string whose value is the display format for the DataWindow column
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If any argument's value is NULL,
SetFormat returns NULL. The return value is usually not used.
173 What is the pixeltounits function.
Ans :
174 How can we get the environment
Ans : Gets information about the operating system, processor, and screen display of the system.
GetEnvironment ( environmentinfo )
Argument Description
environmentinfo The name of the Environment object that will hold the information
about the environment
Return value
Integer. Returns 1 if it succeeds and -1 if an error occurs. If environmentinfo is NULL,
GetEnvironment returns NULL
175 What events get fire on calling update functions.and what are the parameter in update function.
176 What values we can send with open with param.
177 When does idle event fire.
Ans : Occurs when the Idle function has been called in an application object script and the
specified number of seconds have elapsed with no mouse or keyboard activity
178 When does systemerror event fire.
Ans : Occurs when a serious execution time error occurs (such as trying to open a nonexistent
window).
179 What are the connection begin and connection end event
180 What does classname function return
Ans : Provides the class (or name) of the specified object.
controlname.Classname ( )
Argument Description
controlname The name of the control for which you want to know the name assigned to the
control in the style window (the class of the control)
Return value
String. Returns the class of controlname, the name assigned to the control. Returns the empty
string ("") if an error occurs. If controlname is NULL, ClassName returns NULL.
181 What does typeof function return
Ans :
182 What does setlibrarylist function does.
183 What does getapplication function return.
184 How can we get next modified row and column.
185 When does updatestart6 and updateend event fire.what are the argument to these events.
186 What all events get fire on calling any scrolling function.
187 What will return by the function getbandatpointer
188 When does sqlpreview event get fire.
189 What is ISO and CMM. What are the differences.
190 What is quality control and quality asurence.
191 What is normalysation and denormalisation.
192 Describe various normal forms.
193 What is ER diagarams
194 What is DFDs.
195 What all models are there .
196 What is difference between query with in and exist operator and which one is preferable.
197 What is outer join.
198 What is the package in oracle and what is the use of it.
199 Can you write create statement in procedure.
Ans : Yes
200 What all locks provided in sybase.
201 What are the durty tables and magic tables in sybase.
202 What is transactions.
203 List down the NVO user object.
Ans : 1. Connection
2. ContextInformation
3. ContextKeyword
4. Datastore
5. Dynamicdescriptionarea
6. DynamicStagingarea
7. Error
8. Inet
9. Internetresult
10. Mailsession
11. Message
12. Oleobject
13. Olestorage
14. Olestream
15. Pipeline
16. Profiling
17. Service
18. Timing
19. TraceTree
20. Transaction
21. Transport
203 What is the keyword that used only in menu.
Parentwindow – which gives you the name of the window to which the menu assigned.
204 How to get handle to a printer

205 How can you execute any exe through the pb.
Ans Using run function with the name of exe.
206 What is rowsread and rowswritten.
Ans Rowsread - The number of rows written by the pipeline.
Rowswritten - The number of rows written by the pipeline.
207 What is the RPC call.
Ans RPC is the remote procedure call.A stored procedure in a database that you can call from a
script. The declaration for an RPC can be global or local (belonging to an object). The
definition for the procedure is in the database
208 What is sqlpreview event and when these get triggers. What are the parameters.
209 Can you define arguments to a user define event
Ans : Yes, we can define argument in user difined event.
210 What is the use of event id in events
Ans :
211 Can you change the presentation style of a datawindow.
Ans : Yes we can export the datawindow object and then we can changed the parameter
processing = 1 then it will convert it to GRID style.
212 Can you change the ancester of a user object.
yes
213 What are the object at client side and server side in distributed applications
214 What differences are there regarding distributed application.
215 What is proxy objects
Ans Ans :It is a copy of server side objects with which your client object communicates and pass re
You can not make proxy object in pb5 but is possible in pb6.
216 Is it neccessory to have same name for client and server side objects.
Ans It is neccessory in pb5 not in pb6
218 Can you write user event in menu object.
Ans Ans : No since menu is the window object which we can not modify through th ePower
Builder.
219 What is datawindow child objects.
Ans : A DataWindowChild object is a nested report or a DropDownDataWindow within a
DataWindow object. For example, a DataWindow object that populates a column having the
DropDownDataWindow edit style is a DataWindowChild object.The DataWindowChild object
is used for accessing DataWindow objects independently from DataWindow functionality, and
it inherits from the system Structure object because it needs storage and autoinstantiation. A
DataWindowChild object has no properties and no events.
220 What is % row type datatype in oracle.
221 How can change the messagebox title for datawindow error?
Ans The title of the dialog box that displays when an error occurs.
Controls
DataWindows
Syntax
Dot notation:

dw_control.Object.DataWindow.Message.Title
Describe and Modify argument:

"DataWindow.Message.Title { = ' titlestring ' }"

SyntaxFromSQL:

DataWindow(Message.Title = ' titlestring ' )


Parameter Description
titlestring A string containing the title that displays in the title bar of the DataWindow
dialog box that displays when an error occurs

You might also like