Is this statement correctly Deleting row-by-row
Before i delete a parent table, i want to delete the child table. The parent table's primary key is a composite key having 3 columns.
So i need a DELETE like the following
DELETE FROM Child_Table1
where
pkCol1,pkCol2,pkCol3=(SELECT pkCol1, pkCol2,pkCol3 FROM Parent_table WHERE curr_trk_code=40);Since the above Statement is not valid I am thinking of changing it to
DELETE FROM Child_Table1
where
pkCol1 in (SELECT pkCol1 FROM Parent_table WHERE curr_trk_code=40)
and
pkCol2 in (SELECT pkCol2 FROM Parent_table WHERE curr_trk_code=40)
and
pkCol3 in ((SELECT pkCol3 FROM Parent_table WHERE curr_trk_code=40);Is this DELETE correctly deleting each row in Child_Table1 based on the Composite Primary key of the parent table?
This post is related to
Purging records from table with Child tables
Edited by: M.Everett on Nov 14, 2008 1:10 AM
Edited by: M.Everett on Nov 14, 2008 1:14 AM
Does it not work like this...
DELETE FROM Child_Table1
where
(pkCol1,pkCol2,pkCol3)=(SELECT pkCol1, pkCol2,pkCol3 FROM Parent_table WHERE curr_trk_code=40);i.e. include brackets around your first 3 comparison columns
Similar Messages
-
Is this statement correct?------------QNo.101
Is this statement correct?
"You can use a resource plan instead of a consumer group to implement a priority within the plan."To enable flashback database mode, the db needs to be in archivelog mode first.
The other part of this is when you actually use this functionality, both flashback logs and archive/redo logs are used. As always the basics are spelled out in the docu set:
"When a database is restored to its state at some past target time using Flashback Database, each block changed since that time is restored from the copy of the block in the flashback logs most immediately prior to the desired target time. The redo log is then used to re-apply changes since the time that block was copied to the flashback logs."
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/rpfbdb001.htm -
Is this statement correct?----QNo.125
Is this statement correct?Why?
"During flashback database recovery, archive logs are applied to database."
If no aechive log, Can flashback database work?
Thank you!
Message was edited by:
frank.qianTo enable flashback database mode, the db needs to be in archivelog mode first.
The other part of this is when you actually use this functionality, both flashback logs and archive/redo logs are used. As always the basics are spelled out in the docu set:
"When a database is restored to its state at some past target time using Flashback Database, each block changed since that time is restored from the copy of the block in the flashback logs most immediately prior to the desired target time. The redo log is then used to re-apply changes since the time that block was copied to the flashback logs."
http://download.oracle.com/docs/cd/B19306_01/backup.102/b14192/rpfbdb001.htm -
Is this statement correct?
hi guys
String employee_name=request.getParameter("employee_name");
String queryText = "insert into sshl_account_application (employee_name)values('" + request.getParameter('employee_name')");hi guys
String
employee_name=request.getParameter("employee_name");
String queryText = "insert into
sshl_account_application (employee_name)values('" +
request.getParameter('employee_name')");Please format your code for better reading. Take a look at Formatting Help when you post something.
String queryText = "insert into
sshl_account_application (employee_name)values('" +
request.getParameter('employee_name')"); That is some kinda wrong.
try this.
String queryText = "insert into
sshl_account_application (employee_name)values( ' " +
request.getParameter(\"employee_name\") + " ')";you just have messed up with the "'s...
good luck
... -
[Help]Grid (Add row - Delete row)
Hi experts. Just want to ask how can I add row and delete row in Grid?
And how can I get the data from the specific row so I can Save the data in my table.
Please help.Hi hikaru1207 ,
this code for delete row from Matrix :
Matrix oMatrix_cat = (Matrix)form.Items.Item("mtx_cat").Specific;
Delete Row -
for (int i = 2; i <= oMatrix_cat .rowcount; i++)
oEditText = (EditText)oMatrix.Columns.Item(colname).Cells.Item(i).Specific;
oMatrix.DeleteRow(i);
if (form.Mode == BoFormMode.fm_ADD_MODE)
if (oMatrix.RowCount == 0)
DBDataSource oDBDataSource = form.DataSources.DBDataSources.Item(table name);
oDBDataSource.Clear();
oMatrix_cat .FlushToDataSource();
Add row----
if (oMatrix_cat.RowCount == 0)
oMatrix_cat.AddRow(1, 1);
oDBDataSource_cat.InsertRecord(oDBDataSource_cat.Size);
else
oDBDataSource_cat.InsertRecord(oDBDataSource_cat.Size - 1);
oDBDataSource_cat.SetValue("LineId", oDBDataSource_cat.Size - 1, "");
oDBDataSource_cat.SetValue("U_SKU", oDBDataSource_cat.Size - 1, "");
oDBDataSource_cat.SetValue("U_CatId", oDBDataSource_cat.Size - 1, "");
oMatrix_cat.LoadFromDataSource();
oDBDataSource_cat = null;
please reply ......
yhanks
surajit -
My add/delete row function is unselectable. How do I fix this?
For no reason that I can guess I am unable to add or delete rows. That little circle icon with the two horizontal dashes is gone and when I click on a numbered row the 'add/delete row' choices are grayed out, unelectable. My spreadsheet needs are VERY basic so I'm at a loss for what has happened because I've been using this file. It WAS working like it should, but now it's not and I don't know if I clicked something OFF or what. I am not new to a Mac, so I'm not a newbie with this stuff. Any ideas??????
Try deactivating any filter you have set on the table.
SG -
I have a CORD_LOB_MAPPING table which has a line_of_business as a column
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
D2>DESC CORD_LOB_MAPPING
Name Null? Type
LINE_OF_BUSINESS NOT NULL VARCHAR2(10)
LOB_DESCRIPTION VARCHAR2(100)
LOB_SID NOT NULL VARCHAR2(10)
D2>SELECT LINE_OF_BUSINESS FROM CORD_LOB_MAPPING;
LINE_OF_BU
OPNRCH
OPNWLD
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
I have the following 3 tables:
I want to delete rows from all the 3 tables depending on the follwoing rule.
In all the 3 tables i want to retain those rows whose data is present in CORD_LOB_MAPPING's line_of_business column
All those rows which do not corrospond to the line_of_business in CORD_LOB_MAPPING should be deleted.
For example, in the example given below, i am deleteing all rows from TMP_CORD_OUCS whose line_of_business
does not match with CORD_LOB_MAPPING line_of_business.
In other words, delete all rows which do not belong to OPNRCH and OPNWLD
DELETE FROM TMP_CORD_OUCS TCO
WHERE NOT EXISTS ( SELECT 1 FROM CORD_LOB_MAPPING CLM
WHERE UPPER(TCO.LINE_OF_BUSINESS) = UPPER(CLM.LINE_OF_BUSINESS));
D2>DESC tmp_cord_oucs
Name Null? Type
OUC_CODE VARCHAR2(9)
LATEST_PERIOD NUMBER(10)
OUC_PROCESS_FLAG VARCHAR2(1)
LINE_OF_BUSINESS VARCHAR2(10)
I want to know the delete statement for this table?
Delete all those rows from tmp_cord_rate_ids whose line_of_business is anything except OPNRCH and OPNWLD
DELETE FROM TMP_CORD_RATE_IDS TCRI
WHERE NOT EXISTS (SELECT 1
FROM TMP_CORD_OUCS TCO, CORD_LOB_MAPPING CLM
WHERE TCO.LINE_OF_BUSINESS=CLM.LINE_OF_BUSINESS
AND TCRI.OUC_CODE=TCO.OUC_CODE)
D2>DESC tmp_cord_rate_ids
Name Null? Type
OUC_CODE VARCHAR2(9)
RATE_ID VARCHAR2(5)
RATEID_PROCESS_FLAG VARCHAR2(1)
I want to know the delete statement for this table?
Delete all those rows from tmp_cord_rates whose line_of_business is anything except OPNRCH and OPNWLD
D2>DESC TMP_CORD_RATES
Name Null? Type
RATE_ID VARCHAR2(5)
RATE NUMBER(13,4)
RATE_PROCESS_FLAG VARCHAR2(1)Hi folks,
I will explain again.
I have a table
D2>DESC CORD_LOB_MAPPING
Name Null? Type
LINE_OF_BUSINESS NOT NULL VARCHAR2(10)
LOB_DESCRIPTION VARCHAR2(100)
LOB_SID NOT NULL VARCHAR2(10)
I have a column in cord_lob_mapping as line_of_business.
Now i want to delete rows from all the following 3 tables whose rows do not match up with line_of_business of cord_lob_mapping.
D2>DESC tmp_cord_rates
Name Null? Type
RATE_ID VARCHAR2(5)
RATE NUMBER(13,4)
RATE_PROCESS_FLAG VARCHAR2(1)
D2>DESC tmp_cord_rate_ids
Name Null? Type
OUC_CODE VARCHAR2(9)
RATE_ID VARCHAR2(5)
RATEID_PROCESS_FLAG VARCHAR2(1)
D2>DESC tmp_cord_oucs
Name Null? Type
OUC_CODE VARCHAR2(9)
LATEST_PERIOD NUMBER(10)
OUC_PROCESS_FLAG VARCHAR2(1)
LINE_OF_BUSINESS VARCHAR2(10)
Suppose the cord_lob_mapping table has the following rows in line_of_business
column
Line_of_business
world
universe
Now all rows from tmp_cord_oucs whose line_of_business is not world or universe should be deleted.
Simillarly, all corrosponding rates from tmp_cord_rates and rate_ids from tmp_cord_rate_ids should also be deleted whose line_of_business is not world or universe.
I have included the delete statements for each of the 3 tables. Could anyone of you please verify them to be correct.
delete from tmp_cord_rates tcr
where not exists(select 1
from cord_lob_mapping clm, tmp_cord_oucs tco, tmp_cord_rate_ids tcri where clm.line_of_business=tco.lob_mapping
and tco.ouc_code=tcri.ouc_code
and tcri.rate_id=tcr.rate_id);
delete from tmp_cord_rate_ids tcri
where not exists(select 1
from cord_lob_mapping clm, tmp_cord_oucs tco
where clm.line_of_business=tco.lob_mapping
and tco.ouc_code=tcri.ouc_code);
delete from tmp_cord_oucs tco
where not exists(select 1
from cord_lob_mapping clm
where clm.line_of_business=tco.lob_mapping); -
Microsoft Visual Basic 2010 Express.
I am new to Visual Basic programing and i am trying to understand the relationships between Datasets, database, table Adaptors. I have to following code that is is giving me the following error" Unable to load, Update requires a valid DeleteCommand
when passed DataRow collection with deleted rows".
I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
It seems that i can delete the data on the DataGridView Table and it only displays the correct data. but my database is not updating, even though the data grid displays differently.I can determine this because, when i save the offset database, i have all
the previous uploads and all the rows that i wanted to delete are still there.
My final goal is to be able to import offset data from a CSV file, save this data on the pc, send a copy of this data to a NuermicUpDown so the customer can modify certain numbers. From here they download all the date to a controller. IF the customer
needs to modify the imported data, they can go to a tab with a data grid view and modify the table. They will also have to option to save the modified data into a csv file.
Im not sure if i am making this overcomplicated or if there is a easier way to program this.
CODE:
Private Function LoadOffSetData()
Dim LoadOffsetDialog As New OpenFileDialog 'create a new open file dialog and setup its parameters
LoadOffsetDialog.DefaultExt = "csv"
LoadOffsetDialog.Filter = "csv|*.csv"
LoadOffsetDialog.Title = "Load Offset Data"
LoadOffsetDialog.FileName = "RollCoaterOffset.csv"
If LoadOffsetDialog.ShowDialog() = Windows.Forms.DialogResult.OK Then 'show the dialog and if the result is ok then
Try
Dim myStream As New System.IO.StreamReader(LoadOffsetDialog.OpenFile) 'try to open the file with a stream reader
If (myStream IsNot Nothing) Then 'if the file is valid
For Each oldRow As MaterionOffsetDataSet.OffsetTableRow In MaterionOffsetDataSet.OffsetTable.Rows
oldRow.Delete()
'delete all of the existing rows
Next
'OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
Dim rowvalue As String
Dim cellvalue(25) As String
'Reading CSV file content
While myStream.Peek() <> -1
Dim NRow As MaterionOffsetDataSet.OffsetTableRow
rowvalue = myStream.ReadLine()
cellvalue = rowvalue.Split(","c) 'check what is ur separator
NRow = MaterionOffsetDataSet.OffsetTable.Rows.Add(cellvalue)
Me.OffsetTableTableAdapter.Update(NRow)
End While
Me.OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)
MainOffset.Value = OffsetTableTableAdapter.MainOffsetValue 'saves all the table offsets
to the offset numericUpDown registers in the main window
StationOffset01.Value = OffsetTableTableAdapter.Station01Value
StationOffset02.Value = OffsetTableTableAdapter.Station02Value
myStream.Close() 'close the stream
Return True
Else 'if we were not able to open the file then
MsgBox("Unable to load, check file name and location") 'let the operator know that the file wasn't able to open
Return False
End If
Catch ex As Exception
MsgBox("Unable to load, " + ex.Message)
Return False
End Try
Else
Return False
End If
End FunctionHello SaulMTZ,
>>I can track the error and its located in "OffsetTableTableAdapter.Update(MaterionOffsetDataSet.OffsetTable)" code. What am i missing?
This error usually shows that you do not initialize the
DeleteCommand object, you could check this
article to see if you get a workaround.
>> Im not sure if i am making this overcomplicated or if there is a easier way to program this.
If you are working CSV file, you could use OleDB to read it which would treat the CSV file as a Table:
http://www.codeproject.com/Articles/27802/Using-OleDb-to-Import-Text-Files-tab-CSV-custom
which seems to be easier (in my opinion).
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Right way to delete row before insert
I create a new row with method of ViewObject.
Row row = viewObject.createRow();Then I want to delete this row. I found there are 4 methods. Which is the right answer?
//1.
row.remove();
//2.
row.refresh(Row.REFRESH_REMOVE_NEW_ROWS);
//3.
row.refresh(Row.REFRESH_FORGET_NEW_ROWS);
//4.
row.removeFromCollection();Thanks,Timo, we're having a problem when deleting as you describe, maybe you can offer some advice?
We have a button to delete a row from an editable table, this is set to immediate=true (obviously the user should be able to skip validation when doing a delete). After deleting, if the user then clicks another button to add a new row, the values from the deleted row show in the new row :(
If we set immediate=false this seems to fix the problem, but we then get the undesirable side effect that the user has to make sure all the values in the row are correct before it can be deleted (because the validation is firing). The user experience becomes a bit strange. -
Getting error while deleting rows from the database using the View Object
Hi All,
I am using jdev 11.1.1.4.0. I am removing the rows from the database using viewobject( quering the viewobject to find the records i want to delete).
I am using vo.removeCurrentRow(0). Before this statement I am able to get the rows I want to delete.
after that i am doing am.transaction.commit(). But I am getting the error..
javax.faces.el.EvaluationException: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
at org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:58)
at org.apache.myfaces.trinidad.component.UIXComponentBase.broadcastToMethodBinding(UIXComponentBase.java:1256)
at org.apache.myfaces.trinidad.component.UIXCommand.broadcast(UIXCommand.java:183)
at oracle.adf.view.rich.component.fragment.UIXRegion.broadcast(UIXRegion.java:148)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:102)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent$1.run(ContextSwitchingComponent.java:92)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent._processPhase(ContextSwitchingComponent.java:361)
at oracle.adf.view.rich.component.fragment.ContextSwitchingComponent.broadcast(ContextSwitchingComponent.java:96)
at oracle.adf.view.rich.component.fragment.UIXInclude.broadcast(UIXInclude.java:96)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.broadcastEvents(LifecycleImpl.java:879)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:312)
at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:185)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at 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:205)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:106)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:446)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:271)
at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:177)
at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.adf.library.webapp.LibraryFilter.doFilter(LibraryFilter.java:175)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:111)
at java.security.AccessController.doPrivileged(Native Method)
at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:313)
at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:413)
at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:94)
at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:161)
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:136)
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)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
at 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:207)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:176)
Caused by: oracle.jbo.DMLException: JBO-26080: Error while selecting entity for CriteriaEO
at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:1117)
at oracle.jbo.server.BaseSQLBuilderImpl.doEntitySelect(BaseSQLBuilderImpl.java:553)
at oracle.jbo.server.EntityImpl.doSelect(EntityImpl.java:8134)
at oracle.jbo.server.EntityImpl.lock(EntityImpl.java:5863)
at oracle.jbo.server.EntityImpl.beforePost(EntityImpl.java:6369)
at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:6551)
at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:3275)
at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:3078)
at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:2088)
at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:2369)
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 org.apache.myfaces.trinidadinternal.taglib.util.MethodExpressionMethodBinding.invoke(MethodExpressionMethodBinding.java:53)
... 53 more
Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:457)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:405)
at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:889)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:476)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:204)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:540)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:217)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:924)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1261)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1419)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3752)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3806)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1667)
at oracle.jbo.server.OracleSQLBuilderImpl.doEntitySelectForAltKey(OracleSQLBuilderImpl.java:869)
Please give suggestions...
Thanks
KanikaHi,
First Run Application module and confirm whether model project is OK,Cause for the Error is Caused by: java.sql.SQLSyntaxErrorException: ORA-00972: identifier is too long
check:
Issues with table/column name length
identifier is too long
I guess following error occurred because above issue
JBO-26080: DMLException
Cause: An unexpected exception occurred while executing the SQL to fetch data for an entity instance or lock it.
Action: Fix the cause for the SQLException in the details of this exception.
See:
http://download.oracle.com/docs/cd/A97337_01/ias102_otn/buslog.102/bc4j/jboerrormessages.html#26080Hope you will helpful -
Add row / delete row in PDF Form
Alright so I am really struggling here and no one has been able to provide me a solid answer to date.
1. I am creating a PDF form I want users to be able to fill and remit via email
2. I have created the form in Acrobat 9 Pro via the form Wizard and in some combination with MS Word 2007 for text and table fields to get the forms wizard to auto-populate Adobe form fields.
3. Some of the tables, i.e. In the first table for "Full Time" and "Part Time" should have check boxes - works fine to date. While others should have drop downs, i.e. platform build, etc - works fine to date.
4. This is the pressing issue. As they exist today there is a large table as you can clearly see. I want users to be able to simply click an "Add Row" or "Delete Row" button to add another row to the table (or delete) without having to have a massive table.
I've watched demos on Lynda.com (all of which are irrelevant and provided 0 value), tried to work with what people have responded with previously but all are mainly sample documents and I don't know where to start. In short, I open my form and other forms in LifeCycle Designer ES, take a look at the buttons people have created, the scripts, the XML source, etc. but no idea where to go. If the button needs to be in the table. How it should be scripted. etc. I cannot find a video tutorial anywhere on the web and all the responses simply provide a sample but no idea how to make it a reality in terms of translating their sample into a working dynamic form in PDF. Any help is greatly appreciated. Thanks.For a dynamic table you have to design a new XFA-form in Designer.
Here's a little tutorial how to create dynamic tables.
http://forms.stefcameron.com/2009/02/25/expandable-table-with-totals/
Just a little correction.
You can inport Docx-Files with tables and add / remove rows in a dynamic PDF.
But, this is not handy, if the table contains more than one row when it is imported because Designer gives every detected row the same name (Row).
Delete all row excepting the first one and set it to repeatable in the binding tab.
Then you can use the addInstance() and removeInstance() methods to add/remove row to the table.
Here an example file I made from a docx file.
https://acrobat.com/#d=k8XbQWmqu6bhfrrwui93pw -
How to delete row by row comparing to first collumn?
Hello!
I have a problem - I need to delete row by row , but the problem is, that I know that first COLUMN of any table is a PK.
To retrieve COLUMN NAME I use:
SELECT column_name, table_name FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = c1.tmp_table_name;
But this somehow doesn't work.
Below you can see my script (not worked for now):
declare
xxx varchar2(100);
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
EXECUTE IMMEDIATE
' SELECT column_name into '|| xxx ||' FROM USER_TAB_COLUMNS WHERE column_id = 1 and table_name = ' ||''''||c1.tmp_table_name||'''';
execute immediate
'begin
for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name || ' where ' || xxx ||' = c2.'||xxx ||'; exception when others then null; end; end loop; end;';
end loop;
end;
P.S. Inserts work perfect. I have a problem with delete rows that are in c1.table_name, from c1.tmp_table_name (this two tables have the same structure, PK, always), because I have different column names in another tables tables that are PK. (for example: K, ID, NS and so on) please help me to write correct script.
For example for first fetched row it will be like:
begin
for c1 in (select table_name, tmp_table_name from tmp_tables) loop
execute immediate
'begin for c2 in (select * from '|| c1.tmp_table_name || ') loop begin
insert into '|| c1.table_name || ' values c2; delete from '|| c1.tmp_table_name ||' where K = c2.K; exception when others then null; end; end loop; end;';
end loop;
end;
That script works perfect. But I have many others tables with different PK - not K.Solution with error-logging table
-- create the error-logging table
CREATE TABLE tbl_MergeErrors (
Stamp TIMESTAMP(3),
TableName VARCHAR2(30),
KeyColumn VARCHAR2(30),
KeyValue VARCHAR2(4000),
ErrorCode NUMBER(5),
ErrorMsg VARCHAR2(4000),
CONSTRAINT pk_MergeErrors
PRIMARY KEY (TableName, Stamp)
USING INDEX
-- procedure to insert errors
CREATE OR REPLACE
PROCEDURE LogMergeError (pTableName IN VARCHAR2,
pKeyColumn IN VARCHAR2,
pKeyValue IN VARCHAR2)
IS PRAGMA AUTONOMOUS_TRANSACTION;
-- you couldn't insert SQLCODE or SQLERRM directly into a table (ORA-00984)
nSQLCODE NUMBER(5) := SQLCODE;
vcSQLERRM VARCHAR2(4000) := SQLERRM;
BEGIN
INSERT INTO tbl_MergeErrors
(Stamp, TableName, KeyColumn, KeyValue, ErrorCode, ErrorMsg)
VALUES (SYSTIMESTAMP, RTrim( SubStr( pTableName, 1, 30)),
RTrim( SubStr( pKeyColumn, 1, 30)), SubStr( pKeyValue, 1, 4000),
nSQLCODE, vcSQLERRM);
COMMIT WORK;
-- if an error occured here, then just roll back the autonomous transaction
EXCEPTION
WHEN OTHERS THEN ROLLBACK WORK;
END LogMergeError;
-- create the tables and insert test-data
CREATE TABLE TMP_TABLES (
TABLE_NAME VARCHAR2(200),
TMP_TABLE_NAME VARCHAR2(200),
CONSTRAINT TMP_TABLES_X PRIMARY KEY (TABLE_NAME)
CREATE TABLE TMP_KL002 (
K VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE TMP_TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200)
CREATE TABLE KL002 (
K VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_KL002 PRIMARY KEY (K)
CREATE TABLE TABLE1 (
NS VARCHAR2(40),
N VARCHAR2(200),
CONSTRAINT PK_TABLE1 PRIMARY KEY (NS)
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('kl002','tmp_kl002');
INSERT INTO TMP_TABLES (TABLE_NAME, TMP_TABLE_NAME) VALUES ('table1','tmp_table1');
INSERT INTO tmp_KL002 (K, N) VALUES ('00', 'none');
INSERT INTO tmp_KL002 (K, N) VALUES ('07', 'exists');
INSERT INTO tmp_KL002 (K, N) VALUES ('08', 'not assigned');
INSERT INTO tmp_table1 (NS, N) VALUES ('2000', 'basic');
INSERT INTO tmp_table1 (NS, N) VALUES ('3000', 'advanced');
INSERT INTO tmp_table1 (NS, N) VALUES ('4000', 'custom');
COMMIT WORK;
-- to test, if it works correct when primary key values exists before
INSERT INTO KL002 VALUES ('07', 'exists before');
COMMIT WORK;
-- check the data before execution
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- empty the error-logging table
TRUNCATE TABLE tbl_MergeErrors DROP STORAGE;
-- a solution
DECLARE
PLSQL_BLOCK CONSTANT VARCHAR2(256) := '
BEGIN
FOR rec IN (SELECT * FROM <0>) LOOP
BEGIN
INSERT INTO <1> VALUES rec;
DELETE FROM <0> t WHERE (t.<2> = rec.<2>);
EXCEPTION
WHEN OTHERS THEN
LogMergeError( ''<1>'', ''<2>'', rec.<2>);
END;
END LOOP;
END;';
BEGIN
FOR tabcol IN (SELECT t.Tmp_Table_Name, t.Table_Name, c.Column_Name
FROM Tmp_Tables t,
User_Tab_Columns c
WHERE (c.Table_Name = Upper( t.Tmp_Table_Name))
AND (c.Column_ID = 1)
) LOOP
EXECUTE IMMEDIATE Replace( Replace( Replace( PLSQL_BLOCK,
'<0>', tabcol.Tmp_Table_Name),
'<1>', tabcol.Table_Name),
'<2>', tabcol.Column_Name);
END LOOP;
END;
-- check the data after execution ...
SELECT * FROM TMP_KL002 ORDER BY K;
SELECT * FROM KL002 ORDER BY K;
SELECT * FROM TMP_TABLE1 ORDER BY NS;
SELECT * FROM TABLE1 ORDER BY NS;
-- ... and also the error-logging table
SELECT * FROM tbl_MergeErrors ORDER BY Stamp, TableName;
-- of couse you must issue an COMMIT (the ROLLBACK is only for testing
ROLLBACK WORK;
-- drop the test-tables
DROP TABLE TABLE1 PURGE;
DROP TABLE KL002 PURGE;
DROP TABLE TMP_TABLE1 PURGE;
DROP TABLE TMP_KL002 PURGE;
DROP TABLE TMP_TABLES PURGE;
-- you shouldn't drop the error-logging table, but I use it to free up my db
DROP TABLE tbl_MergeErrors PURGE;Greetings, Niels -
Records added into the DB when deleting row in List
I have a list with an add button at the bottom. Every entry has a delete button on the left.
Whenever I create new entries and then delete some rows, the newly created entries are automatically saved.
How can I solve this? Deleting calls getOADBTransaction.commit(), is there a way to isolate deleting form saving?Hi,
When do some operations on Records from OAF page it maintains a list of state of entity, and on the basis of this state it performs the DML operations like insert/Update and Delete.
Your case is no exception if you are inserting some records OAF will mark these for insertion, deleted records will marked for deletion and on commit data will be posted to DB accordingly.
Still if you don't want to save the data, explictly change the VO Row status as Initialize(same as we do while inserting new record STSTUS_INITIALIZED) then OAF will not consider this row for insertion.
Hope this will give you some clue.
Regards,
Reetesh Sharma -
hallow
i have internal table with lot of data and i wont to delete row in the table
if i find some value in field.
like that
loop at itab into wa_itab
if wa_itab-field = '5'
delete row
endloop.
<b>delete just the row in my itab that value in some field = 5.</b>how can i do that?
regardsHi Antonio,
Use the DELETE statement with WHERE clause.
<b>DELETE ITAB WHERE FIELD = '5'.</b>
It is not recommended to useDELETE statement inside LOOP...ENDLOOP.
Check this link to know about DELETE statement
http://www.sts.tu-harburg.de/teaching/sap_r3/ABAP4/delete_i.htm
Thanks,
Vinay -
ADF UIX - programmatically deleting rows
Hi gang
I'm attempting to programmatically delete rows from an exposed VO client-method as follows:
public void deleteRecord(String cesId) {
ApplicationModule am = this.getApplicationModule();
ViewObject voCes = am.findViewObject("ClinicalDataElementSetsView1");
ViewObject voDcv = am.findViewObject("DacCesView1");
Object [] keyValues = new Object[1];
keyValues[0] = cesId;
Row[] rowsCes = voCes.findByKey(new Key(keyValues), 1);
Row deleteRowCes = rowsCes[0];
voCes.setCurrentRow(deleteRowCes);
voCes.removeCurrentRow();
Row currentRowDcv = voDcv.getCurrentRow();
voDcv.removeCurrentRow();
am.getTransaction().commit();
}However when requerying the UIX screen that shows the relating data, the records are still there? What am I doing wrong? Should I be calling voCes.removeCurrentRowFromCollection() instead?
Any help appreciated.
Cheers,
CM.
PS. JDev 10.1.2I got around this by retreiving the DBTransaction and executing a SQL Delete statement on the data.
Maybe you are looking for
-
What happens internally while loading master data and transaction?
hello, What happens internally and which tables are used while loading master data and transaction? I have loaded the data in DSO, but i am not getting value of particular InfoObject after loading the data. I have executed Attribute change run also.
-
Layer disappear when using blur gallery
The same thing happens on all three blur gallery effects (field blur, iris blur, tilt shift). Once I pick the filter the layer becomes empty. The strange thing is that when I manipulate any of the controls the object appears, but once I stop holding
-
Scheduling agreements with time-independent cond are not supported - Error
Hi All Processing IDOC IDOC_INPUT_PURSAG_CREATE for schedule agreements. the BAPI BAPI_SAG_CREATE is being called internally to create schdule agreements. I am using this BADI ME_PROCESS_OUT_CUS to update the field EKKO-STAKO for time dependent c
-
Hello, I have to use code from flex 1.5, it works fine in the production server, but I have errors in the local one. I have installed fds2-lin, but in the production server they have flex 1.5. I am thinking if this could be down to the errors I have
-
[SOLVED] xterm: redraws window slowly / flickers
The problem is most obvious when reading man pages in xterm. After each action that causes the window to be redrawn (like page down) it can be clearly seen how the redrawing is not instant. It takes only a tenth of a second but the flickering can be