Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 967
  • Last Modified:

OWA_UTIL.TABLEPRINT on the web

Can you specify 2 or more tables in the owa_util.tableprint command?  Kind of like instead of displaying 1 table on a web page you display a "JOIN" of two tables.
Any code examples would be appreciated!
0
reenie1
Asked:
reenie1
  • 2
1 Solution
 
daveceeCommented:
Yes, just create a view of the joined tables and pass the view name to owa_util.tableprint. For example:

 create view empdept (Ename, Dname) as
(select Ename, Dname from emp, dept
 where emp.deptno = dept.deptno);

 owa_util.tableprint(ctable=>'empdept', cclauses=>'order by Ename');

 In the long run it's easier to write custom table display routines for your own tables, views, and joins since tableprint is inflexible in other ways.

 Dave
0
 
reenie1Author Commented:
That answer was helpfull...but being a web application we do not give the user rights to create a table or a view...is it possible to use a cursor in the OWA_UTIL.TABLEPRINT command instead of a view or table?
0
 
daveceeCommented:
You would usually create the view as a separate one-time step when installing the application, then web users would call owa_util.tableprint on that view at runtime.

 You can't use a dynamically-created object like a cursor with tableprint because it uses the Oracle data dictionary to get the names and data types of the table/view columns.

 You can however use owa_util.cellsprint with a dynamic query, maybe you should take a look at that, although as I said earlier you may find it easier just to write custom table generation procedures yourself.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now