Monday, April 28, 2008

forms and reports

1. What is Oracle Forms and what is it used for?
Oracle Forms is a 4GL Rapid Application Development (RAD) environment. Forms Builder is used to create applications to enter, access, change, or delete data from Oracle (and other) databases. The Forms Runtime environment is required to execute compiled Forms modules. Forms can also be deployed across the Web using the Oracle Internet Application Server (iAS) Forms Services.
Oracle Forms is part of the Oracle Internet Developer Suite (iDS). It was previously called SQL*Forms.
2. Can an Forms FMX be moved from one operating system to another?
FMX files are operating system dependent. On the other hand, FMB's are not. So, you have to regenerate them when ever you change the operating system or the Forms version.
3. How does one iterate through items and records in a specified block?
One can use NEXT_FIELD to iterate (loop) through items in a specific block and NEXT_RECORD to iterate through records in a block. Code example: OriPos := TO_NUMBER(:System.Trigger_Record); First_Record; LOOP -- do processing IF (:System.Last_Record = 'TRUE') THEN Go_Record(OriPos); EXIT; ELSE Next_Record; END IF; END LOOP
4. Can on bypass the Oracle login screen?
The first thing that the user sees when using runform is the Oracle logon prompt asking them for their username, password, and database to connect to. You can bypass this screen or customise it by displaying your own logon screen. Eg: ON-LOGIN declare uname varchar2(10); pass varchar2(10); begin uname := 'username'; pass :='password'; logon(uname, pass'@connect_database'); end;
5. Can one Maximize/ Minimize a Window in Forms?
On MS-Windows, Forms run inside a Windows Multiple-Document Interface (MDI) window. You can use SET_WINDOW_PROPERTY on the window called FORMS_MDI_WINDOW to resize this MDI (or any other named) window. Examples: set_window_property(FORMS_MDI_WINDOW,WINDOW_STATE, MINIMIZE); set_window_property(FORMS_MDI_WINDOW, POSITION, 7, 15); set_window_property('my_window_name', WINDOW_STATE, MAXIMIZE);
6. How does one suppress or customize error messages in Forms?
One can either set the message level using the system variable SYSTEM.MESSAGE_LEVEL or trap the errors using the ON-ERROR or ON-MESSAGE triggers.
7. Can one issue DDL statements from Forms?
DDL (Data Definition Language) commands like CREATE, DROP and ALTER are not directly supported from Forms because your Forms are not suppose to manipulate the database structure.
A statement like CREATE TABLE X (A DATE); will result in error:
Encountered the symbol "CREATE" which is a reserved word.
However, you can use the FORMS_DDL built-in to execute DDL statements. Eg:
FORMS_DDL('CREATE TABLE X (A DATE)');
FORMS_DDL can also be used to create dynamic SQL statements at runtime. The FORMS_SUCCESS built-in can be used to determine if the last executed built-in was successful.
8. Can one execute dynamic SQL from Forms?
Yes, use the FORMS_DDL built-in or call the DBMS_SQL database package from Forms. Eg: FORMS_DDL('INSERT INTO X VALUES (' col_list ')');
Just note that FORMS_DDL will force an implicit COMMIT and may de-synchronize the Oracle Forms COMMIT mechanism.
9. Forms won't allow me to use restricted built-in's. What should I do?
How to get around the "can't use a restricted built-in in built-in XXX" message:
1. Create a TIMER at the point where you want the navigation to occur.
Eg. create_timer('TIMER_X', 5, NO_REPEAT);
2. Code a WHEN-TIMER-EXPIRED trigger to handle the navigation DECLARE tm_name VARCHAR2(20); BEGIN tm_name := Get_Application_Property(TIMER_NAME); IF tm_name = 'TIMER_X' THEN Go_Item('ITEM_X'); END IF; END;Dirty but effective (didn't Oracle promise to fix this feature?).
10. Can one change the mouse pointer in Forms?
The SET_APPLICATION_PROPERTY build-in in Oracle Forms allow one to change the mouse pointer. The following cursor styles are supported: DEFAULT, BUSY, HELP, INSERTION and CROSSHAIR.
Eg: SET_APPLICATION_PROPERTY(CURSOR_STYLE, BUSY);
11. Why doesn't my messages show on the screen?
Regardless of whether you call the MESSAGE() built-in with ACKNOWLEDGE, NO_ACKNOWLEDGE, or with no mode specification at all, your message may or may not be displayed. This is because messages are displayed asynchronously. To display messages immediately, use the SYNCHRONIZE build-in:
message('...'); synchronize;
This can also be used to execute a query while the user is looking at the results of a previous query.
12. What happened to SQL*Menu?
From Forms V4.5, SQL*Menu is fully integrated into Oracle Forms. Application menus can be added to your application by creating Menu Modules (*.MMB) and generate it to Menu Module Executables (*.MMX).
13. How does one create a custom toolbar?
Create a new block, let's name it "TOOLBAR" and a canvas named "C_TOOLBAR" (for ilustration purposes). Put some iconic buttons on your canvas. Use the following properties for these buttons:
 Enabled: True
 Navigable: False
 Mouse Navigate: False
Now set the "Canvas Type" in the canvas property palette to "Horizontal Toolbar" and the "Form Horizontal Toolbar Canvas" in the module property palette to your canvas name (C_TOOLBAR in our case).
14. How does one compile MS Help files?
The Microsoft Help Compiler does not ship with Designer/2000 or Developer/2000, but you can download it from here:
Help Compiler - FTP Sites
Note: Designer/2000 includes a Help Generator that can generate source files for the Help Compiler.
15. How can I read/write OS Files from Forms?
OS files can be read/written from Forms using the TEXT_IO package in Forms. The TEXT_IO package has a datatype FILE_HANDLE. It also has procedures FCLOSE, GET_LINE, NEW_LINE, PUT, PUT_LINE & PUTF and a function FOPEN. Example: DECLARE file1 TEXT_IO.FILE_TYPE; file2 TEXT_IO.FILE_TYPE; str VARCHAR2(80); BEGIN= file1 := TEXT_IO.FOPEN( 'input.txt','r' ); file2 := TEXT_IO.FOPEN( 'output.txt', 'w' ); TEXT_IO.GET_LINE( file1, str ); TEXT_IO.PUT_LINE( file2, str ); TEXT_IO.FCLOSE( file1 ); TEXT_IO.FCLOSE( file2 ); END;
16. How can I generate all my forms in a batch?
Look at this DOS Batch file example: @echo off @echo. +---------------------------------------------------------- @echo. FMXGNALL.BAT @echo. +---------------------------------------------------------- @echo. @echo. Create runtime FMXs from source FMBs @echo. Will convert ALL of the fmbs in the current direcotry @echo. Usage : FMXALL.BAT username/password@connect string @echo. @echo. +---------------------------------------------------------- @echo. @echo. Username/Password@connect_string = %1 @echo. IF %1 == "" GOTO END @echo Removing old FMX files del *.fmx @echo Creating the new FMX files rem Change f45gen32 to f45gen if in 16 bit environment. FOR %%F in (*.fmb) DO start /w f45gen32 userid=%1 batch=y module=%%F @echo. @echo Done!!! Remember to move the FMX files into your runtime directory. @echo. :END
17. How does one get a form to run on Unix?
You need to design your form on your workstation. FTP or copy the Forms's FMB file to the Unix box. If you generate for a terminal environment (character based),
the syntax is: f45gen USERID=userid/passwd@db_name MODULE_TYPE=FORM MODULE=module_name
If you want to generate a Library file, replace FORM with LIBRARY. Use f45genm to generate your form in a Motif environment. Use the "f45run" command to run your form.
Why do terminal users hate Forms?
Most Unix, MVS and VMS users do not like Forms 4.5/ 5.0/ 6.0 for a couple of reasons:
You need to design on a PC and frequently get compatibility problems (font scaling, etc);
Forms 4.5 is no improvement for Forms 3.0 terminal users at all, rather it is a step backwards;
Forms 4.5 uses too much memory and executables are about 400% larger than for its 3.0 counter part;
The largest Oracle Forms customers still runs on Forms V3.0 and will rather throw out Oracle than to convert to Forms 4.5.
I think Oracle should bring SQL*Forms v3.0 back for terminal users. They could rename the product to Oracle Forms for Terminals, or something.
Oracle Forms and Reports Services FAQ
1. What is Forms and Reports Services?
Oracle Forms and Reports Services is a component of the Oracle Internet Application Server (9iAS) that enables programmers to deploy Oracle Forms and Oracle Reports across the Web. Forms and Reports services as previously known as WebForms and WebReports. Some people also refer to it as the Forms and Reports Server.
With Oracle's Forms and Reports Services one can web-enable existing Oracle Developer (Forms and Reports) applications without changing any application code.
WebForms consist of a Forms client (downloadable Java applet) and FormsServer (Java NCA Cartridge). WebForms can be centrally deployed and managed and provides a nice thin client implementation.
2. What Web Servers can be used with the Forms and Reports Services?
The Oracle HTTP Server (Apache Web server) is installed with the Forms and Reports Services. However, any web server that supports CGI (Common Gateway Interfaces) can be used.
3. How does one start and stop the Forms and Reports Services?
Please note that the Forms Services will be running directly after installing the product. Use the following command to start and stop the Forms Services: $ORACLE_HOME/6iserver/forms60_server start $ORACLE_HOME/6iserver/forms60_server stop
Test if the Forms server is running by navigating to the following URL: http://host_name:port/dev60html/runform.htm. Change host_name and port to the server where you HTTP server is running. the
4. How does one deploy a Form on the Web?
Follow these steps to deploy a Form on the Web:
Copy or FTP the Form's FMB file to the server where the Forms Services are running.
Re-compile the Form to a FMX
Etc...
Forms 4.5 Questions

1) which system variables can be set by users?
1) SYSTEM.MESSAGE_LEVEL
SYSTEM.DATE_THRESHOLD
SYSTEM.EFFECTIVE_DATE
SYSTEM.SUPPRESS_WORKING



