Showing posts with label POWER BUILDER. Show all posts
Showing posts with label POWER BUILDER. Show all posts

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 20

PowerBuilder Interview Question and Answers:

105.     What are facilities of the User Objects?
      We define a component once, then reuse it many times as we need without any additional work.

106.     What does Open User Object() do?
      Open User Object() adds a user object to the specified window and makes all its properties and controls available to scripts. window name.Open User Object ( user object var, user object type {, x, y } ) This function is used when you want dynamically, at run time place some user objects on a window. This function displays this user object, makes all its attributes available to scripts. You must open a user object before you can access the attributes of the user object. If you access the user object’s attributes before you open it, it will cause an execution error.

107.     How can you dynamically place an User Object on the window?
      By using functions : Open User Object( ), Open User Object With Parm( )

108.     What Events does the Custom Class have?
      Constructor and Destructor

 109.     What are Non-Visual User Objects?
      Non-visual user object is an object that encapsulates attributes and functions but is not visible to the user. NVO is a collection of business user functions. They can be Custom Class and Standard Class. NVOs are useful because they allow you to encapsulate application operations into objects making them easier to develop, manage and maintain and also to encapsulate all security management for an application into a single object.

110.     Explain the purpose of a non-visual user objects?
      The purpose of non-visual user objects is to define business rules and other processing (which are checked in different windows in your application) that act as a unit. We implement them in Power Builder using Class User Objects.

111.     What events are available to a standard class User Object?
      Constructor and Destructor.

112.     How is a custom visual UserObject different from a standard UserObject?
      A custom visual user object is an object that has several controls that work as a unit. A standard visual user object inherits its definition from a standard control. We modify the definition to make the control specific to our applications.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 19

Power Builder Interview Question and Answers:

97.     When do you need to use .PBD?
      We use .PBD when the number and size of the objects in our application would otherwise make a very large .EXE (1.2 to 1.5 megabytes). we need to share components among several applications. distribute application components selectively, for example, to upgrade an application or fix a bug.

98.     How many .PBDs can you have for one application?
      As many as we need and depending on available memory.

99.     How many .PBRs can you have for one application?
      One

100.     What is .PBR file?
      PBR file is an ASCII File in which we list resource names or DW object names that were referenced dynamically in the script.

101.     What types of Menus available in Power Builder?
     

    Drop Down
    Cascading
    Pop-up

102.     What is Regenerate option in the Library painter? When is it most useful?
      It compiles all codes of an object(s). Regeneration is important during the development of our PB application. Regeneration is useful :

    when we have an error message with no reason for it;
    When we upgrade to a new version of PB, the new version should regenerate all its source code to update it;
    When we make a change to an ancestor window that has many descendants, the changes can be immediately rippled throughout all child window through regeneration. Regenerating could be called “recompiling”. When you regenerate an entry, Power Builder recompiles the source form stored in the library and replaces the existing compiled form with the recompiled form.


103.     When do you need to use a .PBR?
      We create .PBR if we have any dynamically assigned objects, bitmaps or icons and to reduce the number of files we need to distribute with the .EXE. We typically use a .PBR when we have scripts in our application in which we dynamically assign resources to attributes of objects or controls in the application. If we do not use a .PBR, we must distribute various .BMP, .RLE, .ICO files with the application. We must place in .PBD’s any objects that we reference dynamically in scripts in the application.

104.     Why do we create PBR, PBD files?
      We create .PBR if we have any dynamically assigned objects, bitmaps or icons to reduce the number of files we need to distribute with the .EXE. We have to create .PBD if we have more than one PBL. It allows us to break the application into smaller units that are easier to manage and makes the executable file smaller, and at execution time we can load any objects that are not contained in the application’s executable file. It makes sense to use PBD when our application is really large.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 19

PowerBuilder Interview Question and Answers:

96.     What is the differents between EVENT and FUNCTION in PowerBuilder?
     
      EVENT                                                                                FUNCTIUON
1.     An action in an object or control that can trigger a script.     A program or rutine that performs specific process.

2.     Top-Down approach     Bottom-Up approach

3.     Event has User Event and System or Built-in Event.             Function has System Function, Object Function, User Define Function, Global Function, Local External Function, Global External Function and Remote Procedure call (RPC).

4.     Event has Public default Access Level                               Function can declare Public, Private and Protected Access Level.

5.     Event has PassByVal, PassByRef and ReadOnly.               Function has PassByVal, PassByRef and ReadOnly.

