A service based on a procedure to insert records in ESB
Hi all,
I have the following requirement:
I have a service that is based on a PL/SQL procedure that returns n number of records (pl/sql table type). I want to be able to pass the output of this service to another service based on a pl/sql procedure that will process them and insert them into various tables.
The problem is (I think) that any database adapter service based on a procedure is an outbound service- and, therefore, I can't define a route between the two.
Diagrammatically (sort of), what I want is:
{dbAdapterProducingRecords} -> {routingServiceInbound} -> {routingServiceOutbound} -> {dbAdapterInsertingRecords}
I would have thought that this would be a fairly normal scenario - maybe I'm just missing something blindingly obvious.
Any help would be greatly appreciated (and apologies if it is obvious).
Regards,
T.
Load balancing using pre-defined headers is supported. Not sure if load balancing using user defined fields is possible. You could refer to the following document.
http://www.cisco.com/univercd/cc/td/doc/product/webscale/css/css_710/bsccfggd/httphead.htm
We would appreciate it if someone could share their experience if they know more about this.
Similar Messages
-
Inserting records into a table with all caps
Hello
I have a procedure that inserts records into a table. How do I ensure that the text values inserted are recorded all capital letters into the table?
Thanks.You can use UPPER(..) function in your insert statement, so that values are converted to UPPER, before insert.
If you want to check at table level, you can achieve that by writting a before insert trigger and in that trigger check
IF UPPER(:new.<col>) != :new.<col> THEN
RAISE_APPLICATION_ERROR(-20101,'Error: Not all values are in upper case')
END IF; -
How to insert records into the Table?
Dear Sir,
I'm new to JDeveloper. Now I managed to create a Frame in JDeveloper with many Text fields and a button. In the back end, I have a procedure to insert records to a table, to which I pass the values of the fields as parameters. Now I'm not getting the steps to call the PL/SQL Stored procedure when I click on the button. I'm using Oracle 9i JDeveloper version 9.0.3.1. and Oracle 9i Database.
Please give me the complete steps to achieve my task - it is quite urgent.
Thanking You in advance.
Regards,
Senthil .A. Perumal.The JDBC tutorial will show you how to call a stored procedure from Java:
http://download-west.oracle.com/docs/cd/B10501_01/java.920/a96654/basic.htm
One more thing, why are you using such an old version of JDeveloper? any reason not to upgrade to the 10.1.3 version of JDeveloper?
Also you might want to look into ADF and how it makes these type of database interactions easier.
See this demo:
http://www.oracle.com/technology/obe/obe1013jdev/adf_swing/master_detail_page_adfswing_bc.htm -
Generating Web Service from PL/SLQL procedures using ODSI
1) Is there a way for us to generate REST based web services from PL/SQL procedures using Oracle data services Integrator? If Yes, Can you please point me to any available documentation
2) I am trying to create a phyiscal data source based on PL/SQL procedures in the hope of turning these data sources into web services. I created a JDBC connection in web logic server console and am trying to view the packages under APPS but ODSI always crashes after selecting APPS. Is there a way to resolve this?
Thanks
BhanuHi..
We came accross this problem a while back (I think it was us that the patch was created for). The patch was released under CR369707.
Additionally it took us a while to figure out how to use it correctly.. Here's the info for it from a mail i receievd from our support contact..
Here is more information from engineering on the patch:
This is patch for filtering Stored Procedures in the New Physical Data Service Wizard. It is a partial fix to the problem. It just does filtering - it still retrieves all the jdbc metadata for everything that matches the filter. Ideally, the wizard would let you explore the stored procedures - retrieving the name only - and once you selected a stored procedure, it would retrieve the argument types (which is the expensive part).
Copy these two files to a safe place
<bea_home>\<aldsp_home>\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.external_10.3.0\dsp-ide-ldshredder.jar
<bea_home>\<aldsp_home>\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.import_metadata_10.3.0.jar
Replace the files with the ones provided in the patch (which I sent you be eMail recently).
Creating Relational Database Physical Data Services -> Stored Procedures will be affected as follows :
The Search field used to represent a pattern for the stored procedures only, and this patterns were applied against every schema visible to ALDSP. The patch allows you to also specify a list of catalogue patterns (useful only when applicable), a list of schema patterns and a list of procedure name patterns. These lists are separated by the pipe symbol, and the lists themselves are command-separated. The catalogue and schema patterns are regular expressions, the procedure pattern is for a database 'like' clause. For, Oracle, the catalogue patterns are not applicable.
Example:
|ODM1,ODM2|B% // look in schemas containing the strings ODM1 or ODM2 for procedures that start with B
// possible results would be MY_ODM1.BUILDER, ODM2.BOTTOM
|^ODM$|B%D // look in the ODM schema for procedures that start with B and end with D.
Also - if there is a search string in the Search box, that search string will be applied to the schema when you click on the + to expand it in the Tree.
Note that once a schema has been 'explored' - either by a search, or by expanding it in the tree, further searches will not update it's children. You would need to quit the wizard and restart.
Once you get the patch if you have issues let me know.. -
Physical Data Service to Oracle Stored Procedure Package
i'm calling a package with the following signature:
PROCEDURE QUERY_ENTITY (
P_TABLE_NAME IN VARCHAR2,
P_ENTITY_ID IN NUMBER,
P_USER IN VARCHAR2,
P_RECORDSET OUT CNODB_ENTITY_PKG.C_ENTITY);
When defining the data source what to I type the OUT parameter as? My DBA tells me that it returns a reference cursor. I've randomly chosen quite a number of things which results in the error "Relational wrapper excpetion. could not find the corresponding sql type for output parameter P_RECORDSET.
Has anyone written a Physical DS that connects to Oracle Packages that return a refernce cursor rather than a specific data type?
Sorry, here's the full dump of the error:
com.bea.dsp.das.exception.DASException: weblogic.xml.query.exceptions.XQuerySagaException: {bea-err}UPD003: Update failure: mixed outcome, update error dispatched (updateid=SAGA_64f908a41cb48aeb:51ff32b4:1233d8ca55c:-7fdb): com.bea.dsp.wrappers.rdb.exceptions.RDBWrapperException: {bea-err}RDBW0000: Relational wrapper exception. could not find the corresponding sql type for output parameter P_RECORDSET
at com.bea.dsp.das.ejb.EJBClient.invokeOperation(EJBClient.java:160)
at com.bea.dsp.das.DataAccessServiceImpl.invokeOperation(DataAccessServiceImpl.java:171)
at com.bea.dsp.das.DataAccessServiceImpl.invoke(DataAccessServiceImpl.java:122)
at com.bea.dsp.ide.xquery.views.test.QueryExecutor.invokeFunctionOrProcedure(QueryExecutor.java:113)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.getFunctionExecutionResult(XQueryTestView.java:1041)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.executeFunction(XQueryTestView.java:1176)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedImpl(XQueryTestView.java:1866)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.access$300(XQueryTestView.java:174)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent$3.run(XQueryTestView.java:1594)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:67)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelectedBusy(XQueryTestView.java:1597)
at com.bea.dsp.ide.xquery.views.test.XQueryTestViewContent.widgetSelected(XQueryTestView.java:1560)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:938)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3687)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3298)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:106)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:169)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
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:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:508)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:447)
at org.eclipse.equinox.launcher.Main.run(Main.java:1173)
at org.eclipse.equinox.launcher.Main.eclipse_main(Main.java:1148)
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:597)
at com.m7.installer.util.NitroxMain$1.run(NitroxMain.java:33)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
Caused by: weblogic.xml.query.exceptions.XQuerySagaException: {bea-err}UPD003: Update failure: mixed outcome, update error dispatched (updateid=SAGA_64f908a41cb48aeb:51ff32b4:1233d8ca55c:-7fdb): com.bea.dsp.wrappers.rdb.exceptions.RDBWrapperException: {bea-err}RDBW0000: Relational wrapper exception. could not find the corresponding sql type for output parameter P_RECORDSET
at com.bea.ld.server.update.recovery.SagaRecovery.process(SagaRecovery.java:104)
at com.bea.ld.server.update.recovery.DSPSagaManager.processSagaFailure(DSPSagaManager.java:222)
at weblogic.xml.query.update.recovery.SagaState$2.afterCompletion(SagaState.java:87)
at weblogic.xml.query.transaction.TransactionManager.afterCompletion(TransactionManager.java:134)
at weblogic.transaction.internal.ServerSCInfo.doAfterCompletion(ServerSCInfo.java:1032)
at weblogic.transaction.internal.ServerSCInfo.callAfterCompletions(ServerSCInfo.java:1011)
at weblogic.transaction.internal.ServerTransactionImpl.callAfterCompletions(ServerTransactionImpl.java:2990)
at weblogic.transaction.internal.ServerTransactionImpl.afterRolledBackStateHousekeeping(ServerTransactionImpl.java:2871)
at weblogic.transaction.internal.ServerTransactionImpl.setRolledBack(ServerTransactionImpl.java:2847)
at weblogic.transaction.internal.ServerTransactionImpl.globalRetryRollback(ServerTransactionImpl.java:3087)
at weblogic.transaction.internal.ServerTransactionImpl.globalRollback(ServerTransactionImpl.java:2837)
at weblogic.transaction.internal.ServerTransactionImpl.internalRollback(ServerTransactionImpl.java:400)
at weblogic.transaction.internal.ServerTransactionImpl.rollback(ServerTransactionImpl.java:378)
at weblogic.xml.query.transaction.TransactionHelper.rollback(TransactionHelper.java:102)
at weblogic.xml.query.transaction.TransactionManager.teardownOnFailure(TransactionManager.java:264)
at com.bea.ld.EJBRequestHandler.handleThrowable(EJBRequestHandler.java:829)
at com.bea.ld.EJBRequestHandler.invokeOperation(EJBRequestHandler.java:326)
at com.bea.ld.ServerBean.executeOperationStreaming(ServerBean.java:84)
at com.bea.ld.Server_ydm4ie_EOImpl.executeOperationStreaming(Server_ydm4ie_EOImpl.java:426)
at com.bea.ld.Server_ydm4ie_EOImpl_WLSkel.invoke(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
Caused by: com.bea.dsp.wrappers.rdb.exceptions.RDBWrapperException: {bea-err}RDBW0000: Relational wrapper exception. could not find the corresponding sql type for output parameter P_RECORDSET
at com.bea.dsp.wrappers.rdb.exceptions.RDBWrapperException.create(RDBWrapperException.java:89)
at weblogic.xml.query.exceptions.XQueryException.create(XQueryException.java:127)
at weblogic.xml.query.exceptions.XQueryException.create(XQueryException.java:87)
at weblogic.xml.query.exceptions.XQueryException.create(XQueryException.java:151)
at weblogic.xml.query.exceptions.XQueryException.create(XQueryException.java:139)
at com.bea.dsp.wrappers.rdb.runtime.ProcedureCallableWrapper.prepareQuery(ProcedureCallableWrapper.java:272)
at com.bea.dsp.wrappers.rdb.runtime.ProcedureIterator.getNextToken(ProcedureIterator.java:175)
at com.bea.dsp.wrappers.rdb.runtime.ProcedureIterator.fetchNext(ProcedureIterator.java:125)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
at weblogic.xml.query.runtime.core.ExecutionWrapper.fetchNext(ExecutionWrapper.java:88)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:104)
at weblogic.xml.query.runtime.util.TokenBuffer.addAll(TokenBuffer.java:368)
at weblogic.xml.query.update.runtime.Interpreter$Frame.setValueUsingTemporary(Interpreter.java:429)
at weblogic.xml.query.update.runtime.Interpreter.processMSet(Interpreter.java:271)
at weblogic.xml.query.update.runtime.Interpreter.run(Interpreter.java:108)
at weblogic.xml.query.update.rewriting.UVMUtils$3.run(UVMUtils.java:130)
at weblogic.xml.query.update.recovery.SagaInterpreter.run(SagaInterpreter.java:41)
at weblogic.xml.query.update.runtime.UVMRewritingEvaluatorImpl.run(UVMRewritingEvaluatorImpl.java:32)
at weblogic.xml.query.xdbcimpl.XQSEStatementImpl.execute(XQSEStatementImpl.java:103)
at com.bea.ld.server.XQueryInvocation.execute(XQueryInvocation.java:752)
at com.bea.ld.EJBRequestHandler.invokeQueryInternal(EJBRequestHandler.java:624)
at com.bea.ld.EJBRequestHandler.invokeOperationInternal(EJBRequestHandler.java:478)
at com.bea.ld.EJBRequestHandler.invokeOperation(EJBRequestHandler.java:323)
... 12 more
Edited by: user10592709 on Aug 21, 2009 11:41 AMFirst (and somewhat unrelated) - how come the "update" errors? Aren't you just trying to read it? You should probably be using "function" instead of "procedure" in your dataservice. You should only be using procedure (XQSE) if you are updating. Not that this is related to your problem - it's just something you should know.
Now for the REF CURSOR. You need to figure out what columns are being returned, and then define a schema to match, then use that schema as the definition. If you are lucky, the REF CURSOR will actually be a cursor from selecting on a table. If that is the case, you can create a new physical data service based on that table - which will result in a schema being created with the same name as the table. Then create a new physical data service based on the stored procudure, the type of that parameter should appear as "Unknown". Edit the parameter types and specify the type in the schema that was generated for the table. -
Block based on Stored Procedures & Locking_Mode
Hello,
I'm creating a block in Forms 6.0.8 based on Stored Procedures. I'm using the example given in Metalink doc 52778.1. Updates to data work fine if locking_mode = 'Immediate'. If I set locking_mode to 'Delayed' and run the form, when I try to update and commit something, then the IF condition in lock-procedure (grp_lock) always returns TRUE and I run into the exception trapped there. It appears that Forms is passing NEW values in p_grp_data if locking_mode is Delayed and this is causing the problem. Is there any thing I could do in the form or procedure (preferably in the procedure) to solve this problem ? I'm trying to write procedures that will work with both Immediate and Delayed locking_modes
thanks in advance..
-- Table and package source:
-- GRP
create sequence grp_s
create table grp
id number constraint grp_pk primary key,
name varchar2(10) not null constraint grp_uk unique,
description varchar2(30) not null,
active varchar2(1) default 'Y'
create or replace trigger grp_bri before insert on grp for each row
begin
select grp_s.nextval
into :new.id
from dual ;
end ;
CREATE OR REPLACE PACKAGE grp_pkg AS
TYPE grpidrec IS RECORD( id grp.id%TYPE ) ;
TYPE grprec IS RECORD ( id grp.id%type, name grp.name%type, description grp.description%type, active grp.active%type ) ;
TYPE grp_cursor IS REF CURSOR RETURN grp%rowtype ;
TYPE grp_tab IS TABLE OF grp%rowtype INDEX BY BINARY_INTEGER ;
TYPE grp_id_tab IS TABLE OF grpidrec INDEX BY BINARY_INTEGER ;
PROCEDURE grp_refcur( p_grp_data IN OUT grp_cursor,
p_group_name IN grp.name%type ) ; -- use if a ref cursor is required
PROCEDURE grp_query( p_grp_data IN OUT grp_tab, p_group_name IN grp.name%TYPE ) ;
PROCEDURE grp_insert( p_grp_data IN grp_tab ) ;
PROCEDURE grp_update( p_grp_data IN grp_tab ) ;
PROCEDURE grp_delete( p_grp_data IN grp_id_tab ) ;
PROCEDURE grp_lock( p_grp_data IN grp_tab ) ;
END grp_pkg ;
sho err
create or replace package body grp_pkg as
-- ================================================================================
PROCEDURE grp_refcur( p_grp_data IN OUT grp_cursor, p_group_name IN grp.name%type ) AS
begin
open p_grp_data FOR select id, name, description, active
from grp
where name = nvl( p_group_name, name ) ;
end ;
-- ================================================================================
PROCEDURE grp_query( p_grp_data IN OUT grp_tab, p_group_name IN grp.name%TYPE ) AS
i number ;
CURSOR grp_select IS
SELECT id, name, description, active
FROM grp
WHERE name = nvl( p_group_name, name ) ;
begin
OPEN grp_select ;
i := 1 ;
LOOP
FETCH grp_select INTO p_grp_data(i).id, p_grp_data(i).name, p_grp_data(i).description, p_grp_data(i).active ;
EXIT WHEN grp_select%NOTFOUND ;
i := i + 1 ;
END LOOP ;
end ;
-- ================================================================================
PROCEDURE grp_insert( p_grp_data IN grp_tab ) AS
i NUMBER ;
begin
FOR i in p_grp_data.FIRST .. p_grp_data.LAST
LOOP
INSERT INTO grp( name, description, active )
VALUES ( p_grp_data(i).name, p_grp_data(i).description, p_grp_data(i).active ) ;
END LOOP ;
end ;
-- ================================================================================
PROCEDURE grp_update( p_grp_data in grp_tab ) AS
i binary_integer ;
rec_modified exception ;
BEGIN
FOR i in p_grp_data.first .. p_grp_data.last LOOP
UPDATE grp
SET name = p_grp_data(i).name,
description = p_grp_data(i).description,
active = p_grp_data(i).active
WHERE id = p_grp_data(i).id ;
if sql%rowcount = 0 then
raise rec_modified ;
else
-- success
null ;
end if ;
END LOOP ;
exception
when rec_modified then
raise_application_error(-20006, 'Record already modified' ) ;
when others then
raise_application_error(-20007, 'Other error : ' || sqlerrm ) ;
END ;
-- ================================================================================
PROCEDURE grp_delete( p_grp_data IN grp_id_tab ) AS
i BINARY_INTEGER ;
begin
FOR i IN p_grp_data.FIRST .. p_grp_data.LAST LOOP
DELETE FROM grp
WHERE name = p_grp_data(i).id ;
END LOOP ;
end grp_delete ;
-- ================================================================================
PROCEDURE grp_lock( p_grp_data IN grp_tab ) AS
i BINARY_INTEGER ;
grec grprec ;
err varchar2(255) ;
errcd number ;
rec_modified exception ;
begin
FOR i in p_grp_data.FIRST .. p_grp_data.LAST LOOP
begin
SELECT id, name, description, active
INTO grec
FROM grp
WHERE id = p_grp_data(i).id
FOR UPDATE OF description NOWAIT ;
-- this part returns true
-- if locking_mode = 'Delayed'
-- Forms is passing NEW values in p_grp_data if mode is Delayed
-- and OLD values if mode is Immediate
if ( grec.name != p_grp_data(i).name
OR grec.description != p_grp_data(i).description
OR grec.active != p_grp_data(i).active ) THEN
raise rec_modified ;
end if ;
exception
when no_data_found then
raise_application_error( -20007, 'Record deleted by another user' ) ;
when rec_modified then
raise_application_error(-20006, 'Record modified by another user' ) ;
when others then
raise_application_error(-20009, 'Others' ) ;
end ;
END LOOP ;
end ;
-- ================================================================================
end grp_pkg ;
show error package body grp_pkgYes, I was hoping to use these procedures to map the collection type returned to the database to the block data. I guess I was wrong. Except for the initial query and reading some other information from the database, I don't have to use these procedures as I do not write anything to it.
Thank you for your help, I will go on from there.
So, it means that I will have to iterate through my collection inside Forms and manipulate my data row by row. Or, is there a way to pass an Oracle collection type between the database and the Forms client and have it displayed without having to iterate through the rows and mapping each field?
adsm -
RAISING EXCEPTION AND SHOWING TO USERS IN FORM BASED ON STORED PROCEDURE
I have a form based on stored procedure.
I want to handle exceptions in the stored procedure and show it to users.
Here is what i want to do.
I have a sku# field in the form and i want to validate it(against the database
table) in the procedure before inserting into the database.
I want to give a message to users when the validation fails.
How is this possible with the forms based on stored procedure?
Can i use javascript to do the same?
Thanks in AdvanceI have a form based on stored procedure.
I want to handle exceptions in the stored procedure and show it to users.
Here is what i want to do.
I have a sku# field in the form and i want to validate it(against the database
table) in the procedure before inserting into the database.
I want to give a message to users when the validation fails.
How is this possible with the forms based on stored procedure?
Can i use javascript to do the same?
Thanks in Advance -
Procedure to insert data in multiple rows
Hi,
I need a stored procedure which inserts data into multiple rows..
Ex: I need to have 3 columns in Procedure, where col3 has limit in size let's say 500.
If user insert about 1500 in col3, i has to insert first 500 in row1 and 501 - 1000 in row 2 and 1001 - 1500 in row 3.
Can any one help in creating procedure for above scenario.
Thanks in Advance...
Sreecreate table #t (id int, id1 int)
WITH [1-20]
AS
SELECT row_number() over (order by number) rn,number
FROM master..spt_values
WHERE type = 'P'
AND number BETWEEN 1 AND 20
[21-30]
AS
SELECT row_number() over (order by number) rn,number
FROM master..spt_values
WHERE type = 'P'
AND number BETWEEN 21 AND 30
) INSERT INTO #t
SELECT A.number,B.number FROM
[1-20] A JOIN [21-30] B ON A.rn=B.rn
SELECT * FROM #t
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
How can i inserts record using procedure in adf
how can i insert record using procedure
hi i have the following i what to insert record using store procedure, i try this
am in JDeveloper Studio 11.1.2.1.0
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
xmlns="http://xmlns.oracle.com/bc4j"
Name="SmsPartyAddressView"
Version="11.1.2.60.81"
BindingStyle="OracleName"
CustomQuery="true"
PageIterMode="Full"
UseGlueCode="false"
RowClass="sms1100.SmsPartyAddressViewRowImpl"
ComponentClass="sms1100.SmsPartyAddressViewImpl"
DefClass="sms1100.SmsPartyAddressViewDefImpl"
RowInterface="sms1100.common.SmsPartyAddressViewRow"
ClientRowProxyName="sms1100.client.SmsPartyAddressViewRowClient">
<DesignTime>
<Attr Name="_isExpertMode" Value="true"/>
<Attr Name="_codeGenFlag2" Value="Access|Def|Coll|Prog|VarAccess"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<LABEL
ResId="sms1100.SmsPartyAddressView_LABEL"/>
</SchemaBasedProperties>
</Properties>
<ViewAccessor
Name="Sub_lov1"
ViewObjectName="sms1100.Sub_lov"
RowLevelBinds="true"/>
<ListBinding
Name="LOV_Town"
ListVOName="Sub_lov1"
ListRangeSize="-1"
ComboRowCountHint="10"
NullValueFlag="none"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="Town"/>
</AttrArray>
<AttrArray Name="DerivedAttrNames">
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="TowId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="Id"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="DsdRegion"/>
<Item Value="ServiceDeliveryArea"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<SQLQuery><![CDATA[SELECT
SmsPartyAddress.ADDRESS_LINE1,
SmsPartyAddress.ID,
SmsPartyAddress.ADDRESS_LINE2,
SmsPartyAddress.ADDRESS_LINE3,
SmsPartyAddress.ADDRESS_LINE4,
SmsPartyAddress.ADDRESS_TYPE_IND,
SmsPartyAddress.PAR_ID,
SmsPartyAddress.PROP_ID,
SmsPartyAddress.START_DT,
SmsProperties.ERF_NO,
SmsProperties.ADDRESS_LINE,
SmsProperties.ZONE,
SmsProperties.GPS_LONGITUDE,
SmsProperties.GPS_LATITUDE,
SmsProperties.TOW_ID,
SmsProperties.WAR_ID,
DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
TOW.TOWN SUBURB,
POSTAL_CODE
FROM SMS_PARTY_ADDRESS SmsPartyAddress,
SMS_PROPERTIES SmsProperties,
SMS_TOWNS TOW
,SMS_TOWNS TOW1
,SMS_POSTAL_CODES PCOD
WHERE TOW.PCOD_ID = PCOD.ID
AND TOW.TOW_ID = TOW1.ID (+)
--and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
and TOW.ID = SMSPROPERTIES.TOW_ID
and SMSPARTYADDRESS.PROP_ID = SMSPROPERTIES.ID
CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
<EntityUsage
Name="SmsPartyAddress"
Entity="sms1100.SmsPartyAddress"/>
<ViewAttribute
Name="AddressLine1"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE1"
Expression="ADDRESS_LINE1"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="Id"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="java.math.BigInteger"
ColumnType="NUMBER"
AliasName="ID"
Expression="ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="AddressLine2"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE2"
Expression="ADDRESS_LINE2"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine3"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE3"
Expression="ADDRESS_LINE3"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine4"
IsPersistent="false"
PrecisionRule="true"
Precision="50"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE4"
Expression="ADDRESS_LINE4"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="50"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressTypeInd"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="java.math.BigInteger"
ColumnType="NUMBER"
AliasName="ADDRESS_TYPE_IND"
Expression="ADDRESS_TYPE_IND"
SQLType="NUMERIC"/>
<ViewAttribute
Name="ParId"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="PAR_ID"
Expression="PAR_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="PropId"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="java.math.BigInteger"
ColumnType="NUMBER"
AliasName="PROP_ID"
Expression="PROP_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="StartDt"
IsPersistent="false"
PrecisionRule="true"
Type="java.sql.Timestamp"
ColumnType="DATE"
AliasName="START_DT"
Expression="START_DT"
SQLType="DATE"/>
<ViewAttribute
Name="ErfNo"
IsPersistent="false"
PrecisionRule="true"
Precision="80"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ERF_NO"
Expression="ERF_NO"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="80"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine"
IsPersistent="false"
PrecisionRule="true"
Precision="120"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE"
Expression="ADDRESS_LINE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="120"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="Zone"
IsPersistent="false"
PrecisionRule="true"
Precision="20"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ZONE"
Expression="ZONE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="20"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="GpsLongitude"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Precision="40"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="GPS_LONGITUDE"
Expression="GPS_LONGITUDE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="40"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="GpsLatitude"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Precision="40"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="GPS_LATITUDE"
Expression="GPS_LATITUDE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="40"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="TowId"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="java.math.BigInteger"
ColumnType="NUMBER"
AliasName="TOW_ID"
Expression="TOW_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="WarId"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Type="java.lang.Integer"
ColumnType="NUMBER"
AliasName="WAR_ID"
Expression="WAR_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="Town"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="TOWN"
Expression="TOWN"
SQLType="VARCHAR"
LOVName="LOV_Town">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="combo_lov"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="Suburb"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="SUBURB"
Expression="SUBURB"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="PostalCode"
IsPersistent="false"
PrecisionRule="true"
Precision="4"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="POSTAL_CODE"
Expression="POSTAL_CODE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="4"/>
</DesignTime>
</ViewAttribute>
<ResourceBundle>
<PropertiesBundle
PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
</ResourceBundle>
</ViewObject>my calling method is
public class SmsPartyAddressViewRowImpl extends ViewRowImpl implements SmsPartyAddressViewRow {
protected void callNewProperty(String stmt, Object[] bindVars) {
PreparedStatement st;
st = null;
try {
// 1. Create a JDBC PreparedStatement for
st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);
if (bindVars != null) {
// 2. Loop over values for the bind variables passed in, if any
for (int z = 0; z < bindVars.length; z++) {
// 3. Set the value of each bind variable in the statement
st.setObject(z + 1, bindVars[z]);
// 4. Execute the statement
st.executeUpdate();
} catch (SQLException e) {
throw new JboException(e);
} finally {
if (st != null) {
try {
// 5. Close the statement
st.close();
} catch (SQLException e) {
protected void callInsertProcedure(TransactionEvent e) {
// String Addressline = null;
String Zone = "UNDERF";
Date StartDt = null;
// EntityDefImpl SmsPropertiesDef = SmsPropertiesImpl.getDefinitionObject();
// SmsPropertiesImpl newSmsProperties = (SmsPropertiesImpl)SmsPropertiesDef.createInstance2(getDBTransaction(), null);
callNewProperty("Sms_Location.newProp(?,?,?,?,?,?,?,?,?,?,?,?)",
new Object[] { getParId(), getAddressTypeInd(), getAddressLine1(),
getAddressLine2(), getAddressLine3(), getAddressLine4(),getAddressLine(),getSuburb(),getTown(),getPostalCode(),getTowId(),Zone,StartDt });
Edited by: ADF007 on 2012/08/13 6:59 PMthat solution was based on the hr schema now am inserting using my schema
inserting record in a view using procedure
hi i have the folowing view, i what to insert record using procedure,this is what i what ,i what to insert record using the view but pass those view variable to procedure. my view is
<?xml version="1.0" encoding="windows-1252" ?>
<!DOCTYPE ViewObject SYSTEM "jbo_03_01.dtd">
<!---->
<ViewObject
xmlns="http://xmlns.oracle.com/bc4j"
Name="smsproppartyview"
Version="11.1.2.60.81"
BindingStyle="OracleName"
CustomQuery="true"
PageIterMode="Full"
UseGlueCode="false"
RowClass="sms1100.smsproppartyviewRowImpl"
ComponentClass="sms1100.smsproppartyviewImpl"
RowInterface="sms1100.common.smsproppartyviewRow"
ClientRowProxyName="sms1100.client.smsproppartyviewRowClient">
<DesignTime>
<Attr Name="_isExpertMode" Value="true"/>
<Attr Name="_codeGenFlag2" Value="Access|Coll|Prog|VarAccess"/>
<Attr Name="_isCodegen" Value="true"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<LABEL
ResId="sms1100.smsproppartyview_LABEL"/>
</SchemaBasedProperties>
</Properties>
<ViewAccessor
Name="Sub_lov1"
ViewObjectName="sms1100.Sub_lov"
RowLevelBinds="true"/>
<ListBinding
Name="LOV_Town"
ListVOName="Sub_lov1"
ListRangeSize="-1"
ComboRowCountHint="10"
NullValueFlag="none"
MRUCount="0">
<AttrArray Name="AttrNames">
<Item Value="Town"/>
</AttrArray>
<AttrArray Name="DerivedAttrNames">
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="TowId"/>
</AttrArray>
<AttrArray Name="ListAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="Id"/>
</AttrArray>
<AttrArray Name="ListDisplayAttrNames">
<Item Value="Town"/>
<Item Value="Suburb"/>
<Item Value="PostalCode"/>
<Item Value="DsdRegion"/>
<Item Value="ServiceDeliveryArea"/>
</AttrArray>
<DisplayCriteria/>
</ListBinding>
<SQLQuery><![CDATA[SELECT
SmsPartyAddress.ID,
SmsPartyAddress.ADDRESS_LINE2,
SmsPartyAddress.ADDRESS_LINE3,
SmsPartyAddress.ADDRESS_LINE4,
SmsPartyAddress.ADDRESS_LINE1,
SmsProperties.ADDRESS_LINE,
DECODE(TOW1.TOWN,NULL,TOW.TOWN,TOW1.TOWN)TOWN ,
TOW.TOWN SUBURB,
POSTAL_CODE,
SmsPartyAddress.PAR_ID,
SmsPartyAddress.PROP_ID,
SmsProperties.ID AS ID1,
SmsPartyAddress.ADDRESS_TYPE_IND,
SmsPartyAddress.START_DT,
SmsProperties.TOW_ID,
SmsProperties.ERF_NO,
SmsProperties.WAR_ID,
SmsProperties.ZONE
FROM SMS_PARTY_ADDRESS SmsPartyAddress, SMS_PROPERTIES SmsProperties,
SMS_TOWNS TOW
,SMS_TOWNS TOW1
,SMS_POSTAL_CODES PCOD
WHERE SmsPartyAddress.PROP_ID = SmsProperties.ID
and TOW.PCOD_ID = PCOD.ID
AND TOW.TOW_ID = TOW1.ID (+)
--and TOW1.ID = SMSPROPERTIES.TOW_ID(+)
and TOW.ID = SMSPROPERTIES.TOW_ID
and SmsPartyAddress.prop_id = SmsProperties.id
CONNECT BY PRIOR TOW.TOW_ID = TOW.ID]]></SQLQuery>
<ViewAttribute
Name="Id"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="ID"
SQLType="NUMERIC">
<RecalcCondition><![CDATA[true]]></RecalcCondition>
<TransientExpression><![CDATA[(new oracle.jbo.server.SequenceImpl("SMS_MAST1_SEQ",adf.object.getDBTransaction())).getSequenceNumber()]]></TransientExpression>
</ViewAttribute>
<ViewAttribute
Name="AddressLine2"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE2"
Expression="ADDRESS_LINE2"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine3"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE3"
Expression="ADDRESS_LINE3"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine4"
IsPersistent="false"
PrecisionRule="true"
Precision="50"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE4"
Expression="ADDRESS_LINE4"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="50"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine1"
IsPersistent="false"
PrecisionRule="true"
Precision="100"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE1"
Expression="ADDRESS_LINE1"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="100"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="AddressLine"
IsPersistent="false"
PrecisionRule="true"
Precision="120"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ADDRESS_LINE"
Expression="ADDRESS_LINE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="120"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="Town"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="TOWN"
Expression="TOWN"
SQLType="VARCHAR"
LOVName="LOV_Town">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
<Properties>
<SchemaBasedProperties>
<CONTROLTYPE
Value="combo_lov"/>
</SchemaBasedProperties>
</Properties>
</ViewAttribute>
<ViewAttribute
Name="Suburb"
IsPersistent="false"
PrecisionRule="true"
Precision="60"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="SUBURB"
Expression="SUBURB"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="60"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="PostalCode"
IsPersistent="false"
PrecisionRule="true"
Precision="4"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="POSTAL_CODE"
Expression="POSTAL_CODE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="4"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="ParId"
IsPersistent="false"
PrecisionRule="true"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="PAR_ID"
Expression="PAR_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="PropId"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="PROP_ID"
Expression="PROP_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="Id1"
IsUpdateable="false"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="ID1"
SQLType="NUMERIC">
<RecalcCondition><![CDATA[true]]></RecalcCondition>
<TransientExpression><![CDATA[(new oracle.jbo.server.SequenceImpl("SMS_MAST1_SEQ",adf.object.getDBTransaction())).getSequenceNumber()]]></TransientExpression>
</ViewAttribute>
<ViewAttribute
Name="AddressTypeInd"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="ADDRESS_TYPE_IND"
Expression="ADDRESS_TYPE_IND"
SQLType="NUMERIC"/>
<ViewAttribute
Name="StartDt"
IsPersistent="false"
PrecisionRule="true"
Type="java.sql.Timestamp"
ColumnType="DATE"
AliasName="START_DT"
SQLType="DATE">
<RecalcCondition><![CDATA[true]]></RecalcCondition>
<TransientExpression><![CDATA[adf.currentDate]]></TransientExpression>
</ViewAttribute>
<ViewAttribute
Name="TowId"
IsPersistent="false"
PrecisionRule="true"
Precision="38"
Scale="0"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="TOW_ID"
Expression="TOW_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="ErfNo"
IsPersistent="false"
PrecisionRule="true"
Precision="80"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ERF_NO"
Expression="ERF_NO"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="80"/>
</DesignTime>
</ViewAttribute>
<ViewAttribute
Name="WarId"
IsPersistent="false"
PrecisionRule="true"
Type="oracle.jbo.domain.Number"
ColumnType="NUMBER"
AliasName="WAR_ID"
Expression="WAR_ID"
SQLType="NUMERIC"/>
<ViewAttribute
Name="Zone"
IsPersistent="false"
PrecisionRule="true"
Precision="20"
Type="java.lang.String"
ColumnType="VARCHAR2"
AliasName="ZONE"
Expression="ZONE"
SQLType="VARCHAR">
<DesignTime>
<Attr Name="_DisplaySize" Value="20"/>
</DesignTime>
</ViewAttribute>
<ResourceBundle>
<PropertiesBundle
PropertiesFile="SmsFrontService.SmsFrontServiceBundle"/>
</ResourceBundle>
</ViewObject>this is what i have try
public class smsproppartyviewImpl extends ViewObjectImpl {
protected void callNewProperty(String stmt, Object[] bindVars) {
PreparedStatement st;
st = null;
try {
// 1. Create a JDBC PreparedStatement for
st = getDBTransaction().createPreparedStatement("begin " + stmt + ";end;", 0);
if (bindVars != null) {
// 2. Loop over values for the bind variables passed in, if any
for (int z = 0; z < bindVars.length; z++) {
// 3. Set the value of each bind variable in the statement
st.setObject(z + 1, bindVars[z]);
// 4. Execute the statement
st.executeUpdate();
} catch (SQLException e) {
throw new JboException(e);
} finally {
if (st != null) {
try {
// 5. Close the statement
st.close();
} catch (SQLException e) {
protected void callInsertProcedure(TransactionEvent e) {
String Addressline = null;
String Zone = "UNDERF";
String Town = null;
String Suburb = null;
String PostalCode = null;
String Addressline1 = null;
String Addressline2 = null;
String Addressline3 = null;
String Addressline4 = null;
Integer AddressTypeInd = null;
Integer parid = null;
//Date StartDt = null;
Integer towid = null;
ApplicationModuleHandle handle = null;
handle = Configuration.createRootApplicationModuleHandle
("sms1100.sms1100Moduleold", "sms1100ModuleShared");
ApplicationModule sam = handle.useApplicationModule();
sam.processChangeNotifications();
ViewObject svo = sam.findViewObject("smsproppartyview1");
svo.executeQuery();
Row row = svo.first();
if (svo != null){
Addressline = (String)row.getAttribute("AddressLine");
Zone = (String)row.getAttribute("Zone");
Town = (String)row.getAttribute("Town");
Suburb = (String)row.getAttribute("Suburb");
PostalCode = (String)row.getAttribute("PostalCode");
towid = (Integer)row.getAttribute("TowId");
Addressline1 = (String)row.getAttribute("Addressline1");
Addressline2 = (String)row.getAttribute("Addressline2");
Addressline3 = (String)row.getAttribute("Addressline3");
Addressline4 = (String)row.getAttribute("Addressline4");
AddressTypeInd = (Integer)row.getAttribute("AddressTypeInd");
parid = (Integer)row.getAttribute("ParId");
//EntityDefImpl SmsPropertiesDef = SmsPropertiesImpl.getDefinitionObject();
//SmsPropertiesImpl newSmsProperties = (SmsPropertiesImpl)SmsPropertiesDef.createInstance2(getDBTransaction(), null);
//newSmsProperties.setAddressLine(Addressline);
//newSmsProperties.setTowId(towid);
callNewProperty("Sms_Location.newProp(?,?,?,?,?,?,?,?,?,?,?,?)",
new Object[] { parid, AddressTypeInd, Addressline1,
Addressline2, Addressline3, Addressline4,Addressline,Town,Suburb,PostalCode,towid,Town,Suburb,PostalCode,towid,Zone });
}am in Jdeveloper 11.1.2.1.0 -
How to create a Service based on complex query
Hi,
I'm using JDev 11.1.2.2.0 for developing fusion based application based on EJB3.0 and JPA. I search on net and got a link for sample application as shown below:
http://www.oracle.com/webfolder/technetwork/tutorials/obe/jdev/obe11jdev/ps1/ejb/ejb.html#t2s1
But above application is based on "Entities based on Tables" but my requirement to build a service based on query which contains multiple tables which means I want to create a generic one...
please let me know what I need to change or please provide any link for docs.Hi Desmukh,
I want to create a wsdl for complex queries based on ADF fusion applicaiton using EJB3.0 and JPA...!
the link which you provided 'entity with tables' which is restricting for my requirement but I want similar implementation for complex queries :( -
PL/SQL procedure to insert data doesn't work and unable to find reason.
Sorry that I couldn't find the best place to post this question. It seems that the forum does not deal with this kind of question. I post here for help.
I have a stored procedure to insert data into one table. SP was compiled without error and executed without error (from log table to get information). But the data was not inserted into
the target table. I have tried different way to figure out the reason. But I failed to get any idea. Please help me to find possible reasons. The smple SP looks like this:
CREATE OR REPLACE PROCEDURE my.sp_insert( P_DATE IN VARCHAR2)
IS
declare section
begin
insert into target_table (column1, column2, column3, column4)
select record1, record2, record3, record4 from table1, table2, table3, table4
where clause;
commit;
exception section
UPDATE PROCESS_LOG_TABLE CLAUSE;
html_email section;
rollback;
end my.sp_insert
I have tested that "select record1, record2, record3, record4 from table1, table2, table3, table4" really fetch the 7,000 records. and if I only run part of SQL from SQLPLUS as
insert into target_table (column1, column2, column3, column4)
select record1, record2, record3, record4 from table1, table2, table3, table4
where clause;
It will work and insert 7,000 records into target table. Why did it not insert into target_table when execiting as stored procedure? Please help with your input. Thanks.
Edited by: citicbj on Feb 12, 2013 4:15 PMDear Friend,
Is the user from which you created database procedure and sqlplus that you tested the code successfully is same?
Regards
Ahamed Rafeeque Cherkala -
Return values for a Form based on a procedure
Hi,
I am fairly new to Portal Applications.
I have a form based on a procedure.
The procedure has an IN OUT parameter and what happens at the moment is that once the submit button is pressed the IN OUT parameter is displayed on a new page.
My question is...
How do I display the returned value in a field on the form?
Please help
ThanksHi,
This is how it works right now. It is not possible to show it in the same form.
Thanks,
Sharmila -
Creating web service from pl/sql procedure
Hello.
I need to create a web service from pl/sql procedure and i chose JDeveloper for this implementation. I have wsdl, but I never created web services. So, I created web service with document/literal message format.
But I have several troubles:
1. All element names have lower case letters.
2. The SOAP envelope must begin from words soapenv:Envelope but i have soap:Envelope.
3. And operation name has tail like "Element".
I know bad way for implement 1 and 3 points. It's a modification of java_wsdl_mapping.xml and wsdl files. But if I want to add new method to my service all changes will be cleaned. It's not critical but inconvenient to support.
But for point 3 i have no ideas.
This task is very important for me. Can somebody help me?
JDeveloper 10.1.3.3
Regards,
Alekseyhttp://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm
Frank -
New Window for Form called from a form based on a procedure
Hi
I have a form that is based on a procedure that asks for an employee number. The number is then passed to the procedure. The procedure then calls the next form passing in the employee number.
This works however I would like the form called from the procedure to open in a new window while still being able to pass in the employee number as a parameter.
Is there a way to do this? I have tried looking at wwa_app_module.new_instance & wwv_media.show_newwindow but I these only take the moduleid, I can't see how to pass in the employee number at the same time.
Any help would be appreciated.
Thanks
BelindaHi,
You can pass parameters like this
wwv_redirect.url('SJAYARAM_9042F.wwa_app_module.link?p_arg_names=_moduleid&p_arg_values=1060253649&p_arg_names=deptno&p_arg_values=10&p_arg_names=_deptno_cond&p_arg_values=%3d');
In this example the parameter deptno is passed with a value 10 and conditional operator '='
Hope that helps.
Thanks,
Sharmila -
How to autopopulate fields in a portal form based on database procedure?
Dear gurus, I am a newbie to the portal world and i have a rather unique problem. I have searched online but still cant find a solution to my problem. I have a portal form (AS version 10.1.4) based on a db procedure that accepts only one parameter. The form has about 12 fields, two of which are combo boxes. Because of the relationship b/n combo box 1 and combo box 2 and the rest of the form fields, the user has to start out by selecting a value in combo box 1. This auto populates combo box 2 (based on the previous selection). However, when the user selects a value from the populated combo box 2, this is supposed to trigger an action to query the database and retrieve values for the remainder of the form fields and populate them accordingly.
I tried to use p_session.get and set values but discovered that one cannot do this with form fields that are based on a procedure. I could write javascript to call a database procedure but i am not sure how to pass the return values from the database back to the javascript routine and then populate the remaining fields accordingly.
HELP ME PLEASE!!!
ThanksHi Venkat, create a section (section control) for each set of columns you want to hide/reveal. Put your columns in that section. Then set a rule on the dropdown so that if dropdown = "this" then show "this" section.
cameron rautmann
Maybe you are looking for
-
SetTimeout() not working on mobile devices
setTimeout() does not work on mobile devices ie. Safari on iOS 7.1.2 and Android 2.2. What is the alternative that works on mobile devices? Thank you.
-
PST Capture Tool does not populate my Office 365 mailboxes
Hi all, -I have installed PST capture on a win 7 64 bit machine with 64 bit office 2010 sp1. -I can successfully sign in to the online connection. -I have made sure that the account I am using to sign in is assigned organization management role. -do
-
When I go in to SYSTEM PREFERENCE and click on DESKTOP/SCREENSAVERS it says pictures loading but then I get that coloured circle and nothing else - I then have to force quit
-
What is a migrated document report.CVS?
establish_communication_SmartKey.htm,C:\temp\HP_WebRelease\setup\help\fr,C:\temp \HP_WebRelease\setup\help\fr....I found this in "a Migrated Document Report. CVS. Ant idea what it is and can I get rid of it?
-
How to define and use FMS in UDF?
Hello, I searched the forum and find the link: https://websmp103.sap-ag.de/~sapidb/011000358700004565932005E/How_To_DefindeAndUseFMS.pdf but I can't access this link. I think it's useful to me. can anyone send it to me? Thanks a lot.