2) Can you store objects in library?
2) Referencing allows you to create objects that inherit their functionality and appearance from other objects. Referencing an object is similar to copying an object, except that the resulting reference object maintains a link to its source object. A reference object automatically inherits any changes that have been made to the source object when you open or regenerate the module that contains the reference object.

3) Is forms 4.5 object oriented tool and why?
3) Yes, partially. 1) PROPERTY CLASS - inheritance property
2) OVERLOADING : procedures and functions.

4) Can you issue DDL in forms?
4) Yes, but you have to use FORMS_DDL.
Any string expression up to 32K:
Ø a literal
Ø an expression or a variable representing the text of a block of dynamically created PL/SQL code
Ø a DML statement or
Ø a DDL statement

Restrictions:
The statement you pass to FORMS_DDL may not contain bind variable references in the string, but the values of bind variables can be concatenated into the string before passing the result to FORMS_DDL.

5) What is SECURE property?
5) Hides characters that the operator types into the text item. This setting is typically used for password protection.

6) What are the types of triggers and how the sequence of firing in text item
6) Triggers can be classified as Key Triggers, Mouse Triggers, Navigational Triggers.

Key Triggers: Key Triggers are fired as a result of Key action.
e.g :: Key-next-field, Key-up, Key-Down

Mouse Triggers: Mouse Triggers are fired as a result of the mouse navigation.
e.g. When-mouse-button-pressed, when-mouse-doubleclicked, etc

