Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

control file

Deepak_DBASep 30 2008 — edited Oct 3 2008
hi all,
i'm usin oracle 9i in rhel4.. in my test env.. i have a f1eo database..i was wokin in that .. unfortunately i deleted all my control files.. but the database was workin.. i gave the following command..
alter system switch logfile;
it does not show any err..i shut the database, but when i restart the db next day it shows cntrlfile missing.. luckily the deleted cntrl files was in my recyclebin.. i just restored it and opened the database.. the db was perfect.. what abt th result of the cmd i gave before the db shut.. what happen to the cntrl file.. where the information abt logswitch have been updated...

note - i don't have any multiplixed or controlfile trace.. as it was test Db there was no issue.. but i want to know what happen really..

thnx in advance,
regards,
Deepak...
This post has been answered by jgarry on Sep 30 2008
Jump to Answer

Comments

fac586

Please update your forum profile with a recognisable username instead of "User_25KFL", and supply the following information:
Full database version
Full APEX version
APEX theme and theme style used in the application

fac586

This will work if the number of columns is consistent within the dataset.

<<dynamic_table>>
declare

  type table_record is record (n_lin number, n_col number, val varchar(4000));
  type table_chunk is table of table_record;

  i pls_integer;
  n pls_integer := 0;

  /*
    This form of test data generation requires Oracle 18+
  */
  l_columns_data dynamic_table.table_chunk := dynamic_table.table_chunk(
                                                  dynamic_table.table_record(1, 0, 'DATA')
                                                , dynamic_table.table_record(1, 1, 'UGW')
                                                , dynamic_table.table_record(1, 2, '500')
                                                , dynamic_table.table_record(2, 0, 'DATA')
                                                , dynamic_table.table_record(2, 1, 'Teste')
                                                , dynamic_table.table_record(2, 2, '100')
                                              );

begin

  i := l_columns_data.first;

  if i is not null
  then
    htp.p('<table>');
    htp.p('<tbody>');

    while i is not null
    loop
      if l_columns_data(i).n_lin != n
      then
        htp.p('<tr>');
        n := l_columns_data(i).n_lin;
      end if;

      htp.p('<td>' || l_columns_data(i).val);

      i := l_columns_data.next(i);

    end loop;

    htp.p('</tbody>');
    htp.p('</table>');

  end if;

end;
Content-type: text/html
Content-length: 96

<table>
<tbody>
<tr>
<td>DATA
<td>UGW
<td>500
<tr>
<td>DATA
<td>Teste
<td>100
</tbody>
</table>

If the data contains rows with different numbers of columns then things will get more complicated.

Gonçalo
Answer

Thank you in advance.
Yes the problem is because i never know how many columns i will have so i save in the collection the line, the column and the value, but to construct the body dinamically i's getting hard.

Because when i loop the collection the first row is :

dynamic_table.table_record(1, 0, 'DATA')

and i can save them into a variable to get to the next row if necessary, but this won t work cause i never know exactly the number of columns.
Thanks.

Marked as Answer by Gonçalo · Feb 7 2021
fac586

Yes the problem is because i never know how many columns i will have so i save in the collection the line, the column and the value, but to construct the body dinamically i's getting hard.
Because when i loop the collection the first row is :

dynamic_table.table_record(1, 0, 'DATA')

and i can save them into a variable to get to the next row if necessary, but this won t work cause i never know exactly the number of columns.
This provides no additional information.
Please respond the questions asked above.
What is your:
Full database version
Full APEX version
APEX theme and theme style used in the application
Does the code posted above produce the expected output for the test data provided?
Can an individual dataset contain rows with different numbers of columns or data positions? For example:

dynamic_table.table_chunk(
    dynamic_table.table_record(1, 0, 'DATA')
  , dynamic_table.table_record(1, 1, 'UGW')
  , dynamic_table.table_record(2, 1, 'DEF')
  , dynamic_table.table_record(3, 0, 'Teste')
  , dynamic_table.table_record(3, 1, 'XYZ')
  , dynamic_table.table_record(3, 2, '586')
)
Gonçalo

Sorry, afterall its working.
Thank you so much.
Cheers

1 - 5
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Oct 31 2008
Added on Sep 30 2008
12 comments
838 views