How to write test procedures of the following code, need someones help
ITS VERY URGENT.....PLEASE SEND ME THE REPLY ON MY EMAIL ID [email protected]
// Account.java - Data class for account files
// MODULE INDEX
// NAME CONTENTS
// Account Constructor
// Account Constructor
// getAccountNo Get account identifier
// getAccountType Get account type
// getCustNo Get customer identifier
// getBalance Get balance
// getCurCode Get currency code
// setAccountNo Set account identifier
// setAccountType Set account type
// setCustNo Set customer identifier
// setBalance Set balance
// setCurCode Set currency code
// MAINTENANCE HISTORY
// DATE PROGRAMMER AND DETAILS
// 6-5-08 TLT Original
// IMPORTATIONS
import java.util.*;
import java.lang.*;
// CLASS DECLARATIONS
public class Account
// INSTANCE DATA
private String accountNo; //Account identifier
private String accountType; //Account type
private String custNo; //Customer identifier
private double balance; //Balance
private String curCode; //Currency code
// CLASS CONSTRUCTOR
Account (
String accountNo) //Account idenfier
this.accountNo = accountNo;
Account (
String accountNo, //Account identifier
String accountType, //Account type
String custNo, //Customer identifier
double balance, //Balance
String curCode) //Currency code
this.accountNo = accountNo;
this.accountType = accountType;
this.custNo = custNo;
this.balance = balance;
this.curCode = curCode;
// Get account identifier
String getAccountNo () {
return accountNo;
// Get account type
String getAccountType () {
return accountType;
// Get customer identifier
String getCustNo () {
return custNo;
// Get balance
double getBalance () {
return balance;
// Get currency code
String getCurCode () {
return curCode;
// Set account identifier
void setAccountNo (
String accountNo)
this.accountNo = accountNo;
// Set account type
void setAccountType (
String accountType)
this.accountType = accountType;
// Set customer identifier
void setCustNo (String custNo) {
this.custNo = custNo;
// Set balance
void setBalance (double balance) {
this.balance = balance;
// Set currency code
void setCurCode (String curCode) {
this.curCode = curCode;
}
123shweta wrote:
ITS VERY URGENT.....W00t? Well if its soo urgent then perhaps you should learn from this and do some planning ahead in the future so you dont find ur self in these urgent needs.
PLEASE SEND ME THE REPLY ON MY EMAIL ID [email protected]
Wat tha.., do you expect someone to just magically solve your problem for ya just like that? with an half asked question even.
Last but not least.. Why would you even need an test for an getters and setter class?
Similar Messages
-
Pls help me in write a join for the following code.
can any one give me optimized code for the posted query..
DATA :BEGIN OF BAPITABLE OCCURS 1,
EDITELEM LIKE TOJTB-EDITELEM,
FUNCTION LIKE SBAPIS-FUNCTION,
SHORTTEXT LIKE TFTIT-STEXT,
END OF BAPITABLE.
SELECT EDITELEM INTO (BAPITABLE-EDITELEM)
FROM TOJTB
WHERE APPLIC = APPLICATIONCODE
AND MODELONLY = 'R'
and ACTIVE = 'X'.
SELECT FUNCTION INTO (BAPITABLE-FUNCTION)
FROM SBAPIS
WHERE OBJECT = JEDITELEM.
SELECT STEXT INTO (BAPITABLE-SHORTTEXT)
FROM TFTIT
WHERE SPRAS = 'EN' AND FUNCNAME = BAPITABLE-FUNCTION.
APPEND BAPITABLE.
ENDSELECT.
ENDSELECT.
ENDSELECT.
waiting for ur replies....
RESHALIHi
i'm giving you a sample code please change according to your requiirement.
I've taken required fields from 3 different tables and put them in one internal table.
please see the following code.
types : begin of ty_kna1,
kunnr type kna1-kunnr,
name1 type kna1-name1,
vbeln type vbap-vbeln,
erdat type vbak-erdat,
end of ty_kna1.
data : it_kna1 type table of ty_kna1,
wa_kna1 type ty_kna1.
data : it_fieldcat type slis_t_fieldcat_alv,
wa_fieldcat type slis_fieldcat_alv.
start-of-selection.
select kkunnr kname1 v1erdat v2vbeln
into corresponding fields of table it_kna1
from ( ( kna1 as k
inner join vbak as v1 on kkunnr = v1kunnr )
inner join vbap as v2 on v1vbeln = v2vbeln )
up to 100 rows.
Reward if helpful
Regards
Lakshman -
Hello
I keep getting an error message when I write the following
<?if:LanguagePreference_ID335='F'?><?'Numéro d’inscription TVQ'?><?end if?>
Is there anyway to write this code and keep the apostraphy?try as below:
<?if:LanguagePreference_ID335='F'?><?'Numéro d?’inscription TVQ'?><?end if?>
Cheers
AJ -
How to write a query for the following issue
Hello,
I would like to write a query to display the result in the following format
Item
Categort1
Categort2
Categort3
Categort4
Categort5
Categort6
Min
Max
Avg
Min
Max
Avg
Min
Max
Avg
Min
Max
Avg
Min
Max
Avg
Min
Max
Avg
01
02
03
04
For every item for the category i need to find Min,Max and Avg from the Value column
Table structure is as follows
ID
Item Id
Item
Category
value
1
01
A
Categort1
1
2
01
A
Categort1
2
3
01
A
Categort1
3
4
02
B
Categort2
7
5
02
B
Categort2
8
6
03
C
Categort3
6
7
04
D
Categort4
12
8
04
D
Categort4
14SELECT ItemID,
MIN(CASE WHEN Category = 'Categort1' THEN value END) AS Min_category1,
MAX(CASE WHEN Category = 'Categort1' THEN value END) AS Max_category1,
AVG(CASE WHEN Category = 'Categort1' THEN value END) AS Avg_category1,
MIN(CASE WHEN Category = 'Categort2' THEN value END) AS Min_category2,
MAX(CASE WHEN Category = 'Categort2' THEN value END) AS Max_category2,
AVG(CASE WHEN Category = 'Categort2' THEN value END) AS Avg_category2,
MIN(CASE WHEN Category = 'Categort6' THEN value END) AS Min_category6,
MAX(CASE WHEN Category = 'Categort6' THEN value END) AS Max_category6,
AVG(CASE WHEN Category = 'Categort6' THEN value END) AS Avg_category6
FROM Table
GROUP BY ItemID
The format can be achieved using tools like SSRS
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
How to write a procedure with the table name as an argument
I'm very new to Oracle, usually developing in SQL server.
I would like to write a procedure that accepts a table name and then does a
SELECT * FROM [table name] order by CollectionDate.
In SQL I would build up a varchar variable and then execute it.
ThanksI often wonder why so many people new to Oracle want to do this as a first step, when most people who know what they are doing try and avoid it.
SQL> create or replace function f (p_tab varchar2)
2 return sys_refcursor as
3 c sys_refcursor;
4 begin
5 open c for
6 'select * from ' || p_tab || ' order by hiredate';
7 return c;
8 end;
9 /
Function created.
SQL> var c refcursor
SQL> exec :c := f('emp')
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7369 SMITH CLERK 7902 12/17/1980 800 20
7499 ALLEN SALESMAN 7698 02/20/1981 1600 300 30
7521 WARD SALESMAN 7698 02/22/1981 1250 500 30
7566 JONES MANAGER 7839 04/02/1981 2975 20
7698 BLAKE MANAGER 7839 05/01/1981 2850 30
7782 CLARK MANAGER 7839 06/09/1981 2450 10
7844 TURNER SALESMAN 7698 09/08/1981 1500 0 30
7654 MARTIN SALESMAN 7698 09/28/1981 1250 1400 30
7839 KING PRESIDENT 11/17/1981 5000 10
7900 JAMES CLERK 7698 12/03/1981 950 30
7902 FORD ANALYST 7566 12/03/1981 3000 20
7934 MILLER CLERK 7782 01/23/1982 1300 10
7788 SCOTT ANALYST 7566 12/09/1982 3000 20
7876 ADAMS CLERK 7788 01/12/1983 1100 20
14 rows selected.
SQL>Note if you pass in a value to be used in the where clause like deptno, you should not use this technique, but use bind variables intead like this -
Wrote file afiedt.sql
1 create or replace function f (p_tab varchar2, p_deptno number)
2 return sys_refcursor as
3 c sys_refcursor;
4 begin
5 open c for
6 'select * from ' || p_tab
7 || ' where deptno = :p_deptno order by hiredate'
8 using p_deptno;
9 return c;
10* end;
SQL> /
Function created.
SQL> exec :c := f('emp', 10)
PL/SQL procedure successfully completed.
SQL> print c
EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
7782 CLARK MANAGER 7839 06/09/1981 2450 10
7839 KING PRESIDENT 11/17/1981 5000 10
7934 MILLER CLERK 7782 01/23/1982 1300 10
SQL> -
How to write selection Query for the following requirment.
Hi All,
I am new to ABAP, I need a help ,
I need to select all plants(WERKS) from MARC at Plant/Material level,
then I need to take all sales organozation(VKORG) from T001w,
then I need the company code(BUKRS) from TVKO based on VKORG,
then I need the currency key(WAERS) from T001 based on BUKRS,
Can any one help me in writing selection Query for the same?
Thanks All,
Debrup.Hi,
Its easy for you if you learn SELECT with JOIN to complete your task. So SEARCH the forum with SELECT statement and you will get a lot of examples using which you can write your own.
If you struck up anywhere revert back.
Regards
Karthik D -
How to write query to get the following o/p
Hi i've the following data and
create table hirarchical(prnt_id number,child_id number)
insert into hirarchical values(1,2)
insert into hirarchical values(1,3)
insert into hirarchical values(1,4)
insert into hirarchical values(2,5)
insert into hirarchical values(2,6)
insert into hirarchical values(2,7)
insert into hirarchical values(3,8)and
If i give in where condition prnt_id=1 then
the o/p should be 7 instead of 1 as it's having all connected childs...
thanks in advanceuser10502250 wrote:
If my reply is correct or helpful please mark it so.Begging for points is unprofessional and considered poor netiquette. It also makes a mockery of the already poor points system, by putting pressure on the original poster to award points for answers that may or may not be the most helpful or correct. If your answer is correct or helpful and meets the needs of the original poster then it is entirely up to them to award points as they see fit when they feel they have had sufficient answers or responses. Most of the people on the forum who have gained a lot of points have done so through providing good answers and without needing to ask for them. Please avoid such begging in future. -
How to creat an xsl for the following code ?
Hi all !
Could any one help me to creat an xsl (in the form of table) for the following xml data ?
<?xml version="1.0" encoding="UTF-8"?>
<scenarioReport>
<node name="V2_DR">
<netObjId >1 </netObjId>
<result>undefined</result>
<report>xyz</report>
<action>no action</action>
<netObjId > 2 </netObjId>
<result>defined</result>
<report> sdfherh</report>
<action>action</action>
</node>
<node name="V3_DR">
<netObjId >1 </netObjId>
<result>undefined</result>
<report>xyz</report>
<action>no action</action>
<netObjId > 2 </netObjId>
<result>defined</result>
<report>dfhdfj</report>
<action>action</action>
</node>
</scenarioReport>
could you please send me as soon as possible !!!!To do that you would have to know what output the XSL should produce, based on the input. You haven't said anything about that. All you have posted is a single XML file which could be either the input or the output of this mythical XSL. Do what Steve said and read the tutorial.
-
How to read cursor position in the following code?
I am using reuse_alv_list_display
FORM user_command USING r_ucomm LIKE sy-ucomm
rs_selfield TYPE slis_selfield.
DATA:gs_selfield TYPE slis_selfield,
ok_code LIKE sy-pfkey.
CASE r_ucomm.
WHEN '&IC1'.
gs_selfield = rs_selfield.
IF gs_selfield-fieldname = 'EBELN'.
MOVE 'EVRTN' TO rs_selfield-fieldname.
SET PARAMETER ID 'VRT' FIELD rs_selfield-value.
SET PARAMETER ID 'BES' FIELD rs_selfield-value.
CALL TRANSACTION 'ME38' AND SKIP FIRST SCREEN.
ELSE.
IF gs_selfield-fieldname = 'MATNR'.
SET PARAMETER ID 'MAT' FIELD rs_selfield-value.
CALL TRANSACTION 'MM03' AND SKIP FIRST SCREEN.
ENDIF.
ENDIF.
ENDCASE.
ok_code = sy-ucomm.
READ TABLE it_rep_tab INTO wa_rep_tab INDEX l_selfield-value.
SET PARAMETER ID 'MAT' FIELD wa_rep_tab-matnr.
SET PARAMETER ID 'WRK' FIELD wa_rep_tab-werks.
CASE ok_code.
WHEN 'MD04'.
CALL TRANSACTION 'MD04'." AND SKIP FIRST SCREEN.
WHEN 'MMBE'.
CALL TRANSACTION 'MMBE'." AND SKIP FIRST SCREEN.
WHEN 'MD51'.
CALL TRANSACTION 'MD51' ."AND SKIP FIRST SCREEN.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
ENDCASE.
ENDFORM.
Please help me............
but here not getting values ib l_selfield-value when I place in the toolbar.
Please help me.you have to read your itab in a workarea yourself using the correct index using the returned rs_selfield-tabindex.
so you have allways the correct values. -
HELP! How to load multiple swfs using the following code?
In actions for Frame 1:
var myrequest:URLRequest=new URLRequest("A.swf");
var myloader:Loader=new Loader();
myloader.load(myrequest);
img1.addEventListener(MouseEvent.CLICK, clickButton);
function clickButton(event:MouseEvent):void{
stage.addChild(myloader);
img1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToAndStopAtFrame_5);
function fl_ClickToGoToAndStopAtFrame_5(event:MouseEvent):void
gotoAndStop(13);
In action for Frame 13: (img2 is another button)
img2.addEventListener(MouseEvent.CLICK, unloadFunction);
function unloadFunction(event:Event):void{
stage.removeChild(myloader);do you want to load another swf (eg, B.swf) when you're in frame 13 and img2 is clicked? if yes, and you don't want A.swf to continue to play, use:
//In action for Frame 13: (img2 is another button)
img2.addEventListener(MouseEvent.CLICK, loadF2);
function loadF2(event:Event):void{
myloader.load(new URLRequest("B.swf")); -
Error in the following code.need help asap
hi i have written a block which bulk collects into a pl/sql table.
Getting an error as shown below.
PLz help asap
declare
type summary_upd_tab is table of summary%rowtype;
summary_upd_var summary_upd_tab;
begin
select
min(a.start_time_utc),
max(a.end_time_utc),
sum(duration_seconds),
sum(upload_bytes),
sum(download_bytes)
bulk collect into summary_upd_var ------GEETTING AN ERROR --TOO MANY VALUES???
from aaa_sessions a
group by user_id;
---,type_of_summary,ispeak;
end;
Edited by: user8731258 on Jul 20, 2010 10:16 PMi think the no. of columns should match(and that too in Order) else how will it know which value should go in which field of the collection ?
-
hii am new to oracle , can u help me how to write a procedure for the following query
Transfer Funds between Accounts:
Table: AccountMaster (AcctNo (primary key), AcctHolderName, currentBal
Data: 1, 'A', 1000
2, 'B', 3000
3, 'C', 4000
Function: getBalance (AcctNo)
Stored Proc: tranferFunds (FromAcctNo IN, ToAcctNo IN, Amt IN, result OUT)
The proc should use the function getBalance (AcctNo) to find out the current balance for account.
The proc should return a value of 1 if the transfer was successful.
It should return a value of -1 if the funds are not sufficient in the fromAccount to transfer.
Thanx ,
Raj0412I would start by asking your teacher to clarify the parts of the assignment that are not clear to you.
You may also want to read some books.
http://download.oracle.com/docs/cd/B19306_01/server.102/b14200/toc.htm
http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm -
How to write a procedure for update the table
Hi all
can any body please tell me how to write a procedure to update the table......
I have a table with about 10,000 records...........Now I have add a new column and I want to add values for that like
registration Code Creidits
13213 BBA
1232 MCS
I had add the creidit now i want to update the table.........the new value want to get by SQL like
Creidit = select creidit from othere_table...........
Hope u can understand my problem
Thanks in advance
Regards
Shayan
[email protected]Please try the following --
update Program_reg a
set TotalCreidit = ( select tot_cr <Accroding to your logic>
from Program_reg b
where a.Registration = b.Registration
and a.Enrollment = b.Enrollment
and a.code = b.code
where a.Registration in ( select distinct Registration
from Program_reg );
N.B.: Not Tested....
Regards.
Satyaki De. -
How to write a procedure to run the call the custom package from backend
Hi All
Oracle 10g
Oracle Apps R12
I am working with oracle order management here we have a customize Package called (Pick Release).Due to some problem we have running this concurrent program by manually giving Route_id as parameter. The route_id is taken from the route Table. By using this query
select distinct route_id from route@DB_LINK_APPS_TO_ROADSHOW
where trunc(route_date) = trunc (sysdate+2).
so daily we have nearly 42 routes and we are running this concurrent program manually nearly times.
so now how to write a procedure for this
Step 1 Getting the route from route table.( By cursor we can get the route_id Accordingly)
Step 2 How to trigger the custom package from back end and execute accordingly to that output of the cursor(route_id)
If the cursor get 40 routes is it then the concurrent program runs 40 times according to that route_id.
can some could provide the steps to do this
Thanks & Regards
Srikkanth.MThis is about 4 or 5 lines of PL/SQL and the name of the custom package is not provided.
If you request someone in this forum to do your work for free -because obviously you didn't even try to write it, which must be considered abusing this forum- you must at least provide sufficient info so someone can do it.
And no, I won't do it for you.
Sybrand Bakker
Senior Oracle DBA -
How to write a procedure to retrieve data in a collection from a table?
create or replace type Subject as object(
subject_id number,
subject_Desc varchar2(50)
create or replace type Subjects_All as varray(10) of Subject
create table student(
StudentID varchar(10),
Subjects Subjects_all
so how do i write a procedure to display info such as this:
Subjects:
101 'Maths'
102 'Science'
Subjects:
I wrote a procedure like the following but it didn't quite work :(
CREATE OR REPLACE PROCEDURE StudentLoop AS
all_subj subjects_all;
each_subj subject;
CURSOR all_subjectsrow IS select * from student;
BEGIN
FOR all_subj IN all_subjectsrow LOOP
FOR each_subj IN all_subj LOOP
DBMS_OUTPUT.PUT_LINE('Last row selected has ID ' || each_subj.subject_id || each_subj.subject_desc );
END LOOP;
END LOOP;
END StudentLoop ;
Any Advice?Hello,
1.) Don't store Types in Tables. It will become a nightmare when you want to query your data any other way then retrieving your object types. Just don't do it.
2.) A more relational model is much easier. Considering students and subjects is a n:n relation (a student can have more subjects and a subject can have more students) this might look like this:
SQL> r
1 declare
2 cursor cStudents is
3 with student as (
4 select 1 student_id, 'test1' name from dual
5 union all
6 select 2 student_id, 'test2' name from dual
7 ),
8 subjects as (
9 select 1 subject_id, 'Maths' subject_desc from dual
10 union all
11 select 2 subject_id, 'Science' subject_desc from dual
12 ),
13 student_subjects as (
14 select 1 student_id, 1 subject_id from dual
15 union all
16 select 1 student_id, 2 subject_id from dual
17 union all
18 select 2 student_id, 2 subject_id from dual
19 )
20 select a.name name, b.subject_desc subject
21 from student a, subjects b, student_subjects c
22 where a.student_id = c.student_id
23 and b.subject_id = c.subject_id;
24 begin
25 for rS in cStudents loop
26 dbms_output.put_line('Student '||rS.name||': '||rS.subject);
27 end loop;
28* end;
Student test1: Maths
Student test2: Science
Student test1: Sciencecheers
Maybe you are looking for
-
i am fairly new to JSP. I need to create a form(html,jsp) that interacts with oracle database (help desk ticketing system to input problems). I am using jdeveloper as a software to develop it. Are there any tutorial or some kind of documentation avai
-
HT1551 AppleTV is no longer recognizing my password.
AppleTV is no longer recognizing my password. I streamed a purchased TV show an hour or so ago and had to enter my password and everything was fine. When I went to stream another episode, I was asked to enter my password and was told it was incorre
-
Attributes / Variable assignment in Excel
How do you create a variable assignment in Excel that passes the "test script coverage" report? We thought we were being clever when we put a list of our variable assignments in Excel. This allowed us to sort the assignments (something we could not d
-
Error installing Application Express 3.1.2 on oracle 11g
Hi I was trying to install APEX on Oracle 11g. Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - Production PL/SQL Release 11.1.0.6.0 - Production CORE 11.1.0.6.0 Production TNS for Linux: Version 11.1.0.6.0 - Production NLSRTL Version 11.1
-
How do I navigate a long song quickly?...markers?
Hey there...I'm new to logic express. Just trying to find ways to work quickly. I understand that logic pro has markers but xpress doesnt...I assume they are used to set up sections for quick navigation. Can someone tell me the best way to navigate a