11.01.2013 Views

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

Oracle Forms Developer – Form Builder Reference, Volume 1

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

8<br />

column_width If you specify CHAR_COLUMN as the column_type, you must indicate the<br />

maximum length of the data. COLUMN_WIDTH cannot exceed 2000,<br />

and must be passed as a whole number.<br />

Error Conditions:<br />

An error is returned under the following conditions:<br />

• You enter the name of a non-existent record group.<br />

• You specify the name for a group or a column that does not adhere to standard <strong>Oracle</strong> naming<br />

conventions.<br />

• You enter a column type other than CHAR, NUMBER, DATE, or LONG.<br />

ADD_GROUP_COLUMN restrictions<br />

• You must add columns to a group before adding rows.<br />

• You cannot add a column to a group that already has rows; instead, delete the rows with<br />

DELETE_GROUP_ROW, then add the column.<br />

• You can only add columns to a group after it is created with a call to CREATE_GROUP.<br />

• If the column corresponds to a database column, the width of CHAR_COLUMN-typed columns<br />

cannot be less than the width of the corresponding database column.<br />

• If the column corresponds to a database column, the width of CHAR_COLUMN-typed columns can<br />

be greater than the width of the corresponding database column.<br />

• Only columns of type CHAR_COLUMN require the width parameter.<br />

• Performance is affected if a record group has a large number of columns.<br />

• There can only be one LONG column per record group.<br />

ADD_GROUP_COLUMN examples<br />

/*<br />

** Built-in: ADD_GROUP_COLUMN<br />

** Example: Add one Number and one Char column to a new<br />

** record group.<br />

*/<br />

PROCEDURE Create_My_Group IS<br />

rg_name VARCHAR2(15) := ’My_Group’;<br />

rg_id RecordGroup;<br />

gc_id GroupColumn;<br />

BEGIN<br />

/*<br />

** Check to see if Record Group already exists<br />

*/<br />

rg_id := Find_Group( rg_name );<br />

/*<br />

** If Not, then create it with one number column and one<br />

** Char column<br />

*/<br />

IF Id_Null(rg_id) THEN<br />

rg_id := Create_Group( rg_name );<br />

gc_id := Add_Group_Column(rg_id, ’NumCol’,NUMBER_COLUMN);<br />

gc_id := Add_Group_Column(rg_id, ’CharCol’,CHAR_COLUMN,15);<br />

END IF;<br />

END;

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!