6.     Event can call Object Events Dynamically or Statically.      Function can call Object Level Function Dynamically or Statically.

7.     We can POST or TRIGGER an Event call.                        We can POST or TRIGGER a Function call

8.     Events are associated only with objects.                           Function can be Global or part of an object’s definition.

9.     Call an undefined event does not trigger an error.             Call an undefined function triggers an error.

10.     Event cannot be Overloaded                                         Object-Level  Function can be OverLoaded.

11.     Events either return a value or do not have a return value.     Function always has return value.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 17

Power Builder Interview Question and Answers:

86.     Explain Close Query event?
      Power Builder triggers Close Query event before it triggers Close event. If Close Query event’s script not executed successfully close event will nerver trigger.

87.     Which function is used to change a validation rule in Data Window at run time?
      Set Validate().

88.     Explain types of Windows in PB?
      MAIN
A standlone overlaped window that can be independed of all other windows. Used for single window application.

CHILD
A window that is dependent on a main window and can only exist within the main(PARENT) window. If minimize the main window as well as the child window is minimizsed. A child window cannot beyond the parent window.

MDI
MDI window allows to open multiple window as sheet inside it. When a window inside the MDI window it minimize and maximized wheet icon is displayed at the bottom of the MDI window.

MDIHELP
MDIHELP window has additional feature of a status bar at the bottom of the MDIHELP window. This status bar used to display help text like run time.

POPUP
POPUP window depends on it parent window. POPUP window will behave like a main window. IT the parent window is minimized POPUP window will be hidden.

RESPONSE
RESPONSE window equalent of a window dialog box. When a response window is opened from another window the response window can’t minimize and maximize untill the user gives response to the window can»t get another window.

89.     Explain HELT CLOSE keyword?
      When PB encounters HALT without the keyword CLOSE, it immediately terminates the application.
When PB encouters HALT with the keyword CLOSE, it immediately executed the script for the close event for the application and then terminates the applicaiton.

90.     Explain MDI?
      MDI stand for Multiple Document Interface. It is an application style that allows users to open multiple windows(called sheets) in a single window(called MDI Frame) and to move freely among these sheet.

MDI has two PB window styles:

    MDI Frame
    MDI Frame with MicroHelp

MDI Frame has three parts:

    Frame
    Client Area
    Sheets

91.     Which comman/function will blank out a Data Window?
      Reset().

92.     Explain Transaction Objects?
      Transaction object contains the necessery informaiton needed to connect to a database. Like user id , password..

SET TRANS OBJECT()
Set Trans Object tells the Data Window to use specified transaciton object.

SETTRANS()
The DataWindow control connects and disconnects after each Retrieve or Update function while using SetTrans
When we use SetTrans we can’t update multiple DataWindow object.

93.     Explain SQLSA?
      Dynamic Staging Area is internally used by Power Builder and is the connection between execution of a statement and Transaction object. SQLSA contains no.of parameters and SQL statements.

94.     Explain SQLDA?
      Dynamic Description Area stores information about input and output parameters. The two principle of dynamic SQL are PREPARE and EXECUTE.

95.     How to open a window with a parameter?
     
Opening window with a parameter
   
Stored in
Open With Param()
   
Message.String Param
Open Sheet With Param()
   
Message.Double Param
Open User Object With Param()
   
Message.Power Object Param
Close With Return()

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 16

Power Builder Interview Question and Answers:

76.     How to execute the ancestor event’s script from the decendent’s event?
      We can use CALL SUPER::EVENT_NAME

77.     Can we have Global and Local/Instance variable with the same name?
      YES.
This.var_1 = 100 //Instance Variable.
var_1 = 100 //Local Variable.
::var_1 = 100 //Global Variable.

78.     Explain Computed Column
      Computed clumn is a column that we define as a part of the SELECT statement. This values are calculated by the database and send to the Power Builder.

79.     Explain Computed Field?
      Computed fields are defined in DataWindow bands and Power Builder calculates these values, not the database server.
80.     Explain Post Event()?
      Post Event() will be executed after completing the current script execution. Post Event() executes asychronously. Post Event() scripts are bending in the message queue.

81.     Explain Diffrent levels of attribute method protections?
      Public, Protected, Private, Private Read, Private Write, Protected Read, Protected Write.

82.     How do you pass a value to a window at opening time?
      Use either OpenWithParm() or Open Sheet With Parm().

