By specifying the Composite primary key (columns 4 and 5)
Hi all
I am new to Oracle Apex,
I have a few paintings with a composite primary key (4 or 5 columns)... When I try to create a primary key constraint, it gives me only 3 columns!
Any help please in how can I solve this problem?
Thanks in advance
You are probably using the workshop for this sql Object Explorer
which seems to be limited to 4 columns on APEX 4.2.3
best thing to do is to create manually using the sql commands in sql workshop, here's an example:
{code}
CREATE UNIQUE INDEX myui ON JC_ACCOUNT
(TITLE_ID, FAMILY_NAME GIVEN_NAME, GENDER_ID, TELEPHONE_NUMBER)
/
{code}
I hope this helps you
KR
Martin
Tags: Database
Similar Questions
-
A composite primary key column cannot be null
Hi all
It will be a silly question, but still, I would like to ask if a composite primary key column can be null?
Thank you
Rafi.Rafi,
Why you think he would be allowed?
SQL> drop table test purge; drop table test purge * ERROR at line 1: ORA-00942: table or view does not exist SQL> create table test as select * from dba_objects; Table created. SQL> alter table test add primary key(object_id, owner); Table altered. SQL> insert into test(object_id, owner) values(null, 'aman'); insert into test(object_id, owner) values(null, 'aman') * ERROR at line 1: ORA-01400: cannot insert NULL into ("SYS"."TEST"."OBJECT_ID") SQL> insert into test(object_id, owner) values(1,null); insert into test(object_id, owner) values(1,null) * ERROR at line 1: ORA-01400: cannot insert NULL into ("SYS"."TEST"."OWNER") SQL>
HTH
Aman... -
How to create validation of business for a composite primary key
Hi all
I am newbie in oracle ADF and my knowledge is lacking in the validation of the company,
My requirement is to display an error message when the user enter the same data into the table.
Let me exaggerate I have a table which the composite primary key is defined on 2 columns, if the user does not have the composite primary key constraints, so I have to display the warning message.
FYI, I use the version of Jdeveloper 11.1.2.3.0
Please let me know the steps to create business for this rule.
Thank you very much!!
User, if you use adfbc, you have nothing to do because this behavior out of the box. When you create a model of your tables infrastructure creates the business rule for you.
Timo
-
How to find the primary key columns in the tables in MS Access using SQL queries
How to find the primary key columns in the tables in MS Access using SQL queries
Hello
This is the forum for Windows Vista programs related issues.
For better assistance, please try instead the Forums in SQL Server .
Thank you! Vincenzo Di Russo - Microsoft MVP Windows Internet Explorer, Windows Desktop Experience & security - since 2003. ~ ~ ~ My MVP profile: https://mvp.support.microsoft.com/profile/Vincenzo
-
Hello
I have a page with adf faces table, I need to pass values to the table to another the inputfields page (both fields are composite primary keys), I'm passing values but I get the error while I'm passing values twice on the next page with a button command (using setPropertyListener) this error... Please help me?
Houston-29114 ADFContext is not configured to process this exception messages. Use the code of exception stack trace and error to investigate the root cause of this exception. Root cause error code is Houston-25013. Error messages settings are {0 = oracle.jbo.Key [22 9]}
ADF_FACES-60097: for more information, see the error log of the server for an entry beginning with: ADF_FACES - Exception during the PPR, #1 60096:Server
The error log is...
URL - target http://127.0.0.1:7101/Recruting-ViewController-context-root/faces/login.JSPX
< ViewHandlerImpl > < _checkTimestamp > Apache Trinidad runs with control of activated timestamp. This should not be used in a production environment. See the org.apache.myfaces.trinidad.CHECK_FILE_MODIFICATION property in WEB-INF/web.xml
< UIXEditableValue > < _isBeanValidationAvailable > Validation Bean A provider is not present, so bean validation is disabled
passing the user name: 201157
< _LogUnhandledException > ADF_FACES - 60098:Faces life cycle receives exceptions that are unhandled in phase 5 of INVOKE_APPLICATION
oracle.jbo.TooManyObjectsException: Houston-25013: too many objects correspond to the oracle.jbo.Key [22 primary key 9].
at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:608)
at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:617)
at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1030)
at oracle.jbo.server.EntityCache.add(EntityCache.java:541)
at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1141)
at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1140)
at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:461)
at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:478)
at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5800)
at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1941)
at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2504)
at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2545)
at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2510)
at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11133)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1342)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
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.sun.el.parser.AstValue.invoke (unknown Source)
at com.sun.el.MethodExpressionImpl.invoke (unknown Source)
at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:173)
at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:163)
at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1091)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:982)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:880)
at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:553)
at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:158)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:115)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:84)
at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:50)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
< RegistrationConfigurator > < handleError > ADF_FACES - 60096:Server Exception during the PPR, #1
oracle.jbo.TooManyObjectsException: Houston-29114 ADFContext is not configured to process this exception messages. Use the code of exception stack trace and error to investigate the root cause of this exception. Root cause error code is Houston-25013. Error messages settings are {0 = oracle.jbo.Key [22 9]}
at oracle.jbo.server.EntityCache.throwTooManyObjectsException(EntityCache.java:608)
at oracle.jbo.server.EntityCache.handleDuplicateKey(EntityCache.java:617)
at oracle.jbo.server.EntityCache.addForAltKey(EntityCache.java:1030)
at oracle.jbo.server.EntityCache.add(EntityCache.java:541)
at oracle.jbo.server.EntityImpl.callCreate(EntityImpl.java:1141)
at oracle.jbo.server.ViewRowStorage.create(ViewRowStorage.java:1140)
at oracle.jbo.server.ViewRowImpl.create(ViewRowImpl.java:461)
at oracle.jbo.server.ViewRowImpl.callCreate(ViewRowImpl.java:478)
at oracle.jbo.server.ViewObjectImpl.createInstance(ViewObjectImpl.java:5800)
at oracle.jbo.server.QueryCollection.createRowWithEntities(QueryCollection.java:1941)
at oracle.jbo.server.ViewRowSetImpl.createRowWithEntities(ViewRowSetImpl.java:2504)
at oracle.jbo.server.ViewRowSetImpl.doCreateAndInitRow(ViewRowSetImpl.java:2545)
at oracle.jbo.server.ViewRowSetImpl.createAndInitRow(ViewRowSetImpl.java:2510)
at oracle.jbo.server.ViewObjectImpl.createAndInitRow(ViewObjectImpl.java:11133)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.doIt(JUCtrlActionBinding.java:1342)
at oracle.adf.model.binding.DCDataControl.invokeOperation(DCDataControl.java:2169)
at oracle.jbo.uicli.binding.JUCtrlActionBinding.invoke(JUCtrlActionBinding.java:731)
at oracle.adf.controller.v2.lifecycle.PageLifecycleImpl.executeEvent(PageLifecycleImpl.java:402)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding._execute(FacesCtrlActionBinding.java:252)
at oracle.adfinternal.view.faces.model.binding.FacesCtrlActionBinding.execute(FacesCtrlActionBinding.java:210)
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.sun.el.parser.AstValue.invoke (unknown Source)
at com.sun.el.MethodExpressionImpl.invoke (unknown Source)
at oracle.adf.controller.internal.util.ELInterfaceImpl.invokeMethod(ELInterfaceImpl.java:173)
at oracle.adfinternal.controller.activity.MethodCallActivityLogic.execute(MethodCallActivityLogic.java:163)
at oracle.adfinternal.controller.engine.ControlFlowEngine.executeActivity(ControlFlowEngine.java:1091)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:982)
at oracle.adfinternal.controller.engine.ControlFlowEngine.doRouting(ControlFlowEngine.java:880)
at oracle.adfinternal.controller.engine.ControlFlowEngine.routeFromActivity(ControlFlowEngine.java:553)
at oracle.adfinternal.controller.engine.ControlFlowEngine.performControlFlow(ControlFlowEngine.java:158)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleAdfcNavigation(NavigationHandlerImpl.java:115)
at oracle.adfinternal.controller.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:84)
at org.apache.myfaces.trinidadinternal.application.NavigationHandlerImpl.handleNavigation(NavigationHandlerImpl.java:50)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:190)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:159)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:1137)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:361)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:202)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:508)
to weblogic.servlet.internal.StubSecurityHelper$ ServletServiceAction.run (StubSecurityHelper.java:227)
at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
to org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$ FilterListChain.doFilter (TrinidadFilterImpl.java:468)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to oracle.security.jps.ee.http.JpsAbsFilter$ 1.run(JpsAbsFilter.java:119)
at java.security.AccessController.doPrivileged (Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.wrapRun (WebAppServletContext.java:3715)
to weblogic.servlet.internal.WebAppServletContext$ ServletInvocationAction.run (WebAppServletContext.java:3681)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
Hi all, finally I found the solution to this exception.
I did the following steps to solve the problem.
1. create a bean and use this method
public void tooManyObjectsMatchExceptioHandeler() {}
Add the code in the event here...
System.out.println ("inside the Handeler");
FacesMessage message =
new FacesMessage ("Type your friendly message");
message.setSeverity (FacesMessage.SEVERITY_ERROR);
FacesContext fc = FacesContext.getCurrentInstance ();
fc.addMessage (null, message);
}
Now, drag and drop the file above java projects in data controls in the browser of the application.
2. drag a workflow method call (where u get exception as Houston-25013) and call this method as an activity of the exception handler,
Now, do a right click on this--> definition of the page method call create or go to definition of the page--> create a link Action method and select the above method in the select and file def page this method call in the workflow then go to properties inspector set out fixed property (here name of activities of method call) u give.
-
How to refer to the primary key column of newly inserted rows of tabular form
Hello
I use APEX 4.2.0.00.27 with Oracle DB 11.2.0.3.0.
I work with a tabular presentation wizard-created for insert and update a table using the integrated SRM process (sequence 10). I'm trying to use a process of anonymous block of PL/SQL (sequence 30) to make another manipulation of table after the records were inserted or updated. The manual process is associated with my tabular form and I use the variables of name of column binding in my program block.
My (rsn_test) table has 3 columns: test_id (number), test_nbr (number), test_id2 (number). Test_id column is identified as the primary key and the type of the source already exists a sequence rsn_test_seq. Column test_id2 gets its default value 0 to a hidden page element.
I would use my manual process for updating the value of the test_id2 column. If it's 0 then I want to put the value of the column test_id. If it is any other value, then it must remain at this value. My logic works very well for an existing line, but I'm running into a problem with the newly added lines. The new lines get inserted, but the test_id2 column remains the default value 0. I can tell the debugger that the SRM process is triggered first and inserts the line, then my manual dealing with fires. The problem seems to be that the connection variable: TEST_ID for the primary key column remains NULL after insertion. I don't know how to get the value of the column test_id of my newly created line to use in my PL/SQL block to my update.
Process of PL/SQL:
DECLARE BEGIN :P7_SHOW := NULL; :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999); IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN UPDATE rsn_test SET test_id2 = :TEST_ID WHERE test_id = :TEST_ID; ELSE :TEST_ID2 := :TEST_ID2; END IF; END;
Excerpt from the debugger:
0.01625 0.00010 Processes - point: ON_SUBMIT_BEFORE_COMPUTATION 0.01635 0.00008 Branch point: Before Computation 0.01643 0.00003 Process point: AFTER_SUBMIT 0.01646 0.00022 Tabs: Perform Branching for Tab Requests 0.01668 0.00008 Branch point: Before Validation 0.01676 0.00024 Validations: 0.01700 0.00135 Perform basic and predefined validations: 0.01835 0.00020 Perform custom validations: 0.01855 0.00049 ...Validation "TEST_NBR must be numeric" - Type: ITEM_IS_NUMERIC 0.01904 0.00007 ......Skip for row 1 because row hasn't changed 0.01911 0.00016 ......Skip for row 2 because row hasn't changed 0.01927 0.00012 ...Validation "TEST_ID2 must be numeric" - Type: ITEM_IS_NUMERIC 0.01939 0.00007 ......Skip for row 1 because row hasn't changed 0.01945 0.00018 ......Skip for row 2 because row hasn't changed 0.01964 0.00005 Branch point: Before Processing 0.01968 0.00004 Processes - point: AFTER_SUBMIT 0.01972 0.00588 ...Process "ApplyMRU" - Type: MULTI_ROW_UPDATE 0.02560 0.00154 ...Execute Statement: declare function x return varchar2 is begin begin for c1 in ( select "RSN_TEST_SEQ".nextval pk from sys.dual ) loop return c1.pk; end loop; end; return null; end; begin wwv_flow.g_value := x; end; 0.02714 0.00140 ......Row 3: insert into "APPPCSRSN"."RSN_TEST" ( "TEST_ID", "TEST_NBR", "TEST_ID2") values ( :b1, :b2, :b3) 0.02854 0.00011 ...Process "ApplyMRD" - Type: MULTI_ROW_DELETE 0.02865 0.00004 ......Skip because condition or authorization evaluates to FALSE 0.02869 0.00015 ...Process "Process Submit" - Type: PLSQL 0.02884 0.00007 ......Skip for row 1 because row hasn't changed 0.02891 0.00012 ......Skip for row 2 because row hasn't changed 0.02903 0.00012 ......Process row 3 0.02915 0.00429 ...Execute Statement: begin DECLARE BEGIN :P7_SHOW := NULL; :P7_SHOW := NVL(:TEST_ID2,555) || ' and ' || NVL(:TEST_ID,787) || ' and ' || NVL(:TEST_NBR,9999); IF :TEST_ID2 = 0 AND :TEST_ID IS NOT NULL THEN UPDATE rsn_test SET test_id2 = :TEST_NBR WHERE test_id = :TEST_ID; ELSE :TEST_ID2 := :TEST_ID2; END IF; END; end; 0.03344 0.00013 ...Session State: Saved Item "P7_SHOW" New Value="0 and 787 and 1300" 0.03356 0.00004 Branch point: After Processing 0.03360 0.00048 ...Evaluating Branch: "AFTER_PROCESSING" Type: REDIRECT_URL Button: (No Button Pressed) Condition: (Unconditional) 0.03407 0.00013 Redirecting to f?p=290:7:8717971109610:::::&success_msg=0%20row(s)%20updated%2C%201%20row(s)%20inserted.Success%2FEBD244168556408CBA714E3974918C09%2F 0.03420 0.00012 Stop APEX Engine detected 0.03432 0.00007 Stop APEX Engine detected 0.03439 - Final commit
Any suggestions?
I have run tests on
https://apex.Oracle.com/pls/apex/f?p=83488:1 demo/demo
to see your problem.
I have 2 solution for your problem.
I add trial NOT tabular just usual block of PL/SQLBEGIN I'm IN (SELECT TEST_ID FROM RSN_TEST WHERE TEST_ID2 = 0) LOOP UPDATE RSN_TEST SET test_id2 = TEST_ID WHERE test_id = i.TEST_ID; END LOOP; END; and works very well, you can see in the sample.
The other solution is to show new generated TEST_ID
Adding a sequence as a default value for a column in a table field
And to execute your procedure.
I get how is with the good luck of time.
By
-
Diagram of all the tables list of primary key column names
Hi people,
I have a Scott user for example, I want to retrieve all tables primary key column names in the user Scott.
can someone help me please.
Thanks in advance,
karmayaYou can log in to SCOTT and try this
select c.constraint_name , cc.table_name , cc.column_name from user_constraints c join user_cons_columns cc on c.constraint_name = cc.constraint_name where c.constraint_type = 'P';
-
How to convert a single column in the primary key column
Hi all
I have a column that's unique cnstraint, this column contains the value as digital and also null.
So how do you convert to primary key column
Concerning
PrashantPrashant wrote:
Hi allI have a column that's unique cnstraint, this column contains the value as digital and also null.
So how do you convert to primary key column
Concerning
PrashantPrashant,
You must assign new values to null values. You can use a sequence to produce the figures in this column.
Select max (your_unique_column) from your_table; -find the maximum value of this column, so you can start the sequence of this number.
create sequence seq_for_your_table with XXXX - value max + 1 you have found
Update your_table set your_unique_column = seq_for_your_table.nextval () where your_unique_column is null
You can create a primary key on this column.
Best regards
Grosbois
-------------------------------------------------------
If you answer this question, please mark appropriate as correct/useful messages and the thread as closed. Thank you -
How can I update the primary key column
Hello
Can you suggest me best workaround/algorithm for task below:
(Oracle 10g, Solaris OS.)
Location:
Table a primary key column P 'Code', tables children F1, F2,..., reference to F15 "Code_P' foreign key column"P.Code"column, and we do not know which of the child tables data available for a particular value"P.Code.
Task:
Change the value "P.Code" from 100 to 200. So that the result would be that record P [Code = 100] should be updated:
And child tables 'Code_P' column should be updated as:update P set Code = 200 where Code = 100;
The best solution would be that you can easily repeat this task.update F1, F2, .., F15 set P_code = 200 where P_code = 100;
Edited by: CharlesRoos the 28.12.2010 12:10Will there be FK constraints in place?
If so, you may need to modify them so that their application may be temporarily deferred.The gameplan would be something like this:
-Making of CF can be deferred, immediate departure.
-Alter FK set delay.
-Update of Parent table.
-Update of the children tables.
-Immediate constraints set
s ' engage; -
change a composite primary key
HelloI have a table that has a composite primary key with 3 columns (col1, col2, col3)
Now I need to change the primary key (col1, col2, col4) remove composite col3 replace with col4
col1 col2 COL3 COL4 col5 1 one x p DFD 1 one There p DFD 1 one z p SD 1 one m p amplifier 1 one n p Try There are thousands of records in the table in the format above. How to make this change?
Thank you.
In this case, you will need to establish that if the change to the primary key makes sense - if so, you'll have to remove some lines to remove duplicates. I think that if this requirement has been raised at a request of the company, they will (should) have indicated what lines need to be maintained.
If it is not sensible, you will need to go to the one who asked for the change and get them to change their mind or tell you what to do with duplicate lines.
Out of curiosity, why did you change the primary key?
-
identification of composite primary keys
Hi mates,
I am trying to identify a unique value in a particular table, so then I tried to look for the primary key of the table constraints:
11:54:07 brunos@vvp > select constraint_name, constraint_type, index_name, owner of dba_constraints where table_name = 'CARD_TRANSACTIONS ';
OWNER CONSTRAINT_NAME, CONSTRAINT_TYPE INDEX_NAME
------------------------------ ------------------------------ --------------- ------------------------------
VVP PK_CARD_TRANSACTIONS P PK_CARD_TRANSACTIONS
Then I looked at dba_cons_columns:
11:56:22 brunos@vvp > select * from dba_cons_columns where constraint_name = "PK_CARD_TRANSACTIONS";
OWNER CONSTRAINT_NAME TABLE_NAME COLUMN_NAME POSITION
------------------------------ ------------------------------ ------------------------------ --------------------------------------------------
VVP PK_CARD_TRANSACTIONS CARD_TRANSACTIONS CARD 4
VVP PK_CARD_TRANSACTIONS CARD_TRANSACTIONS METER 3
VVP PK_CARD_TRANSACTIONS CARD_TRANSACTIONS 2 OPERATION
VVP PK_CARD_TRANSACTIONS CARD_TRANSACTIONS STATE 1
I understand that in a single table, we have only 1 PK only. It is a composite primary key? I expected to see 1 single value, and then he showed me 4.
Thanks in advance.
Published by: BSalesRashid on 06/29/2012 07:58It is a Composite key, you can see the column in position to observe order in the Composite key.
Rgds,
Ahmer
Published by: Ahmer Mansoor on June 29, 2012 20:02
-
How to use a Select list on a second primary key column in a tabular presentation?
Hello
I created a tabular presentation located on the details page of the user (form), that allows to manage roles for this user.
The shape of table contains 3 elements:
-> a checkbox
-> user (PK) column is hidden, and its default value is generated by a function pl/sql (to submit the time), which refers to the element to username.
-> the role of the column is displayed as a named select list LOV: add you a line, choose a role, submit, etc..
But my ROLES table (not created by me...) contains 2 columns: USER and GRANTED_ROLE.
The USER is the primary key, but a user can have multiple roles (= one line per role).
GRANTED_ROLE is the second primary key, so that we can differentiate between one line of another.
At the moment my tabular form has only one primary key (USER), so the GRANTED_ROLE can display as a list select.
But, for this reason, in my opinion, remove the button do not work: all the lines of the user have the same key, so when I select a few lines to remove these, all lines in the form of tables are deleted.
I don't know how my button Delete could recognize the subkey to remove only selected rows...
Or maybe I should use a different type of region?
Thanks for your help!
FannyIn the process of ApplyMRD, try to specify the 'secondary key' column in the section "Source: Multi line Update and Delete"to the second column key in tabular form.»
I have not tested this with your situation, but worth it.
-
assign a Composite primary key
Hi all
I have the table with composite primary key (ID, year)
I want to assign the value using triggers and sequence
the number will start from 1 and current year to the end of the year and start again next year
How can I do this
Best regardsHello
mkm802 wrote:
Dear FrankHow can please I use the ROW_NUMBER for this
You have not posted the CREATE TABLE and INSERT statements for examples of data, so I'll use scott.emp:
SELECT ename , deptno , EXTRACT (YEAR FROM hiredate) AS year , hiredate , ROW_NUMBER () OVER ( PARTITION BY deptno , EXTRACT (YEAR FROM hiredate) ORDER BY hiredate ) AS r_num FROM scott.emp ORDER BY deptno , hiredate ;
Output:
ENAME DEPTNO YEAR HIREDATE R_NUM ---------- ---------- ---------- ----------- ---------- CLARK 10 1981 09-Jun-1981 1 KING 10 1981 17-Nov-1981 2 MILLER 10 1982 23-Jan-1982 1 SMITH 20 1980 17-Dec-1980 1 JONES 20 1981 02-Apr-1981 1 FORD 20 1981 03-Dec-1981 2 SCOTT 20 1987 19-Apr-1987 1 ADAMS 20 1987 23-May-1987 2 ALLEN 30 1981 20-Feb-1981 1 WARD 30 1981 22-Feb-1981 2 BLAKE 30 1981 01-May-1981 3 TURNER 30 1981 08-Sep-1981 4 MARTIN 30 1981 28-Sep-1981 5 JAMES 30 1981 03-Dec-1981 6
-
Hi all
I need mapping composite primary key to foreign key.
Example:
first create LOCATION_MASTER table with composite primary key,
CREATE TABLE LOCATION_MASTER (LOC_CITYCODE VARCHAR2 (10))
LOC_CITY VARCHAR2 (30),
CONSTRAINT ANN_LOCMAS_PK PRIMARY KEY (LOC_CITYCODE, LOC_CITY)
);
Then create the route_master table. In the table route_master source_city, destination_city maps to loc_city
CREATE TABLE ROUTE_MASTER (ROUTE_ID NUMBER (3),)
SOURCE_CITY VARCHAR2 (30),
DESTINATION_CITY VARCHAR2 (30),
CONSTRAINT ANN_INPK PRIMARY KEY (ROUTE_ID).
CONSTRAINT ANN_INFK FOREIGN KEY (SOURCE_CITY, DESTINATION_CITY)
REFERENCES LOCATION_MASTER (LOC_CITY)
);
If I create like that, then I got error...
The samething is my need. So please fix the code that I have attached.
Please do what is necessary...
Thank you
AnnCONSTRAINT ANN_LOCMAS_PK PRIMARY KEY (LOC_CITYCODE, LOC_CITY)
CONSTRAINT ANN_INFK FOREIGN KEY (SOURCE_CITY, DESTINATION_CITY)
REFERENCES LOCATION_MASTER (LOC_CITY)It is not possible to refer to the part of the parent key. In your case, you must create a separate unique constraint on LOCATION_MASTER. LOC_CITY and then to establish referential constraints of ROUTE_MASTER. SOURCE_CITY and ROUTE_MASTER. DESTINATION_CITY individually i.e. two different referential constraints.
-
Composite primary key (reverse)
Hello
I created a table with composite primary key
for example: -.
create table demo (NUMBER one, NUMBER two, the key pk_composite primary (one, two);)
Insert into demo values (1,2);
1 row inserted
Insert into demo values (1,2);
ORA-00001: unique constraint (username. PK_composite) violated
its ok...........................
I know composite primary will not work reverse (i.e.)
Select * from demo;
one | two
1. 2
Insert into demo values (2,1);
1 row inserted
Select * from demo;
one | two
1. 2
2. 1
I need to do reverse, is it possible to make? (i.e.)
Insert into demo values (2,1); -This should not
Please help me... Thanks in advance...A quick way to do this is to create a unique index based on a function like this:
create unique index demo_i1 on demo (least(one,two) ,greatest(one,two));
Maybe you are looking for
-
MacBook Air overheating all using Skype
When I use Skype, for some reason my macbook air gets very hot and the fan is non-stop. So I checked the activity monitor, and it seems that Skype uses 70% more than my CPU, which is not normal. I ran a virus and malware scan, everything is clean. My
-
Expansion of the RAM from 512 to 1024 MB. Much better?
HelloI want to enhancen the standard memory of this tecra M2 from 512 to 1024: who gives such a faster computer or gain is not that value?Thanks in advance
-
compatibility issue with my HP Officejet 6600 printer and my Samsung laptop
I have a problem for my printer HP Officejet 6600 to be compatible with my new laptop. The laptop is a Samsung with Windows 8.1 and when I try to configure the printer with it, the printer says that I have Windows Vista, Windows 7 or Windows xp with
-
You will need to create some interactive checklist. Any suggestions on how to approach? Maybe the substitution documents? Captivate is perhaps not best solution? I am open and curious. Thank you!
-
I want to cancel the service of illustrator that I bought for a month. Not it keeps me.