Monday, August 30, 2010

Powerbuilder interview question _part2

How PowerBuilder looks for variables

When PowerBuilder executes a script and finds an unqualified reference to a variable, it searches for the variable in the following order:

1 A local variable
2 A shared variable
3 A global variable
4 An instance variable

As soon as PowerBuilder finds a variable with the specified name, it uses the variable's value.

1. 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.

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:\winword.exeleter.doc”, Maximized!)

3. How do you know that the application is already running?
(How do you avoid MessageBox “Application is already running”?)
Use Handle( ) function. Handle( ) returns the object’s name if the object exists.

4. What are the two structures every application has?
Every PowerBuilder application has the MessageObject and the ErrorObject. ErrorObject is used to report errors during execution. MessageObject--to process messages that are not PowerBuilder-defined events, and pass parameters between windows.
5. What are the ways to close your application?
HALT(), HALT CLOSE(), CLOSE()
6.What is HALT? HALT CLOSE? What is the difference between them?
The 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.

7. What do you do to find out how fast your select is being executed on a client site?
Put TRACE option in the .INI file ( SQL_OPT_TRACE—Connect Option DBParm parameter) Purpose - Turns on/off the ODBC Driver Manager Trace in PB to troubleshoot a connection to an ODBC data source. It provides detailed information about the ODBC API function calls made by PB when connected to an ODBC data source. Values - The values you can specify are:
SQL_OPT_TRACE_OFF (Default) - Turns off the ODBC Driver Manager Trace. SQL_OPT_TRACE_ON - Turns on the ODBC Driver Manager Trace.

8. What are the ways to test correctness of your SQL? SQL Time?
Put TRACE option in the .INI file.

9. 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’


10. How do you manipulate .INI file through PowerBuilder functions?
n Set Profile String( )
n ProfileString( )
n Profile Int( )

11. How do you set calculator in PB application?
Run (“c:\ calculator” )
SQL
What is SQL?
SQL is A Structure Query Language.
1. Is a standard way of specifying data sets.
2. Is a way to retrieve and manipulate data in DataBase.
3. Is used for all DataBase functions.
4. Can be used in the form of “embedded SQL” from an application program.

1 comment:

zulmach said...

please visit my blog for PowerBuilder Installers and other resources :
http://zulmach.wordpress.com
and subscribe my youtube channel, we have modern UI for PowerBuilder
www.youtube.com/c/pemulapb/sub_confirmation=1

Custom Search