Baan Technical Interview Questions


Technical Questions:

Q.1 Write a query to validate an user…
Soln:
domain ttaad.user logged_user

logged_user = logname$
select ttaad200.*
from ttaad200
where ttaad200._index1 = {:logged_user} and ttaad200._compnr = 0

selectdo

selectempty
message (“Not a Valid User.”)
endselect

Q.2. Find the Logical error

Query.id = “Select..”
sql.exec(Query.id)
sql.fetch(Query.id)

if some.condition then
return(1)
endif

sql.close(Query.id)
return(0)
Soln:

Sql.close function is called after the first return function.

Q.3. Difference between Function & DLL? If we make any changes in the DLL or function then should we make the changes in the Program script. If yes then how? If No then why?
Soln:

Functions are included in the code at the time of compilation. Libraries are included at run time (dynamically).

In case of function and dll, if there is any change in the function arguments or return values, then equivalent change in program scripts are required. If there is no change, then in case function used in program script, then program script needs to be compiled. in case of dll used in program script, no changes needs to be done in program script.
Q.4. Find the Logical error

Select *
from tiitm001 for update
where tiitm001._index1 ={:a}
selectdo
a.type = “purchased”
db.update()
commit.transaction()
endselect

Soln:

We cant use a.type to assign values, as the table is not bind to an alias variable.
Q.5 How to maintain Referential Integrity among tables ?

Soln:

In Maintain Table definition against each table field we can maintain the referential integrity to another table. You can maintain the reference table, reference mode and reference message (in case of any errors).

If a normal field refers to a table, the primary index of that table must contain only one part with the same domain as the field. If a combined field refers to a table, the domains of the child fields of the combined field correspond to the domains of the parts of the primary index of the table.
Q.6 What is error log? how it gets maintained in Baan ?

Soln:

Error log are nothing but the different files which are stored in the filesystem when any error occurs at the shell, database, audit, licensing, CRDD etc. This files are stored in the $BSE/log folder.
Q. 7. Approach to improve the performance of a query if it is very slow.

Soln:

Check for following

a) Wildcards (e.g. tccom001. *) are not used in select.
b) Refers to used wherever references available.

c) Index_n used wherever possible.

d) Unwanted joins removed from the main selecte) If reference does not exist, select is split into 2 selectsf) Multiple indices on same table not used in one select

Q.8 When we get error “Out of Range” ? How to solve it?

Soln:

Out of Range error usually occurs when the value of a particular field in table which needs to be updated falls out of the specified range. This range could be specified in the domain which is linked to the field.

Check the log.bshell for the table field and the value which is falling out of range and then cross verify the range in the field domain range.
Q.9 Approach for Code Review?

Soln:

The following points to be considered when one is doing code review

a) Orders of Sections and Subsections is as per standards.
b) Are proper domains used for the variables
c) Codes are used for message/questions (not hard coded)
d) Select statements appear only in functions
e) Whenever only one record is needed, as set with used in select clause
f) Repeating code put in a function
g) Wildcards (eg. tccom001.*) not used in select statement
h) Refers to used wherever references available
i) Index_n used wherever possible
j) Unwanted joins removed from the main select
Q.10. If there is a Display Session having an Enum field. On changing the Enum value how to filter the current showing records.. ??

Soln:

Assuming the enum field is not a primary key of the table. Write the logic to filter the records based on the enum value in main.table.io section, and subsection before.read. if the values does not fall in the range then use skip.io.
Q.11. Which one is better a. Query.Extension b. Skip.io ?

Soln:

Query.extension is better than skip.io. Query.extension retrieves only the filtered records. Skip.io fetches all the record set form the tables and then skips based on the failing filter conditions, which means larger processing time, and un-optimized performance.
Q.12. Delayed lock.

Soln:

Locking a record for longer than required can result in unnecessarily long waiting times. The use of delayed locks solves this problem to a great extent. A delayed lock is applied to a record immediately before changes are committed to the database and not earlier. When the record is initially read, it is temporarily stored. Immediately before updating the database, the system reads the value of the record again, this time placing a lock on it. If the record is already locked, the system goes back to the retry point and retries the transaction. If the record is not locked, the system compares the content of the record from the rst read with the content from the second read. If changes have been made to the record by another process since the rst read, the error ROWCHANGED is returned and the transaction is undone. If no changes have occurred, the update is committed to the database. You place a delayed lock by adding the keyword FOR UPDATE to the SELECT statement.
Q.13 Difference between of Mandatory & Mandatory unless empty?

Soln:

The difference is as follows

Mandatory – The relation to the specified table is mandatory, i.e. the record which is referred must exist in the table which is being referred to.

Mandatory unless empty – The relation to the specified table is mandatory unless the field (or one of the child fields incase of a combined field) is not filled (for fields with numeric value ‘not filled’ means ‘equal to zero’)

Q.14 Report layouts for following report

Customer
Region
————————
————————–
—————————-
Total
Region
————————
————————–
—————————-
Total

Soln:

Customer (before.field.customer) Sorting Ascending, priority 1 in Input Field
Region (before.field.Region) Sorting Ascending, priority 2 in Input Field
————————
————————–
—————————-
Total (after.field.Region) Sorting Ascending, priority 2 in Input Field
Region
————————
————————–
—————————-
Total
(after.field.Customer) Sorting Ascending, priority 1 in Input Field

Advertisements