SQL query...pls help ASAP
Actor (Aname: varchar(40), Ano: varchar(6)) Ano is pk
Movie (Mname: varchar(40),mno: varchar(8)) Mno is pk
PlayIn (Ano, Mno, Pay: Integer) Ano and Mno are fk referencing Acotr and Movie respectively.
Actor(Aname, Ano)
A Bingo, A1
B Castro, A2
C Katie, A3
S Hommy, A4
J Tammy, A5
K loren, A6
Movie(Mname, Mno)
Gladiator, M1
Cast, M2
Dog, M3
Jilters, M4
PlayIn(Ano,Mno,Pay)
A1 M1 800
A1 M2 1500
A2 M2 78
A2 M3 1750
A2 M4 2301
A3 M2 904
A3 M3 629
A4 M2 565
A4 M3 5695
A4 M4 1255
A5 M1 989
A5 M4 238
A6 M2 137
A6 M3 236
A6 M4 545
QUESTION: write SQL query to find the names of actors who earned less than 'B Castro' in each movie that 'B Castro' played in.
thanks so so much.....
another question:
for each movie, list the movie number, the average
pay and the total number of actors in the movie.....Rather than just asking homework questions and expecting everyone else to do your work for you, why don't you at least have a go at it yourself and post the query that you've tried, then we'll tell you where you are going wrong. You won't learn anything if we just write it for you.
Also, your use of "pls help ASAP" in the subject title is not polite.
This forum is manned by volunteers who have their own jobs and offer their help free of charge.
Everyone who posts an issue on here would love to have it answered as soon as possible, but nobody has the right to assume that their issue is any more important, urgent or requires a quicker answer than anybody elses.
If you need urgent help then you should pay someone to do the work for you.
Similar Messages
-
my safari browser is not loading any thing after an update 5.1!! i had to create guest account to brows!! pls help ASAP!!
my safari browser is not loading any thing after an update 5.1!! i had to create guest account to brows!! pls help ASAP!!
-
HI...
I want to modify 'coois' report but i am not able to find the final output table in it.
Production Order number appears at output screen, i've to display SO NO and SO item which is there in Production order in the output list.
Pls Help ASAP...
Pts rewarded for more helpful ans for sure...
Best regards
SnehalHello.
Have a look into include LCOISOUTPUTF04, form pbo_0100, field symbol <table>. Insert a break-point in line 121:
<ls_detail_list>-list->set_initial_data(
Please, have in mind that this is a standard report before changing it.
Regards.
Valter Oliveira. -
Cluster bar chart- sql query please help-
Hi,
I am trying to create cluster bar chart and am stumped with this sql query.Any help is appreciated.
Here is my table
city region issue value
c1 north i1 y
c1 north i2 y
c2 north i1 n
c2 north i2 y
c3 south i1 y
c3 south i2 n
c4 east i1 n
c4 east i2 n
The bar chart will have 3 series, north south and east.
And labels will be i1 and i2. value will be number of times this issue was encountered(y) in this region.
How can I get something like this from the above table-
region issue count(yes)
north i1 1
north i2 2
south i1 1
south i2 0
east i1 0
east i2 0
thanksWITH table1 AS
(SELECT 1435177 qte_id, 2 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no
FROM dual
table2 AS
SELECT 1435177 qte_id, 1 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 2 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 3 seq_no, 0 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 4 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 5 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 7 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 8 seq_no, 98500 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 11 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 12 seq_no, 59300 cmmt_curr_amt
FROM dual
UNION ALL
SELECT 1435177 qte_id, 14 seq_no, 59300 cmmt_curr_amt
FROM dual
SELECT qte_id, t2_seq_no, cmmt_curr_amt - cmmt_curr_lag diff
FROM
(SELECT t2.qte_id, t2.seq_no t2_seq_no, t1.seq_no t1_seq_no, cmmt_curr_amt, LAG(cmmt_curr_amt,1,0) OVER (PARTITION BY t2.qte_id ORDER BY t2.seq_no) cmmt_curr_lag
FROM table1 t1, table2 t2
WHERE t2.qte_id = t1.qte_id (+)
AND t2.seq_no = t1.seq_no(+)
ORDER BY 1,2
WHERE t1_seq_no IS NOT NULL
ORDER BY 1,2
QTE_ID T2_SEQ_NO DIFF
1435177 2 0
1435177 5 0
1435177 7 0
1435177 8 0
1435177 12 0
1435177 14 0 -
Row_number query - need help ASAP
Hi ,
Need some help bout query
I need a query for display output like below
DATE CODE MAC_NO BATCH_NO
01-OCT-07 1119 02 1
20-OCT-07 1210 01 2
01-NOV-07 1209 01 3
01-NOV-07 1510 01 4
01-NOV-07 4025 01 5
01-NOV-07 4025 01 5
01-NOV-07 4051 03 6
02-NOV-07 1209 01 7
i hv no idea how to do it. My query doesn't work for tat requirement.Tis is my query
SELECT date
,code
,mac_no
,ROW_NUMBER()
OVER (PARTITION by date,code,mac_no
ORDER by date,code,mac_no)
as batch_no
FROM PAYMENT
WHERE npcs_cycle_num = 27
AND txn_insert_seq_num > 0;
The output juz like below.I need everybody help ASAP.
DATE CODE MAC_NO BATCH_NO
01-OCT-07 1119 02 1
20-OCT-07 1210 01 1
01-NOV-07 1209 01 1
01-NOV-07 1510 01 1
01-NOV-07 4025 01 1
01-NOV-07 4025 01 2
01-NOV-07 4051 03 1
02-NOV-07 1209 01 1
Thanks
CTI'm sorry..Maybe my words it not that clear enough. You were right about how ROW_NUMBER works (it
assigns a numeric value and resets based on the grouping you specify in the PARTITION clause).
What I want actually is the row number increment based on the txn_date,poc_code and machine_no.
I'm not sure whether using the row_number() can solve my solutions. I really hope that you could help me.
I thought of using row_number() may help. Do you have any other solution?
Here is my table description.
DESC PAYMENT;
Name Null? Type
TXN_ID_NUM NOT NULL NUMBER(12)
ACCT_NO NOT NULL VARCHAR2(14)
CANCEL_CODE VARCHAR2(5)
ADJ_TYPE_NO VARCHAR2(2)
REASON_CODE VARCHAR2(5)
CASHIER_ID_NO VARCHAR2(10)
SUPERVISOR_ID_NO VARCHAR2(10)
REV_CODE VARCHAR2(5)
TXN_DATE DATE
PAY_ADJ_DATE DATE
POC_CODE VARCHAR2(10)
MACHINE_NO VARCHAR2(3)
PAY_MODE_CODE VARCHAR2(5)
ORIG_ACCT_NO VARCHAR2(14)
PAY_AMT NUMBER(12,2)
INVOICE_NO VARCHAR2(20)
PAY_RECEIPT_NO VARCHAR2(24)
PAY_BATCH_NO VARCHAR2(20)
NPCS_CYCLE_NUM NUMBER(4)
TXN_INSERT_SEQ_NUM NOT NULL NUMBER(12)
2) Below is the query before assigning the row number:
SQL> SELECT TXN_DATE,POC_CODE,MACHINE_NO,PAY_BATCH_NO,PAY_AMT,REV_CODE,ADJ_TYPE_NO,PAY_MODE_CODE
2 FROM PAYMENT
3 WHERE NPCS_CYCLE_NUM=27
4 AND REV_CODE IN (SELECT rev_code
5 FROM OUTBND_REV_CODE
6 WHERE outbnd_agen_file_code = 'TMB'
7 AND sys_appl_id ='CCC')
8 ORDER BY TXN_DATE,POC_CODE,MACHINE_NO;
TXN_DATE POC_CODE MAC PAY_BATCH_NO PAY_AMT REV_C AD PAY_M
01-OCT-07 1119 02 20071101120900000000 154.25 017 85 1
20-OCT-07 1210 01 20071101402501400000 444.02 017 00 5
01-NOV-07 1209 01 20071101120901100000 585.32 017 85 1
01-NOV-07 1510 01 20071101402501100000 493 014 00 1
01-NOV-07 4025 01 20071101402501100000 203.85 016 00 3
01-NOV-07 4025 01 20071101402501100000 487.96 017 00 1
01-NOV-07 4051 03 20071101402501100000 109.26 016 00 3
02-NOV-07 1209 01 20071102120900000000 105.76 014 00 1
3)This is my query and the result:
SQL> SELECT /* SQL_ID 2703 */
2 txn_date
3 ,poc_code
4 ,machine_no
5 ,pay_batch_no
6 ,pay_amt
7 ,rev_code
8 ,adj_type_no
9 ,pay_mode_code
10 ,ROW_NUMBER()
11 OVER (PARTITION by txn_date,poc_code,machine_no
12 ORDER by txn_date,poc_code,machine_no)
13 as row_number
14 FROM PAYMENT
15 WHERE npcs_cycle_num = 27
16 AND txn_insert_seq_num > 0
17 AND rev_code IN (SELECT rev_code
18 FROM OUTBND_REV_CODE
19 WHERE outbnd_agen_file_code = 'TMB'
20 AND sys_appl_id ='CCC');
TXN_DATE POC_CODE MAC PAY_BATCH_NO PAY_AMT REV_C AD PAY_M ROW_NUMBER
01-OCT-07 1119 02 20071101120900000000 154.25 017 85 1 1 (1)
20-OCT-07 1210 01 20071101402501400000 444.02 017 00 5 1 (2)
01-NOV-07 1209 01 20071101120901100000 585.32 017 85 1 1 (3)
01-NOV-07 1510 01 20071101402501100000 493 014 00 1 1 (4)
01-NOV-07 4025 01 20071101402501100000 203.85 016 00 3 1 (5)
01-NOV-07 4025 01 20071101402501100000 487.96 017 00 1 2 (5)
01-NOV-07 4051 03 20071101402501100000 109.26 016 00 3 1 (6)
02-NOV-07 1209 01 20071102120900000000 105.76 014 00 1 1 (7)
8 rows selected.
What I want actually as in the bracket (group by three fields which are txn_date,poc_code and machine_no)
.I hope this is clearer. -
Hi all,
I m creating a table dynamically and after that i m inserting records in tht table dynamically..
After tht i want to fetch all the records from tht table into a cursor which is a SYS_REFCURSOR. as i have to return the data to frntend ..
But when i m opening tht cursor like
OPEN cur_GetCertDetails
FOR
SELECT TRIM(certrefno) As CertNo,
TRIM(damagedno) As Damagedno,
TRIM(personname) As Name,
TRIM(icnumber) As Icnumber,
TRIM(coursename) As CourseName,
TRIM(organiser) As Organiser,
TRIM(location) As Location,
TRIM(TO_CHAR(startdate,'DD-MON-YYYY') ||' ~ '||
TO_CHAR(enddate,'DD-MON-YYYY')) As StartEndDate
FROM ACprintInductionCert;
Its giving error as
64/5 PL/SQL: SQL Statement ignored
73/10 PL/SQL: ORA-00942: table or view does not exist
Dynamically created table name is ACprintInductionCert
Pls help me out ..
I have tried to use EXECUTE IMMEDIATE after FOR but its givin errsince your table is created dynamically, you can not
have the name hardcoded in the cursor....which is precisely the point (or one of them) I made in your Procedure Problem Urgent on this topic.
Once you start down the road of dynamic code execution it is very difficult to stop. Dynamic code has its uses but it should be very much the last resort. Dynamic code means you are literally running untested code in a production environment, and is consequently more likely to fail. Its failures are also more difficult to recover from. It also makes dependency tracking extremely difficult.
Cheers, APC -
Hi All,
Could you please help me out the below SQL query tuning .
Temp table is having 1 Million records
Master table is having 60 Million records
Query :
SELECT B.*,U.ID, SD, LE, LAE
FROM client.Temp B, client.Master
U WHERE U.policyno = B.policyno
AND B.UPFLAG = 0
1. Indexes are created on both email columns and Upflag for both tables.
2. Gathered DBMS Stats for MASTER Table
Data is loading 100k/hour on production .When your query takes too long ...
When your query takes too long ...
HOW TO: Post a SQL statement tuning request - template posting
HOW TO: Post a SQL statement tuning request - template posting -
Need a SQL query(Pls Its urgent)
Hi,
I want a SQL query for the foll..
Details r below..
Table AFPFTRAN
BU TRansactiondate Amt
13202 10-04-05 10,000
13203 11-05-05 20,000
13202 20-04-05 5,000
Table AFGENCOD
BU Clerk Name Clerk Code
13202 Amit TFBG
13203 Anand TFMG
I want a query to get data as below..
Tr Date TFBG TFMG
Apr 15,000 0
May 0 20,000
JUn 0 0
Jul 0 0
Aug
Sep
Aug
Nov
DEc
Jan
Feb
Mar
I want this to achieve using a single query...?How can I achive this?
Pls give the sol...
Adios...
Prashanth DeshmukhDoes it look like you need ?
SQL> select * from t;
BU TDATE AMT
13202 10.04.05 10000
13203 11.05.05 20000
13202 20.04.05 5000
SQL> select * from t1;
BU NAME CODE
13202 Amit TFBG
13203 Anand TFMG
SQL> SELECT pivot_month.mname, tops.TFBG, tops.TFMG
2 from
3 (
4 select to_char(t.tdate,'MM') month_no,
5 sum(decode(t1.code,'TFBG',t.amt,0)) TFBG,
6 sum(decode(t1.code,'TFMG',t.amt,0)) TFMG
7 from t1, t
8 where t.bu=t1.bu
9 and to_char(t.tdate,'yyyy') = 2005
10 GROUP BY t1.code, to_char(t.tdate,'MM')
11 ) tops,
12 (select rownum mn, to_char(to_date(rownum,'MM'),'MON') mname,
13 case when rownum between 1 and 3 then rownum + 9
14 else rownum - 3 end rn
15 from dict where rownum < 13) pivot_month
16 where pivot_month.mn = tops.month_no (+)
17 order by pivot_month.rn
18 /
MNA TFBG TFMG
APR 15000 0
MAY 0 20000
JUN
JUL
AUG
SEP
OCT
NOV
DEC
JAN
FEB
MAR
12 rows selected.Rgds. -
Passing parameter to a SQL query - Please help
Hi All,
I am new to JDBC. I have been trying to pass an external variable to an SQL Query.
The query is
String username1="le";
PreparedStatement pstmt = null;
pstmt = c.prepareStatement("select * from users where USER_NAME like '%?%'");
pstmt.setString(1, username1);
pstmt.executeQuery();
ResultSet rs = pstmt.getResultSet();
I am trying to retrieve values from the users table where the USER_NAME column value that is a String contains the supplied value username1.
I am using the question mark (?) character to pass the value from the variable username1. I am also using the '%' substitution character which matches for any number of characters. So, the above query should retrieve rows where the USER_NAME is something like "charles","leander","Elena" etc.( that contains "le")
I am getting the error:
SQLException: java.sql.SQLException: ORA-01006: bind variable does not exist
I changed the query to
PreparedStatement pstmt = null;
pstmt = c.prepareStatement("select * from users where USER_NAME like '% " + username1 + "%'");
//pstmt.setString(1, username1);
pstmt.executeQuery();
This time , it is not giving the error and retrieving properly.
But I want to use the original query and use the "pstmt.setString(1, username1); " . Is there any way of achieving this?
Please help.
Cheers,
charles_amhi,
try this...
String username1="%le%";
pstmt = c.prepareStatement("select * from users where USER_NAME like ?")
pstmt.setString(1,username1);
cheers,
rpk -
Reconfiguring JCo (Urgent Pls Help ASAP)
Dear all,
My back-end CRM system is getting migrated. So IP, username, password, client will get change.
Now I have currently imported 8-10 RFC models from this existing CRM system. I have one JCo configured for the same.
So if i change the existing JCo's settings (IP, username, password, Client etc) from Wed Dynpro Content Administrator for new system, then will those model work? Or I have to re-import the models again???
Pls help me asap as I have to convey estimated system downtime to business.
Thank you in advance.
Regards,
AmeySo if i change the existing JCo's settings (IP, username, password, Client etc) from Wed Dynpro Content Administrator for new system, then will those model work? Or I have to re-import the models again???
Yes. we can change JCo settings to point a different system
if signature of RFC are same in both CRM instance, there is no need of re-import.
Best Regards,
nikhil -
Hi All,
We have a native SQL query accessing Oracle database(given below).
Can anyone please let me know what this query is about and how can we fine tune the query?
SELECT O.OBJECT_NAME ,
H.SID,
HS.MACHINE,
HS.PROCESS,
W.SID,
WS.MACHINE,
WS.PROCESS,
H.CTIME,
W.CTIME,
WS.ROW_WAIT_OBJ#,
WS.ROW_WAIT_FILE#,
WS.ROW_WAIT_BLOCK#,
WS.ROW_WAIT_ROW#,
HP.SPID,
WP.SPID
FROM V$LOCK H, V$LOCK W, V$LOCK I, V$LOCK I2, ALL_OBJECTS O,
V$SESSION HS, V$SESSION WS, V$PROCESS HP, V$PROCESS WP
WHERE H.ID1 = W.ID1
AND H.SID <> W.SID
AND H.TYPE IN ('TX','DL')
AND H.REQUEST = 0
AND H.SID = I.SID
AND I.TYPE = 'TM'
AND I.ID1 = O.OBJECT_ID
AND I.ID1 = I2.ID1
AND W.SID = I2.SID
AND I2.TYPE = 'TM'
AND H.SID = HS.SID
AND W.SID = WS.SID
AND HS.PADDR = HP.ADDR
AND WS.PADDR = WP.ADDR
INTO :EXCL_LOCK_WAITERS-OBJ_NAME ,
:EXCL_LOCK_WAITERS-HOLDER_SID ,
:EXCL_LOCK_WAITERS-H_HOSTNAME ,
:EXCL_LOCK_WAITERS-HOLDER_PID ,
:HOLDER_PID ,
:EXCL_LOCK_WAITERS-WAITER_SID ,
:EXCL_LOCK_WAITERS-W_HOSTNAME ,
:EXCL_LOCK_WAITERS-WAITER_PID ,
:WAITER_PID ,
:EXCL_LOCK_WAITERS-HELD_SINCE ,
:EXCL_LOCK_WAITERS-WAITSSINCE,
:ROW_WAIT_OBJ,
:ROW_WAIT_FILE,
:ROW_WAIT_BLOCK,
:ROW_WAIT_ROW,
:H_PROCESS,
:W_PROCESS
ENDEXEC
Thanks in advance.
Neethu MohanHi Neethu,
It gives you an overwiew of blocking Oracle sessions.
1. In general, the SQL checks Oracle sessions (SID's) that were requirering a DML lock ('TM') and now holding row locks (TX) to prevent destructive interference of simultaneous conflicting DML or DDL operations. DML statements automatically acquire both table-level locks and row-level locks ('TX') => holders
It joins these with the sessions that are waiting of releasing the lock by the holders => waiters.
2. it retrieves the detail information wich Oracle process , the object (table) , it's row , block and file
are affected by the locks.
3. Normally, the locks are only hold for a short period of time. If you have blocking sessions it may be of a log running task (i.e. mass data update of a table) ; but it could also be a application bug due to improper handling of concurrent updates of the same object.
4. Tuning
V$tables are expensive to query: Why?
v$ tables are generally Oracle memory structures.
v$ tables are not read consistent.
v$ tables require latches to access -- cannot modify and read memory at the same
time.
heavy access to v$ tables like this may cause some serious heavy duty contention.
Especially if you self join V$lock several times.
So the best would be to save the contents of V$LOCK in some table:
Create table mylocks as select * from v$lock;
Use that table for self-joining and joins to the other tables.
You can also CTAS the other v$ tables to bypass the performance bottleneck while retrieving
v$ directly.
You can empty or drop the created tables any time for new data.
Because you want to investigate only lock hold for a longert time to copy the v$ memory structures into
physical tables is not a disadvantage. You certainly will wait longer on finishing your query
instead of copy them into the tables.
Hope this helped
yk -
I have a row output like this
select * from test;
s.no C1 C2 C3
1 a1 b1 x1
2 a1 b1 x2
3 a1 b1 x3
i want the output as with the new added column as like this
s.no C1 C2 C3 C4
1 a1 b1 x1 a1
2 a1 b1 x2 b1
3 a1 b1 x3 x3
pls help me in this query its urgent for the solutionHello,
So, what is the complexity in this query? Would you like to mention from where you will get that C4 column?
-Ammad -
hiii,
I have a table which has 14 rows & 8 cols.
I want covert it into 14 cols & 8 rows,
by using sql how to do it..pls help me.Oracle Database Search Results: pivot
-
Hi all
i am new to abap
I have the following requirement.
kindly help me how to write the select queries to achieve it.
its urgent
pls help me
thanks in advance
In June of year 1, new budget prices must be determined for the following year (year 2). The budget prices for year 2 are calculated out of the average contract prices in the first 5 months of year 1 (January May). The average contract price will then (outside the system) be corrected with an index. To calculate new prices for Campina Netherlands, a report is needed to show all materials with current budget price, volumes and contract prices during the first five months of year 1
The purchasing assistant creates an excel file per Material type, based on the Budget pricelist out of SAP.
Purchasers check the file on:
 being correct,
 materials marked for deletion in SAP
 changes to be made in data
The new prices, calculated based ion the output of the SAP Budget pricelist, are sent to controlling in june year 1.
On the 1st of January year 2 the new budget prices are inserted in SAP as the new standard price / budget price.
the fields for display are as follows
<b>table</b> <b> field<b>[/b</b>] <b> description</b>
ekko ekorg pur org
ekpo matnr mat no
makt maktx mat des
cawn zunspsc unspsc code
mbew stprs standard price
mbew peinh price unit
mara meins base unit of measure
s012 menge purchsed amount of mat
in month 1
s012 menge purchsed amount of mat
in month 2
s012 menge purchsed amount of mat
in month 3
s012 menge purchsed amount of mat
in month 4
s012 menge purchsed amount of mat
in month 5
ekpo netpr net price on date criteria 1
ekpo peinh price unit
ekpo bprme order price unit
ekpo netpr net price on date criteria 2
ekpo peinh price unit
ekpo bprme order price unit
ekpo netpr net price on date criteria 3
ekpo peinh price unit
ekpo bprme order price unit
ekpo netpr net price on date criteria 4
ekpo peinh price unit
ekpo bprme order price unit
ekpo netpr net price on date criteria 5
ekpo peinh price unit
ekpo bprme order price unitHi,
DATA: begin of i_ekpo,
menge........
netpr............
date ..........
end of i_ekpo.
Select menge netpr date
from ekpo
into table i_ekpo
where ....
if sy-subrc = 0.
LOOP AT i_ekpo.
v_month = i_ekpo-date+4(2).
CASE v_month.
WHEN '01'
itab-menge1 = i_ekpo-menge.
itab-menge5 = i_ekpo-menge.
itab-netpr1 = i_ekpo-netpr.
itab-netpr5 = i_ekpo-netpr.
WHEN '02'.
itab-menge1 = i_ekpo-menge.
itab-menge5 = i_ekpo-menge.
itab-netpr1 = i_ekpo-netpr.
itab-netpr5 = i_ekpo-netpr.
WHEN '03'.
itab-menge1 = i_ekpo-menge.
itab-menge5 = i_ekpo-menge.
itab-netpr1 = i_ekpo-netpr.
itab-netpr5 = i_ekpo-netpr.
WHEN '12'.
itab-menge1 = i_ekpo-menge.
itab-menge5 = i_ekpo-menge.
itab-netpr1 = i_ekpo-netpr.
itab-netpr5 = i_ekpo-netpr.
ENDCASE.
APPEND itab.
ENDLOOP.
Please be more specific with some sample outputs how is should be. -
Hi
I have an assignment due today at midnight, I need some help please please....
the assignment is about implementing a tow-dimensional sparsearrays using LinkedList
here is what I've got so far and I am not even sure
import java.*;
public class SparseMatrix implements SparseMatrixInterface{
//members
private Object defaultValue = 0;
private List[] rowHead = null;
private List[] colHead = null;
private List current = null;
private List previous = null;
private Object value = null;
//constructor
public SparseMatrix(int rIndex, int cIndex)
if(rIndex <= 0) System.exit(rIndex);
if(cIndex <= 0) System.exit(cIndex);
rowHead = new List[rIndex];
colHead = new List[cIndex];
//SparseMatrixInterface
//iterateRow(), iterateCol() should return another iterator
@Override
public Object defaultValue() {return defaultValue;}
@Override
public RowIterator iterateRow() {return null;}
@Override
public ColIterator iterateCol() {return null;}
@Override
public Object fetch(int row, int col) {
do{
if((row == current.row) && (col == current.col)) {return current.value;}
current = current.next;}
while(row < current.row && col < current.col && current.next != defaultValue);
return defaultValue;}
@Override
public void store(int row, int col, Object value) {}
//methods
private void display(){int count = 0; List value; System.out.println();}
private void addRow(int rIndex, Object value){}
private void addColumn(int cIndex, Object value){}
private int getRowCount(int cIndex){return List[rIndex].length;}
private int getColumnCount(int cIndex){return List[cIndex].length;}
//Colterator class
//next() should return another iterator
private class Colterator
public boolean hasNext() {return current != null && current.next != null;}
public ElementIterator next() {return null;}
//RowIterator class
//next() should return another iterator
private class RowIterator
public boolean hasNext() {return current != null && current.next != null;}
public ElementIterator next() {return null;}
//ElementIterator
//iteratingRow() true if a call to next from ColIterator
//iteratingCol() true if a call to next from RowIterator
private class ElementIterator implements MatrixInterface
public boolean iteratingRow() {return true;}
public boolean iteratingCol() {return true;}
public int nonIteratingIndex() {
if (iteratingRow())return rIndex();
if (iteratingCol())return cIndex();
return 0;}
public boolean hasNext() {
return current.getRow() != 0 && current.next.getRow() != 0
|| current.getCol() != 0 && current.next.getCol() != 0;}
public MatrixInterface next() {
if(hasNext() == true) previous = current; current = current.getNext();
return (MatrixInterface) current.value;}
//MatrixInterface
public int rIndex() {return current.getRow();}
public int cIndex() {return current.getCol();}
public Object value() {return null;}
//nested class
private class List{
private List next = null;
private int row = 0;
private int col = 0;
private Object value = null;
public void setNext(List next) {this.next = next;}
public void setRow(int row) {this.row = row;}
public void setCol(int col) {this.col = col;}
public void setValue(Object value) {this.value = value;}
public List getNext() {return next;}
public int getRow() {return row;}
public int getCol() {return col;}
public Object getValue() {return value;}
}please fill in the missing parts
I really appreciate it.
you can email me at [email protected]Let me just post a couple of important parts of the [FAQ's|http://wikis.sun.com/display/SunForums/Forums.sun.com+FAQ] of Sun's forum:
Be thorough and precise: Proofread your question before posting. Describe the steps that you have taken. The more effort you put into researching and describing your problem, the more likely you will get a sincere effort in return.
Post a subject line that describes the problem: Experts in your subject may skim right past subject lines like "Urgent" and "Need help ASAP". Use keywords about the technologies instead.
Post a problem, not an assignment: Break your assignment down into specific problems that you can ask for help with. Dorm hall lounges may be a better resource if you have a last minute, "urgent" demand for solutions to homework problems.
Maybe you are looking for
-
Lets say you have two columns one that renders as an image the other text. Why is it that the image gets distorted when there is more text. Is there anyway to fix this?
-
My PC was recently taken back to the factory settings and as a result I lost my itunes library and software. The uploaded tunes are still on the ipod but I can't link this to a PC with the new software on it as i think it will delete the music. Can a
-
Is there anythin like swing jtable you can use in html pages. Thank you very much
-
APERTURE3 changing all my in camera color corrections while importing?
hey everyone finally made the switch to aperture 3, not sure what im doing wrong but whenever i import the pictures from my PANASONIC GF1 or CANON 50D all the in camera color corrections (for example white balance or conversion to black and white ) t
-
Oracle.DataAccess.Client not found[SOLVED]
Hello, I am trying to run a stored procedure using C# and I need to use the Oracle.DataAccess.Client but when i enter "using Oracle.DataAccess.Client;" visual studio throws the error: Error 1 The type or namespace name 'Oracle' could not be found (ar