Displaying a procedure in a column
Hi all SQL gurus...
I need some help in a query.. i want to to display the data of a procedure in a column of SQL query
like select first_name, lastname, "procedureal column" from mytab;
I write a procedure which calculate the yearly salary of employes and now i want to display it with name of employee..
hope you understand my question
Thanx in advance
regards
you need to modify your PROCEDURE into a FUNCTION. And then call it in a sql query.
Something like this
SQL> create or replace function get_emp_count(pdeptno dept.deptno%type) return number
2 as
3 lcount number;
4 begin
5 select count(1) into lcount
6 from emp
7 where deptno = pdeptno;
8
9 return lcount;
10 end;
11 /
Function created.
SQL> select deptno, dname, get_emp_count(deptno) emp_count
2 from dept
3 /
DEPTNO DNAME EMP_COUNT
10 ACCOUNTING 3
20 RESEARCH 5
30 SALES 6
40 OPERATIONS 0
Similar Messages
-
Problem displaying PDF stored in BLOB column
Hello everyone.
I've been trying to follow this tutorial http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::p11_question_id:232814159006 on displaying PDFs stored in BLOB columns. This is being performed on Apex 4.2, with my DB running 11g. I've got my procedure, which I'll post below:
create or replace procedure "PDF" (p_id IN gvo_documents.doc_id%type)
is
l_lob blob;
l_amt number default 30;
l_off number default 1;
l_raw raw(4096);
begin
select contents into l_lob
from gvo_documents
where doc_id = p_id;
-- make sure to change this for your type!
owa_util.mime_header( 'application/pdf' );
begin
loop
dbms_lob.read( l_lob, l_amt, l_off, l_raw );
htp.prn( utl_raw.cast_to_varchar2( l_raw ) );
l_off := l_off+l_amt;
l_amt := 4096;
end loop;
exception
when no_data_found then
NULL;
end;
end;
I am trying to run this through a PL/SQL dynamic region and while I don't receive any error's, the content displayed is a huge mess of garbled text and odd characters. I've tried to run this procedure on numerous other document types, including word files and jpeg images, all with the necessary changes in my procedure, and regardless of what I use, I still get a large mess of strange characters. Does anyone have any information or ideas about why this is happening?If I understand correctly, your requirements needs to be broken down into two problems:
1) click link that pops up a window displaying a new APEX page
2) an APEX page the displays the document, not downloads it.
I haven't done #1 (yet).
However, you may be able to generate a URL that points to the new page as part of the SELECT statement for the Report.
This has a related question, but no answer yet:
open pdf in popup browser window
The key is target="_blank" for the anchor tag.
To generate the URL, you should use the APEX_UTIL.prepare_URL() function.
If that doesn't work, a Dynamic Action that does some magical JavaScript stuff may be needed.
For #2, I lost the URL that showed how to display a PDF as part of a "form" page.
From what I remember:
Start with a blank page with one blank HTML region (all the Items go in the HTML region)
Add an Item for the PK/Doc_ID
part I forgot Create a Data Manipulation Process
- Automated Row Fetch
- On Load - After Header
- (stuff for your table/view)
part I forgot Create an (I believe) "File Browser" item type. For Settings:
- Storage Type "BLOB column specified in Item Source" (and place the column name of the BLOB there)
- MIME Type Column: (column name) -- since you have multiple types, this is a MUST HAVE
- Filename Column: (column name) -- I highly recommend you have this.
- Content Disposition == INLINE <-- this is the kicker
Also, you will need a Browser Plugin for each of the MIME Types (otherwise, the browser may try to 'download' the file)
Browsers can handle Image types internally. Adobe's plugin can handle PDFs. I don't know about Word/Excel.
Again, I don't remember the exact details, but that should cover most of it.
MK -
Multiple Display Types in a single column
I have a situation where I have to display a bunch of attributes for a customer. Each attribute can have a different type, Text, Dropdown, Date etc and that information is stored in a table.
I was able to use apex_item to display the different display types based on the type of attribute.
So the layout of the form has 2 columns, column 1 is the name of the attribute and column 2 is the value of the attribute (displayed as the various types of date, text, dropdown etc) However, I am having an issue with the Date popups. When I select a date it always goes into whatever date is listed first. No sorting is going on in the select or the report.
I'm guessing my issue has to do with displaying different display types in the same column? If that is true, how should I change my approach to this problem? I want all the attributes on a single page, so is my only option to have each attribute in a different region?
Thanks,
-- JohnnieDenes,
OK thanks for the heads up, let me try to clarify.
My problem is that I have multiple date popups on the same form. When I pick a date for any of the date popups, it always updates the first date popup field on the form. I stated there was no sorting at all because this thread indicated that sorting could cause this issue:
DATE_POPUP
Another hit for this issue was here:
Re: HTMLDB_ITME.DATE_POPUP problems
This suggested that having multiple data types in the same column (which is what I am doing) is not supported, but this is an old thread.
My form will be a manual tabular form. I need to display a list of attributes, however some are freeform text, some are SQL LOV dropdowns, and some are date popups. Right now they are all displayed in the same column. Could this be causing my date popup issue? If so what alternatives do I have?
Screenshot of my form here: http://johnniebillings.googlepages.com/outlook.jpg
Hope that clears up the issue I am having.
-- Johnnie -
To display Total sum of a column in a table view control ?
Hi,
I am unable to display the sum of a column in a table view control ( using HTMLB ). How should one display the sum of a column in a table view control ?
Thanks in advance.
Vara.Hi there, do a search in this forum for TableView Iterator. Then check out these weblogs:
/people/thomas.jung3/blog/2004/09/15/bsp-150-a-developer146s-journal-part-xi--table-view-iterators
/people/brian.mckellar/blog/2003/10/31/bsp-programming-htmlb-tableview-iterator
An Iterator is the way to go for you -
How to display presentation variable in a column
Hi all....I have to display presentation variable in a column...
I tried placing @{variable_name} in column formula..
But it is displaying a value 0 ..where the variable carries a date value.
Any suggestions?Take a look at this blog: http://gerardnico.com/wiki/dat/obiee/presentation_variable
Try it out by providing a default format.
Thanks,
BIPuser -
How to display the value of a column in a chart at the top of each column
How to display the value of each column in a chart at the top of each column?
Like this?
Done using chart Inspector.
For details, see Chapter 7, Creating Charts from Numerical Data in the Numbers '09 User Guide. The guide may be downloaded via the Help menu in Numbers.
Regards,
Barry -
Problem with displaying same field in three columns
Hi
I am using reports developer 11g and I have created a report which displays only one field (column), which is id_number as output but I have a problem now.
I would like to display the id_number in three columns on one page to save paper, that is, I want to show the first 20 (1 - 20) id_numbers in one column going down, then display the next 20 id_numbers (21 - 40) on the second column on the same page and the next 20 (41 - 60) on the third column still on the same page. If there are more than 60 id_numbers, they should be printed on the next page again in three columns, and so on until all the id_numbers are displayed. How can I achieve this? Could you please assist me?
Thanks.Andreas, I think I am missing something here. I have done what you have said but still the id_numbers are all being displayed
in the first column and jumps on to the next page without displaying the id_numbers across the page in columns.
My data model contains a group with not only the id_number but has other fields which I am not displaying.
I am only using the other fields just to use them in conditions to select only id_numbers which meet a certain criteria which I then display in the report.
I have created a repeating frame for that group and changed the orientation property to Down/Across. Within that frame, I have a field for the id_number
which I want displayed in three columns, running across the page as I have already told you. Please help.
Thanks. -
How to display images in a table column?
Hi,
In a VC model, I have to display images in a table column for each record found.
How can this be done?
Regards,
NitinHi Nitin,
It can be done by adding to the table the Image control (can be found under Advanced Controls in the Compose panel).
In the URL property (in the Configure panel of the Image control) you can define any expression that will return the image URL. For example:
="http://hosting.site.url/"&@ImageNameField
Regards,
Udi
Edited by: Udi Cohen on Jun 11, 2008 1:39 PM -
Displaying images from ORDSYS.ORDIMAGE columns
Does anyone know, if Oracle9i Reports can display images fetched from ORDIMAGE columns in the database? If so, could you give me a brief explanation how?
Thanks in advance!Jacob,
As of now , it is not supported. It is under development for next release.
It currently supports images stored in DB as LOBs
Thanks
The Oracle Reports team -
JTable : How to display an icon near the column name ?
Hi all,
I'd like to display an icon near the column name of my JTable when an user click on the column; the icon specify the sorting applied to the data of JTable.
I know that i have to write a render, but how ?
Cheers.
StefanoHi all,
I found the solution at http://exampledepot.com/egs/javax.swing.table/IconHead.html
Cheers anyway.
Stefano -
How to display number of rows as columns in a select statement? This is on
How to display number of rows as columns in a select statement? This is on 10g R2.
Thanks,
RFor the current (ie. row 1 of 100)
row_number over (order by -pick_a_column_set) as rnfor the total number of columns returned in your query
count(*) over() as total_count -
Negative number cannot be displayed in table if the column is too narrow
Hi, All
When a number is formatted as a certain formatting(not locale formmatting),Negative number cannot be displayed in table if the column is narrower than the negative number, just minus is displayed.
Can you help me? Thanks.
Version: EHP1 for netweaver 7.0 SP3
Best regards,
Jiande DingHi,
I think this has nothing to do with positive and negative numbers, By default the alignment of the text is Left, if you dont want to see '-' sign initially then you can change the alignment of the text to center or right in the display tab of properties for that column.
As you as saying that at runtime the numbers are visible if manually adjusted. to icrease the width of that column permanently goto Layout tab of the story board and increase the size of the table and then increase the width of the column.
the Fit Contents in the Layout should be set to "Actual Size".
Regards,
Rk. -
Spry:repeat display data in multiple rows/columns
I know how to use spry:repeat to display data in table rows,
one item per row.
Is there a way to tell spry to display data in a grid of x
rows by y columns?
I'm trying to maximize the page's real estate. Here is the
page
http://www.jannah.com/mp3/browse.html
Click on "Artist/Scholar" in "STEP1" section. "STEP2" section
gets filled with a list. I'm trying to display that list in 3
columns and as many rows as needed. How do I do that?
While I'm at it, I also can't figure out why the spry:select
is not working for "STEP2" section; I need to click twice on the
same item to get it highlighted. the other spry selects on the page
work ok. Can someone take a look.
Greatly appreciated.You can't use Spry with tables to do this, but if you're up
to using a div based layout/presentation, it is possible. Check out
the Zuggest sample:
http://labs.adobe.com/technologies/spry/samples/data_region/ZuggestSample.html
It uses floated divs to get the same effect. The nice thing
about using divs, is that more columns dynamically appear as the
horizontal real-estate is expanded.
--== Kin ==-- -
How to display stored procedure
what is the command to display stored procedure through sqlplus.
If you would like to get a view about the parameters of the procedure, just use
SQL> desc <procedure name>;
If you would like to see the code for the procedure, then use (assuming you are logged in as the owner of the procedure)
SQL> SELECT Text FROM User_Source WHERE Name ='PROCEDURENAME' ORDER BY Line;
Message was edited by:
Satish Kandi
@Dave: Sorry I did not see your post. -
UIX: How to display more items in 1 column on the same row
Hi
I have a uix table with a couple of columns.
Now I want to display more elements in 1 column, but on the same row
E.g.
article | quantity <> | price
The quantity column has also to buttons to increase/decrease the quantity. Something like:
<column>
<columnFormat displayGrid="true" cellNoWrapFormat="true" columnDataFormat="numberFormat"/>
<columnHeader>
<sortableHeader text="Quantity" required="yes"/>
</columnHeader>
<contents>
<messageTextInput id="${ui:concat('PurchaseInvoiceLinesView3:Quantity:',uix.current.tableIndex)}" model="${ui:cond(uix.current.isNewRow,null,uix.current.PurchaseInvoiceLinesQuantity)}" text="${uix.current.PurchaseInvoiceLinesQuantity}" name="Quantity" promptAndAccessKey="Quantity" rows="1" maximumLength="6" columns="8">
<onSubmitValidater>
<decimal/>
</onSubmitValidater>
</messageTextInput>
<button text="<" onClick="..."/>
<button text=">" onClick="..."/>
</contents>
</column>
But both buttons appear on a new line. Resulting in:
[ 1]
<
>
The useSeperateRows attribute is by default false, so that should be ok. Any ideas to get the buttons on the same row?
Regards.Hi,
If all of your line items are getting displayed in different pages, to my knowledge, there may be two possibilities.
1) May be the size of the main window can accomodate only one line item. If one item data fills up the window, then there wont' be any space for the next line item data to be accomodated in the same window in the same page, so, the system triggers the next page. Like-wise for each item data. If this is the case, increase the height of the main window to display items in same page.
2) Check the driver program. Find the Write_form block, which is written inside an item loop. May be there is a Form-control Function module( Control_form with parameter 'NEW-PAGE' ) being called after the write_fom block, within the loop. If this is the case, remove the control_form FM section to make the data display in same page.
Best Regards,
Kumaar.S
Maybe you are looking for
-
How do I create a filter that bypasses the in page and goes directly to spam rather to delete?
How do I create a filter that bypasses the in page and goes directly to spam rather than to delete?
-
Oracle 8.1.7 and HPUX IA64
I have been requested to install an oracle 8.1.7 on a HP IA system running HP-UX11.23 , I thinks it is not support but not sure? did any one have this experience to install an ORA 8.1.7 into HPUX 11.23 IA system. BTW both are in 64 bit version Regard
-
Need help with setting up a PPTP connection
Hello all, I am having trouble setting up a PPTP connection in Mac OS X "Snow Leopard". The ISP has provided the following info: - Protocol: PPTP - Login - Password - IP Address - Subnet mask - Default Gateway - IP Address of the VPN Server I am usin
-
I was wondering if there is a log file for screen sharing, or how I can enable debugging? I am trying to connect using a VNC client, this works on my internal netowrk but I cannot get access from outside despite adding the correct port forwarding rul
-
Best practice to create order extract from CRM to Business Objects
Is there a "best practice" to extract orders created/changed on a daily basis to Business Objects. We have considered trying to use the standard CRM BI extractors, but we are not sure this is possible without actually running a SAP BI system. Is th