Inteview Questions
Inteview Questions
Inteview Questions
Use OpenWithParm method () and accessing the three system message object
properties:
Message.DoubleParm
Message.PowerObjectParm
Message.StringParm
The parameters are stored in the Message object.
4. What are the different status’s a row can have in a DW and what function do you call
to find the status?
The 4 DW Statuses:
1. Not Modified – the information in the row/column is unchanged from what was
retrieved.
2. Data Modified – the information in a column or one of the columns in the row has
changed since it was retrieved
3. New Modified – the row is new and values have been assigned to columns. (Changes
are primarily due to user entry or by using the setitem () method)
4. New – the row is new and values have not been specified to columns.
a) All are applicable to rows but only 1 & 2 are applicable to columns.
b) Getitemstatus () can be used to find the data window status
6. What is a dynamic data window? Give an example of why you’d need to use a
dynamic data window.
It is a data window that is modified or created during runtime. CREATE method can be
used to create or replace the current DW object in the DW control with the newly created
DW. Settransobject () needs to be reset with the new DW in the control since the earlier
association would have been destroyed.
ODBC takes care of locating the Sybase/SQL server address on the network by reading
the win.ini/sql.ini files
17. Explain the different types of data sources that can be linked to data window controls
a) Quick Select – Used when data comes from one or more tables linked by a foreign
key.
b) SQL Select – In addition to above grouping & computed columns can be specified
c) External – the data can be imported from a flat file or populated from the code. ( for
example using setitem() methods)
d) Query – used when the data source (SQL statement) is saved in a query object
defined in the query painter.
e) Stored Procedure
When the Auto Commit property is set to FALSE (default) or 0, PB issues SQL statements
inside the scope of a transaction. 1(TRUE) implies statements outside the scope of a
transaction (for example when your application requires creating temporary tables).
a) If you want to execute stored procedures containing DDL (CREATE, ALTER, DROP etc)
statements, then Auto Commit = TRUE.
b) If Auto Commit = TRUE, then rollback cannot be issued, it should be set to FALSE
after completing the DDL operation.
When Auto Commit is set from FALSE to TRUE, then PB issues a COMMIT statement by
default.
PowerBuilder can access Unicode data in an ASE 12.5 Unicode database or in Unicode
columns in ASE 12.5. PowerBuilder converts between double-byte character set (DBCS)
data and Unicode automatically, provided that the Locale parameter is set with DBCS
values. For example, the Locale DBParm should be set to chs or cht.
a) By Value – a copy of the variable is passed. Any changes to the value of the variable
will affect the copy only, the original variable in the calling script is not affected
b) By Reference – a pointer to the variable is passed to the function/event. Any changes
affect the original variable in the calling script
c) READ-ONLY – a copy of the variable treated as a CONSTANT is available to the
function/event
24. Mention some features of N-Up, Composite & CrossTab DW presentation styles
a) N-Up: two or more rows of data displayed next to each other across the page. It is
useful for periodic data such as data for each day/week or each month in the quarter
b) CrossTab: - provides a data summary in a row and column format. Data to be
selected from one or more tables, DW cannot be external. Crosstab functions can be
used for filters, validation rules or computed fields
c) Composite: - it consists of one or more nested reports. It also serves as a container
for other reports and has no data source of its own. The user can specify one DW object
to be shown on screen, as many reports as the number of DW objects can be viewed on
screen based on the retrieval arguments specified by the user
25. Explain some performance considerations that you as a developer would like to
review while designing client/server (PB/Sybase) applications
An important consideration is the usage of COMMIT/CONNECT statements to maximize
performance and limit locking and resource use. Two design considerations that should
be taken care are:
a) Long running connections – if these are NOT acceptable then the application should
connect to the database only when necessary. If acceptable then COMMITs should be
issued as often as possible so that the changes do in fact occur. More importantly
COMMITs should be issued to release any locks placed on DB entities as a result of
statements executed during the transaction
b) Settrans/Settransobject function – if the application functionality requires connections
to be kept open and issue periodic COMMITs then Settransobject () should be used or
use Settrans () for many short-lived transactions
28. Explain the two classes of PB user objects and their sub types
Uos are custom visual objects that you can build to supplement standard PB objects.
UOs can request/display information and respond to mouse or keyboard actions and
create a tab page UO.
a) Visual UO – a reusable control/set of controls. For example a set of buttons to
function as a unit having scripts associated with them for standard processing. Three
types are:
1. Standard – inherited from a specific visual control. For example command
button/checkbox etc
2. Custom - inherited from the userobject system class. You can include many controls
in the UO and write scripts for these events.
3. External - it is a UO that displays a visual control defined in a DLL.
b) Class UO – they consist of properties, functions, and events with no visual
components.
1. Standard – inherited from a NV PB object such as a transaction/error object, which
can have instance variables and functions.
2. Custom – an object of your own design for which you define variables, events and
functions in order to encapsulate application-specific programming in an object
30. Can you use an array as an argument to the DW’s Retrieve () function?
Yes, it can be used when your DWs data source contains a Select statement with an IN
clause.
31. Application functionality would like to allow the user to print selected rows. How is
this done?
You can copy the selected rows to a data store or a hidden DW control using rowscopy ()
and print the data store or hidden DW control
33. Explain the following error: “Rows changed between retrieve and update”
It occurs when a user updates the data before you update it. PB detects it when you
include the timestamp column in the DW or use “key and updateable columns” in the
WHERE clause. The solution to the problem would be to use the reselectrow () function
to reselect the row that caused the error and get the latest values for the error row and
update the DB again.
34. What is the difference between a computed column and a computed field?
The former is defined as part of the SELECT statement, (for example sum, avg etc)
whose values are calculated by the database, while in the latter the PB client calculates
the values. If it is a fat client then computed fields are recommended, else for thin
clients it is computed column.
35. If the application needs to display rows as soon as they are retrieved, what should
be done?
Write code in the retrievrow () event and also set the asynch attibute in the DBParm
property in the transaction object
36. How would you retrieve multiple result sets in a single DW?
A DW can retrieve only one result set at a time. To retrieve other result sets, you can
change the result set number either by modify () or using object notation making sure
the number of columns and data types match the existing DW definition.
37. What is the event from which I can see the exact SQL statement sent to the DB by
PowerBuilder?
SQLPreview ()
38. How can you update a DW that has a stored procedure as a data source?
It can be done by going to the update properties in the DW by selecting Rows/Update
properties from the menu in the design mode in the DW painter. The tables to be
updated can be selected.
40. If you create a response window and open that window in an MDI frame using
opensheet (), what would happen?
When you open a window in a MDI frame using opensheet () or opensheetwithparm ()
the window gets the sheet properties irrespective of the window type. If a response
window is opened using the above functions the window will behave like any other sheet
having maximise, minimize, close controls etc
42. How can I find out if the PB application is connected to the DB or not?
Use the Dbhandle () function
45. I have a window, which has a menu, associated with it. For some reason I have
deleted the menu and I am getting any error while trying to open the window. What
needs to be done?
Export the window as a SRW and look for the menu name in the file. Once found the
menu can be created again and linked to the source window.
46. Explain the different types of embedded SQL that can be used in PB scripting
Given below are the SQL statements in scripts that are possible with Sybase ASE:
a) Transaction Management statements – CONNECT, COMMIT, ROLLBACK and
DISCONNECT are used to manage transactions in ASE. If a trigger fails, then a
RAISEERROR should be issued in the trigger and not ROLLBACK. PB has got a DBMS
specific return code (SQLDBCode = -1) within the transaction object which can be used
to throw messages to the user.
b) Non-cursor statements – INSERT/UPDATE/DELETE/SELECT
c) Cursor statements – the user can retrieve ( declare, open, fetch & close cursors) and
issue update( update & delete cursors)
d) DB Stored Procedures – they can be used for retrieve, update or both. To execute
DDL statements the AutoCommit must be set to TRUE (1), but if it is TRUE, ROLLBACK
cannot be issued, hence after completion of the DDL operation it must be set back to
FALSE.
47. What is DDE? Which PB object has DDE related events associated with it?
DDE stands for dynamic data exchange by means of which two applications can talk to
each other and exchange data between them. Examples are RemoteExec & RemoteSend.
A PB window has DDE events associated with it
51. If you were experiencing a GPF in your application, how would you go about tracking
it down?
a) Check library search path in development, required DLL’s, PBL’s in runtime etc
b) If PFC is used, check that the PB version is exactly the same as PFC version, i.e.
5.0.04 etc
c) Use DLL tracking utility to check executables DLL list
d) Enabling the PB Debug Tracing information and find the last line of code that executed
prior to the GPF.
No,But you need`multiple inheritance then you can inherit one object from other and
You make one object as userobject and then use this userobject inherited object.
open(),close(),connectionbegin(),connectionend(),idle(),systemerror().