ISeries Stored Procedure - How To
Good morning,
(I searched for iSeries (formerly called AS/400) stored procedures, but didn't get any hits. I'm thinking that calling an iSeries stored procedure will be a bit different from what's described in the threads I found, hence this thread. :-)
Our Apex environment connects to our iSeries but with Read Only rights. We retrieve a lot of iSeries data and do so via DB Links and SQL. We now have an Apex app that needs to create purchase orders in our iSeries PO system. Since we don't have update rights and won't be given update rights we are being asked to call a stored procedure on the iSeries to do this. That's cool, but I don't know how to go about doing so. :-)
Can anyone help get me started? If you've done this and have all the details that would be great. Or, if you just know from a high level how to go about it that would be helpful too. I can work out the details. In other words, any help is appreciated.
Thanks, Tony
Hi Mojib,
Please create a sample stored procedure like this which contains select statement and in communication channel give
wite stored procedure name only to sql query statment and in update statement write <test>.
I am executing this stored procedure successfully.
Create Proc GetResultX As
Begin
Select * From TESTX
End
Execute statement for stored procedure is :
Exec GetResultX
Regards
Laxmi Bhushan Jha
Rewards point if found usful
I have given same answer to one of the same thread
Similar Messages
-
Stored procedure : how to call SP in sender JDBC adapter for mysql
HI friends ,
we have JDBC---->XI--
>SAP scenario. For some business requirement, we have to call STORED PROCEDURE , please let me know how to call SP in sender JDBC adapter for mysql .
Thanks
mojibHi Mojib,
Please create a sample stored procedure like this which contains select statement and in communication channel give
wite stored procedure name only to sql query statment and in update statement write <test>.
I am executing this stored procedure successfully.
Create Proc GetResultX As
Begin
Select * From TESTX
End
Execute statement for stored procedure is :
Exec GetResultX
Regards
Laxmi Bhushan Jha
Rewards point if found usful
I have given same answer to one of the same thread -
Multi-Mapping - JDBC receiver - Multiple stored procedure - How to sequence?
Hi Folks,
We have 7.1 .Done multi-mapping , single source mapped to 5 different stored procedures.
The challenge we are facing here is , these stored procedure is not working sequentially .
i.,e for e.g., 2nd Stored Procedure should start only when first Stores procedure completely finished its turn.
But third procedure getting completed before1 st stored procedure completes .
Highly appreciate if any views on this ? How to sequence and make sure second will start only when first SP complete ?
-- ShivaHi ,
Thanks for your reply. all stored procedures are asynchronous one.
If we go for ccBPM , do we need to put wait step ?
- Here we dont know how much time each procedure takes to complete. Requirement is another procedure has to start only when the previous one completes.
--Shiva -
Stored procedure: how to return multline table
Environment: SQL Server 2008 R2, Windows
Tools: MSMS 2008 R2
Code:
CREATE PROCEDURE [dbo].[Cleanup]
(@id CHAR(12)
,@Date DATETIME
,@ID int OUT
,@Ln_ID CHAR(10) OUT
,@qcdate DATETIME OUT
,@P4 VARCHAR(8000)OUT
,@P9 VARCHAR(8000) OUT
,@P11 VARCHAR(8000) OUT
) WITH ENCRYPTION
AS
BEGIN
Update Table_mocha
SET P4=Replace(PE4,RTRIM(Cast(Q_ID as varchar(10))), '')
where id=@id and order_dt=@Date
Update Table_mocha
SET P4 = NullIf(P4,'')
where id=@id and order_dt=@Date
Update Table_mocha
SET P4=LTRIM(RTRIM(P4))
where id=@id and order_dt=@Date
SELECT @id=id, ln_id=@ln_id,@p4=p4, @p9=P9,@p11=P11
where id=@id and order_dt=@Date
Problem: having three updates would cause the database to lock. How would I pass input paramaters for those three updates in SP. How would I update multiple tables, how to avoid database lock, how to return multi-statment table - value (display
table contains multiple records)I prefer to use different stored procedures to do different things.
CREATE PROCEDURE [dbo].usp_updatedata
(@id CHAR(12)
,@Date DATETIME
AS
BEGIN
Update Table_mocha
SET P4=LTRIM(RTRIM(Nullif(Replace(PE4,RTRIM(Cast(Q_ID as varchar(10))), ''),'')))
where id=@id and order_dt=@Date
End
CREATE PROCEDURE [dbo].usp_getData
(@id CHAR(12)
,@Date DATETIME
AS
BEGIN
SET NOCOUNT ON;
SELECT id, ln_id,p4, P9,P11
where id=@id and order_dt=@Date
End -
Stored Procedures - How to store procedures?
Hi,
I would like to use this feature on the database, how do I achieve this?
What is a stored procedure? At the moment it is none. I will have to store this from somewhere. At the database design level?Reynold Dreamweaver CS6 wrote:
Could you elaborate what do you mean by "...the php mysql 'standard' extension anyway, which is the one supported by DW'. Why do they not work?
Hi
The 'standard' php:mysql extension is the one used by php to communicate with the database server, (it translates the php you/Dw writes for the database). Each type of php database extension offers different functionality, and PDO, (this is my opinion) is the best one, as it not only supports SP's, Transactions/Views, but different databases, (with additional extensions required for each database type).
The 'standard' php:mysql extension does not support any of these 'newer' features, and never will. If you visit the php site it well tell you that the old 'standard' extension should no longer be used as it has been deprecated, which means that it no longer being developed.
Unless you are reliant on Dw extensions then I would recommend that you learn OOP, with one of the newer database models, as these are the future of php and databases.
FIO: Yes, I do use OOP, PDO and SP's, Transactions in all of my database work now, and once learned these skills are much easier, (and more secure) to use than the old ones that you are currently learning.
I also wrote a 'learners' extension for PDO and the MySQL database and one to display SP's in Dw, a few years ago, but I have for various reason stopped development. The extensions are available at - http://www.pziecina.com/design/dreamweaver/pdo_extension.php
PZ -
Concept:
Every month i need to find the list of .rar files from the
E:/TempBackup directory from the different environments (remote desktop servers) and i need to delete the current month
.rar files alone from the respective (E:/TempBackup) directory. below is example files structure inside the
E:/TempBackup.
example:
zDROP_2014_08_31_Backups.rar
zDROP_2014_09_31_Backups.rar
zDROP_2014_10_31_Backups.rar
from the above list i need to delete the zDROP_2014_08_31_Backups.rar(current month) file alone and also logs should be capture for this deletion.
key words for this are zDROP and Current month and date.
i need a stored procedure for this concept. could you please help on this.Hello,
You can schedule an operating system task (Control Panel -> Schedule task) to either call a batch file or a PowerShell script.
Please read the following resources for examples:
http://social.technet.microsoft.com/Forums/windowsserver/en-US/61373719-fffb-4d94-bdbe-7d8ed8620b44/delete-filesfolders-on-remote-servers-using-powershell?forum=winserverpowershell
http://www.networknet.nl/apps/wp/archives/943
http://jeffwouters.nl/index.php/2011/10/powershell-script-to-delete-files-older-that-a-week/
Hope this helps.
Regards,
Alberto Morillo
SQLCoffee.com -
Check If Tables are being used in Stored Procedures & How many times !!
Dear All,
I want to make a script which can give me an answer, that If there is any table , then Whether It's using in any stored procedure or not ? If yes, then what the occurrence in procedures - means if table is "ABC" & Its being used in stored procedure
"XYZ" then i want to know that its using 1 time, 2 time or more in particular procedure ..
Pls Helpjust in-case if you want to get the Cross DB dependency
i have extent Visakh16 code
please use sql_modules to get the full definition of the DB Objects
you can replace stg_table with your decided table, also use dbname.schemaname.tablename if you want to get Cross DB dependency
just came up with this from
link
create table #temp (
dbname sysname,
name sysname,
Occurance int
exec sp_MSforeachdb '
use ?
DECLARE @TableName varchar(100)
SET @TableName = ''stg_table''
insert into #temp
SELECT db_name() ,name,(LEN(definition) - LEN(REPLACE(definition,'' '' + @TableName + '' '','''')))/LEN('' '' + @TableName + '' '') AS Occurance
FROM sys.sql_modules m
INNER JOIN sys.objects o
ON o.object_id = m.object_id
AND o.type = ''p''
WHERE m.definition LIKE ''% '' + @TableName + '' %'''
select *
from #temp
where dbname not in ('master','model','msdb','tempdb')
order by 1,2
Thanks
Saravana Kumar C -
How to pass arry in stored procedure
I want to pass an array thru a JDBC to a stored procedure
how can i pass a java variable string array to the store procedure using JDBC.
here is my package for array:
CREATE OR REPLACE PACKAGE TABLE_TYPES
AS
TYPE tString IS TABLE OF VARCHAR2(10) INDEX BY BINARY_INTEGER;
END;
here is my store procedure:
CREATE OR REPLACE PROCEDURE Declassification
(P_COMPANY_ID IN SECURITY.COMPANY_ID%TYPE,
P_SECURITY_NAME IN SECURITY.SECURITY_NAME%TYPE,
P_SECURITY_SYMBOL IN SECURITY.SECURITY_SYMBOL%TYPE,
P_CURRENCY IN SECURITY.CURRENCY%TYPE,
P_ISIN IN SECURITY.ISIN%TYPE,
P_LISTING_DATE IN VARCHAR2,
P_SECTOR IN SECURITY.SECTOR%TYPE,
P_INDUSTRY IN SECURITY.INDUSTRY%TYPE,
P_PAR_VALUE IN VARCHAR2,
P_PAR_VALUE_AS_OF IN VARCHAR2,
P_BOARDLOT IN VARCHAR2,
P_BOARDLOT_AS_OF IN VARCHAR2,
P_MARKET_PRICE IN VARCHAR2,
P_REQD_PUBLIC_OWN_PERC IN VARCHAR2,
P_STATUS IN SECURITY.STATUS%TYPE,
P_SECURITIES IN Table_Types.tString,
P_ID OUT SECURITY.SECURITY_ID%TYPE)
AS
P_SECURITY_ID SECURITY.SECURITY_ID%TYPE;
rec_count NUMBER;
BEGIN
SELECT COUNT(*)
INTO rec_count
FROM SECURITY;
IF rec_count > 0 THEN
SELECT MAX(TO_NUMBER(security_id)) + 1
INTO P_SECURITY_ID
FROM SECURITY;
ELSE
P_SECURITY_ID:=1;
END IF;
INSERT INTO SECURITY
VALUES(P_SECURITY_ID, P_COMPANY_ID, P_SECURITY_NAME, P_SECURITY_SYMBOL, 'COMMON',
P_CURRENCY, P_ISIN, TO_DATE(P_LISTING_DATE,'mm/dd/yyyy'), P_SECTOR, P_INDUSTRY, TO_NUMBER(P_PAR_VALUE),
TO_DATE(P_PAR_VALUE_AS_OF,'MM/DD/YYYY'), TO_NUMBER(P_BOARDLOT), TO_DATE(P_BOARDLOT_AS_OF,'MM/DD/YYYY'),
TO_NUMBER(P_MARKET_PRICE), TO_NUMBER(P_REQD_PUBLIC_OWN_PERC), P_STATUS);
INSERT INTO SECURITY_FINANCIAL(SECURITY_ID)
VALUES (P_SECURITY_ID);
INSERT INTO SECURITY_TOTAL(SECURITY_ID)
VALUES (P_SECURITY_ID);
COMMIT;
END Declassification;I want to pass an array thru a JDBC to a stored
procedure
how can i pass a java variable string array to the
store procedure using JDBC.
here is my package for array:
CREATE OR REPLACE PACKAGE TABLE_TYPES
AS
TYPE tString IS TABLE OF VARCHAR2(10) INDEX BY
Y BINARY_INTEGER;
END;
There are two ways to pass in Arrays to stored procedures in Oracle:
1. Define an Oracle TYPE outside a package and then use oracle.sql.ARRAY and oracle.sql.ArrayDescriptor to explain to the driver how the array is structured. This is what Avi has shown how to do.
2. You can also pass in INDEX BY arrays of VARCHAR2 or NUMBER, provided they are indexed by BINARY_INTEGER. This is what you appear to want. In order to do this you'll probably need the 10g JDBC driver and code that uses the 'setPlsqlIndexTable' method of 'OraclePreparedStatement' to bind your array.
Be careful about the values you pass into the 'setPlsqlIndexTable' method. You have to specify in advance how much data you expect to get back and how long each row is. The driver allocates memory based on these numbers. You code also needs to cope with arrays that have null elements.
I work for a company that makes a JDBC code generator. A list of common situations we've encountered when working with Index By tables can be found here:
http://www.orindasoft.com/public/PL-SQL%20Recordstwo.php4?siteloc=PL-SQL%20Recordstwo#probix
David Rolfe
Orinda Software
Dublin, Ireland
www.orindasoft.com
Orinda Software makes OrindaBuild, which writes JDBC calls for PL/SQL and SQL. -
How to find Stored Procedure in CLM
Hi All,
In some standard queries system is calling stored procedure, How to find these stored procedure in CLM?
I tried in setup but I am unable to find.
Thanks for help.
Regards,
PrabhatFor accessing any stored procedure, you would need direct access to the DB. Updates to the stored procedures can only be done at the DB level, not through the Sourcing UI.
Now, for your specific case, you could try changing the Detail Report parameter on the Master Agreement Search desktop channel to point to your report. This desktop channel can be accessed from Setup > Desktop Channels. I didnu2019t try it, so donu2019t know if this works but worth a shot.
Another option you could look into is, creating a custom report channel on the workbench and add your report to that channel. For example you could create a new workbench page with one wide column and add the report channel.
Regards,
Vikram -
How to compare two stored procedure
I have two oracle database and each database have stored procedure
How to compare two stored procedure?
What is the command to compare the stored procedure?select line, text
from user_source
where name='....'
minus
select line, text
from user_source
where name='....'
should do nicely.
Or: get the procedure text to a file using dbms_metadata.get_ddl (9i and higher) and run diff (Unix) or fc (Windhoze) on it.
You are a bit scarce on details.
Better still: implement source control.
Sybrand Bakker
Senior Oracle D.B.A. -
How to execute MYSQL stored procedure using java
Hello friend
I am very new to MYSQL stored procedure how to call external stored procedure , from where i got good tutorials about MYSQL stored procedure and JAVAIf you need help with MYSQL or stored procedures this is not the place. If you need help with JDBC:
http://java.sun.com/docs/books/tutorial/jdbc/basics/index.html -
Call a pl/sql stored procedure from a report link
Hello everyone:
I have a report with a link in a column, which takes you to another page and passes values to that page, but also need the link, run a stored procedure before going to the other page.
In the Forum I found cases similar to this, but none of the examples is clear to me how I do this. It seems that the target of the link should be URL, and also I have to call the stored procedure with a javascript function.
My questions are:
- Is this the best method to make what I need?
- How should be the syntax of the link that takes me to another page and run the "stored procedure"
- How and where I put the function "javascript" to run the "stored procedure"
BDD: Oracle 11 g
Apex version 4.1
Best regards
GerardHi,
Change the link to call an apex.submit process. (javascript).
Edit:
I've set up a basic example.
Region 1 (just so you can see the value getting set):
select :P27_HIDDEN item_Value
from dual
Region 2:
select rownum id, dbms_random.string('U', 12) sss
from dual
connect by level <= 20
item attributes for ID:
Target: URL
URL: javascript:apex.submit({request:'NAVIGATE', set:{'P27_HIDDEN':#ID#}});
(P27_HIDDEN is just a hidden item i created)
http://apex.oracle.com/pls/apex/f?p=54920:27
Edit2:
In your case, then you can just have a page process based on conditions request = expression1, expression1: NAVIGATE..... then a page branch to go to the desired page, also with the same conditions
Edit3:
Im not sure what examples you are referring to , as you didn't supply any links; but you mention calling the stored procedure from javascript, so would likely involve some AJAX, but imo not necessary. -
Can JPA invoke a stored procedure with a cursor type output parameter?
i use JPA ,i hope get a result set by a stored procedure ,
how to solve it ?thank you!i try to do,but i get a ClassCastException
below is the sesion ejb :
@PersistenceContext(unitName = "Model")
private EntityManager em;
((oracle.toplink.ejb.cmp3.EntityManager)em).getActiveSession().executeQuery(query);
i am getting the following ClassCastException:
07/05/24 15:49:40 [110] DCBindingContainer.reportException :oracle.jbo.JboException
07/05/24 15:49:40 [111] oracle.jbo.JboException: JBO-29000: java.lang.ClassCastException: com.evermind.server.ejb.persistence.EntityManagerProxy; nested exception is: java.lang.ClassCastException: com.evermind.server.ejb.persistence.EntityManagerProxy
at oracle.adf.model.binding.DCInvokeMethod.invokeMethod(DCInvokeMethod.java:533)
at oracle.adf.model.binding.DCDataControl.invokeMethod(DCDataControl.java:1795)
at oracle.adf.model.generic.DCGenericDataControl.invokeMethod(DCGenericDataControl.java:248)
at oracle.adf.model.binding.DCInvokeMethod.callMethod(DCInvokeMethod.java:219)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1289)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:1802)
at oracle.adf.model.generic.DCGenericDataControl.invokeOperation(DCGenericDataControl.java:266)
at oracle.adf.model.adapter.AdapterDCService.invokeOperation(AdapterDCService.java:305)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:627)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:378)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:128)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:89)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:146)
at oracle.adf.view.faces.component.UIXComponentBase.__broadcast(UIXComponentBase.java:1087)
at oracle.adf.view.faces.component.UIXCommand.broadcast(UIXCommand.java:204)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:287)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:401)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:95)
at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:245)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:110)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:213)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:64)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:15)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._invokeDoFilter(AdfFacesFilterImpl.java:228)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl._doFilterImpl(AdfFacesFilterImpl.java:197)
at oracle.adfinternal.view.faces.webapp.AdfFacesFilterImpl.doFilter(AdfFacesFilterImpl.java:123)
at oracle.adf.view.faces.webapp.AdfFacesFilter.doFilter(AdfFacesFilter.java:103)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:162)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:17)
at com.zspost.xin.view.filter.RequestEncodingFilter.doFilter(RequestEncodingFilter.java:45)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:620)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:369)
at com.evermind.server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:865)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:447)
at com.evermind.server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:215)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:117)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:110)
at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260)
at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239)
at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34)
at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:303)
at java.lang.Thread.run(Thread.java:595)
null -
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.
-
Hyperion Shared Services always running stored procedure in sqlserver2005
Hi,
I installed a hyperion shared services with sqlserver 2005, and created a ssis data feed job oon that server. When I run this ssis job in sqlserver, it works slowly. I traced the slqserver and find there is a hyperion account always running some stored procedures. how to solve it?
thanksI'm still plagued by this 'symptom/feature'. Is there any workaround?
Maybe you are looking for
-
Adobe Reader X is not responding while dr.eye 9
Symptom: OS is windows 7 with sp1 + Adobe Reader X 10.0.1version + Dr.eye 9.0. When Adobe Reader X - ("Enabled protected mode" by default) and Dr.eye 9 (Install Translation is enabled) are on , they will cause Adobe Reader X error while directly open
-
SCEP 2012 Exchange 2013 Exclusions
Hi, I am in need of assistance sorting out the exclusions for Exchange 2013 for SCEP. The problem is that SCEP seems to not like %ExchangeInstallPath% littered all over the article https://technet.microsoft.com/en-us/library/bb332342(v=exchg.150).asp
-
Hi, I'm not sure if this is the correct place for this topic but I have a 80 GB Black Classic and was wondering how to make a audio book to add to my iPod. I have several audio books on CD that have numerous chapters in them. Is there some type of co
-
Flash cs5 interface freeze! please help!
Hello, recently where i job the IT Guys was installed new package CS5, im just use Flash because im a programmer. The problem its present when with somes flas and sometimes... when i try to edit objects in a scene (movies, box text, any symbol) its l
-
Droid X Multi Touch Keypad jamming
I'm having a problem with my keypad while in Google Talk, Text Messaging, and Gmail. When I try to type, the characters do not appear in the text window, and when I hit the space bar, the keypad resets. The messages are still there and able to be s