Home » Developer & Programmer » Application Express, ORDS & MOD_PLSQL » owa_util.tablePrint is showing timestamp fields as "Not Printable". (Oracle 9.2.0.1.0, windows XP)
owa_util.tablePrint is showing timestamp fields as "Not Printable". [message #418561] Mon, 17 August 2009 05:57 Go to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

Hi,
I am creating one small 'Readonly' application. This will access multiple DBs by
using multiple DADs.

01. When i am printing one table's data (by using owa_util.tablePrint), all
timestamp columns are displaying as Not Printable.
Please suggest how to implement timestamp fields as date.?

02. how to apply oracle column functions(upper, nvl etc) with using
owa_util.tablePrint?

Any suggestion will really help me a lot.
Re: owa_util.tablePrint is showing timestamp fields as "Not Printable". [message #418749 is a reply to message #418561] Tue, 18 August 2009 08:25 Go to previous messageGo to next message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

I checked OWA_UTIL package body also. This package is dealing only with few datatypes, for rest of all, it is showing 'Not Printable'.
See below code part from this package.
Can We customize this package??
if dbms_sql.fetch_rows(crsr) > 0
            then
               row_count := row_count+1;

               for col_counter in 1..nnum_cols
               loop
                  col_dtype := col_dtypes(col_counter);
                  if (col_dtype = 'VARCHAR2' OR col_dtype = 'CHAR')
                  then
                     dbms_sql.column_value(crsr, col_counter, vc_var);
                     col_size := nvl(lengthb(vc_var),0);
                  else if (col_dtype = 'NUMBER')
                       then
                          dbms_sql.column_value(crsr, col_counter,
                                                number_var);
                          col_size := nvl(lengthb(number_var),0);
                       else if (col_dtype = 'DATE')
                            then
                               dbms_sql.column_value(crsr, col_counter,
                                                     date_var);
                               col_size := nvl(lengthb(date_var),0);
                            else if (col_dtype = 'LONG')
                                 then
                                    dbms_sql.column_value(crsr, col_counter,
                                                          long_var);
                                    col_size := nvl(lengthb(long_var),0);
                                 else if (col_dtype = 'RAW')
                                      then
                                         dbms_sql.column_value_raw(crsr,
                                                          col_counter,
                                                          raw_var);
                                         col_size := nvl(lengthb(raw_var),0);
                                      else
                                         col_size := length('Not Printable');
                                      end if;
                                 end if;
                            end if;
                       end if;
                  end if;
Re: owa_util.tablePrint is showing timestamp fields as "Not Printable". [message #418820 is a reply to message #418749] Tue, 18 August 2009 11:16 Go to previous messageGo to next message
andrew again
Messages: 2577
Registered: March 2000
Senior Member
don't change the package - just convert your timestamp to a string before owa_util.tablePrint gets hold of the data. just pass in 'col1, col2, to_char(tstamp_col, ''Mon fmdd yyyy fmhh:mi:ss:FF3PM'')' rather than 'col1, col2, stamp_col'
Re: owa_util.tablePrint is showing timestamp fields as "Not Printable". [message #418888 is a reply to message #418820] Wed, 19 August 2009 01:34 Go to previous message
misragopal
Messages: 125
Registered: June 2005
Location: New Delhi, india
Senior Member

I found solution.

CREATE TABLE T1
( COL_V   VARCHAR2(10),
  COL_N   NUMBER,
  COL_D   DATE,
  COL_T   TIMESTAMP(6),
  COL_T6  TIMESTAMP(6)
);

DECLARE

BEGIN
  FOR i IN 1.. 25
  LOOP
    INSERT INTO T1 
      (col_v, col_n, col_d, 
       col_t, col_t6)
    VALUES(
       chr(65+i)||'00'||i, i+20, sysdate+1, 
       add_months(sysdate,i),add_months(sysdate,i+2));
  END LOOP;
  END;


after some R&D, i found that if you are not specifying column names in this procedure, you will get 'Not Printable' text.
  vBoolVar:= owa_util.tablePrint(
                           ctable=> 't1', 
                           cclauses =>'order by col_n',		
                           cattributes=>'border="1"');


but if you specify column names in 'ccolumns' (in type) parameter, it will show actual data.
  vBoolVar:= owa_util.tablePrint(
	                    ctable=> 't1',
                            cclauses =>'order by col_n',
                            ccolumns => 'col_v, col_n, col_d, col_t, col_t6',
                            cattributes=>'border="1"');


Thanks Andrew, for your reply.
Previous Topic: apex in middle
Next Topic: how to test ? (cookie)
Goto Forum:
  


Current Time: Thu Dec 08 18:00:55 CST 2016

Total time taken to generate the page: 0.13659 seconds