Navigational Triggers: These Triggers are fired as a result of Navigation.
E.g : Pre-text-item, Post-Text-item.

We also have event triggers like when –new-form-instance and when-new-block-instance.
We cannot call restricted procedures like go_to(‘my_block.first_item’) in the Navigational triggers But can use them in the Key-next-item.

The Difference between Key-next and Post-Text is an very important question. The key-next is fired as a result of the key action while the post text is fired as a result of the mouse movement. Key next will not fire unless there is a key event.
The sequence of firing in a text item are as follows ::
a) pre - text
b) when new item
c) key-next
d) when validate
e) post text

7) Can you store pictures in database? How?
7) Yes, in long Raw datatype or BLOB datatype.

8) What are property classes ? Can property classes have trigger?
8) Property class inheritance is a powerful feature that allows you to quickly define objects that conform to your own interface and functionality standards. Property classes also allow you to make global changes to applications quickly. By simply changing the definition of a property class, you can change the definition of all objects that inherit properties from that class.
Yes . All type of triggers .

9) If you have property class attached to an item and you have same trigger written for the item * Which will fire first?
9) Item level trigger fires, If item level trigger fires, property level trigger won't fire. Triggers at the lowest level are always given the first preference. The item level trigger fires first and then the block and then the Form level trigger.