83.     How many Data Window can share the data from a Data Window?
      There is no limitation.

84.     What is DDE?
      DDE means Dynamic Data Exchange. This technology allows two different applications talk to each other under MS-Windows environment and exchange data between them.

85.     Explain Trigger Event()?
      Trigger Event() executes the specifed event’s script right way. All pre-defined events are defined as enumerated data types under Trigger Event().

Trigger Event() function executes synchronously, the next command after this command will not be executed untill thios command is executed completly.

Return type is :
Return 1 Successfully Executed.
Return -1 Invalid.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 15

Power Builder Interview Question and Answers:

66.     Explain DB ERROR() & ERROR() event.
      DB ERROR() event is fired when a database related error occurs.
ERROR() event at the Data Window control level is triggered, when a wrong expression is encountered in the object notaiton.

67.     How to load a text file in a Data Window?
      We can use Import File() function.

68.     What STATUS occurs When a row is copied from another Data Window?
      New Modified!

69.     What are the buffers will maintain a Data Window if set to Read Only?
      All the four buffers. Primary!, Original!, Delete!, Filter!.

70.     When would you use Set Trans()?
      We use Set Trans() when only a limited No. of connections to the DB is allowed or we are only retrieving data and do not need to hold DB locks on records the user is modifying.

71.     Define ‘Retrieve Only as Needed’?
      Power Builder displays the first row on the screen when its complete retrieveing. When we scroll downward additional rows are retrieved.

72.     How Power Builder search for a function?
      Bottom - to -Top.

73.     How Power Builder search for a function?
      Top - to - Bottom.

74.     Will it ignore extra retrieve arguments to the Retrieve() function?
      YES, it will ignore extra arguments.

75.     Explain Accept Text() function.
      Accept Text() function applies the content of the edit control to the Primary Buffer after validating the data. We can also specify to the Update() via argument of call Accept Text() internally before applying the changes to the database.
Accept Text() function should no be called from ItemChanged event. This is because AcceptText() function triggers the ItemChanged event.

Return value is .
Return 1 if succeeds and -1 if its fails.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 14

Power Builder Interview Question and Answers:

61.     Can you call batch SQL from your Data Window?
      YES

62.     Explain the difference between Set Trans() and Set Trans Object()?
      SetTransObject() works faster because it doesn’t perform Connect and Disconnect each time we call it. When we specify SetTrans() system Does all transaction Automatically. When we specify SetTransObject() we have to manage all Transaction by ourselves. When we 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. Use SetTrans() when we want PowerBuilder to manage the database connections automatically because we have a limited number of available connections or will be used the application from a remote location. SetTrans() is appropriate when we are only retrieving data and do not need to hold database locks on records the user is modifying. However, for better performance, we should use SetTransObject().

63.     How do you stop the retrieval of the D W immediately?
      DB Cancel()

64.     If the source for a D W is a stored procedure and this stored procedure has parameters, where do we have to pass these parameters?
      In the RETRIEVE().

65.     What is the BLOB data type?
      Unbound data type that stands for binary large object. Usually used to hold pictures in database, window’s wave sound file or MIDI music.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 13

PowerBuilder Interview Question and Answers:

56.     What do you use computed fields for?
      We use computed fields if we need some calculation based on column data that change for each retrieved row, some summary statistics system information (as current date and time).

57.     How do you assign the transaction object to the DW control?
      We use SETTRANS() or SETTRANSOBJECT().

When we use SETTRANS(), the DW control uses its own Transaction object and automatically performs connect, disconnect, commit and rollback. The SetTransObject() tells the DW control to share the transaction object with other DW controls. We have to control the database processing and we are responsible for managing database transactions. Application performance is better when we use SetTransObject().

58.     What two types of computed columns are allowed in a DataWindow?  
    One from the database side
    One from the client side

59.     How can you print multiple DataWindows?
      We should open the print job by calling the PrintOpen() function. After that, we can print DWs by using PrintDataWindow() function. After that, we close the print job by calling PrintClose(). When we use PrintDataWindow() with PrintOpen() and PrintClose(), we can print several DataWindows in one print job. The info in each DataWindow control starts printing on a new page.
Example:
long job
job = PrintOpen() //Each DataWindow starts printing on a new page.
PrintDataWindow(job, dw_EmpHeader)
PrintDataWindow(job, dw_EmpDetail)
PrintDataWindow(job, dw_EmpDptSum)
PrintClose()

