Can we call a stored procedure in a select statement
Hi All
I want to call a stored procedure inside a select statement is this possible.
Regards
Sravz
You can create a pipelined function which gathers the data from your stored procedure and then use that in a select statement or directly write your script in any function or pipelined function. ;)
There is no way you can call any stored procedure in a SELECT statement directly - i guess.
Regards.
Satyaki De.
Similar Messages
-
Can i call a stored procedure from OracleDashboardPrompt?
Hi,
Can i call a stored procedure from OracleDashboardPrompt once i click the Go button in OBIEE?The input parameters to the procedure are the one that i have given in DashboardPrompt.and based on the result of the procedure(either 0 or 1),i have to display reports.Can anyone help me.
Thanks in Advance...Please find below the possible approach to the scenario:
1.Create a prompt for the column which you need as input to store proc and create a presentation variable for that .
2.Create a dummy report with 1 column which will have the above created presentation variable as filter(We can design this reports in such a way like the first column will get filtered based on the presentation variable)
3.Create a second column and in the column definition we can add a code like
evaluate('StoreProc(%1)','@{firstcolumn}')
4.We can hide the first column in the report and only show the output of store proc to the end user
Hope this helps :) -
Can we call a stored procedure from a Trigger
Hello Everyone,
I need some help in writing the triggers in Oracle 10g Database.
Can we call a stored procedure from a trigger?Can we call a stored procedure from a trigger? Yes. Why did you think we couldn't?
Cheers, APC -
Use of a stored procedure in a select statement submitted to cx_oracle
Hi,
I am developping under python and I'm using the cx_oracle interface.
I've written a stored procedure that I've tested directly under sqlplus session : it's ok. I've also tested this stored procedure from python by using callproc routine : its also ok.
Now I need to use this procedure within a select statement that I submit to the execute statement of cx_oracle as :
s = "select a.airport_name,gmlpos.ExpLatLong(a.point_name) from airport"
self.db = oracledb('ops/opeope00@ACE2008B')
dbmsg = self.db.execute(s)
IF (dbmsg == "") :
An error occurs :
Message = request = select a.AIRPORT_NAME, gmlpos.ExpLatLong(a.point_name) from airport, errmsg = ORA-00904: "GMLPOS"."EXPLATLONG": invalid identifier
Noting that the execution of any other select (without stored procedure) order from python works fine.
Is anybody has a solution or workaround ?
thanks a lot for your helpThe result gives what is expected :
AIRP
GMLPOS.EXPLATLONG(A.POINT_NAME)
LFLL
-45.71666666666667 -5.08333333333333
As I said the stored procedure works fine.
Thanks for your expertise
PS : why change the login password until nobody says which machine or database is concerned ? -
Can I call a stored procedure from EJB?
Hi,
Can I call a regular (non-Java) stored procedure from an enterprise Java bean? Transaction is managed by the ejb application server.
Thank you for your response.
CThi, i saw your question in the forum....have you got a response
since mars because i 've the same problem...
thanks in advance
cheers
jp -
Help : How can i call oracle stored procedure in PHP
i have following stored procedure and i want to call it in PHP.
pls give me syntax how can i call it.
Create or Replace Procedure Insert_profilebasicdetail
p_isubprofileid IN NUMBER,
p_Copyisubprofileid IN NUMBER,
p_itranno IN NUMBER,
As
v_IncKeyID NUMBER;
v_tempkeyId NUMBER;
CURSOR TempInsert IS
SELECT ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,iyear,isubprofileid
FROM profilebasicdetail
WHERE isubprofileid=p_Copyisubprofileid and itranno=p_itranno;
BEGIN
SELECT MAX(NVL(iKeyID,0))
INTO v_IncKeyID
FROM profilebasicdetail;
FOR r in TempInsert LOOP
v_IncKeyID := v_IncKeyID + 1;
Insert into profilebasicdetail
(ikeyid,iprofileid,iquestionid,vquestionans,cstatusindi,dmodifyon,imodifyby,itranno,iyear,isubprofileid)
select v_IncKeyID,r.iprofileid,r.iquestionid,r.vquestionans,
r.cstatusindi,r.dmodifyon,r.imodifyby,1,
r.iyear,p_isubprofileid
from profilebasicdetail
where ikeyId=r.ikeyId;
END LOOP;
EXCEPTION
WHEN others THEN
raise;
End;
Thanks
allHi, your SP have an error in the sentence "p_itranno IN NUMBER,)"... the comma is the error.
In order to use the SP from PHP you have write...
<?php
$sth = oci_parse($dbh, "begin Insert_profilebasicdetail (:isubprofileid , :copyisubprofileid, :itranno); end;"
oci_bind_by_name($sth, ": isubprofileid ", $youparameter1);
oci_bind_by_name($sth, ": copyisubprofileid", $youparameter2);
oci_bind_by_name($sth, ": itranno", $youparameter2);
oci_execute($sth);
?> -
Executing a stored procedure containing multiple Select statements
Post Author: Beverly
CA Forum: General
I am using Crystal 10.0 against a MS SQL 2000 server.
I am trying to create a report based on a stored procedure that contains multiple select statements. The sp requires a single parameter (Claim number) and contains 17 Select statements that produce results.
I am able to use the Add command and execute the sp with the parameter, but I am only getting the results of the first select statement in the sp back in my data set. Is there a way to have the data from each Select statement returned to my report?
I have used Crystal for a while, but pretty much for straight-forward reporting. I am familiar with the basics of SQL.
I would appreciate any help anyone can offer.
Thanks.Post Author: BISoftware
CA Forum: General
I believe Crystal Reports can only handle one recordset at a time, which means it can only handle a single select statement. The only way I can see around this would be to break up your stored procedure into multiple stored procedures, so that each only contains a single select statement. Then, use subreports to report on each individual sp. Hope this helps. - Davewww.BusinessSoftwareResource.com -
How can I call a Page Process from the Select statement for Report Page
I'm able to call a javascript using the below:
img src="#IMAGE_PREFIX#add2.gif" border="0" alt="Icon 4" onClick="javascript:add_connect1('||CPORT.ID||')"
But Now,
I'd like to accomplish (2) New things:
1. instead of using,....... onClick="javascript:add_connect1,
I'd like to call a Page Process, onClick=
2. I'd like to be able to call two different processes onClick.
a. onClick="javascript:passBack('||ID||')"
b. onClick= <Please see my question #1 above>
Can someone please help me with the syntax for this,
If indeed it can even be done?
Thanks- GaryGreg.
It seems that my situation is the one you describe in you second paragraph, where you mention:
you could then add the ID column value as a parameter to the javascript functionBut,
I do not know how to reference the variable in my javascript nor how to use it in my on-demand process.
If you can hellp me past this last little bump, then I think I will be able to use these skills in Sooo many different areas of my design.
Here's what I've got so far:
A. In the select statement I identify the javascript as:
onClick="javascript:connect_port('<font color=blue>''||ID||''</font>')";
B. In my javascript I have this:
<script language="JavaScript" type="text/javascript">
function connect_port(ID)
var get = new htmldb_Get(null,$x('pFlowId').value,'APPLICATION_PROCESS=CONNECT_PORT',0);
gReturn = get.get();
get = null;
</script>
C. In my on demand function I have this:
BEGIN
INSERT INTO CCONNECTIONS_B
BLDG_ID,CLST_ID,PORT_ID,STRAND_ID
) VALUES
:P2004_BLDG_ID,:P2004_CLST_ID,:P2004_PORT_ID,:P2004_STRAND_ID1
END;
You can see that I dont know how to use the value for 'ID' in either the javascript or the On-Process function.
If you can help me out with this one, Then I can imitate it for the rest.
-Gary
Edited by: garyNboston on Apr 3, 2009 6:44 AM
Edited by: garyNboston on Apr 3, 2009 6:44 AM
Edited by: garyNboston on Apr 3, 2009 6:45 AM
Edited by: garyNboston on Apr 3, 2009 6:47 AM -
How can i call a Stored Procedure procedure from Unix shell script
Hi All,
I want to call a Strored PL-SQL Procedure through Unix shell script.
Can any body help me with this.
Regards,
SaurabhI prefer a seperate script like the other poster mentioned. However, most shells can use a 'here' document as well ...
sqlplus uid/pwd <<END
exec myproc
exit
ENDRichard -
Can I call a stored procedure which has DMLs from a function ??
Hello all,
Here is my req. I Want to use a function which in turn executes a procedure to populate a table. This procedure inserts data into a table .
How can I make it work.?
thanks,
DnakkaHi,
Here is an example procedure and a function.
The procedure:
CREATE OR REPLACE PROCEDURE proc1 AS
BEGIN
INSERT INTO tab1 VALUES(1, 'some string value');
COMMIT;
END;
The function which calls proc1:
CREATE OR REPLACE FUNCTION func1 RETURN VARCHAR2 AS
BEGIN
proc1;
RETURN 'done';
END;
Hope that helps.
Savitha. -
Can we get data return from stored procedure in a select query ?
Hello,
Suppose i have a function GetSum(x,y) that returns sum of two numbers x and y .We can call this function from within a sql function like this :
select GetSum(4,5) SUM from dual;But is this possible through a stored procedure ? i.e., can i call a stored procedure from within a select query like i have done in above code ?Hi,
bootstrap wrote:
Hello,
Suppose i have a function GetSum(x,y) that returns sum of two numbers x and y .We can call this function from within a sql function like this :
select GetSum(4,5) SUM from dual;But is this possible through a stored procedure ? i.e., can i call a stored procedure from within a select query like i have done in above code ?The short answer has already been given.
Why can't you use a function?
Suppose you could use a procedure. What results would you want to see from:
SELECT my_proc (4, 5)
FROM dual
;? Why?
Explain what you want to do, and somebody will help you find a good way to do it. -
Calling of Stored Procedure in After Insert Trigger
Can I call a Stored Procedure in After Insert Trigger ?
Please send a sample code (good example) of After Insert Trigger.
Thanks.Kishore,
I have two table WLCS_ORDER, WLCS_ORDER_LINE
WLCS_ORDER - It holds order header information like
ORDER_ID
CUSTOMER_ID
TRANSACTION_ID
STATUS
ORDER_DATE
SHIPPING_METHOD
SHIPPING_AMOUNT
SHIPPING_CURRENCY
PRICE_AMOUNT
PRICE_CURRENCY
SHIPPING_GEOCODE
SHIPPING_STREET1
SHIPPING_STREET2
SHIPPING_CITY
SHIPPING_STATE
SHIPPING_COUNTRY
SHIPPING_POBOX
SHIPPING_COUNTY
SHIPPING_POSTAL_CODE
SHIPPING_POSTAL_CODE_TYPE
SPECIAL_INSTRUCTIONS
SPLITTING_PREFERENCE
ORDER_SUBTOTAL
WLCS_ORDER_LINE - It holds all order lines information like
ORDER_LINE_ID
QUANTITY
PRODUCT_ID
TAX_AMOUNT
TAX_CURRENCY
SHIPPING_AMOUNT
SHIPPING_CURRENCY
UNIT_PRICE_AMOUNT
UNIT_PRICE_CURRENCY
MSRP_AMOUNT
MSRP_CURRENCY
DESCRIPTION
ORDER_ID
TOTAL_LINE_AMOUNT
Relation between WLCS_ORDER, WLCS_ORDER_LINE is one to many.
For each WLCS_ORDER row, one or more order lines will insert into WLCS_ORDER_LINE table.
For each new row in WLCS_ORDER table, I have to update the following columns in both the tables with my maths.
WLCS_ORDER
shipping_amount
price_amount
order_subtotal
WLCS_ORDER_LINE
shipping_amount
I thought I can do this in after insert trigger, But if it is not possible, Please give the best way to fulfill this requirement.
I appreciate your help.
Have a great day.
Srinivas -
Calling a stored procedure for each row returned
I need to call a stored procedure for each row returned by a repeating frame. I called the stored procedure from the repeating frame format trigger, but that did not work( it did no populated the tables populated by the stored procedure)
How can I call a stored procedure for each row returned by a repeating frame.
Thank youInclude it as a formula column in your data model.
-
Can a SQL Server stored procedure call an SAP function module?
Can a SQL Server stored procedure call an SAP function module.? The stored procedure will be called via a trigger when data records are added to a Z table.
You have two options:
- the other software can use the RFC SDK and call directly in the system
- the other software can use a database connect
Markus -
Can rs.last() be used after calling the stored procedure?
Can rs.last() be used after calling the stored procedure? If yes what should be the CURSOR types?
Can rs.last() be used after calling the stored
procedure? If yes what should be the CURSOR types?That would depend on the driver/database.
And as I said in your other post it is far more efficient to count records by just returning a count rather than a complete collection regardless of how you get to the end.
Maybe you are looking for
-
Preview hanging/crashing/not working in Lion on new MacBook Air
I just migrated from my old 2008 MBP to brand new MacBook Air running Lion. Since then, Preview is screwy: will open a few things but then will stop opening anything and is either fully crashed, or will still be able to go to it and look at what is o
-
How to re-run output determination after goods issue through idoc
Hello, i've got a question about output determination. We are currently in a process to automate picking, packing and goods issue through a 3rd party software. The software creates DELVRY03-Idocs including picking, packing and goods issue-information
-
Time Machine not working as supposed to.
The other day i made changes that i wanted to "roll back". So i selected a date 1 day earlier and restored to that date. After the system rebooted it took the next 18 hours creating a new " image " in time machine. There was no way to stop this. Now
-
Personalization dialog in MSS My Budget
Hi, We're having at bit of trouble modifying the personalization dialogs of the MSS BP (My Budget) - in particular the personalization dialogs used to communicate with the Report Painter/Writer reports of the backend R/3 system. We are using the gene
-
ITunes 11.1.1 on Mac crashes when I click on Apps for iPhone or iPad.
iTunes 11.1.1 on Mac crashes whenever I click on the Apps tab for iPhone or iPad (iOS 7.02).