10) What are record groups? * Can record groups created at run-time?
10) A record group is an internal Oracle Forms data structure that has a column/row framework similar to a database table. However, unlike database tables, record groups are separate objects that belong to the form module in which they are defined. A record group can have an unlimited number of columns of type CHAR, LONG, NUMBER, or DATE provided that the total number of columns does not exceed 64K. Record group column names cannot exceed 30 characters. Programmatically, record groups can be used whenever the functionality offered by a two-dimensional array of multiple data types is desirable.

TYPES OF RECORD GROUP:
Query Record Group
A query record group is a record group that has an associated SELECT statement.
The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the query associated with that record group.

Non-query Record Group
A non-query record group is a group that does not have an associated query, but whose structure and values can be modified programmatically at runtime.
Static Record Group
A static record group is not associated with a query; rather, you define its
Structure and row values at design time, and they remain fixed at runtime.

11) What are ALERT?
11) An ALERT is a modal window that displays a message notifying operator of some application condition.

12) Can a button have icon and label at the same time?
12) -NO

13) What is mouse navigate property of button?
13) When Mouse Navigate is True (the default), Oracle Forms performs standard navigation to move the focus to the item when the operator activates the item with the mouse. When Mouse Navigate is set to False, Oracle Forms does not perform navigation (and the resulting validation) to move to the item when an operator activates the item with the mouse.

14) What is FORMS_MDI_WINDOW?
14) Forms run inside the MDI application window. This property is useful for calling a form from another one.

15) What are timers? When, when-timer-expired does not fire?
15) The When-Timer-Expired trigger can not fire during trigger, navigation, or transaction processing.

16) Can object group have a block?
16) Yes, object group can have block as well as program units.

17) How many types of canvases are there?
17) There are 2 types of canvases called as Content and Stack Canvas. Content canvas is the default and the one that is used mostly for giving the base effect. It’s like a plate on which we add items and stacked canvas is used for giving 3 dimensional effects.

18) What are user-exits?
18) It invokes 3GL programs.

19) Can you pass values to-and-fro from foreign function? how?
19) Yes, You obtain a return value from a foreign function by assigning the return value to an Oracle Forms variable or item. Make sure that the Oracle Forms variable or item is the same data type as the return value from the foreign function.
After assigning an Oracle Forms variable or item value to a PL/SQL variable, pass the PL/SQL variable as a parameter value in the PL/SQL interface of the foreign function. The PL/SQL variable that is passed as a parameter must be a valid PL/SQL data type; it must also be the appropriate parameter type as defined in the PL/SQL interface.

20) What is IAPXTB structure?
20) The entries of Pro*C and user exits and the form which simulate the Pro*c or user_exit are stored in IAPXTB table in d/b.

21) Can you call WIN-SDK thruo' user exits?
21) YES.

22) Does, user exits support DLL on MS-WINDOWS?
22) YES.

23) What is path setting for DLL?
23) Make sure you include the name of the DLL in the FORMS45_USEREXIT variable of the ORACLE.INI file, or rename the DLL to F45XTB.DLL. If you rename the DLL to F45XTB.DLL, replace the existing F45XTB.DLL in the \ORAWIN\BIN directory with the new F45XTB.DLL.

24) How is mapping of name of DLL and function done?
24) The DLL can be created using the Visual C++ / Visual Basic Tools and then the DLL is put in the path that is defined the registry.

25) What is pre-compiler?
25) It is similar to C pre-compiler directives.

26) Can you connect to non - oracle data source ? How?
26) Yes.

27) What are key-mode and locking mode properties? level?
27) Key Mode: Specifies how oracle forms uniquely identifies rows in the database. This is property includes for application that will run against NON-ORACLE data sources. Key setting unique (default.)
updateable
n-updateable.

