How to use stored procedures in postgresql
hiii,
if any body knows how to create a stored procedure in postgresql
please help me
Hi,
Refer the below link:
JDBC:
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
Stored Procedures-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
http://www.ics.com/support/docs/dx/1.5/tut6.html
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://www.ics.com/support/docs/dx/1.5/tut6.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
http://www.sqlteam.com/article/stored-procedures-an-overview
HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
refer the below link which has all the associated action
http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Chirag
Similar Messages
-
How to use Stored Procedure Call in Sender JDBC adapter
Hi All,
Could someone send me a blog on how to use Stored Procedure call in Sender JDBC adapter?
XierHi Xler
refer these links
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/content.htm
Also, you can check Sriram's blog for executing Stored Procedures,
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
/people/jegathees.waran/blog/2007/03/02/oracle-table-functions-and-jdbc-sender-adapter
This blog might be helpfull on stored procedures for JDBC
JDBC Stored Procedures
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
Please go through these threads and see if it helps...
Re: How to execute Stored Procedure?
Re: Problem with JDBC stored procedure
Thnaks !! -
How to use Stored Procedures in form 6i Blocks
Dear Friends,
I would like to know how to use Stored Procedures while creating blocks in Data Block Wizard in forms 6i application.
Please send me sample code of stored procedure.
Regards,
Khader.The Data Block Wizard is not for creating stored procedures. It will allow you to use a stored procedure in your form. See the help documentation for how to use the wizard.
Here's an example of a simple procedure. If you search the database forum or the web, you will find many examples.
CREATE OR REPLACE PROCEDURE procedure_name (value OUT NUMBER ) AS
BEGIN
SELECT COUNT(*) INTO value
FROM your_table;
END;
Message was edited by:
Mark Roberts -
HOW TO USE STORED PROCEDURES IN JASPERREPORTS(URJENT)
Hi,
i'm using jasperreports in struts based project. How to use stored procedures in jasperreports. pls send the solution urjent
Thanks in advance
rameshHi,
Refer the below link:
JDBC:
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
Stored Procedures-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
http://www.ics.com/support/docs/dx/1.5/tut6.html
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://www.ics.com/support/docs/dx/1.5/tut6.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
http://www.sqlteam.com/article/stored-procedures-an-overview
HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
refer the below link which has all the associated action
http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Chirag -
How to use stored procedures in DIAdem and Can the stored procedures be used to return values?
Can anyone please tell me how to use stored procedures in diadem and to return values from it. Its really important, can you please answer it at the earliest.
Thanks In advance
spiyaHi Spria,
I'm very sorry for the mix-up, I thought Allen was going to answer you back with the particulars that we found out. Check out the attached Word document and the below tidbits:
The built-in DIAdem ODBC functions {SQL_...()} can only call stored functions, which return a scaler result {found then in SQL_Result(1,1)}. The syntax for this with an ORACLE db is
"select function(parameters) from package"
...where package defaults to "dual" if you don't use your own package.
There might be exceptions to that though, and the syntax will be different for other databases. Note that stored ORACLE procedures can NOT be called from the ODBC functions, instead you must use either ADO function calls in the DIA
dem VBScript or the OO4O COM wrapper that ORACLE provides (this is described in further detail in the below Word document).
Hope this helps,
Brad Turpin
DIAdem Product Support Engineer
National Instruments
Attachments:
Calling_ORACLE_Stored_Procedures_from_DIAdem.doc 28 KB -
How to use Stored Procedures in JDBC sender side and receiver side
Hello,
Can anyone explain how to use stored procedures in configuring the scenario using JDBC adapter at bothe sides sender nad receiver..
Thanks,
SooryaHi,
Refer the below link:
JDBC:
Receiver JDBC scenario MS access - /people/sameer.shadab/blog/2005/10/24/connecting-to-ms-access-using-receiver-jdbc-adapter-without-dsn
/people/sap.user72/blog/2005/06/01/file-to-jdbc-adapter-using-sap-xi-30 --> for jdbc receiver: file -JDBC
Stored Procedures-
/people/siva.maranani/blog/2005/05/21/jdbc-stored-procedures
http://www.ics.com/support/docs/dx/1.5/tut6.html
/people/sriram.vasudevan3/blog/2005/02/14/calling-stored-procs-in-maxdb-using-sap-xi
http://www.ics.com/support/docs/dx/1.5/tut6.html
http://java.sun.com/docs/books/tutorial/jdbc/basics/sql.html
http://www.sqlteam.com/article/stored-procedures-an-overview
HI in the message mapping structure u need to specify the different action and also u need to specify the procedure name.
refer the below link which has all the associated action
http://help.sap.com/saphelp_nw04s/helpdata/en/22/b4d13b633f7748b4d34f3191529946/frameset.htm
Chirag -
How to use stored procedure in crystal report for eclipse
Hi;
I am working on crystal report for eclipse 2.0 and trying to use stored procedure in report .It is created from Oracle but it is not showing any dependencies
CREATE OR REPLACE procedure ACT_DB.getCostTransferDetails
p_In_Contract_ID varchar2 DEFAULT '*',
p_In_Status_ID varchar2 DEFAULT '*',
p_In_COST_TRAN_DATE varchar2 DEFAULT '*',
p_In_DEPT_ID varchar2 DEFAULT '*',
p_In_PROJECT_ID varchar2 DEFAULT '*',
p_In_EMPLOYEE_ID varchar2 DEFAULT '*',
p_Out_CostTransfer_Cusor OUT COST_TRANSFER_PACKAGE.COST_TRANSFER_TYPE
AS
BEGIN
OPEN p_Out_CostTransfer_Cusor FOR
SELECT
header.cost_tran_id,
header.cost_tran_date,
header.total_credit_amount,
header.total_debit_amount,
header.transfer_status,
header.updated_by,
header.added_by,
header.trf_over_ninety_days,
header.business_unit_id,
header.equip_approval,
header.batch_desc,
details.opr_unit_id,
status.status_id,
details.fund_code_id,
details.prgm_code_id,
details.class_id,
details.activity_id,
details.product_id,
details.status_id,
details.transaction_amount,
details.jrnl_date,
details.adjust_prcnt,
details.adjust_amnt,
details.details_equip_approval,
details.detail_desc,
details.account_id,
details.project_id,
details.dept_id,
details.contract_id,
details.reason_code_id,
details.jrnl_id,
employee.f_name,
employee.l_name,
employee.employee_id,
project.project_id,
project.project_status,
--header.transfer_status,
contracts.contract_desc
FROM header, details, status, employee, department, project, contracts
WHERE (header.cost_tran_id = details.cost_tran_id)
AND (header.cost_tran_date = details.cost_tran_date)
AND (header.transfer_status = status.status_id)
AND (department.dept_id = details.dept_id)
AND (department.dept_id = employee.dept_id)
AND (project.project_id = details.project_id)
AND (contracts.contract_id = details.contract_id)
AND (details.Contract_ID = p_In_Contract_ID OR p_In_Contract_ID ='*' )
AND (header.TRANSFER_STATUS = p_In_Status_ID OR p_In_Status_ID ='*' )
AND (TO_CHAR(details.COST_TRAN_DATE, 'MM/DD/YYYY') = p_In_COST_TRAN_DATE OR p_In_COST_TRAN_DATE ='*' )
AND (details.DEPT_ID = p_In_DEPT_ID OR p_In_DEPT_ID ='*' )
AND (details.PROJECT_ID = p_In_PROJECT_ID OR p_In_PROJECT_ID ='*' )
AND (header.ADDED_BY = p_In_EMPLOYEE_ID OR '*'=p_In_EMPLOYEE_ID )
Can any another way to make procedure
Thanx
Regards ,
AmolHi Amol,
Are you able to execute your stored procedure from oracle?.
- If "Yes" then use the Crystal Report XIR2 Designer to create the report.
- Import this report in the Crystal Report For Eclipse Workbench.
- The latest version for Crystal Report For Eclipse is SP1.
Please let me know the results.
Thanks,
Neeraj -
How to use Stored Procedures in Sender JDBC Adapter.
Hi Experts,
we are having a lot of legacy application which are on .Net. basicaly using MS SQL & stuff. As a Integration scenario we have to triggered some events from JDBC to XI. How can i do this. Secondly there are multiple tables from which i will be selecting a record & sending it to XI for further processing the Receiver Side we are having SAP system.
How can i use a Stored procedure in XI Sender Adapter ?
Can anybody tell me step by step how to get the XSD of Stored procudere & used in XI. ?
I am new to XI. I have not yet configured any sceneario.
Can anybody guide me step by step how to do this.
I am only intersted in Sender Side configuration.
Regards,
UmeshHey,
check this in the JDBC Sender Adapter Configuration
Query SQL Statement -> Specify an SQL EXECUTE statement to execute a stored procedure, which contains exactly one SELECT statement.
The expression must correspond to the SQL variant supported by the relevant JDBC driver. It can also contain table JOINs.
http://help.sap.com/saphelp_nw04/helpdata/en/7e/5df96381ec72468a00815dd80f8b63/content.htm
JDBC adapter
/people/saravanakumar.kuppusamy2/blog/2005/01/19/rdbms-system-integration-using-xi-30-jdbc-senderreceiver-adapter
<b>Cheers,
*RAJ*
*REWARD POINTS IF FOUND USEFULL*</b> -
How to use stored procedure with many return results and variable with perl
Hi everybody,
i´m writtting now a Perl programm, wich use a oracle stored procedure with more than 1 result and 1 variable(I have to return 2 variable fpr each result). I don´t now how I can get it.I already search the web but I didn´t find.
My example:
PROCEDURE get_projects_and_sub_projects (
v_project_id IN INTEGER,
v_project_c_id OUT INTEGER,
v_project_id_find OUT VARCHAR2
IS
BEGIN
SELECT c_id, proj_id
INTO
v_project_c_id,
v_project_id_find
FROM t_projet
WHERE t_projet .ksa_pro_art_kbz = 'KU'
AND t_projet.proj_id LIKE v_project_id || '%';
EXCEPTION
WHEN NO_DATA_FOUND
THEN
v_project_c_id := NULL;
v_project_id_find := NULL;
WHEN OTHERS
THEN
kmessages.error (NULL,
'get_projects_and_sub_projects',
'Project-Name: ' || v_project_id,
'Errornumber: '
|| SQLCODE
|| ' Error: '
|| SQLERRM,
TRUE,
TRUE
raise_application_error (-20001,
'Error '
|| SQLCODE
|| ' get_projects_and_sub_projects: '
|| SQLERRM,
TRUE
END get_projects_and_sub_projects;
in Perl Program:
sub get_projects_unterprojects_name($$){
my ($db_handle, $proj_name_id) = @_; #$db_handle ist the DB Connection return value
my $db_proj_c_id;
my $db_proj_name;
eval{ my $csr = $db_handle->prepare(q{
BEGIN
pro_doc_ber.get_projects_and_sub_projects(:proj_name_id, :db_proj_c_id, :db_proj_name);
END;
# parameter value
$csr->bind_param(":proj_name_id", $proj_name_id);
# return values
$csr->bind_param_inout(":db_proj_c_id", \$db_proj_c_id, 11);
$csr->bind_param_inout(":db_proj_name", \$db_proj_name, 20);
$csr->execute(); };
But this didn´t work. Could somebody give me some idea?
Thank you
FelxSome additional info would probably be helpful.
What is your programming enviironment? Java?
In any case I suspect that you will need to use the OCI to deal with specific Oracle types such as user defined object types -- thats not standard ANSI SQL.
In Java I believe you need to use OPAQUE, there are some examples out there. I'm mostly a PL/SQL developer with some Java expereince so others here are more qualifed to answer your question more directly. -
How to use stored procedure which returns result set in OBIEE
Hi,
I hav one stored procedure (one parameter) which returns a result set. Can we use this stored procedure in OBIEE? If so, how we hav to use.
I know we hav the Evaluate function but not sure whether I can use for my SP which returns result set. Is there any other way where I can use my SP?
Pls help me in solving this.
ThanksHi Radha,
If you want to cache the results in the Oracle BI Server, you should check that option. When you run a query the Oracle BI Server will get its results from the cache, based on the persistence time you define. If the cache is expired, the Oracle BI Server will go to the database to get the results.
If you want to use caching, you should enable caching in the nqsconfig.ini file.
Cheers,
Daan Bakboord -
How to use Stored Procedure in RPD
In the physical layer we have a option for procedure when we select a tables general tab.I created the procedure
but i am not able to retrieve values in the Dashboard.
Could anyone help me with this as how to use procedure.Oracle stored procedure don't return recordssets. You have to put the result of the stored procedure in a global temp table and reference the rpd to that table. the execution of the stored procedure can be triggerd form the "execute before query" part in the connection pool.
regards
John
http://obiee101.blogspot.com/ -
How to call stored procedure from postgresql to jsp
i'm using a jdeveloper.. and i'm a newbie of jsp.. i just wanna know how to call a stored procedure in jsp?... This is my function in postgres and i don't know how to call it in jsp...
SELECT * from SP_1('2006-01-11') as ( company_code char(5), branch_category char(5), branch_code char(15), day_sales numeric(19,2), month_to_date numeric(19,2), no_of_transaction int8, month_to_date_py numeric(19,2), year_to_date numeric(19,2), year_to_date_py numeric(19,2), remarks text, time_reported text );hi again.. i'm using jsp in jdeveloper, i just wanna know how to declare double in jsp because my module is report and i need to get the average daily sales = 4500/ no. of transaction = 3. This is my code.. Where will i put the code in declaring the double and the average daily sales? Thanks in advance..
<%@ page contentType="text/html;charset=windows-1252" import="java.sql.*,Connect.CRMCon"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>untitled</title>
</head>
<body>
<%
String ave = request.getParameter("ave_daily_sales");
double cashsales = Double.parseDouble(ave);
%>
<%
logparameters data = new logparameters();
data.txtbox = request.getParameter("txtbox");
%>
<table cellspacing="3" cellpadding="2" border="1" width="100%">
<tr>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">Company Code</DIV>
</td>
<td width="4%" bgcolor="#cccccc" height="29">
<DIV align="center">Branch Category</DIV>
</td>
<td width="6%" bgcolor="#cccccc" height="29">
<DIV align="center">Branch Code</DIV>
</td>
<td width="8%" bgcolor="#cccccc" height="29">
<DIV align="center">Day Sales</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Month to Date</DIV>
</td>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">No.of Transaction</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Month to Date(PY)</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Ave.Daily Sales to Date</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Year to Date</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Year to Date(PY)</DIV>
</td>
<td width="9%" bgcolor="#cccccc" height="29">
<DIV align="center">Remarks</DIV>
</td>
<td width="5%" bgcolor="#cccccc" height="29">
<DIV align="center">Time Reported</DIV>
</td>
</tr>
<%
try
CRMCon ccon = new CRMCon();
Connection con = ccon.getConnection();
String sql = "select * from sp_1('"+data.txtbox+"')";
// String sql = "SELECT * from SP_1('"+ request.getParameter("data.txtbox")+"')" ;
sql += " as (company_code char(5), branch_category char(5) ," ;
sql += "branch_code char(15) , day_sales numeric(19,2)," ;
sql += "month_to_date numeric(19,2), no_of_transaction int8," ;
sql += "month_to_date_py numeric(19,2), year_to_date numeric(19,2)," ;
sql += "year_to_date_py numeric(19,2), remarks text, time_reported text) " ;
//out.println(sql);
Statement st = con.createStatement();
ResultSet rs = st.executeQuery(sql);
while (rs.next())
%>
<tr>
<td width="13%"> <%= rs.getString("company_code") %> </td>
<td width="63%"> <%= rs.getString("branch_category") %> </td>
<td width="24%"> <%= rs.getString("branch_code") %> </td>
<td width="24%"> <%= rs.getString("day_sales") %> </td>
<td width="24%"> <%= rs.getString("month_to_date") %> </td>
<td width="24%"> <%= rs.getString("no_of_transaction") %> </td>
<td width="24%"> <%= rs.getString("month_to_date_py") %> </td>
<td width="24%"> <%= rs.getString("year_to_date") %> </td>
<td width="24%"> <%= rs.getString("year_to_date_py") %> </td>
<td width="24%"> <%= rs.getString("remarks") %> </td>
<td width="24%"> <%= rs.getString("time_reported") %> </td>
</tr>
<%
catch (Exception ex)
out.println("Error:"+ex.getMessage());
%>
</table>
</body>
</html>
<%!
class logparameters
public String txtbox;
%> -
HOW TO USE STORED PROCEDURE IN JDEVELOPER - TOPLINK
-- I really have problem try to do that!!!..
I put the code of adf guide for toplink but have two errors:
StoredProcedureCall call = new StoredProcedureCall();
call.setProcedureName("CHECK_VALID_POSTAL_CODE");
call.addNamedArgument("POSTAL_CODE");
call.addNamedArgumentValue("L5J1H5");
ValueReadQuery query = new ValueReadQuery();
query.setCall(call);
Number isValid = (Number) session.executeQuery(query);
error:
- call.addNamedArgumentValue("L5J1H5"); is not accepted
- session.executeQuery(query); there is no session var defined
Can someone tell me the correct form to call store procedure using a method for commandbutton??
Message was edited by:
user572789Hi Amol,
Are you able to execute your stored procedure from oracle?.
- If "Yes" then use the Crystal Report XIR2 Designer to create the report.
- Import this report in the Crystal Report For Eclipse Workbench.
- The latest version for Crystal Report For Eclipse is SP1.
Please let me know the results.
Thanks,
Neeraj -
How to use Stored Procedures with SQLServer2005 and WAS 6.x
Hi All
I've got a problem, during the call to a StoredProcedure in SQLServer i've get the next message:
Exception : com.microsoft.sqlserver.jdbc.SQLServerException: Fetch size cannot be negative
The stored procedure is working correctly if I run my process out of WAS 6.x but if I get a connection from the pool the process don't work.
Help please, thanks.Your procedure has a single OUT parameter ... and yet it appears you are trying to stuff something into it ... that is never going to work. Additionally everything else about your stored procedure would have gotten you a FAIL grade were you been in my beginning PL/SQL class.
The syntax, a cursor loop, is obsolete and has been for more than 10 years.
The formatting and use of case makes even the few lines written hard to read.
And either no commit ever takes place or you are trying to do incremental commits in origseq: Both of which are bad practice.
This code should use BULK COLLECT to collect all relevant records into an array and then pass the array to origseq ... no loops ... and end with a commit.
Demo here: http://www.morganslibrary.org/reference/array_processing.html -
How to use stored procedures in TestStand
I am trying to run a stored procedure but always get the error:
Error executing substep 'Post'.
The following SQL command failed: 'EXEC dbo.sp_test...'
Native error code -2147217887 0x80040e21
Microsoft OLE DB Provider for SQL Server:
Multiple-step OLE DB operation generated errors. Check each OLE DB status value, if available. No work was done.NI_jc,
> I am trying to run a stored procedure but always get the error:
>
> Error executing substep 'Post'.
> The following SQL command failed: 'EXEC dbo.sp_test...'
> Native error code -2147217887 0x80040e21
> Microsoft OLE DB Provider for SQL Server:
> Multiple-step OLE DB operation generated errors. Check each OLE DB
> status value, if available. No work was done.
In my dealings with TestStand and SQL, such errors are ~usually~ related to
either security permissions or the parameters passed to the stored
procedure.
Can you successfully run the stored procedure from SQL Query Analyzer using
the same username and password (and other connection info) that you use in
the DataLink used in TestStand?
If so, I would then look at the parameters you are passin
g to the stored
procedure. Verify you are passing the correct number and correct data types
for each parameter the stored proc expects.
If that all checks out, double check that you are using the correct
connection handle, etc.
Good luck,
Bob
Maybe you are looking for
-
HP LJ 600 M602 uses paper from other tray
I have a problem with a new HP LJ 600 M602 printer. I think it's best to discribe an example of the problem. For example i start a printjob of 1000 pages from tray 1 which holds 500 sheets. Now it should just say tray 1 is empty when it hits the 500
-
Missing listener-threads attribute in orion-ejb-jar.xml !!
Hi All, I was trying to do some performance tuning as given in BPEL admin guide. For one of the BPEL property namely 'dspMaxThreads', guide says "Sum of dspMaxThreads of ALL domains should be <= the number of mdb listener threads on the workerbean".
-
PSE 11 - People tags showing as groups
Hi, I've upgraded from PSE 6 to PSE 11. My people tags have carried over, but are not showing properly in the "People" view. All my people tags are still present on the pictures and I can search using them by selecting "Advanced Search" in the media
-
Adobe premiere pro CS4 est il capable de capturer les séquences video du Handicam SONY HDR-XR520VE, les fichiers etant du format M2ts,Modd,Moff.Il est donné pour des images haute définition au format AVCHD. Si oui, pouvez vous m'indiquer quels sont l
-
How can i get repeating message tones
How can I get repeating message tones when i recieve a sms?