60.     . How many tables can be updated at the same time in a DataWindow?
      One is updated by default. If we want to update multiple tables from DW, we have to write a script for this using MODIFY()

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 12

Power Builder Interview Question and Answers:

51.     How can you modify a code table during execution?      Using GETVALUE() and SETVALUE() functions.

52.     How do you get the name of a DropDownDataWindow?
      GetChild()

53.     How do you trap errors from the DataBase in the DataWindow?
      Write some code in the DBError Event
For example:
IF SQLCA.SQLCode <> 0 THEN
MessageBox()
return 1
END IF

54.     What are Extended column attributes? How can you change them dynamically?
      It’s DataWindow object property (Expressions) which we can change dynamically using Modify() function.

55.     What is a code table?
      Specifies whether PowerBuilder uses the code table for the column to validate data. Values are Boolean: True-Uses code table to validate data; False-Does not use code table to validate data. The appearance of the text is specified by the edit mask. Each row in the Code Table is a pair of corresponding values: a display value that user sees and data values-those that are saved in the database.
Code Tables are used with DropDownListBox and RadioButtons.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 11

Power Builder Interview Question and Answers:

46.     In order to sort the contents of a DataWindow, two commands must be used. What are they and what does each do?
      SetSort() and Sort().
SetSort() defines the sort criteria (primary, secondary sort files - ascending or descending order, etc.).
Sort() performs the actual sort.

47.     What is the difference between computed columns and computed fields in a DataWindow object?
      Computed columns are created as a result of a SQL query on the server side.
Computed fieldsas a result of internal processing by DataWindow on the client side.

48.     When you implement incremental search, there is no Current row, so how do you highlight the row you are looking for?
      SelectRow()
ll_row = Find()
if ll_row > 0 then SelectRow (ll_row)

49.     What functions do you use to change the row status?
      dw_1.SetUpdateStatus()
dw_1.SetItemStatus()
dw_1.GetUpdateStatus()
dw_1.GetItemStatus()

50.     How do you stop the user from editing data that is displayed in a field of a DataWindow?
      Change the tab value of the field to zero in the DataWindow painter.

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 10

PowerBuilder Interview Question and Answers:

41.     When Insert statement applied in DataWindow what status will be occurred?
      NEWMODIFIED! When a row is inserted into a DataWindow it is initially has a row status of NEW!, and all columns in a row initially have a column status of NOTMODIFIED!.

42.     When Update statement applied in DataWindow what status will be occurred?
      DATAMODIFIED!

43.     When powerbuilder retrieves data from the database what status will be occurred?
      NOTMODIFIED!

44.     What is the difference between nested and composite reports?
      In a Nested report each report has its own data source. Composite report does not have its own data source-it is just a container for other reports.

45.     Descibe DataWindow Item Status?
     
STATUS             NUMERIC VALUE     APPLIES TO

NEW!                                 2               Rows

NEWMODIFIED!               3               Rows
   
NOTMODIFIED!                0               Rows/Columns
   
DATAMODIFIED!               1               Rows/Columns   

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 09

PowerBuilder Interview Question and Answers:

36.     How can you change a Select statement of the DataWindow at runtime?
      We can change the select statement by using functions SetSQLSelect() or by changing the data attributes Table.Select by calling function Modify().
Modify() is preferable because it works faster.
dw_1.Modify(“datawindow.Table.Select = ‘Select * from customer’”)

37.     What is an Update flag?
      We use them when we need to update multiple DataBase tables from one DataWindow.

38.     How can you update multiple DataBase tables from one DataWindow?
      Using Modify() function. When a DataWindow is based on a join of multiple tables, we can update all of those tables by modifying attributes DataWindow.Table, UpdateTable and column attributes Update and Key using Modify() function. For example, if the data initially came from DEPARTMENT and EMPLOYEE tables, and DEPARTMENT table was specified as an Update Table when we painted the DataWindow, we need to:

1. Update the DEPARTMENT table using the Update() function:
iRet = dw_1.Update (TRUE (AcceptText(), FALSE (ResetBuffer))

2.Modify the Update characteristics of the DataWindow to point to the Employee table:
IF iRet = 1 THEN
dw_1.Modify(“Dep_id.Update = NO”) dw_1.Modify(“Dep_name.Update = NO”)
dw_1.Modify(“Dep_id.Key = NO”)
dw_1.Modify(“DataWindow.Table.Updatetable = ‘employee’”)
dw_1.Modify(“Dep_id.Update = YES”)
dw_1.Modify(“Dep_name.Update = YES”)
dw_1.Modify(“Dep_id.Key = YES”)
dw_1.Update()
END IF

39.     What is the method to validate a numeric column in a DataWindow?
      SetValidate()

40.     In what attribute of the Transaction object are the database-specific error codes for Connect/Update/Retrieve stored?
      SQLDBCode

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 08

Power Builder Interview Question and Answers:

31.     Why must you specify the transaction object for a DataWindow control after creating the Data Window object?
      The Create() function must be followed by SetTransObject() function because Create() destroys any previous association between the DataWindow and a transaction object. Then, we can issue a Retrieve().

 32.     Can you dynamically assign a DataWindow object?
      Yes, using Data Window’s control attribute “Data Object”. DataWindow control has the attribute Data Object. If we want to change an associated DataWindow object at runtime we need to put a line in the script that changes the value of the DataObject attribute.
For example:
dw_1.DataObject = “d_name”

33.     Where is a Query stored?
      In a .PBL file.

34.     How do you create a DataWindow object dynamically?
   
We use SyntaxFromSQL() and Create()
functions:
SQLCA.SyntaxFromSQL(select string, presentation string, Error string)
dw_1.Create(syntax, Error string)
dw_1.SetTransObject(SQLCA)
dw_1.Rerieve()

To create a Data Window dynamically we have to:
1. build a string to hold a SQL Select statement;
2. build a string to specify the presentation characteristics of the Data Window object;
3. associate the syntax and description with an existing DataWindow control;
4. associate the DataWindow control with a transaction object, and perform a retrieval.
The DataWindow that is created exists only for the life of the DataWindow control, unless we use the LibraryImport() function to save it in a library. Dynamic DW objects allow us to create and modify DW objects on the fly. To create a DW dynamically, use the Create() function.
Creating takes two arguments: the name of the DataWindow object that will be replaced by the new DW object, and the syntax for creating the new DW object. We can create the DW object syntax in a script, but it is easier to use the SyntaxFromSQL() to generate the syntax from a SELECT statement.

35.     Let’s say, you share two DW buffers and the primary DW has some DDDW columns. Will this DDDW be shared automatically as well?
      NO. After we have shared 2 DataWindows, we have to share all DropDowns as well. First, we have to get the reference for the Child DataWindow using
GetChild() function and then do sharing by using ShareData() function.
DataWindowChild dwc_1, dwc_2
dw_1.getchild(“employee”, dwc_1)
dwc_1.SetTransObject(sqlca)
dwc_1.Retrieve()
dw_2.getchild(“employee”, dwc_2)
dwc_1.ShareData(dwc_2)

LANGUAGES | POWER BUILDER | POWER BUILDER INTERVIEW QUESTION AND ANSWERS - 07

Power Builder Interview Question and Answers:

26.     What is the difference between SQLCA.SQL Code and the value returned by the DB Error Code() function?
      The DBErrorCode() function (not SQLCA.SQLCode) checks the results of Database access performed by a DataWindow. We check SQLCA.SQLCode after explicitly issuing embedded SQL statements, such as Commit.

27.     Which feature of the Data Window painter greatly simplifies the creation of a report having only one group?
      The easiest way to create a report that has a single group is to select the Group presentation style from the New Data Window dialog box.

28.     How would you define validation rules for the Data Window object?
      We can define validation rules in the Data Window painter. We can use the SetValidate() function in a script to set validation rules dynamically (at run time) in a script for DW.

29.     What is the difference between a Data Window control and object?
      Data Window control is a container for a DW object and is placed on the window. DW control has attribute and functions. Data Window object is a PB object which has connection to database and GUI. DW object has attributes. Data Window object represents the data source. It encapsulates your database access into a high level object that handles the retrieval and manipulation of data use for displaying data and capturing user input. Data Window object consist of :
data intelligence (perform test validation rules)
user interface (presentation style)
It is used to display data or capture user input. DW is an object that we use to retrieve, present and manipulate data from a relational DB or other data source in an intelligent way. (The DW control is the container for the DW object. The DW object is created using the DW painter; a DW control is placed on the window. A DW object has attributes. A DW control has attributes and functions. A DW object represents the data source. It encapsulates your database access into a high level object that handles the retrieval and manipulation of data. It is used for displaying data and capturing the user input. A DW object consists of data intelligence (performs test validation rules) and user interface (presentation style).

30.     What are the strongest points of using the DataWindow control?    
    Displaying data.
    Entering data.
    Scrolling.
    Reporting.

LANGUAGES | POWER BUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 06

Power Builder Interview Question and Answers:

21.     Describe the difference between the labels and N-up presentation styles.
      In N-up style, we can also have information from several rows in the database across the page, but the information is not printed on labels.

22.     How often must you set the Transaction object ?
      Just once when we define the DW control. If we change the association of a DataWindow object with a DataWindow control in a script, we must re-issue the SetTransObject () before the next retrieval or update.

23.     What function changes the current row?
      ScrollToRow()

24.     What Presentation Styles do you know and when do you use them?
      The Tabular presentation style presents data with the data columns going across the page and headers above each column. As many rows from the database will display at one time as can fit in the DataWindow object. We can reorganize the Tabular presentation style any way we want by moving columns and text. Tabular style is often used when we want to group data.

The Freeform style presents data with the data columns going down the page and labels next to each column. We can reorganize the default layout any way we want by moving columns and text. Freeform style is often used for data entry form.

The Grid style presents data in a row-and-column format with grid lines separating rows and columns. Everything we place in a grid DataWindow object must fit in one cell in the grid. We cannot move columns and headings around as we can in the Tabular and Freeform styles. But, unlike the others styles, users can reorder and resize columns with the mouse in a grid DataWindow object during execution.

The Label style presents data as labels. We choose this style to create mailing labels or other kinds of labels. If we choose the Label style, we are asked to specify the attributes for the label in the Specify Label Specification.

The N-Up style presents two or more rows of data next to each other. It is similar to the Label style. We can have information from several rows in the database across the page, but the information is not printed on labels. The N-Up presentational style is useful if we have periodic data; we can set it up so each period repeats in a row..

The Group presentation style provides an easy way to create grouped DW objects, where rows are divided into groups, each of which can have statistics calculated for it. It generates a tabular DW that has one group level and some other grouping properties defined. We can customise the DataWindow in the DataWindow painter workspace.

The Composite presentation style allows us to combine multiple DWs in the same object. It is handy if we want to print more than one DataWindow on a page.

The Graph presentation style creates a DataWindow object that is only a graph the underlying data is not displayed. As the data changes, the graph is automatically updated to reflect the new values. We use a graph to enhance the display of information in the DataWindow object such as a tabular or freeform DataWindow.

Crosstab processes all the data and presents the summary information that we have defined for it. We use if we want to analyse data. Crosstab analyses data in a spreadsheet. Instead of seeing a long series of rows and columns, users can look at a Crosstab that summarises the data.

OLE 2.0 presentation style using a process called uniform data transfer; info from PB supported data sources can be sent to an OLE 2.0 server application. The OLE 2-compliant application uses the PB supplied data to formulate a graph, map, a spreadsheet or the like to be displayed in the DW.

RichText presentation style using a RichText DW, you can create letters of other documents by merging info in your DB into a formatted DW. Master word processing oriented features such as headers, footers and multiple fonts are available in an easy-to-use format.

25.     Describe the difference between the grid and tabular presentation styles.
      In the Grid presentation style, we cannot move columns and headings around as we can in the Tabular presentation style but in Grid presentation style users can reorder and resize columns with the mouse during execution.

LANGUAGES | POWER BUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 05

Power Builder Interview Question and Answers:


16.     What Data Sources do you know and how do you use them?
      The Data Source determines how we select the data that will be used in the DW object. If the data for the DataWindow object is retrieved from a database, we may choose one of the following Data Sources:

Quick Select is a select from one or multiple tables that are joined through foreign keys and may include simple selection criteria which appear on the WHERE clause. We can only choose columns, selection criteria, and sorting. We cannot specify grouping before rows retrieved, include computed columns, or specify retrieval arguments.

SQL Select is an SQL Select statement from one or more tables in a relational database and may include selection criteria that appear on any of the possible Select statement clauses (can include selection criteria (WHERE clause), sorting criteria (ORDER BY clause), grouping criteria (GROUP BY and HAVING clauses), computed columns, one or more arguments to be supplied during execution.

Query is a predefined SQL Select statement, which must be previously constructed and saved as a Query object.
Stored Procedure indicates that the DataWindow will execute a Stored Procedure and display the data in the first result set. This Data Source only appears if the DBMS to which PowerBuilder is connected and which supports Stored Procedures. We can specify that the data for a DataWindow object is retrieved through a stored procedure if our DBMS supports Stored Procedures.

External is used when the data is not in the database and the DataWindow object will be populated from a script or data will be imported from a DDE application. If the data is not in the DB, we select External as the Data Source. This includes the following situations:
If the DataWindow object is populated from a script
If data is imported from a DDE application
If data is imported from an external file, such as a tab-separated text file (.TXT file) or a dBASE file (.DBF file).

Externalindicates that we have coded a script that supplies the DataWindow object with its data. We use this Data Source when the data is in a .TXT or .DBF file or obtained through DDE. We may also use it when we plan to obtain the data by embedding our own SQL Select statement in a script. With this Data Source the DataWindow object does not issue its own SQL statement. We specify the data columns and their types so that PB can build an appropriate

DataWindow object to hold the data. These columns make up the result set. In a script, we will need to tell PowerBuilder how to get data into the DataWindow in our application. Typically, we will import data during execution using a PowerScript Import function (such as ImportFile() and ImportString() or do some data manipulation and use the SetItem() function to populate the DataWindow.

17.     Under what circumstances will PowerBuilder automatically join tables that you select in the Select painter?
      If we select tables that have one or more columns with identical names, the Select painter automatically displays the join, assuming equality between the two columns. 

18.     Define DataWindow buffers?

      PRIMARY BUFFER:
When data is retrieved from the databse by using retrieve() function, it is retrieved into the Primary Buffer and it is the content of this buffer that are displayed in the datawindow.
Powerbuilder always displays the data in datawindow control from the Primary Buffer. Data from other buffers are not visible to the user.

ORIGINAL BUFFER
When user modifies a row in the DataWindow the row in the Primary Buffer is modified and the original value is copied into the Original Buffer from the Primary Buffer. Copies data only when the user modify the row for the first time.

DELTED BUFFER

When the user deletes a row with the DeleteRow() function, rows are transferred from Primary Buffer to Deleted Buffer.

FILTERED BUFFER
When rows are filtered using the SetFilter() function, the filtered rows are display in the DataWindow and don’t match the filterd conditions are moved to the Filtered Buffer.

EDIT CONTROL OR DATA BUFFER
Edit DataWindow Control has one edit control. It contains the current column’s data. When the user modify the data in a column modify data is copied in Edit Control Buffer. The modify data on the screen and the content of the Edit Control are same. But the value in the Primary Buffer has the old data.

19.     Define Data Store?
      DataStore is a non-visual DataWindow control. DataStore used for Background processing, processing Embeded SQL and Distributed objects.
Background Processing:
Sometimes we use multiple DataWindow control on the screen to display one single report. But those DataWindows are not usable for printing. So we use hidden DataWindow control for printing.

Processing Embedded SQL:
Lot of times we need to use embedded SQL to check whether a particular record is existing in the databse or not. So we can check for the existing record using DataStore.

Distrubuted Objects:
We can use DataStore in the server application when we are developing a distributed application.

20.     Which Data Source in the DataWindow painter is itself an object?
      Query

LANGUAGES | POWER BUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 04

Power Builder Interview Question and Answers:

11.     What is the Data Window Child?
      A Drop Down Data Window behaves a child of the Data Window Object that contains it.

12.     What do you mean about Data Window?
      A data window object is an object that you use to retrieve, present and manipulate data from a relational database or other data source(Such as EXCEL worksheet or DBASE file).
Retrieves data from a database and present it to the user in a wide variety of styles.
We can use data window objects in client/server, web-bsed and mult-itier applications.
The report we can create in Infomaker and the Data window objects. We can create in power builder and the same objects.

13.     What is the purpose of the PB.INI files?
      INI stands for “initialization”. They are primarily intended to be a standard format that applications can make use of to hold info from one run to the next. Rather than hard-coding the values of transaction properties in scripts, which is too inflexible for most real-world applications, you’ll want your scripts to read some or all of them from an .INI file. You could use PB.INI .INIs are always in the same format:
[Database]
DBMS = Sybase
Database = Video Store DB
User Id =
DB Password =
Log Password =
Server Name =
Log Id=
Lock =
DBParm=ConnectString=‘DSN=VideoStore DB;UID=dba’

14.     How do you manipulate .INI file through PowerBuilder functions?
      Set Profile String()
ProfileString()
ProfileInt()

15.     Explain types of presentation styles available in Datawindow?     
    Composite
    Crosstab
    Freeform
    Graph
    Grid
    Group
    Label
    N-up
    OLE-2.0
    Richtext
    Tabular

LANGUAGES | POWER BUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 03

Power Builder Interview Question and Answers:

6.     What are the ways to close your application?
      HALT, HALT CLOSE, CLOSE

7.     What is HALT? HALT CLOSE? What is the difference between them?
      HALT :
Halt statement forces the application to terminate immediately. This is most often used to shut down the application after a serious error occurred.

HALT CLOSE :
Halt Close does the same thing but triggers the application object’s Close event before terminating. 

8.     How do you avoid Message Box “Application is already running”?
      Use Handle() function. Handle() returns the object’s name if the object exists.

9.     What do you mean Structures and types?
      A structure is a collection of one or more related variable of the same or different data types grouped under a single name.

Global:
Not associated with any objects.

Object Level:
Associated with particular types of windows, menu or user object.

10.     What are the two structures every application has?
      Every Power Builder application has the Message Object and the Error Object. Error Object is used to report errors during execution. Message Object to process messages that are not Power Builder-defined events, and pass parameters between windows.

LANGUAGES | POWERBUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 02

PowerBuilder Interview Question and Answers:


1.     What are the Scope Variables?
      Local:
Local variable is a temporary variable only declared in the script itself and they are available only in the script where they were declared, when the script is finished execution the local variable is destroyed.

Instance:
Intance variable that belongs to an object and associated with an instance of object. It allows values to be shared between scripts in the same object.

Shared:
Shared variable retain their value when an object is closed and opened again.

Global:
Global variabl can access anywhere in the application. Can access any object in the application. It has public access level.

2.     How can you run another application from within PowerBuilder?
      We could do it using PB function Run(). Run(string{, WindowState}), where string is a string whose value is the filename of the program we want to execute. Optionally, the string can contain one or more parameters of the program; WindowState (optional) is a value of the WindowState enumerated data type indicating the state in which we want to run the program.
E.g., Run(“c:\windows\notepad.exe”, Maximized!)

3.     What events do you know for the application object?
      OPEN - the user starts application.

IDLE
No mouse or keyboard activity happens in a specified number of seconds SystemError - A serious error occurred during execution.

CLOSE
The user closes the application

ConnectionBegin
In a distributed computing environment, occurs on the server when a client establishes a connection to the server by calling the ConnectToServer function.

ConnectionEnd
In a distributed computing environment, occurs on the server when a client disconnects from the server by calling the DisconnectServer function.

 4.     What is the User-defined function?
      A user define function is a collection of power script statements that perform some processing.
Two types of user define function :

    Global function : Accessible any whare in the application.
    Object Level function :Object Level functions are defined for a window, menu, user object or application object.

5.     What are the Passing Arguments?
      PassByValue :
When an argument is passed by value the function can accesses the temperory local copy of the arguments and can change the value of the local copy.

PassByRef:
When an argument is passed by reference the function can accesses the original value of the argument and can change it directly.

PassbyReadOnly:
When an argument is passed by read-only we can’t change its value but we can change the value of the argument but we can’t assign another object to that object.

LANGUAGES | POWERBUILDER | POWERBUILDER INTERVIEW QUESTION AND ANSWERS - 01

PowerBuilder Interview Question and Answers:

      What is PowerBuilder?
     
PowerBuilder is a powerful Windows-based professional client/server application development tool, which allows teams of developers to quickly and easily build sophisticated, graphical applications with access to database information stored locally or on networked servers.

      Powerbuilder features
      OBJECT ORIENTATION IMPLEMENTATION:
Supports interitance, encapsulation and polymorphism.

SQL SUPPORTS:
Power builder supports SQL and Strored Procedures using DataWindow and embedded/dynamic SQL and remote procedure calls.

DATA WINDOW:
Data window control is the heart of powerbuilder and is used to display data in a wide variety of presentation styles.

DATABASE CONNECTIVITY

ODBC DRIVERS:
Supports all popular databases like Sybase, MSSQL, Informix, Oracle and DB2 - using ODBC 3.0 drivers.

WEB SUPPORT:
Data window plugin : used basically to display datawindow reports on the web.

UNICODE SUPPORT:

MULTI PLATFORM SUPPORT:
Ms-Window, Macintosh, Sun Solaris, IBM, AIX, HP-UX and ect.