How to eliminate the duplicate rows in the table
How can we eliminate the duplicate rows in the table. Is it possible to write a single query or should we write a pl/sql block to do it
Scope works outwards.
SQL> DECLARE
2 n NUMBER;
3 BEGIN
4 n := 0;
5 DECLARE
6 n number;
7 BEGIN
8 n := 2;
9 dbms_output.put_line(n);
10 END;
11 END;
12 /
2
PL/SQL procedure successfully completed.
SQL> DECLARE
2 n NUMBER;
3 BEGIN
4 n := 0;
5 DECLARE
6 x number;
7 BEGIN
8 dbms_output.put_line(n);
9 n := 2;
10 dbms_output.put_line(n);
11 END;
12 END;
13 /
0
2
PL/SQL procedure successfully completed.
SQL> ed
Wrote file afiedt.buf
1 DECLARE
2 n NUMBER;
3 BEGIN
4 n := 0;
5 DECLARE
6 x number;
7 BEGIN
8 dbms_output.put_line(n);
9 x := 2;
10 END;
11 dbms_output.put_line(x);
12 EXCEPTION
13 WHEN others THEN dbms_output.put_line('oh no!');
14* END;
15 /
dbms_output.put_line(x);
ERROR at line 11:
ORA-06550: line 11, column 27:
PLS-00201: identifier 'X' must be declared
ORA-06550: line 11, column 6:
PL/SQL: Statement ignored
SQL> Cheers, APC
Similar Messages
-
How to eliminate inserting Duplicate rows into database using JDBC Adapter
File->Xi->JDBC
In above Scenario if the file has two rows their values are identical, then how can we eliminated inserting Duplicate rows into database using JDBC AdapterDatabase is a consumer of a SERVICE (SOA!!!!!!).
Database plays a business system role here!!!!
Mapping is part of an ESB service
Adaptor is a technology adapted to ESB framework to support specific protocol.
ESB accomplish ESB duties such as transformation, translation, routing. Routing use a protocol accepted by the consumer. In a JDBC consumer it is JDBC protocol and hence it a JDBC adaptor.
There is clear separation on responsibilities among business system and ESB. ESB do not participate in business decision or try to get into business system data layer.
So who ever are asking people to check duplicate check as part of mapping (an ESB service) may not understand integration practice.
Please use an adaptor module which will execute the duplicate check with business system in a plug and play approach and separate that from ESB service so that people can build integration using AGILE approach.
Thanks -
How to delete the duplicate rows from the table
Hi,
I have 2 tbales namely component, component_audit
For each record in component table there are multiple entries in component_audit table.
I need to keep the first record and delete the others from the component_audit table
say for example
select a.component_id,a.dt_ti_stamp,a.component_name,a.column_before,b.comments from component_audit a,component b where a.component_id=b.component_id
( on the above result set only I shold apply the actual delete query )
PLease help me in this regards.
Thanks.delete from component_audit a where dt_ti_stamp not in (select
min(b.dt_ti_stamp)
from
component_audit b
where
a.component_id = b.component_id) -
How to write the query to find the duplicate rows?
Hi,
How will I find the duplicate rows in the table?
I have a table called ITEM
Select item_no,mfg_id from item
Item Mfg_ID
178 06278
178 06589
238 5489
289 7895
289 7596
Now I want to find only the duplicate rows i.e.,178 & 289 is coming twice.
How will get the all duplicate rows in the table?nihar2 wrote:
Convert to
SELECT it.item,
im.mfg_item,
im.manufacturer,
im.description
FROM (SELECT it.item,
im.mfg_item,
im.manufacturer,
im.description,
count(it.item) over(partition by it.item order by it.item) cnt
FROM item it,item_mfg im
WHERE it.u##item=im.u##item)
WHERE cnt > 1
But I tried It show not valid identifier.You can't use the table aliases from the sub-query...
SELECT item,
mfg_item,
manufacturer,
description
FROM (SELECT it.item,
im.mfg_item,
im.manufacturer,
im.description,
count(it.item) over(partition by it.item order by it.item) cnt
FROM item it,item_mfg im
WHERE it.u##item=im.u##item)
WHERE cnt > 1 -
I have a master table and i need to import the rows into the parent and child table.
Master table name is Flatfile_Inventory
Parent Table name is INVENTORY
Child Tables name are INVENTORY_AMOUNT,INVENTORY_DETAILS,INVENTORY_VEHICLE,
Error details will be goes to LOG_INVENTORY_ERROR
I have 4 duplicate rows in the Flatfile_Inventory which i have already inserted in the Parent and child table.
Again when i run the query using stored procedure,
its tells that all the 4 rows are duplicate and will move to the Log_Inventory_Error.
I need is if i have the duplicate rows in the flatfile_Inventory when i start inserting into the parent and child table the already inserted row have the unique ID i
must identify it and delete that row in the both parent and chlid table.And latest row must get inserted into the Parent and child table from Flatfile_Inventory.
Please help me to write the query i have attached the Full stored procedure Script..
Arunraj KumarHi Santhosh,
This is my Script.
-- =============================================
-- Stored Procedure for FLATFILE_INVENTORY
-- =============================================
-- Drop stored procedure if it already exists
DROP PROCEDURE SP_Flatfile_Inventory
GO
CREATE PROCEDURE SP_Flatfile_Inventory
AS
--USE IconicMarketing
GO
DECLARE
@FileType varchar(50) ,
@ACDealerID varchar(50) ,
@ClientDealerID varchar(50) ,
@DMSType varchar(50) ,
@StockNumber varchar(50) ,
@InventoryDate datetime ,
@StockType varchar(100) ,
@DMSStatus varchar(50) ,
@InvoicePrice numeric(18, 2) ,
@CostPack varchar(50) ,
@SalesCost numeric(18, 2) ,
@HoldbackAmount numeric(18, 2) ,
@ListPrice numeric(18, 2) ,
@MSRP varchar(max) ,
@LotLocation varchar(50) ,
@TagLine varchar(max) ,
@Certification varchar(max) ,
@CertificationNumber varchar(max) ,
@VehicleVIN varchar(50) ,
@VehicleYear bigint ,
@VehicleMake varchar(50) ,
@VehicleModel varchar(50) ,
@VehicleModelCode varchar(50) ,
@VehicleTrim varchar(50) ,
@VehicleSubTrimLevel varchar(max) ,
@Classification varchar(max) ,
@TypeCode varchar(100) ,
@VehicleMileage bigint ,
@EngineCylinderCount bigint ,
@TransmissionType varchar(50) ,
@VehicleExteriorColor varchar(50) ,
@VehicleInteriorColor varchar(50) ,
@CreatedDate datetime ,
@LastModifiedDate datetime ,
@ModifiedFlag varchar(max) ,
@InteriorColorCode varchar(50) ,
@ExteriorColorCode varchar(50) ,
@PackageCode varchar(50) ,
@CodedCost varchar(50) ,
@Air varchar(100) ,
@OrderType varchar(max) ,
@AgeDays bigint ,
@OutstandingRO varchar(50) ,
@DlrAccessoryRetail varchar(50) ,
@DlrAccessoryCost varchar(max) ,
@DlrAccessoryDesc varchar(max) ,
@ModelDesc varchar(50) ,
@Memo1 varchar(1000) ,
@Memo2 varchar(max) ,
@Weight varchar(max) ,
@FloorPlan numeric(18, 2) ,
@Purchaser varchar(max) ,
@PurchasedFrom varchar(max) ,
@InternetPrice varchar(50) ,
@InventoryAcctDollar numeric(18, 2) ,
@VehicleType varchar(50) ,
@DealerAccessoryCode varchar(50) ,
@AllInventoryAcctDollar numeric(18, 2) ,
@BestPrice varchar(50) ,
@InStock bigint ,
@AccountingMake varchar(50) ,
@GasDiesel varchar(max) ,
@BookValue varchar(10) ,
@FactoryAccessoryDescription varchar(max) ,
@TotalReturn varchar(10) ,
@TotalCost varchar(10) ,
@SS varchar(max) ,
@VehicleBody varchar(max) ,
@StandardEquipment varchar(max) ,
@Account varchar(max) ,
@CalculatedPrice varchar(10) ,
@OriginalCost varchar(10) ,
@AccessoryCore varchar(10) ,
@OtherDollar varchar(10) ,
@PrimaryBookValue varchar(10) ,
@AmountDue varchar(10) ,
@LicenseFee varchar(10) ,
@ICompany varchar(max) ,
@InvenAcct varchar(max) ,
@Field23 varchar(max) ,
@Field24 varchar(max) ,
@SalesCode varchar(max) ,
@BaseRetail varchar(10) ,
@BaseInvAmt varchar(10) ,
@CommPrice varchar(10) ,
@Price1 varchar(10) ,
@Price2 varchar(10) ,
@StickerPrice varchar(10) ,
@TotInvAmt varchar(10) ,
@OptRetail varchar(max) ,
@OptInvAmt varchar(10) ,
@OptCost varchar(10) ,
@Options varchar(max) ,
@Category varchar(max) ,
@Description varchar(max) ,
@Engine varchar(max) ,
@ModelType varchar(max) ,
@FTCode varchar(max) ,
@Wholesale varchar(max) ,
@Retail varchar(max) ,
@Draft varchar(max) ,
@Inventoryid int;
DECLARE Inventory_Cursor CURSOR FOR
SELECT * from [dbo].[FLATFILE_INVENTORY];
OPEN Inventory_Cursor
FETCH NEXT FROM Inventory_Cursor
INTO @FileType ,
@ACDealerID ,
@ClientDealerID ,
@DMSType ,
@StockNumber ,
@InventoryDate ,
@StockType ,
@DMSStatus ,
@InvoicePrice ,
@CostPack ,
@SalesCost ,
@HoldbackAmount ,
@ListPrice ,
@MSRP ,
@LotLocation ,
@TagLine ,
@Certification ,
@CertificationNumber ,
@VehicleVIN ,
@VehicleYear ,
@VehicleMake ,
@VehicleModel ,
@VehicleModelCode ,
@VehicleTrim ,
@VehicleSubTrimLevel ,
@Classification ,
@TypeCode ,
@VehicleMileage ,
@EngineCylinderCount ,
@TransmissionType ,
@VehicleExteriorColor ,
@VehicleInteriorColor ,
@CreatedDate ,
@LastModifiedDate ,
@ModifiedFlag ,
@InteriorColorCode ,
@ExteriorColorCode ,
@PackageCode ,
@CodedCost ,
@Air ,
@OrderType ,
@AgeDays ,
@OutstandingRO ,
@DlrAccessoryRetail ,
@DlrAccessoryCost ,
@DlrAccessoryDesc ,
@ModelDesc ,
@Memo1 ,
@Memo2 ,
@Weight ,
@FloorPlan ,
@Purchaser ,
@PurchasedFrom ,
@InternetPrice ,
@InventoryAcctDollar ,
@VehicleType ,
@DealerAccessoryCode ,
@AllInventoryAcctDollar ,
@BestPrice ,
@InStock ,
@AccountingMake ,
@GasDiesel ,
@BookValue ,
@FactoryAccessoryDescription ,
@TotalReturn ,
@TotalCost ,
@SS ,
@VehicleBody ,
@StandardEquipment ,
@Account ,
@CalculatedPrice ,
@OriginalCost ,
@AccessoryCore ,
@OtherDollar ,
@PrimaryBookValue ,
@AmountDue ,
@LicenseFee ,
@ICompany ,
@InvenAcct ,
@Field23 ,
@Field24 ,
@SalesCode ,
@BaseRetail ,
@BaseInvAmt ,
@CommPrice ,
@Price1 ,
@Price2 ,
@StickerPrice ,
@TotInvAmt ,
@OptRetail ,
@OptInvAmt ,
@OptCost ,
@Options ,
@Category ,
@Description ,
@Engine ,
@ModelType ,
@FTCode ,
@Wholesale ,
@Retail ,
@Draft ;
WHILE @@FETCH_STATUS = 0
BEGIN
PRINT @VehicleVIN ;
-- ****************** insert into Inventory Table ***********
INSERT INTO INVENTORY
IconicDealerID,
StockNumber,
DMSType,
InventoryDate
VALUES (@ClientDealerID,@StockNumber,@DMSType,@InventoryDate);
set @Inventoryid = scope_identity();
PRINT @Inventoryid;
--Insert into Inventory_Details Table
INSERT INTO [INVENTORY_DETAILS]
InventoryID,
StockType,
DMSStatus,
LotLocation,
TagLine,
Certification,
CertificationNumber,
CreatedDate,
LastModifiedDate,
ModifiedFlag,
PackageCode,
OrderType,
AgeDays,
OutstandingRO,
Memo1,
Memo2,
Purchaser,
PurchasedFrom,
DealerAccessoryCode,
InStock,
AccountingMake,
SS,
Account,
AccessoryCore,
ICompany,
InvenAcct,
Field23,
Field24,
SalesCode,
Draft,
FTCode
VALUES (
@InventoryID,
@StockType,
@DMSStatus,
@LotLocation,
@TagLine,
@Certification,
@CertificationNumber,
@CreatedDate,
@LastModifiedDate,
@ModifiedFlag,
@PackageCode,
@OrderType,
@AgeDays,
@OutstandingRO,
@Memo1,
@Memo2,
@Purchaser,
@PurchasedFrom,
@DealerAccessoryCode,
@InStock,
@AccountingMake,
@SS,
@Account,
@AccessoryCore,
@ICompany,
@InvenAcct,
@Field23,
@Field24,
@SalesCode,
@Draft,
@FTCode
--Insert into Inventory_Amount Table
INSERT INTO [dbo].[INVENTORY_AMOUNT]
InventoryID,
AllInventoryAcctDollar,
OtherDollar,
PrimaryBookValue,
AmountDue,
LicenseFee,
CalculatedPrice,
OriginalCost,
BookValue,
TotalReturn,
TotalCost,
DlrAccessoryRetail,
DlrAccessoryCost,
DlrAccessoryDesc,
InternetPrice,
InventoryAcctDollar,
BestPrice,
Weight,
FloorPlan,
CodedCost,
InvoicePrice,
CostPack,
SalesCost,
HoldbackAmount,
ListPrice,
MSRP,
BaseRetail,
BaseInvAmt,
CommPrice,
Price1,
Price2,
StickerPrice,
TotInvAmt,
OptRetail,
OptInvAmt,
OptCost,
Wholesale,
Retail
VALUES (
@InventoryID,
@AllInventoryAcctDollar,
@OtherDollar,
@PrimaryBookValue,
@AmountDue,
@LicenseFee,
@CalculatedPrice,
@OriginalCost,
@BookValue,
@TotalReturn,
@TotalCost,
@DlrAccessoryRetail,
@DlrAccessoryCost,
@DlrAccessoryDesc,
@InternetPrice,
@InventoryAcctDollar,
@BestPrice,
@Weight,
@FloorPlan,
@CodedCost,
@InvoicePrice,
@CostPack,
@SalesCost,
@HoldbackAmount,
@ListPrice,
@MSRP,
@BaseRetail,
@BaseInvAmt,
@CommPrice,
@Price1,
@Price2,
@StickerPrice,
@TotInvAmt,
@OptRetail,
@OptInvAmt,
@OptCost,
@Wholesale,
@Retail
--Insert into Inventory_Vehicle Table
INSERT INTO [dbo].[INVENTORY_VEHICLE]
InventoryID,
InteriorColorCode,
ExteriorColorCode,
Air,
ModelDesc,
VehicleType,
VehicleVIN,
VehicleYear,
VehicleMake,
VehicleModel,
VehicleModelCode,
VehicleTrim,
VehicleSubTrimLevel,
Classification,
TypeCode,
VehicleMileage
VALUES (
@InventoryID,
@InteriorColorCode,
@ExteriorColorCode,
@Air,
@ModelDesc,
@VehicleType,
@VehicleVIN,
@VehicleYear,
@VehicleMake,
@VehicleModel,
@VehicleModelCode,
@VehicleTrim,
@VehicleSubTrimLevel,
@Classification,
@TypeCode,
@VehicleMileage
-- Move cursor to Next record
FETCH NEXT FROM Inventory_Cursor
INTO @FileType ,
@ACDealerID ,
@ClientDealerID ,
@DMSType ,
@StockNumber ,
@InventoryDate ,
@StockType ,
@DMSStatus ,
@InvoicePrice ,
@CostPack ,
@SalesCost ,
@HoldbackAmount ,
@ListPrice ,
@MSRP ,
@LotLocation ,
@TagLine ,
@Certification ,
@CertificationNumber ,
@VehicleVIN ,
@VehicleYear ,
@VehicleMake ,
@VehicleModel ,
@VehicleModelCode ,
@VehicleTrim ,
@VehicleSubTrimLevel ,
@Classification ,
@TypeCode ,
@VehicleMileage ,
@EngineCylinderCount ,
@TransmissionType ,
@VehicleExteriorColor ,
@VehicleInteriorColor ,
@CreatedDate ,
@LastModifiedDate ,
@ModifiedFlag ,
@InteriorColorCode ,
@ExteriorColorCode ,
@PackageCode ,
@CodedCost ,
@Air ,
@OrderType ,
@AgeDays ,
@OutstandingRO ,
@DlrAccessoryRetail ,
@DlrAccessoryCost ,
@DlrAccessoryDesc ,
@ModelDesc ,
@Memo1 ,
@Memo2 ,
@Weight ,
@FloorPlan ,
@Purchaser ,
@PurchasedFrom ,
@InternetPrice ,
@InventoryAcctDollar ,
@VehicleType ,
@DealerAccessoryCode ,
@AllInventoryAcctDollar ,
@BestPrice ,
@InStock ,
@AccountingMake ,
@GasDiesel ,
@BookValue ,
@FactoryAccessoryDescription ,
@TotalReturn ,
@TotalCost ,
@SS ,
@VehicleBody ,
@StandardEquipment ,
@Account ,
@CalculatedPrice ,
@OriginalCost ,
@AccessoryCore ,
@OtherDollar ,
@PrimaryBookValue ,
@AmountDue ,
@LicenseFee ,
@ICompany ,
@InvenAcct ,
@Field23 ,
@Field24 ,
@SalesCode ,
@BaseRetail ,
@BaseInvAmt ,
@CommPrice ,
@Price1 ,
@Price2 ,
@StickerPrice ,
@TotInvAmt ,
@OptRetail ,
@OptInvAmt ,
@OptCost ,
@Options ,
@Category ,
@Description ,
@Engine ,
@ModelType ,
@FTCode ,
@Wholesale ,
@Retail ,
@Draft ;
END
CLOSE Inventory_Cursor;
DEALLOCATE Inventory_Cursor;
GO
SET ANSI_PADDING OFF
GO
Arunraj Kumar -
Setfilter to display all the duplicate rows pb7
Friends,
my version is powerbuilder 7.
i am checking the duplicate rows in the datawindow before inserting.
in a button click event...i have the below code
dw_master.SetSort ("rollno A")
dw_master.Sort()
dw_master.SetFilter("rollno = rollno[-1]")
dw_master.Filter()
if dw_master.RowCount() > 0 then
MessageBox('Duplicate Rows','Check the Duplicate Roll numbers',StopSign!,OK!)
Return 1
end if
//no dups, so clear the filter and do the update...
dw_master.SetFilter ("")
dw_master.Filter()
i have 2 duplicate rows...but this setfilter is displaying only one row....
if it displays all the duplicate rows then it will be very useful for me...
how can i modify this code to get all the duplicate rows in this datawindow before inserting?
thanksInstead of a filter you could do this...
boolean lb_dupe_found=false
long ll_row, ll_rowcount
string ls_val1, ls_val2
ll_rowcount = dw_1.rowcount()
for ll_row = 2 to ll_rowcount
ls_val1 = dw_1.getitemstring(ll_row, 'col1')
ls_val2 = dw_1.getitemstring(ll_row -1, 'col1')
if ls_val1 = ls_val2 then
// duplicate
lb_dupe_found = true
exit
end if
next
if lb_dupe_found then
messagebox('DUPE', 'Houston we have a problem!')
else
messagebox('SAVE', 'Data valid for saving')
end if -
Eliminate duplicate rows from the report 6i output
Hi All,
I have generated a report output with the group by and summary options.
For Ex: report has num and amount columns
I had to sum the amount group by num
NUM AMOUNT
1 100
1 50
2 10
2 100
After group by and summary functions the report is generating the output as follows...
NUM AMOUNT
1 150
1 150
2 110
2 110
I want to eliminate the duplicate rows and want the output as follows...
NUM AMOUNT
1 150
2 110
I tried all the ways to implement distinct, but not able to.
I donot want to implement distinct on the query but want to perform at the report level.
Please help me in this ASAP.
Thanks,
VijayIt would be helpful if you post your query, should by something like
SELECT NUM, SUM(AMOUNT)
FROM TABLE
GROUP BY NUM
ORDER BY 1this would not create duplicates with your given example data. -
How to add A single row at the middle of the table in a Webi report
Hi,
I created a Webi report using Universe(Created universe using bex query).Now i have a requirement to display a row at the middle of a report. Can you please tell me ,how to add a sigle row at the middle of a Webi report.
Thanks in advance
Regards
MonikaHi Monika,
It is not really possible to add a row (I assume you mean of unrelated data) to the middle of a table in a report. You can add a new table with a single row between two tables. For instance you could add a new one row table, or even single cells which are positioned relatively between two tables. Possibly a block on top of another. But this gets tricky.
Can you explain in more detail what you are trying to do?
Thanks -
How do you delete duplicate photos in the photo section of your iPad?
How do you delete duplicate photos in the photo section of your iPad? My iPad has duplicated n tripled my photos n want let me delete them. I can delete photos from any other section but not in photos, this is taken up all my memory. Help!!
The links below have instructions for deleting photos.
iOS and iPod: Syncing photos using iTunes
http://support.apple.com/kb/HT4236
iPad Tip: How to Delete Photos from Your iPad in the Photos App
http://ipadacademy.com/2011/08/ipad-tip-how-to-delete-photos-from-your-ipad-in-t he-photos-app
Another Way to Quickly Delete Photos from Your iPad (Mac Only)
http://ipadacademy.com/2011/09/another-way-to-quickly-delete-photos-from-your-ip ad-mac-only
How to Delete Photos from iPad
http://www.wondershare.com/apple-idevice/how-to-delete-photos-from-ipad.html
How to: Batch Delete Photos on the iPad
http://www.lifeisaprayer.com/blog/2010/how-batch-delete-photos-ipad
(With iOS 5.1, use 2 fingers)
How to Delete Photos from iCloud’s Photo Stream
http://www.cultofmac.com/124235/how-to-delete-photos-from-iclouds-photo-stream/
Cheers, Tom -
How to delete the duplicate data from PSA Table
Dear All,
How to delete the duplicate data from PSA Table, I have the purchase cube and I am getting the data from Item data source.
In PSA table, I found the some cancellation records for that particular records quantity would be negative for the same record value would be positive.
Due to this reason the quantity is updated to target but the values would summarized and got the summarized value of all normal and cancellation .
Please let me know the solution how to delete the data while updating to the target.
Thanks
Regards,
SaiHi,
in deleting the records in PSA table difficult and how many you will the delete.
you can achieve the different ways.
1. creating the DSO maintain the some key fields it will overwrite the based on key fields.
2. you can write the ABAP logic deleting the duplicate records at info package level check with the your ABAPer.
3.you can restrict the cancellation records at query level.
Thanks,
Phani. -
How can I filter the LOV rows at the runtime
I am working in oracle forms 6i.
My lov is based on a view. If I selected one row from LOV, that row should not appear in list box.
I would like to restrict rows before saving a form. How can i filer the LOV rows at the runtime?
Please help me.Dear Mr.MH_BD,
Thanks for your immediate response,
My form is built based on master and detail link. On the multi row detail section I am invoking this LOV. The record group containing the following query:
select fees_id,fees_name,term_fees from sk_fees_mst where fees_bal>0;
fees_id
fees_name
term_fees
12
Tuition Fees
2500
13
Smart Class
100
14
Admin Fees
300
If I selected the fees_id 13 for the first row of detail section, then the LOV should display only the following in the next row:
fees_id
fees_name
term_fees
12
Tuition Fees
2500
14
Admin Fees
300
(ie.) Before commit form I need to filter the already selected fees ids from record group.
Thanks in advance. -
My Nano is full and I can no longer sync more music. How do I delete duplicate songs on the Nano to make room for syncing more songs?
I had the same problem today and was able to resolve it without having to do a restore or reset. The problem had something to do with my mail accounts. The upgrade reset my mail settings, switching both my gmail and my .mac mail to "archive all mail". I went into the General Settings, disabled that setting, and resynced the phone. The "other" storage allottment dropped back down to less than a gig.
Before you restore or reset, I would try that first. -
How do I select a row from the middle of a recordset?
UserID QuestionID Answered
10 9 N
10 8 N
10 7 N
10 6 N
10 5 Y
10 4 Y
10 1 Y
From the table sorted by QuestionID DESC, how do I select the first row from the bottom going up with Answered value equal to 'N'?
Which in the example above would be:
10 6 N
I need to select this row and get the QuestionID value equal to 6.
Right now I have:
select QuestionID
from tblMap
where Answered = 'N'
and ROWNUM = 1
order by QuestionID ASC;
This always the top most row, which would be:
10 9 NHere i used DUAL to generate a list of numbers for me.
ME_XE?select *
2 from
3 (
4 select row_number() over (order by col1 desc) as rn, count(*) over() as cnt, col1
5 from
6 (
7 select level as col1 from dual connect by level <= 9
8 )
9 )
10 where ceil(cnt/2) = rn
11 /
RN CNT COL1
5 9 5
1 row selected.
Elapsed: 00:00:00.07
ME_XE?Edited by: Tubby on Jul 8, 2009 1:47 PM
Seems i misread the question :) -
How to highlight the first row of a table
When entering the form, how do I get the first row of the table to be highlighted when it has not been selected yet? There is already data in the table. Thanks.
AllysonAny ideas on what would cause this NOT to work? I added this row right after the table is created and populated and it is still not highlighted when I enter the form. The snippet of code that does this is:
MyTableModel modelS = (MyTableModel)dataModel.get("S");
jTable1 = new JTable(modelS);
jTable1.setRowSelectionInterval(0,0);MyTableModel is this:
class MyTableModel extends DefaultTableModel {
public MyTableModel(Object[] columnNames, int numRows) {
super(columnNames, numRows);
public boolean isCellEditable(int row, int column) {
if (TableKey == 'S') {
if (column == 6) {
return false;
if (TableKey == 'O') {
if (column == 0 || column == 4 || column == 5) {
return false;
if (TableKey == 'P') {
return false;
return true;
}Can anyone help? Thanks.
Allyson -
How can we pass the entire rows of a table to a web service in a VC model ?
Hi,
On the click of the submit button, I have to pass the rows of two tables into an enterprise service. This service also takes other fields of a form as an input.
How can we pass the entire rows of a table into a service ?
Regards,
NitinHi Nitin,
It seems that you have two or three different structures to pass data using your webservice. In your main question, two tables, you can join both in one table and from there call the webservice. In order to pass the entire table you need:
1. Draw a line between your joinned table and your service,
2. Map the fields,
3. Create a 'SUBMIT' in your table tool bar. Right click on your table and choose 'Create Toobar', '+', name and choose 'Submit' as your event.
4. Go to Configure Element (Table View) 'Multiple' at Selection Mode.
Reward points if helps you to solve your question.
Regards,
Gilson Teixeira
Maybe you are looking for
-
Refund cost of unopened printer cartridges due to new printer
I had to buy a new HP printer today. Rep said since I had unopened printer cartridges that cannot be used with new printer, I was to contact this site to get refund or ? re: these cartridges. Case# is [edited Case number by moderator] Please advise
-
Function module for Article creation (transaction MM41)
Hello, I have been trying to create an article which is normally done using transaction MM41. I am trying to use BAPI_MATERIAL_SAVEDATA to do this, but since article creation is different from regular material creation, there are fields that are not
-
Can some one tell me where a cost centre field is in sales order?I can find the field in VBAP though but not in VA01/02
-
If I pre-order on the Verizon website is it possible to pick up my iphone in the store on the 14th???? If I do preorder on the 7th and choose to have it shipped any guess on the arrival date? Will it ship on the 14th or arrive on the 14th?
-
HTMLEkitorKit color change does not work on existing color
My problem is that I use StyledEditorKit.ForegroundAction to update the color of the selected text. It works the first time but if I select a substring of the text with the color attribute and apply the foreground action again the color attribute doe