Locking mode:
Specifies when Oracle Forms should attempt to obtain database locks on rows that correspond to queried records in the form.
a) immediate b) delayed

28) What are savepoint mode and cursor mode properties ? level?
28) Specifies whether Oracle Forms should issue savepoints during a session. This property is included primarily for applications that will run against non-ORACLE data sources. For applications that will run against ORACLE, use the default setting.
Cursor mode - define cursor state across transaction
Open/close.


29) Can you replace default form processing? How?

30) What is transactional trigger property?
30) Identifies a block as transactional control block. i.e. non - database block that oracle forms should manage as transactional block.(NON-ORACLE datasource) default - FALSE.

31) What is OLE automation?
31) OLE automation allows an OLE server application to expose a set of commands and functions that can be invoked from an OLE container application. OLE automation provides a way for an OLE container application to use the features of an OLE server application to manipulate an OLE object from the OLE container environment. (FORMS_OLE)

34) What does invoke built-in do?
34) This procedure invokes a method.
Syntax:
PROCEDURE OLE2.INVOKE (object obj_type, method VARCHAR2, list list_type:= 0);
Parameters:
Object Is an OLE2 Automation Object.
Method Is a method (procedure) of the OLE2 object.
List Is the name of an argument list assigned to the OLE2.CREATE_ARGLIST function.

36) What is call form stack?
36) When successive forms are loaded via the CALL_FORM procedure, the resulting module hierarchy is known as the call form stack.

37) Can u port applications across the platforms? how?
37) Yes we can port applications across platforms. Consider the form developed in a windows system. The form would be generated in unix system by using f45gen my_form.fmb scott/tiger

GUI

1) What is a visual attribute?
1) Visual attributes are the font, color, and pattern properties that you set for form and menu objects that appear in your application's interface.

2) Diff. between VAT and Property Class? imp
2) Named visual attributes define only font, color, and pattern attributes; property classes can contain these and any other properties. You can change the appearance of objects at runtime by changing the named visual attribute programmatically; property class assignment cannot be changed programmatically.
When an object is inheriting from both a property class and a named visual attribute, the named visual attribute settings take precedence, and any visual attribute properties in the class are ignored.

3) Which trigger related to mouse?
3) When-Mouse-Click
When-Mouse-DoubleClick
When-Mouse-Down
When-Mouse-Enter
When-Mouse-Leave
When-Mouse-Move
When-Mouse-Up

4) What is Current record attribute property?
4) Specifies the named visual attribute used when an item is part of the current record. Current Record Attribute is frequently used at the block level to display the current row in a multi-record If you define an item-level Current Record Attribute, you can display a pre-determined item in a special color when it is part of the current record, but you cannot dynamically highlight the current item, as the input focus changes.

5) Can u change VAT at run time?
5) Yes. You can programmatically change an object's named visual attribute setting to change the font, color, and pattern of the object at runtime.

6) Can u set default font in forms?
6) Yes. Change windows registry(regedit). Set form45_font to the desired font.

7) Can u have OLE objects in forms?
7) Yes.

8) Can u have VBX and OCX controls in forms?
8) Yes.

9) What r the types of windows (Window style)?
9) Specifies whether the window is a Document window or a Dialog window.

10) What is OLE Activation style property?
10) Specifies the event that will activate the OLE containing item.

11) Can u change the mouse pointer? How?
11) Yes, Specifies the mouse cursor style. Use this property to dynamically change the shape of the cursor.

Reports 2.5

1) How many types of columns are there and what are they
1) Formula columns:
For doing mathematical calculations and returning one value
Summary Columns:
For doing summary calculations such as summations etc.
Place holder Columns:
These columns are useful for storing the value in a variable

2) Can u have more than one layout in report
2) It is possible to have more than one layout in a report by using the additional layout option in the layout editor.

3) Can u run the report with out a parameter form
3) Yes it is possible to run the report without parameter form by setting the PARAM value to Null

4) What is the lock option in reports layout
4) By using the lock option we cannot move the fields in the layout editor outside the frame. This is useful for maintaining the fields.

5) What is Flex
5) Flex is the property of moving the related fields together by setting the flex property on

