Sample Questions Best site for GRE, LSAT, SAT, GMAT, TOEFL, CCNA, CCSA and interview sample questions  

Technical Sample Questions : C |  C++ |  Oracle |  Java | Unix |  Operating Systems |  Data Structure

Oracle Sample Questions ›› Oracle SQL*Forms 3.0

Technical Sample Questions

Oracle Sample Questions : SQL*Forms 3.0

  1. How to eliminate duplicate rows in a base table block?

    Answer: To eliminate duplicate rows in a base table block, create a SELECT DISTINCT view on your base table.

  2. Explain GLOBAL variables and HIDDEN fields?

    Answer: Global variables can be used in DML and SELECT statements but you can't use global variables in a default Where/Order By clause.Also, remember that global variables are always of type char and that implicit conversion might disable the use of indexes (eg....where number_field = :global.x).

    Global variables that will no longer be used in the application should be deallocated from memory.Use the ERASE command to perform this.Below are some memory requirements for SQL*Forms variables:

    Base Table Field: +-100 bytes + 2*field length
    Non-Base Table Field: +-100 bytes + field length
    Global Variable: +- 20 bytes (internal structure)
    +255 bytes (data length)

    Therefore, Non-Base Table Fields will take up less room than a global variable when it holds less than 175 bytes or characters.For database fields, global variables will use less space when dealing with more than about 88 bytes.

    Some considerations:

    • Fields require longer set-up time during start up.
    • Fields are cleared during CLEAR_FORM; Globals are not.
    • Fields can be used in a DEFAULT WHERE/ORDER BY; unlike Globals.
    • Lookup times for fields (qualified by blockname) are comparable to lookup times for Globals.
    • Globals are character only.TO_NUMBER and other datatype conversion functions are somewhat time expensive.
    • Memory for Global variables gets allocated on an as needed basis.

    In general, control fields can offer lower memory requirements and faster performance for datatypes other than character.Globals are a more convenient data structure since they do not deal with screen position, attributes to be set and triggers to be fired.

  3. Is it better to use :block.fieldname or just :fieldname?

    Answer: Always use :block.fieldname.The reason for this is that SQL*Forms contains an internal data structure to hold all of the information about blocks and their associated fields.By always specifying the blockname, SQL*Forms will not have to search through all of the blocks to find the correct field.This saves a lot of time especially for forms with many blocks and many fields.In addition, :block.field references are less ambiguous and easier to read.

  4. How to generate unique database key values?

    Answer: Use the sequence generator to generate unique primary keys:

    SELECT sequence_name.NEXTVAL,
    Issue this statement only as the last step of the PRE-INSERT after the validations.This will prevent the generation of numbers that won't be used.

    You can do a "SELECT * FROM USER_SEQUENCES;" to get a list of sequences for your current Oracle user/schema.

    Note that a SELECT MAX(...)+1 can generate duplicate key values.If you add a LOCK statement to prevent this, multiple users will wait for the next value of the primary key.

  5. How to make my Forms more portable?

    Answer: There are three methods to make forms more portable:

    • Avoid operating system dependencies like C, COBOL or Assembler interfaces, "EXEC CICS..." call's etc.
    • Re-write user-exits to PL/SQL procedures and functions because user exits limits portability, increases maintenance and unnecessarily complicates an application.
    • Always put a SPACE before and after screen fields.

  6. How to make my code more readable?

    Answer: Avoid the use of the NXTBLK, PRVBLK, NXTFLD, PRVFLD macros.Use GOBLK, GOFLD instead because it is easier to read and to maintain.

  7. How to make my Forms more memory efficient?

    Answer: NEW_FORM as much as possible versus using CALL.With CALL, the previous form and any other previously CALLed forms are kept in memory.

  8. How to make my Forms perform better?

    Answer: Group SELECT...FROM DUAL;'s.If the value of SYSDATE and USER are to be used, it will save time if you make one trip to the database instead of two.In a networked environment (Client/Server) this could be particularly advantageous.

    SELECT sysdate,user INTO...FROM dual;

    Versus

    SELECT sysdate INTO...FROM dual;

    SELECT user into...FROM dual;

    Note that if you access these same values elsewhere, you may wish to store these variables into globals or local variables rather than make another request across the network.

    • Avoid using SELECT...from DUAL's to perform logic or calculations.By using PL/SQL's IF THEN ELSE END IF; constructs, SQL*Forms does not have to access the database.
    • Database procedures can be more efficient than the equivalent Forms and SQL code because it executed directly on the server (near the data) and doesn't need to go though the SQL layer.
    • Be careful when enforcing uniqueness with the "PRIMARY KEY" column attribute.Oracle has to issue a SELECT statement to verify whether the value already exists.This check might be done with a full table scan!!! Make sure that a unique index or constraint has been defined for this column.An alternative is to use your own well designed query to replace this functionality.
    • Retrieve as many columns and do as many computations and validations in a single select statement as possible.This will reduce storage, parsing time and database activity.

  9. Why doesn't my messages show on the screen?

    Answer: Regardless of whether you call MESSAGE(), your message may or may not be displayed.This is because messages are displayed asynchronously.To display messages immediately, use the SYNCHRONIZE packaged procedure:
    message('...'); synchronize;

    The SYNCHRONIZE; packaged procedure forces SQL*Forms to display any information that it should write to the screen but hasn't yet.

    This can also be used to execute a query while the user is looking at the results of a previous query.

« Previous

Oracle SQL Forms Sample Question Number: 0-10|11-19
Sample Test Questions
GRE Sample Questions
CAT Sample Questions
GMAT Sample Questions
TOEFL Sample Questions
ACT Sample Questions
SAT Sample Questions
LSAT Sample Questions
PSAT Sample Questions
MCAT Sample Questions
PMP Sample Questions
GED Sample Questions
ECDL Sample Questions
DMV Sample Questions
CCNA Sample Questions
MCSE Sample Questions
Network+ Sample Questions
A+ Sample Questions
Technical Sample Questions
WASL Sample Questions
CISA Sample Questions

Other Sample Questions
Sample Interview Questions
Sample Teacher Interview Questions
Sample Citizenship Questions
Accuplacer Sample Questions
Science Bowl sample Questions
Driving Test Sample Questions
Sample Survey Questions Sample Essay Questions
Sample Behavioral Interview Questions

Copyright © 2004-2013, Best BSQ. All Rights Reserved.