6) What are the minimum number of groups required for a matrix report
6) The minimum of groups required for a matrix report are 4
7. I switched the page size to 11x8.5, but the printer still prints in portrait.
Even though you set the page size in the report properties, there is a another variable in the system parameters section under the data model in the object navigator called orientation. This sets the printer orientation. Oracle starts by setting it to "default" which means that no matter how you set the page size, the user's default printer setup will be used. You can also set it to either "Landscape" or "Portrait" to force the printer orientation no matter what the user has set as default. These sorts of picky, minor details are the ones which are invariably forgotten when you are designing your report and are the reason I created our two report templates, reptmp_p and reptmp_l (portrait and landscape). For anyone who wants a consistent look in their reports I strongly recommend building a similar pair to save yourself an ulcer, unless you actually like starting from scratch every time!?!
8. I moved this field into that repeating frame, but I'm still getting a "frequency below it's group" error.
Moving fields around does not change what enclosing object is considered it's parent group. Oracle carefully remembers what repeating frame a field was originally placed in and assigns that as it's parent. If you then reference a column further down the line of the query structure it will return that error. If you are not exactly sure which repeating frame a field belongs to, try dragging it out of all of them. Whichever frame will not allow it to escape is it's parent. To change a field's parent, first click on the lock button on the speed button bar. It should now look like an unlocked padlock. Now all of the fields on the layout can be repositioned regardless of their original parent items. When you are satisfied with the repositioning click the lock button again to lock the layout. Oracle will parse the layout and assumes that any item fully enclosed in a repeating frame is a child object of that frame. This can be confirmed again by trying to drag an object out of it's parent. (Cntrl - Z or edit..undo will put it back where it came from)
Sometimes, for unknown and mysterious reasons, this method does not work. The alternative in this case is to highlight the field (or fields), cut it (cntrl-x), and then paste it into the desired frame. The paste does not initially set it into the right frame, but if you drag and drop it there before clicking on any other objects, and then click on something else, Oracle will usually figure what your intent was and assign the object(s) as a child of that frame. This is my preferred method of changing a field's parent as it works much more consistently then the unlock/lock method. One note though, if you are reassigning a group of fields, make sure the frame you are going to move them into is large enough to accept the whole group at once before you do the cut/paste. If you do the paste and then try to grow the frame to fit, you will have to cut and paste again. Once you de-select an object that has just been pasted, Oracle will assign it as a child of whatever it is in at the time.
If this technique also fails, you are probably going to have to delete and then recreate the objects within the desired frame. If the object has triggers attached, save yourself some typing by creating the new object in the right frame, copying over the trigger code, and then deleting the old object
9. I must put a repeating frame around these fields. How do I do this easily?
Well congratulations, you have just discovered one of the main reasons why good planning goes a long way. Oracle looks at the layout as a sort of layered inheritance model such that anything created on top of and completely inside another object is by definition a child of that object. Creation order is there for critical to the layout process. This means that placing a repeating frame on top of a field but larger than that field fails the ownership criteria. At best, if the new frame is fully enclosed within the same higher level frame as the field then the two will be considered sibling children of the higher level frame.
From this point you have two options. First, you can place the new repeating frame in the correct place and then use the techniques shown above in the "I moved this field but am still getting a frequency error" to reassign the fields into the new frame. There is also a second choice (which can also be used as a solution to the above). Go ahead and draw the new frame around the fields you want to have placed in it. Now if you try to click on one of the fields you will not be able to as they are fully covered by the new frame. Now go to the "Arrange" menu. You will find the options Send to back, bring to front, move forwards, move backwards. These are used to alter an object position in the Reports layer ordering. You use the "send backwards" option to move the frame backwards until all of the fields have popped to the front and are now enclosed in it. Oracle reassigns the new repeating frame as each object's parent as they pop to the front.
Note that you can only move an object back and forth amongst it's siblings. You cannot set it back below it's parent, nor in front of it's children. This means that once an object has popped to the front and had a reassignment of parent, you cannot move it back using these tools.
10. Why does part of a row sometimes get shifted to the next page, but not all of it?
This is due to the way the scan works when Oracle is parsing the layout. If the tops of all the fields in a row are aligned and the fields are all of the same height and font, they should all stay together. I suspect, however, that Reports bases it's decision on the printed size rather than the field size you define to determine which objects are too large and must be shifted to the next page. This means that even if you set two fields top-aligned with the same height and font but one of them is bolded, the bolded field could get shifted to the next page due to it's bigger footprint. The solution is to put the whole row into a regular frame which is page protected.
11. What exactly does the "Print Condition" do?
The print condition type First, All, All but first, Last, All but last refer to the frequency with which you want to appear based upon the setting of the print condition object. A print condition object of Enclosing Object is whichever object encloses the current object (could be the parent or a frame within the parent), while Anchoring Object is the parent object (unless you have explicitly anchored the object in which case it is the object to which it is anchored). The key here is that this is about the pages on which the Print Condition Object appears, not the current object. Oracle views First as the first page on which any part of the Print Condition Object is printed, likewise Last is the last page on which any part of the Print Condition Object is printed. For objects inside a repeating frame, this condition is re-evaluated for each instance of the frame.
As an example, assume we have created a field inside a repeating frame with Print Condition Object set to 'anchoring object', and Print Condition Type set to 'All But First'. On every instance of that repeating frame which is printed entirely within a single page, our object will not print. However, if an instance of that frame spans more than one page then our object will print on the second and every subsequent page that this instance of the repeating frame spans.
For most objects you will not have to play with this print condition setting as the default setting is pretty good at determining what pages to print on, even though it only chooses between 'first' and 'last'. Only such things as heading objects you want reprinted on multiple pages are normally candidates for fooling around with this setting.
1. How do I create a truly dynamic 'where' condition which the user can input on the parameter form for my select statement?
While setting a simple parameter for use in defining the select statement, such as a date, bill_period_id etc. is simple, there are times when you may wish to allow a user to add any "where" statement they wish. However, if you create a varchar user variable and try to reference it as an SQL condition ( e.g. Select * from account where :usercondition) you will get an error. The secret is that the variable must be initialized to a valid SQL condition before the Data Model will accept it. This is done in the "Initial Value" spot on the variable's properties form. The usual default is "1 = 1" which simply means all rows meeting whatever other conditions are included in the select statement will pass this condition if the user does not change it in the parameter form.
12. How do I change a user parameter at runtime from a layout object trigger?
Quite simply, you can't. Once the Before Report trigger has fired, Reports locks down the user parameters until the report is finished. Oh, I know you can put a statement into a layout trigger at design time and the compiler will accept it, but the moment you run the report you will get a nasty error and the report will die. Why they couldn't catch those problems at compile time I have no idea, except that it probably uses the same PL/SQL compiler as Forms which uses that same syntax for the perfectly acceptable function of changing field values.
That being said, there is valid technique to mimic having a user variable which can be changed over the course of the report execution. What you have to do is create a PL/SQL package that contains a variable as well as the functions to read and write to that variable. Since variables inside a package are both local to that package and persistent over the duration of the run, you use this to save and change your variable value. I know that this seems like overkill, but it is the most efficient way of handling an issue that is very rarely encountered. As you can probably guess, this technique is a last resort to finding an SQL work around if one exists.
13. How do I set the initial values of parameters for the parameter form at runtime?
This is what the Before Form trigger is primarily used for. Even if you have used a select statement to create a lookup list for the parameter, this statement is fully parsed before the parameter form is opened. Simply setting the parameter to a given value in the Before Form trigger will select that option as the default value displayed to the user. For example, assume you have a parameter called p_input_date which is intended to hold an invoice date. The following example will select the most recent invoice date as the default, and note that it properly handles exceptions to ensure that the report does not arbitrarily die if this default setting fails. Note also that like all report triggers, it must return a true or false value. function BeforePForm return boolean isbeginselect max(bill_period_end_date + 1) into :p_input_date from billing_period where bill_period_end_date <= (select trunc(sysdate) from dual); return (TRUE);exception when others then :p_input_date := null; return true;end;
14. Why can't I highlight a bunch of fields and change all their format masks or print conditions at once?
You can. If you highlight a bunch of objects and then right click and select "properties..", Oracle gives you a stacked set of the individual properties forms for each of the selected objects. While this may be useful for some things, it requires changing values individually for each object. However, instead you can select the group of fields and then select "Common properties" from the "Tools" menu which will allow you to set the format mask , print conditions etc. for the whole set of objects at once.
15. How do I change the printed value of a field at runtime?
Triggers are intended to simply provide a true or false return value to determine whether an object should be printed. It is generally not allowed to change any values held in the cursor, make changes to the database, or change the value of it's objects value. That being said, there is a highly unpublicized method of doing just that using the SRW.Set_Field_Char procedure. The syntax is SRW.Set_Field_char(0,) and the output of the object that the current trigger is attached to will be replaced by . There are also SRW.set_fileld_num, and SRW.set_field_date for numeric or date fields.
While these options do work, they should only be used if a suitable NVL or DECODE statement in the original query is not possible as they are much, much slower to run. Also, note that this change of value only applies to the formatted output. It does not change the value held in the cursor and so can not be used for evaluating summary totals.
Record group types There are three types of record groups: query record groups, non-query record groups, and static record groups.

Query record group A query record group is a record group that has an associated SELECT statement. The columns in a query record group derive their default names, data types, and lengths from the database columns referenced in the SELECT statement. The records in a query record group are the rows retrieved by the query associated with that record group. Query record groups can be created and modified at design time or at runtime.
Non-query record group A non-query record group is a group that does not have an associated query, but whose structure and values can be modified programmatically at runtime. Non-query record groups can be created and modified only at runtime.
Static record group A static record group is not associated with a query; instead, you define its structure and row values at design time, and they remain fixed at runtime. Static record groups can be created and modified only at design time.
You do not specify the record group type explicitly. The type is implied by when the record group is created (at design time or at runtime) and by how the group is defined.

Table Type nodes Table types appear within the Types node in the Object Navigator. A table type node represents a type created by the SQL statement, CREATE TYPE AS TABLE. The table type is displayed in the Object Navigator as:
table-type-name (TABLE OF table-subtype-name)
The table type node is not expandable if the subtype is a built-in type. If the subtype is an object type or REF object, the attributes of the object appear as subnodes.

The following SQL statements create the object type emp_typ and the table type emp_tbl.
CREATE TYPE emp_typ AS OBJECT
(ename VARCHAR2(30), esalary NUMBER(5,2),
MEMBER PROCEDURE raise(amount NUMBER),
MEMBER FUNCTION get_salary RETURN NUMBER,
MAP MEMBER FUNCTION compare RETURN NUMBER);
CREATE TYPE emp_tbl AS TABLE OF emp_typ;

Oracle8 is an object-relational database management system, which means you can define additional kinds of data-specifying both the data and the ways of operating on it-and use these types within the relational model.
There are two categories of user-defined datatypes: object types and collection types. User-defined datatypes use the built-in datatypes (such as CHAR, VARCHAR2, and NUMBER) and other user-defined datatypes as the building blocks for datatypes that model the structure and behavior of data in applications.

An object type serves as a template for objects. An object type specifies the elements (or attributes) that make up a structured data unit like a purchase order. Some attributes, such as the list of line items, may be other structured data units. An object type also specifies the operations (or methods) you can perform on the data unit, such as determining the total value of a purchase order.
Collection types describe data units that are made up of an indefinite number of elements, all of the same datatype. The collection types are varying array types and table types.

A varying array type specifies a data unit called VARRAY, which is an ordered set of data elements all of the same datatype. The number of elements in a VARRAY (or its size) is variable. However, you must specify a maximum size when you declare the varying array type.
A table type specifies a data unit called a nested table, which is an unordered set of data elements all of the same datatype. A nested table has a single column, and the type of that column is a built-in type or an object type.

Matrix reports A matrix (crosstab) report contains one row of labels, one column of labels, and information in a grid format that is related to the row and column labels. A distinguishing feature of matrix reports is that the number of columns is not known until the data is fetched from the database.
To create a matrix report, you need at least four groups: one group must be a cross-product group, two of the groups must be within the cross-product group to furnish the "labels," and at least one group must provide the information to fill the cells. The groups can belong to a single query or to multiple queries.



What are the Delimiters we are using in the SQL* Loader?Delimiters are used to separate the column values in control file. In SQL * Loader we commonly using delimiters is ‘camas’.

No comments: