Help me check this coding!
The following is my coding which is my assignment. i doubt i have logic problem. So, help me check this about multi-thread.
if it's wrong which you find, help me correct.I have thought this several days, but till now, i have no any good idea to correct.
import java.io.*;
import java.net.*;
import java.util.*;
public class WebServer extends Thread{
public WebServer(int port,int timeOut,int maxUser){
public void run(){
for (int i=0;i<=maxUser;i++){
Thread t=new Thread(new HTTPRequest());
t.start();
while(true){
Socket connectionSocket;
try{
connectionSocket=server_Socket.accept();
HTTPRequest.processRequest(connectionSocket);
}catch (IOException e){}
public static void main(String args[]) throws Exception{
class HTTPRequest implements Runnable{
private static List pool= new LinkedList();
public static void processRequest(Socket v_socket) throws IOException{
synchronized(pool){
pool.add(pool.size(),v_socket);
pool.notifyAll();
public synchronized void run(){
while(true){
socket=null;
synchronized (pool){
while(pool.isEmpty()){
try{
pool.wait();
}catch(InterruptedException e){}
socket=(Socket)pool.remove(0);
try{
}catch (IOException e){}
finally {
try{
}catch (IOException e){}
You don't have a specific problem right?
I don't see anything terribly wrong with it.
Other stuff:
Why is WebServer a thread? Will there be more than one?
Use notify() not notifyAll(). You are only adding one object so only one thread needs to service it.
The run() loop for HTTPRequest does not exit after serving a socket right. Hard to tell from your posting without code blocks.
Don't forget to close the sockets.
Similar Messages
-
Could Anyone Help Me Comment This Coding
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onComplete, false, 0, true);
loader.addEventListener(IOErrorEvent.IO_ERROR, onIOError, false, 0, true);
loader.load(new URLRequest("game.xml"));
ii Need To Comment My Coding And ii Cant Remember What This Does Again..
ii Know Part Of It ii Think But Not Sure..
Thanks.You should examine each line and figure out what each is doing and comment each one. TAke a stab at it yourself first, then ask for help.
-
Please, Help me check this code
public Data class{
private static void new(){
PreparedStatement ps = conn.prepareStatement("INSERT INTO Members " +
"VALUES(?, ?, ?, ?)");
ps.setString(1, "14");
ps.setString(2, "Mike");
ps.setString(3, "Nwabikwo");
ps.setString(4, "14/10/2008");
ps.executeUpdate();
public static void main(String [] arg){
new();
Where conn is a Connection object that connects to JDBC-ODBC
When I tried to run it, I expect it to update the Database but it does not
and no exception is reported.
Please, tell me where the problem is.Phemmy wrote:
public Data class{
private static void new(){
PreparedStatement ps = conn.prepareStatement("INSERT INTO Members " +
"VALUES(?, ?, ?, ?)");
ps.setString(1, "14");
ps.setString(2, "Mike");
ps.setString(3, "Nwabikwo");
ps.setString(4, "14/10/2008");
ps.executeUpdate();
public static void main(String [] arg){
new();
Where conn is a Connection object that connects to JDBC-ODBC
When I tried to run it, I expect it to update the Database but it does not
and no exception is reported.
Please, tell me where the problem is.it's because you don't commit the update and close your Connection properly. you don't close any resources correctly, so your code is flawed in every way.
you save a date as a string? awful. make a date a date.
% -
I just bought this movie "Godzilla 2014" but it won't show in my Movie Library. I closed my Itunes and put it back on again but still won't show up. I checked my purchased list and it shows that I recently bought the movie but when I checked the itunes store it wants to buy the movie again. Please help me with this right away Apple.
Apple Store Customer Service at 1-800-676-2775 or visit online Help for more information.
To contact product and tech support: Contacting Apple for support and service - this includes
international calling numbers..
For Mac App Store: Apple - Support - Mac App Store.
For iTunes: Apple - Support - iTunes. -
Mail on my Mac computer does not update when I update my mail on my iPhone and iPad. Can anyone help me with this? Is there a setting that I need to check?
All that you had to do was to sign into the old account in order to update those apps. What I mean is that you just needed to sign into that account in the store settings like I described and that should have worked. You didnt need to enter the credit card information again - you justed needed to use the old ID and password.
Anyway, I think the good news is that if everything else is OK with the new account, just download iBooks with the new ID - it's a free app so its not like you have to pay for it again. I'm not sure what the other App is that you are talking about - but if it is the Apple Store App - that is free as well.
Try this anyway, when you try to update iBooks, just use the old password if the old ID still pops up.
Did you try signing into the store settings with your new ID and see what happens with the updates then? -
Well, i was on my laptop now and all of a sudden a pop up message appeared and said "your download is complete" so i went to go check it out and it was 'MacProtector'. i cant delete it and it keeps opening unwanted web pages, please help me sort this out someone?
Refer to: http://cantalktech.com/2011/05/08/mac-protector/.
-
I got an internet connection on my phone. After getting the internet connection, I was unable to make a call or check the missed calls that I got. Please help me resolve this problem.
-
can anyone out there help me with this assignment ????? i`ll attach the file to this topic
In this assignment, you are to write a Java applet, using arrays, to simulate the functions of a drinks-vending machine.
The assignment requirements described below are broken down into 2 stages of development, described in this document
as 'Basic Requirements' and 'Additional Features'. You are advised to do your programming progressively in these
stages. An Activity Plan has also been specified for you to follow. Refer to the 'Grading Criteria' on page 5 to have
an idea of how the different components are graded.
1. 1. BACKGROUND
A company intends to build computerised drinks-vending machines to enlarge its business portfolio. You have been tasked to develop a
Java applet that simulates the operation of such a machine to determine if it will meet their needs.
2. 1. BASIC REQUIREMENTS
The machine should have a wide range of drinks available. A customer can choose a drink according to the following criteria:
a) a) Category of Drinks
� � Beverages
� � Soft Drinks
(For beverages, there is choice of whether sugar and/or creamer is required, for which there is an additional charge.)
b) b) Type of Beverages
� � Hot
� � Cold
Once a customer has specified the drink he wants, the amount payable is displayed. The unit prices to be displayed are as follows:
Drinks Price per Cup/Packet ($)
Beverage: Coffee 1.00
Tea 1.20
Milo 1.40
Horlicks 1.35
Chrysanthemum 1.00
Ginger 0.80
Soft Drinks: Apple 1.40
Orange 1.40
Pineapple 1.50
Carrot 2.00
Longan 1.20
Bandung 1.00
(For beverages, a request for sugar or creamer attracts an additional charge of $0.10 each. Creamer is not applicable for
chrysanthemum and ginger.)
The customer may then confirm his order by entering the amount payable (this symbolises his payment for the drink). Whenever the
payment input is not correct, an appropriate error message is displayed, whereupon the customer has to re-enter the amount again.
When the correct amount is paid, the required drink is dispensed.
For any drink that is out of stock, a message is shown, stating that it is not available. Each time a drink is dispensed, the stock for that
drink is updated (For beverages, the stock is stored in units of servings for each cup.) To simplify the testing, you may start the simulation
by setting the stock for each drink to 10 packets or cup-servings.
3. 2. ADDITIONAL FEATURES
In addition, the simulator can have the following features:
a) a) Smart Graphical User-Interface (GUI)
You may build upon the basic requirements by recommending alternative drinks of the same category, whenever a requested
drink is not available (as signified from the stock). In this case, only drinks which are available (i.e., in sufficient stock) are
displayed for the customer to choose. And if only soft drinks are available, the selections for creamer and sugar should be disabled.
b) b) Multiple Orders
A customer could order more than one drink. The system could allow him to specify as many drinks as he wants, prompting him
for an appropriate payment, and then dispensing the drinks accordingly, subject to availability. This may also entail the extension
of the graphical user-interface.
c) c) Sales Analysis
Periodically, the total revenue accumulated since the last collection is printed in descending order of sales for each drink sold,
together with a grand total. The cash is then cleared from the machine. This feature requires password-protection.
d) d) Replenishment of Stock
Periodically, the stock is checked to determine how much of each drink needs to be replenished. For this purpose, a list of the
drinks with the corresponding quantity on hand is printed in ascending order of stock level. Drinks with insufficient stock are
topped up to a level of 10 servings or packets. This feature also requires password-protection.
e) e) Any other relevant features
You are limited only by your creativity. You can add any other relevant features for this project. Please consult your tutor before
you proceed.
To qualify for the full marks for this section, you need to implement 2 features, at least one of which must be either (a) or (b) above.
4. 3. ACTIVITY PLAN
Suggestions for Getting Started
There are many ways that you could complete this assignment. The most important part is to think about the entire project first so that
it is easy to integrate the various pieces. You should also consider what type of graphics you want to incorporate.
a) a) Analysis
1. Understand the program specification and the requirements before attempting the project.
b) b) Program Design
2. Work out the GUI components (e.g., TextFields, CheckBoxes, ChoiceBoxes, Buttons, etc.) needed to get the user input.
3. 3. Work out the main logic of the program using modular programming techniques; i.e. use methods appropriately. E.g., tasks that perform
4. 4. a well-defined function or those that are repeated should be coded as methods. For example, you can write the methods, displayBill(),
5. 5. makePayment(), computeTotal(), dispenseDrink(), etc. You need to think carefully about the return type and the parameters of each
6. 6. method.
7. 7. You are required to use arrays appropriately for this assignment. Marks will be deducted for inefficient use or non-usage of arrays.
c) Implementation & Testing
8. 8. Write the method definition of each method ONE at a time.
9. 9. Test your program logic to make sure that it works. In the interim, you can use �g.drawString(�);� or �System.out.println(�);� to print
10. 10. out intermediate results so that you can see whether your program is working correctly. You may not want to bother about error-checking
11. 11. at this point. You should test each method as soon as it is written, as it is much easier to debug your program in this way.
5. 4. DELIVERABLES
By Monday, 25th February before 5:00 p.m., hand in the following to the School of ICT Administrative Office at Block 31, level 8:
� � A copy of the printout of your .java file.
� � A diskette labelled with your name, group, student ID. The diskette should contain ALL the necessary files (.java, .html, and .class)
to run your applet.
� � The above in an envelope topped with the Assignment Completion Report (see pages 6, 7 & 8). Page 6 is for you to paste on top
of your envelope whilst pages 7 and 8 are for you to document your Test Plan, and write your comments (including any
special instructions to run your program) - to be inserted into the envelope.
In your .java program, you are to include a blocked comment at the top stating:
q q Your name, group, student ID.
q q Assumptions (if any) or any deviations from the specified requirements.
q q Any features that you would like to highlight.
6. 5. WALK-THROUGH OF PROGRAM
Monday 25th February at 9:30 a.m. SHARP
In the walk-through, you will be asked to give short, written answers to some questions about your program. These questions will assess
your basic understanding of the code that you are handing in. If you fail to display adequate understanding of your own program, you can
be down-graded by up to two letter grades from what you would have normally received. It is also possible that you will be called to
perform a demonstration cum explanation of your work if it is suspected that you have copied someone else�s work. Lesson: do your own
work and you will have no problem!
7. 6. GRADING CRITERIA FOR PROGRAMMING
Correct and robust implementation of basic features 55 %
Additional features 20 %
Programming style:� � Program design� � Appropriate use of arrays� � Appropriate use of variables, methods, and parameters� � Proper usage of control structures (e.g. if/else, loops) 15 %
Good programming practice:� � Meaningful variable names � � Proper indentations� � Useful and neat comments 5 %
Adequate (black-box) testing:� � Suitably-designed test plan 5 %
Total: 100 %
PROBLEM SOLVING & PROGRAMMING II
(Dip IT/MMC/EI, Year 1, Semester 2)
Assignment Completion Report (to be attached to cover of envelope)
Name: ___________________________________ Group: ________
ID: ___________________ Date & Time submitted: ____________
Requirements % Done (0-100) Remarks
BASIC FEATURES
� � Can choose category (and select appropriate additives)
� � Can choose drink (with error checking)
� � Can display amount payable
� � Can indicate availability of drink (with error checking)
� � Can accept payment for drink (with error checking)
� � Can dispense drink
� � Can update stock
ADDITIONAL FEATURES
� � Smart GUI
� � Multiple Orders
� � Sales Analysis (with password checking)
� � Stock Replenishment(with password checking)
� � Any other relevant features
Test Plan
Using black-box testing, record your test specification and the results according to the following format (the examples here are provided
for your reference only):
Test No. Purpose Test Shot/Data Expected Result Actual Result
E.g. 1a) Check whether beverage can be selected Click on �Chrysanthe-mum� button Checkbox for �Sugar� but not �Creamer� appear �Sugar� and checkboxes appeared
E.g. 1b) Check whether chrysanthemum with sugar can be ordered Select sugar and click on �Order� button Amount payable appears as �$1.10� (i.e., $1.00 + $0.10) Amount payable shown as $1.10
E.g. 1c) Check whether correct payment can be accepted Enter �1.00� in �Payment� textfield Error message �Insufficient payment - $0.10 short� appears Confirmation message �Drink being dispensed� appeared � ERROR!
E.g. 1d) Re-test 1c), after amending program As above As above Error message �Insufficient payment - $0.10 short� appeared
etc.
etc.
Remember to hand in this test plan together with the other deliverables in the envelope.
Have you�
1. 1. Checked to make sure program still works properly even with windows resized?
2. 2. Tested your program thoroughly, as if you're trying to break it?
Any comments about this assignment? Any special instructions to run your program? Write it here.public class testing1 {
String gg;
public void testing3() {
System.out.print(gg); }
// this is are constructor for the object and method we are going to make
next code
class testing {
public static void main(String[] args) {
testing1 tes = new testing1();
tes.gg = "hello there";
tes.testing3(); //here we have made a object and a method
hope this helps -
Hello Everybody,
Please check my coding & solved my error.
CREATE OR REPLACE PACKAGE BODY DISA_OWNER.PS_MDM_STAGING_COLOR_C
IS
NAME: PS_MDM_INTERFACE_COLOR_C
PURPOSE: The package is used to process Merchandise Hierarchy into
DISA.XREF_LEGACY_GOLD_SUB_DEPT, DISA.XREF_LEGACY_GOLD_SUB_CLASS
and GOLD.INTOBJ
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this package body.
-- Global constants
gk_package_name CONSTANT VARCHAR2(30) := 'ps_mdm_staging_color_c';
-- Log information
lr_run_log_rec run_log%ROWTYPE;
ln_run_log_id run_log.run_log_id%TYPE;
ln_end_log_status NUMBER;
lr_error_log_rec error_log%ROWTYPE DEFAULT NULL;
v_log_success disa_params.char_val%TYPE := get_param_char ('RUN LOG SUCCESS');
v_log_failure disa_params.char_val%TYPE := get_param_char ('RUN LOG FAILURE');
BEGIN
PROCEDURE process_all
IS
NAME: PROCESS_ALL (Procedure)
PURPOSE: This is the driving procedure for processing Merchandise Hierarchy
into DISA.XREF_LEGACY_GOLD_SUB_DEPT, DISA.XREF_LEGACY_GOLD_SUB_CLASS
and GOLD.INTOBJ based on AUDIT_STATUS.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
-- Log information (seperate from package variables)
lra_run_log_rec run_log%ROWTYPE;
lna_run_log_id run_log.run_log_id%TYPE;
lna_end_log_status NUMBER;
lra_error_log_rec error_log%ROWTYPE DEFAULT NULL;
BEGIN
-- Set Run Log ID
BEGIN
lra_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.PROCESS_ALL';
lra_error_log_rec.specific_location := 'Creating RUN_LOG entry';
lna_run_log_id := ps_disa_log_util.log_run_start (lra_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
-- Load and process class
lra_error_log_rec.specific_location := 'Load and process class';
load_color;
-- Log Successful Run
lra_run_log_rec.end_code := v_log_success;
lna_end_log_status := ps_disa_log_util.log_run_end (lra_run_log_rec);
COMMIT;
EXCEPTION
WHEN OTHERS THEN
-- Set error Codes for Logging
lra_error_log_rec.run_log_id := lna_run_log_id;
lra_error_log_rec.module_name := lra_run_log_rec.module_name;
lra_run_log_rec.end_code := v_log_failure;
-- This line is used to notify the shell script of a failure.
DBMS_OUTPUT.put_line ('FAILED');
IF lra_error_log_rec.error_code IS NULL THEN
lra_error_log_rec.error_code := SQLCODE;
END IF;
IF lra_error_log_rec.error_text IS NULL THEN
lra_error_log_rec.error_text := substr (SQLERRM, 1, 255);
END IF;
IF lra_error_log_rec.specific_location IS NULL THEN
lra_error_log_rec.specific_location := 'When Others';
END IF;
-- Log Error
disa_err.handler (lra_error_log_rec,
pb_logerr => TRUE,
pb_reraise => TRUE,
pb_mark_end => TRUE
END process_all;
PROCEDURE load_COLOR_C
IS
NAME: load_prod_division (Procedure)
PURPOSE: This is the driving procedure for loading prod_division into
DISA.mdm_staging_proddiv_c staging table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_audit_log_id audit_log.audit_log_id%TYPE;
v_parent mdm_staging_proddiv_c.object_parent%TYPE;
v_line_seq INTEGER := 1;
CURSOR prod_COLOR_cur IS
SELECT color_code, color_desc
FROM item_COLOR;
CURSOR filter_prod_COL_cur IS
SELECT prod_COLOR_FILE_TYPE, prod_COLOR_AUDIT_STATUS
FROM product_COLOR_mst
WHERE prod_COLOR_FILE_TYPE in (0, 10);
BEGIN
TMR.CAPTURE(1);
dbms_output.put_line('load_prod_COLOR began.');
-- Set Run Log ID
BEGIN
v_audit_log_id := ps_disa_audit.create_audit_log('ITEM_COLOR', 'COLOR', null,
null, null, ps_disa_audit.FILE_LOADING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.LOAD_AUDIT_STATUS(' ||
v_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT load_AUDIT_STATUS_savepoint;
-- Load prod_division into mdm_staging_proddiv_c table
lr_error_log_rec.specific_location := 'Load prod_COLOR into DISA.mdm_staging_COLOR_C table.';
FOR pd_rec IN prod_color_cur LOOP
INSERT INTO mdm_staging_color_c(AUDIT_LOG_ID, LINE_SEQ, STAGING_STATUS_ID, COLOR_CODE, COLOR_DES)
VALUES (v_audit_log_id, v_line_seq, PS_DISA_STAGING.PROCESSING, pd_rec.COLOR_CODE, pd_rec.COLOR_DEC);
v_line_seq := v_line_seq + 1;
END LOOP;
END load_color_c;
PROCEDURE process_COLOR_C (
p_audit_log_id IN audit_log.audit_log_id%TYPE
IS
NAME: process_prod_division (Procedure)
PURPOSE: This is the driving procedure for processing prod_division into
GOLD.INTOBJ interface table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_rec_count INTEGER;
BEGIN
TMR.CAPTURE(2);
dbms_output.put_line('process_color_c began.');
-- Set Run Log ID
BEGIN
PS_DISA_AUDIT.set_audit_log_status(p_audit_log_id, ps_disa_audit.DATA_INTERFACING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.PROCESS_PROD_COLOR(' ||
p_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT process_pd_savepoint;
-- count the number of records we expect to insert
lr_error_log_rec.specific_location := 'Count records.';
SELECT COUNT(*)
INTO v_rec_count
FROM mdm_staging_color_c
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
-- Interface into GOLD.
lr_error_log_rec.specific_location := 'Process prod_color into GOLD.INTOBJ table.';
INSERT INTO INTVARIANTE
(VAFTYPEX,VAFUAREX,VAFCDI,VAFVALEX,VAFCIS,VAFLANGUE,VAFLIBC,VAFLIBL.VAFACT,VAFFLAG,VAFLGFI,VAFTRT,VAFDTRT,VAFDCRE,VAFDMAJ,VAFUTIL,VAFFICH,VAFNLIG,VAFNERR,VAFMESS)
SELECT PROD_COLOR_CODE, --OBFCEXTIN Object interface #
COLOR_DES --OBFCEXT Object #
1, --OBFIDSTR Merchandise structure #
2, --OBFIDNIV Object depth
'US', --OBFLANGUE Language #
DESCRIPTION, --OBFODESC Object description
OBJECT_PARENT, --OBFCEXTINP Parent interface #
1, --OBFPRINT Visible or hidden level
TO_DATE('01/01/2011', 'mm/dd/yyyy'), --OBFDDEB Link start date
5, --OBFFLAG Flag
v_rec_count, --OBFLGFI File total number of lines
0, --OBFTRT Processing indicator
TRUNC(sysdate), --OBFDTRT Processing date
sysdate, --OBFDCRE Date of creation
sysdate, --OBFDMAJ Date of last update
'PROD_COLOR', --OBFUTIL Last user
'PROD_COLOR_'||AUDIT_LOG_ID, --OBFFICH Filename
LINE_SEQ, --OBFNLIG File line #
null, --OBFNERR Error message #
null, --OBFMESS Error message
TO_DATE('12/31/2049', 'mm/dd/yyyy') --OBFDFIN Link end date
FROM mdm_staging_color_c
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
-- Mark the interfaced item as processed.
lr_error_log_rec.specific_location := 'Mark prod_division items as processed.';
UPDATE mdm_staging_color_c
SET staging_status_id = PS_DISA_STAGING.PROCESSED
WHERE audit_log_id = p_audit_log_id AND
staging_status_id = PS_DISA_STAGING.PROCESSING;
PROCEDURE load_color
IS
NAME: load_dept (Procedure)
PURPOSE: This is the driving procedure for loading department into
DISA.mdm_staging_dept_c staging table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_audit_log_id audit_log.audit_log_id%TYPE;
v_line_seq INTEGER := 1;
-- Load department into mdm_staging_dept_c table
lr_error_log_rec.specific_location := 'Load department into DISA.mdm_staging_color_c table.';
FOR dept_rec IN color_ccur LOOP
INSERT INTO mdm_staging_color_c(AUDIT_LOG_ID, LINE_SEQ, STAGING_STATUS_ID, COLOR_CODE, COLOR_DEC)
VALUES (v_audit_log_id, v_line_seq, PS_DISA_STAGING.PROCESSING, COLOR_CODE,COLOR_DEC);
v_line_seq := v_line_seq + 1;
END LOOP;
PROCEDURE process_color (
p_audit_log_id IN audit_log.audit_log_id%TYPE
IS
NAME: process_dept (Procedure)
PURPOSE: This is the driving procedure for processing department into
GOLD.INTOBJ interface table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_rec_count INTEGER;
BEGIN
TMR.CAPTURE(4);
dbms_output.put_line('process_dept began.');
-- Set Run Log ID
BEGIN
PS_DISA_AUDIT.set_audit_log_status(p_audit_log_id, ps_disa_audit.DATA_INTERFACING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.PROCESS_COLOR(' ||
p_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT process_dept_savepoint;
-- count the number of records we expect to insert
lr_error_log_rec.specific_location := 'Count records.';
SELECT COUNT(*)
INTO v_rec_count
FROM mdm_staging_color_c
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
-- Interface into GOLD.
lr_error_log_rec.specific_location := 'Process department into GOLD.INTOBJ table.';
-- Mark the interfaced item as processed.
lr_error_log_rec.specific_location := 'Mark department items as processed.';
UPDATE mdm_staging_color_c
SET staging_status_id = PS_DISA_STAGING.PROCESSED
WHERE audit_log_id = p_audit_log_id AND
staging_status_id = PS_DISA_STAGING.PROCESSING;
-- Set Run Log ID
BEGIN
v_audit_log_id := ps_disa_audit.create_audit_log('COLOR_CODE', 'COLOR_DEC', null,
null, null, ps_disa_audit.FILE_LOADING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.LOAD_SUB_DEPT(' ||
v_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT load_color_savepoint;
END LOOP;
FOR filter_subdept_rec IN filter_subclass_cur LOOP
INSERT INTO mdm_staging_subclass_c(AUDIT_LOG_ID, LINE_SEQ, STAGING_STATUS_ID, COLOR_CODE,COLOR_DEC)
VALUES (v_audit_log_id, v_line_seq, PS_DISA_STAGING.FILTERED, COLOR_CODE,COLOR_DECL);
v_line_seq := v_line_seq + 1;
END LOOP;
PROCEDURE process_COLOR_C (
p_audit_log_id IN audit_log.audit_log_id%TYPE
IS
NAME: process_sub_dept (Procedure)
PURPOSE: This is the driving procedure for processing sub-department into
GOLD.INTOBJ interface table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_rec_count INTEGER;
BEGIN
TMR.CAPTURE(6);
dbms_output.put_line('process_color began.');
-- Set Run Log ID
BEGIN
PS_DISA_AUDIT.set_audit_log_status(p_audit_log_id, ps_disa_audit.DATA_INTERFACING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.PROCESS_COLOR(' ||
p_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT process_color_savepoint;
-- Merge sub-department into DISA.xref_legacy_gold_sub_dept table
lr_error_log_rec.specific_location := 'Merge sub-department into DISA.xref_legacy_gold_color table.';
MERGE INTO xref_legacy_gold_color
USING (
SELECT COLOR_CODE,COLOR_DES;
FROM mdm_staging_color_c
WHERE staging_status_id = PS_DISA_STAGING.PROCESSING
) a
ON(xref_legacy_gold_color.color_code= a.color_code)
WHEN NOT MATCHED THEN
INSERT (COLOR_CODE,COLOR_DEC) VALUES (a.COLOR_CODE, a.COLOR_DEC)
WHEN MATCHED THEN
UPDATE SET
COLOR_CODE = a.COLOR_CODE,
LAST_UPDATE_SOURCE = user,
LAST_UPDATE_DATE = sysdate;
-- count the number of records we expect to insert
lr_error_log_rec.specific_location := 'Count records.';
SELECT COUNT(*)
INTO v_rec_count
FROM mdm_staging_color_c
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
PROCEDURE load_color
IS
NAME: load_clolor(Procedure)
PURPOSE: This is the driving procedure for loading class into
DISA.mdm_staging_color_c staging table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_audit_log_id audit_log.audit_log_id%TYPE;
v_line_seq INTEGER := 1;
CURSOR color_cur IS
SELECT DISTINCT a.color_code, a.color_des, c.sobcextin
FROM color_c a, xref_legacy_gold_color_code b, STRUCOBJ c
WHERE a.color_code = b.color_des
AND a.color_code not IN (0, 1169)
AND NOT EXISTS (SELECT 1 FROM class_mst WHERE class_des = a.class_des and color_des IN (0, 990, 993))
AND c.sobidstr = 1
AND c.sobidniv = 4;
CURSOR filter_color_cur IS
SELECT DISTINCT a.color_code, a.color_des
FROM color_code a, xref_legacy_gold_color_dec b
WHERE a.color_code = b.color_des
AND a.class_num IN (0, 1169)
OR EXISTS (SELECT 1 FROM color_mst WHERE class_des = a.color_code and color_des IN (0, 990, 993));
BEGIN
TMR.CAPTURE(7);
dbms_output.put_line('load_color began.');
-- Set Run Log ID
BEGIN
v_audit_log_id := ps_disa_audit.create_audit_log('COLOR_CODE', 'COLOR_DES', null,
null, null, ps_disa_audit.FILE_LOADING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.LOAD_CLASS(' ||
v_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT load_class_savepoint;
END LOOP;
PROCEDURE process_class (
p_audit_log_id IN audit_log.audit_log_id%TYPE
IS
NAME: process_class (Procedure)
PURPOSE: This is the driving procedure for processing class into
GOLD.INTOBJ interface table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_rec_count INTEGER;
SAVEPOINT process_color_savepoint;
-- count the number of records we expect to insert
lr_error_log_rec.specific_location := 'Count records.';
SELECT COUNT(*)
INTO v_rec_count
FROM mdm_staging_color_c
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
-- Interface into GOLD.
lr_error_log_rec.specific_location := 'Process class into GOLD.INTOBJ table.';
PROCEDURE load_color_des
IS
NAME: load_sub_class (Procedure)
PURPOSE: This is the driving procedure for loading sub-class into
DISA.mdm_staging_subdept_c staging table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_audit_log_id audit_log.audit_log_id%TYPE;
v_line_seq INTEGER := 1;
v_subclass_seq INTEGER := 10001;
CURSOR color_des_cur IS
SELECT DISTINCT a.class_code, a.color_des, b.sobcextin
FROM color_c a, STRUCOBJ b
WHERE a.color_code = b.sobcext
AND a.color_code not IN (0, 1169)
AND NOT EXISTS (SELECT 1 FROM color_mst WHERE color_des = a.color_code and color_des IN (0, 990, 993))
AND b.sobidstr = 1
AND b.sobidniv = 5 -- class level
ORDER BY a.class_code;
CURSOR filter_color_des_cur IS
SELECT DISTINCT a.color_code, a.color_des
FROM color_code a, STRUCOBJ b
WHERE a.color_code IN (0, 1169)
OR EXISTS (SELECT 1 FROM color_mst WHERE color_code = a.color_des and color_des IN (0, 990, 993));
PROCEDURE process_color_des (
p_audit_log_id IN audit_log.audit_log_id%TYPE
IS
NAME: process_sub_class (Procedure)
PURPOSE: This is the driving procedure for processing sub-class into
GOLD.INTOBJ interface table.
REVISIONS:
Ver Date Author Description
1.0 06/15/2011 Chada Changchit Created this procedure.
v_rec_count INTEGER;
BEGIN
TMR.CAPTURE(10);
dbms_output.put_line('process_color_des began.');
-- Set Run Log ID
BEGIN
PS_DISA_AUDIT.set_audit_log_status(p_audit_log_id, ps_disa_audit.DATA_INTERFACING);
lr_run_log_rec.module_name := 'PS_MDM_INTERFACE_COLOR_C.PROCESS_COLOR_DEC(' ||
p_audit_log_id || ')';
lr_error_log_rec.specific_location := 'Creating RUN_LOG entry';
ln_run_log_id := ps_disa_log_util.log_run_start (lr_run_log_rec);
EXCEPTION
WHEN OTHERS THEN
RAISE;
END;
SAVEPOINT process_sub_class_savepoint;
-- Merge sub-class into DISA.xref_legacy_gold_sub_class table
lr_error_log_rec.specific_location := 'Merge sub-class into DISA.xref_legacy_gold_color_des table.';
MERGE INTO xref_legacy_gold_sub_class
USING (
SELECT color_code, color_des
FROM mdm_staging_color_des
WHERE staging_status_id = PS_DISA_STAGING.PROCESSING
) a
ON(xref_legacy_gold_COLOR_CODE.COLOR_DES = a.COLOR_CODE)
WHEN NOT MATCHED THEN
INSERT (COLOR_CODE,COLOR_DEC) VALUES (a.COLOR_CODE, a.COLOR_DEC)
WHEN MATCHED THEN
UPDATE SET
COLOR_CODE = a.COLOR_DEC,
LAST_UPDATE_SOURCE = user,
LAST_UPDATE_DATE = sysdate;
-- count the number of records we expect to insert
lr_error_log_rec.specific_location := 'Count records.';
SELECT COUNT(*)
INTO v_rec_count
FROM mdm_staging_color_des
WHERE audit_log_id = p_audit_log_id
AND staging_status_id = PS_DISA_STAGING.PROCESSING;
END process_color_des;
END PS_ MDM_INTERFACE_COLOR_C ;Thank you,
Sam
Edited by: BluShadow on 07-Jul-2011 14:14
added {noformat}{noformat} tags.869574 wrote:
run script in Oracle toad 10.6
Thank you,
samNo. I, like most other people here, am busy working. If you have an issue, YOU run the script and YOU tell us what your issue is. This isn't a game where we are supposed to guess what the problem is. If you can't be bothered to post your question according the forum guidelines ({message:id=9360002}) then why on Earth should we bother to waste our time looking to help? -
Help with getting this to work!
Hi,
I am trying to get this Java application to work - but nothing seems to happen! Basically, its a chemical formulae analyser, e.g. in CaC03, C is the symbol for Carbon and there is 1 atom of this element, Ca for Calcium (1 atom), O for Oxygen (3 atoms). The application should ask the user for input (chemical formulae) and then analyse the formula and identify the symbols present together and the number of atoms of the corresponding element.
The elements should then be identified and a table displayed showing the elements present together with the corresponding number of atoms. Appropriate error messages should be displayed for any invalid data.
Now the code I have seems fine to me, but when you run the application, nothing happens! There are no error messages, but just nothing happens! I have two files, InNeedOfHelp.java and InNeedOfHelp.class, and the InNeedOfHelp.java file contains the following code (but nothin happens when run as I have stated!): -
import java.util.regex.*;
public class InNeedOfHelp {
/* names should be loaded dynamically from that file */
private String[] names = {"H", "C", "Ca", "O"};
private Matcher matcher = null;
private Pattern pattern = null;
public static void main(String[] args) {
InNeedOfHelp inoh = new InNeedOfHelp();
for (int i = 0; i < args.length; i++) {
if (inoh.isValid(args[ i])) {
inoh.check(args[ i]);
} else {
System.out.println("Illegal formula: " + args[ i]);
public InNeedOfHelp() {
String regex = "([A-Z][a-z]?+)([0-9]*+)";
pattern = Pattern.compile(regex);
matcher = pattern.matcher("");
/* Element name needs real solution, current implementation is too static ;) */
private String getElementName(String s) {
if ("H".equals(s)) {
return "Hydrogen";
} else if ("O".equals(s)) {
return "Oxygen";
} else {
return s;
private String getElementCount(String s) {
if ("".equals(s)) {
return "1";
} else {
return s;
public boolean isValid(String formula) {
String regex = "((";
for (int i = 0; i < names.length; i++) {
regex += (i == 0 ? "(" : "|(") + names[ i] + ")";
regex += "){1}[0-9]*)+";
return formula.matches(regex);
/* check needs better name and should be redesigned to just collect data */
public void check(String formula) {
int end = 0;
matcher = matcher.reset(formula);
while (matcher.find(end)) {
end = matcher.end();
System.out.println("Element " + getElementName(matcher.group(1))
+ " occured " + getElementCount(matcher.group(2)) + " time(s)");
So, if anyone could help me with this application I would be very grateful! Thanks guys.If nothing happens, as a first step I suggest putting in some System.out.println statements in the main method to find out what happens with isValid(). It usually makes sense to look for easy problems first. May be your command line arguments are not valid, or your isValid methods thinks they aren't anyway.
-
My safari keeps closing unexpectedly and when it does it tells me that it quite while using the .GameHouseBeachParty.so plugin. I have no idea what this means! Can someone please help me fix this?
You have the Flashback trojan.
Check out the replies in this thread for what to do;
https://discussions.apple.com/message/18114958#18114958 -
I can't find the 2G, 3G and LTE options after updating to iOS8.1, can anyone help me with this? I'm using iPhone5s
I have check on my service provider about the correct APN settings, but unfortunately doesnt work still..
-
I need to reinstall my operating system for 10.5 after seeing a file folder and question mark flashing on my start up screen. Can anyone help me with this?
Hello,
That means it can find the Hard Drive, or can't find the things needed for booting.
See if DU even sees it.
"Try Disk Utility
1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
*Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.*
3. Click the First Aid tab.
4. Select your Mac OS X volume.
5. Click Repair Disk, (not Repair Permissions). Disk Utility checks and repairs the disk."
http://docs.info.apple.com/article.html?artnum=106214
Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
(Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.) -
Hi. I'm trying to make my guest network disappear from the list of network choices that appears to everyone in the neighborhood. Even though I followed the great suggestions on how to delete the network, it's still appearing in the list that everyone sees. It has my name and would prefer to get rid of it.
Please help! Many thanks!Thank you for not only the tip but also especially the research showing that for anybody other that those using Wi-Fi for the first time the network wouldn't disappear. I wanted it to disappear for everyone so.....I finally solved it by resetting the Airport Extreme to the factory settings and starting over from scratch! It worked! Yay!!!!!
So, for everyone that has had this problem (and I've read many of the same complaints in different places on the Internet), you must go into Airport Utility and check the box stating that you want to reset it to the factory settings. Do not do it with a paper clip and the reset button on the box; I tried that first and it did not work. You must reset it via the Airport Utility. Then just start over and you will have the choice to NOT check the box to Enable Guests. If you want to enable guests, just be sure not to use your name or you're back to the same problem. Apple is so great with everything...wouldn't it have been so easy for them to just put this in the manual somewhere????? Thanks for all your help. Hope this helps others! -
I need help to run this package and i got some error
create or replace
PACKAGE BODY SUBS_INS_API_sun
AS
PROCEDURE SUBSCRIBER_INS_sun
(SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidactdvcdetailsobj_sun,
ERROR_CODE OUT VARCHAR2)
IS
Input_Parameter_Is_Null EXCEPTION;
pragma exception_init(Input_Parameter_Is_Null,-2000);
prepaidAccountDetails prepaidActDevDetails_tab:= prepaidActDevDetails_tab(NULL,NULL,NULL,NULL,NULL);
STATUS VARCHAR2(1):='1';
cust_no VARCHAR(10);
m_mac_id VARCHAR2(20);
subscriber_master_Rec subscriber_master%ROWTYPE :=NULL;
flg NUMBER(1);
BEGIN
IF(Source_Sys_Id IS NULL OR Tracking_Id IS NULL OR ACCOUNT_NO IS NULL OR prepaidAccountDetails.LAST=0) THEN
RAISE Input_Parameter_Is_Null;
END IF;
BEGIN
select cm_cust_no into cust_no from customer_master where cm_cust_id=ACCOUNT_NO and cm_status in('A','P','0');
EXCEPTION
WHEN NO_DATA_FOUND THEN
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:='0';
END;
BEGIN
FOR i IN prepaidAccountDetails.FIRST .. (prepaidAccountDetails.LAST) LOOP
prepaidAccountDetails1:=prepaidActDevDetails_tab(i);
prepaidAccountDetails1.Status_of_device:='1';
IF (prepaidAccountDetails.Account_id is NULL OR prepaidAccountDetails.Mac_Id is NULL or prepaidAccountDetails.LOB_value is NULL) THEN
RAISE Input_Parameter_Is_Null;
END IF;
IF(prepaidAccountDetails.LOB_value = 'VDO') THEN
IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
Error_code :='SI002';
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;
END IF;
begin
select 1 into flg from subscriber_master where pm_phone_no=prepaidAccountDetails.Mac_Id and pm_status in('P','0','A','B');
EXCEPTION
WHEN NO_DATA_FOUND THEN
flg:=0;
END;
if(flg=1) then
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;
begin
select md_mac_id into m_mac_id from mac_details where md_mac_id=prepaidAccountDetails.Mac_Id and md_start_date<=sysdate
and md_status='A';
EXCEPTION when OTHERS then
Error_code :='SI004';
DBMS_OUTPUT.PUT_LINE('NO DATA FOUND');
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
end;
if(STATUS= 1 and prepaidAccountDetails.Status_of_device='1') then
SELECT PM_SUBS_ACT_NO_SEQ.nextval
INTO subscriber_master_rec.PM_SUBS_ACT_NO
FROM dual;
subscriber_master_Rec.pm_phone_no :=prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.pm_open_date :=sysdate;
subscriber_master_rec.pm_status :='P';
subscriber_master_rec.PM_CUST_LVL_YN:='S';
subscriber_master_rec.PM_EQUP_CODE:=prepaidAccountDetails.LOB_value;
subscriber_master_rec.PM_HOME_AREA:='HOM';
subscriber_master_rec.PM_USG_CODE:='USG';
subscriber_master_rec.PM_NO_TYPE:='S';
subscriber_master_rec.PM_TCG_CODE:='DEF';
subscriber_master_rec.PM_APLN_DATE:=sysdate;
subscriber_master_rec.PM_USER2:=prepaidAccountDetails.LOB_value;
subscriber_master_rec.PM_USER3:=prepaidAccountDetails.Channel_Line_Up;
subscriber_master_rec.pm_cust_no:=cust_no;
INSERT INTO subscriber_master VALUES subscriber_master_rec;
END IF;
END LOOP;
END;
END SUBSCRIBER_INS_sun;
END SUBS_INS_API_sun;
and
i got this error
Package Body PREPAID_TESTNEW.SUBS_INS_API@PREPAID_TESTNEW
Error(73,4): PL/SQL: Statement ignored
Error(73,99): PLS-00302: component 'LAST' must be declared
Error(87,6): PL/SQL: Statement ignored
Error(87,37): PLS-00302: component 'FIRST' must be declared
please help to run this package if anyone knowsnow i corrected my package. It working fine. But, how to run this package via procedure. my procedure check below. I give all the details about my package check below.
---pkg specification
create or replace
PACKAGE SUBS_INS_API_SS
IS
PROCEDURE SUBSCRIBER_INS_SS
(SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
ERROR_CODE OUT VARCHAR2);
END SUBS_INS_API_SS;
-----pkg body
create or replace
PACKAGE BODY SUBS_INS_API_SS
AS
PROCEDURE log_error (ip_code IN VARCHAR2,
ip_message IN VARCHAR2,
ip_description IN VARCHAR2)
IS
BEGIN
INSERT INTO ERR_LOG (IEL_REF_ID,
IEL_DATE,
IEL_CODE,
IEL_MSG,
IEL_DESC)
VALUES (IVRS_ERR_LOG_SEQ.NEXTVAL,
SYSDATE,
ip_code,
ip_message,
ip_description);
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END log_error;
PROCEDURE INSERT_WS_LOG (SOURCE_SYS_ID IN VARCHAR2,
STATUS IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_ID IN VARCHAR2,
MAC_ID IN VARCHAR2)
IS
ws_log_rec WS_LOG%ROWTYPE := NULL;
BEGIN
SELECT WS_LOG#REC#ID.NEXTVAL INTO ws_log_rec.rec#id FROM DUAL;
ws_log_rec.VER#ID := 1;
ws_log_rec.CRE#TS := SYSDATE;
ws_log_rec.wl_source := SOURCE_SYS_ID;
ws_log_rec.wl_status := Status;
ws_log_rec.wl_tracking_id := tracking_id;
ws_log_rec.wl_account_id := account_id;
ws_log_rec.wl_mac_id := mac_id;
INSERT INTO ws_log
VALUES ws_log_rec;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END INSERT_WS_LOG;
PROCEDURE REPLICO_DEV_INFO( Acc_id IN VARCHAR2, Mc_Id IN VARCHAR2,channel IN VARCHAR2,
LOB_VAL IN VARCHAR2, outlet1 IN VARCHAR2, kit_cod IN VARCHAR2,
serial_No IN VARCHAR2, shipperr IN VARCHAR2, estm_recived_date IN date)
IS
Replico_device_info_det_Rec Replico_device_info_det%ROWTYPE := NULL;
REC_ID NUMBER;
BEGIN
SELECT REPLICO_DEVICE_INFO_DET#RECID.nextval INTO REC_ID FROM dual;
Replico_device_info_det_Rec.REC#ID := REC_ID;
Replico_device_info_det_Rec.ACCOUNT_ID := Acc_id;
Replico_device_info_det_Rec.MAC_ID := Mc_Id;
Replico_device_info_det_Rec.CHANNEL_LINE_UP := channel;
Replico_device_info_det_Rec.LOB_VALUE := LOB_VAL;
Replico_device_info_det_Rec.OUTLET := outlet1;
Replico_device_info_det_Rec.KIT_CODE := kit_cod;
Replico_device_info_det_Rec.SERIAL_NUMBER := serial_No;
Replico_device_info_det_Rec.SHIPPER := shipperr;
Replico_device_info_det_Rec.ESTIMATED_RECIVED_DATE := estm_recived_date;
INSERT INTO replico_device_info_det
VALUES Replico_device_info_det_Rec;
EXCEPTION
WHEN OTHERS
THEN
ROLLBACK;
END REPLICO_DEV_INFO;
PROCEDURE SUBSCRIBER_INS_SS (
SOURCE_SYS_ID IN VARCHAR2,
TRACKING_ID IN VARCHAR2,
ACCOUNT_NO IN VARCHAR2,
prepaidActDevDetails_tab IN prepaidActDeviceDetails_tabobj,
ERROR_CODE OUT VARCHAR2)
IS
Input_Parameter_Is_Null EXCEPTION;
PRAGMA EXCEPTION_INIT (Input_Parameter_Is_Null, -2000);
prepaidAccountDetails prepaid_act_dvc_details_obj
:= prepaid_act_dvc_details_obj (NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL,
NULL);
STATUS VARCHAR2 (1) := '1';
cust_no VARCHAR (10);
m_mac_id VARCHAR2 (20);
channel_lineup VARCHAR2 (25);
LOB_VALUE VARCHAR2 (25);
subscriber_master_Rec subscriber_master%ROWTYPE := NULL;
Replico_device_info_det_Rec Replico_device_info_det%ROWTYPE := NULL;
flg NUMBER (1);
plan_code VARCHAR2(10);
subs_aact_no NUMBER(20);
m_plan_code1 payment_transaction_history.TH_PLAN_CODE%type;
m_payment_mode1 payment_transaction_history.TH_PAYMENT_MODE%type;
pm_phone_no_cur subscriber_master.pm_phone_no%type;
pm_status_cur subscriber_master.pm_status%type;
pm_user2_cur subscriber_master.pm_user2%type;
pm_user9_cur subscriber_master.pm_user9%type;
pm_cust_no_cur subscriber_master.pm_cust_no%type;
pm_cust_1 subscriber_master.pm_cust_no%type;
cm_i customer_master.cm_status%type;
CURSOR subs_rec is select pm_cust_no, pm_phone_no, pm_status, pm_user2, pm_user9 from subscriber_master
where pm_cust_no = cust_no and pm_status= 'S';
BEGIN
IF ( Source_Sys_Id IS NULL
OR Tracking_Id IS NULL
OR ACCOUNT_NO IS NULL
OR prepaidActDevDetails_tab.LAST = 0)
THEN
RAISE Input_Parameter_Is_Null;
END IF;
BEGIN
SELECT cm_cust_no
INTO cust_no
FROM customer_master
WHERE cm_cust_id = ACCOUNT_NO AND cm_status IN ('A', 'P', '0');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
ERROR_CODE := 'SI001';
log_error ('SI001',
SQLERRM,
'No Customer exist with Active or Pre Actiavted');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := '0';
END;
BEGIN
FOR i IN prepaidActDevDetails_tab.FIRST ..
(prepaidActDevDetails_tab.LAST)
LOOP
prepaidAccountDetails := prepaidActDevDetails_tab (i);
prepaidAccountDetails.Status_of_device := '1';
IF ( prepaidAccountDetails.Account_id IS NULL
OR prepaidAccountDetails.Mac_Id IS NULL
OR prepaidAccountDetails.LOB_value IS NULL)
THEN
RAISE Input_Parameter_Is_Null;
END IF;
IF (prepaidAccountDetails.LOB_value = 'VIDEO')
THEN
/* Commented as channel lineup is not coming from the input request */
/*IF(prepaidAccountDetails.Channel_Line_Up is NULL) THEN
Error_code :='SI002';
log_error ('SI002', SQLERRM, 'Channel line up is mandatory for Video');
INSERT_WS_LOG(Source_Sys_Id,'F',Tracking_Id,Account_No,prepaidAccountDetails.Mac_Id);
STATUS:=0;
prepaidAccountDetails.Status_of_device:='0';
END IF;*/
SELECT EC_CHANNEL_LINEUP
INTO channel_lineup
FROM ELIGIBLE_CUSTOMER
WHERE EC_CUSTOMER_NO = cust_no;
END IF;
BEGIN
SELECT 1
INTO flg
FROM subscriber_master
WHERE pm_phone_no = prepaidAccountDetails.Mac_Id
AND pm_status IN ('P', '0', 'A', 'B');
EXCEPTION
WHEN NO_DATA_FOUND
THEN
flg := 0;
END;
IF (flg = 1)
THEN
ERROR_CODE := 'SI003';
log_error ('SI003',
SQLERRM,
'Customer Already Exist with given Mac Id');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := 0;
prepaidAccountDetails.Status_of_device := '0';
END IF;
BEGIN
SELECT md_mac_id
INTO m_mac_id
FROM mac_details
WHERE md_mac_id = prepaidAccountDetails.Mac_Id
AND md_start_date <= SYSDATE
AND md_status = 'A';
EXCEPTION
WHEN OTHERS
THEN
ERROR_CODE := 'SI004';
log_error ('SI004', SQLERRM, 'Invalid Mac Id');
INSERT_WS_LOG (Source_Sys_Id,
'F',
Tracking_Id,
Account_No,
prepaidAccountDetails.Mac_Id);
STATUS := 0;
prepaidAccountDetails.Status_of_device := '0';
END;
select pm_cust_no into pm_cust_1 from subscriber_master where pm_cust_no = cust_no;
IF (STATUS = 1 AND prepaidAccountDetails.Status_of_device = '1')
THEN
SELECT DECODE (prepaidAccountDetails.LOB_value,
'HSD', 'HSD',
'VIDEO', 'VDO')
INTO LOB_VALUE
FROM DUAL;
OPEN subs_rec;
LOOP
FETCH subs_rec into pm_cust_no_cur, pm_phone_no_cur, pm_status_cur, pm_user2_cur, pm_user9_cur;
IF subs_rec%FOUND THEN
IF
( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = prepaidAccountDetails.outlet and pm_status_cur = 'S')
THEN
update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id
where pm_cust_no = pm_cust_no_cur and pm_user9 = prepaidAccountDetails.outlet;
select cm_status into cm_i from customer_master where cm_cust_no = pm_cust_no_cur;
IF( cm_i = '0')
THEN
update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
END IF;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
ELSIF
( pm_cust_1 = pm_cust_no_cur and pm_user2_cur= LOB_VALUE and pm_user9_cur = null and pm_status_cur = 'S')
THEN
update subscriber_master set pm_phone_no = prepaidAccountDetails.Mac_Id, pm_status = 'P', pm_name = prepaidAccountDetails.Mac_Id, pm_user9 = prepaidAccountDetails.outlet
where pm_cust_no = pm_cust_no_cur and pm_user9 = NULL;
update customer_master set cm_status = 'P' where cm_cust_no = pm_cust_no_cur;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
END IF;
ELSIF subs_rec%NOTFOUND THEN
SELECT PM_SUBS_ACT_NO_SEQ.NEXTVAL
INTO subs_aact_no
FROM DUAL;
subscriber_master_rec.PM_SUBS_ACT_NO := subs_aact_no;
subscriber_master_Rec.pm_phone_no :=
prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.pm_open_date := SYSDATE;
subscriber_master_rec.pm_status := 'P';
subscriber_master_rec.PM_CUST_LVL_YN := 'S';
subscriber_master_rec.PM_EQUP_CODE := LOB_VALUE;
subscriber_master_rec.PM_HOME_AREA := 'HOM';
subscriber_master_rec.PM_USG_CODE := 'USG';
subscriber_master_rec.PM_NO_TYPE := 'S';
subscriber_master_rec.PM_TCG_CODE := 'DEF';
subscriber_master_rec.PM_APLN_DATE := SYSDATE;
subscriber_master_Rec.PM_NAME := prepaidAccountDetails.Mac_Id;
subscriber_master_Rec.PM_STAFF_id := '16';
subscriber_master_rec.PM_USER2 := LOB_VALUE;
subscriber_master_rec.PM_USER3 := channel_lineup;
subscriber_master_rec.pm_cust_no := cust_no;
subscriber_master_rec.PM_USER8 := 'Y';
INSERT INTO subscriber_master
VALUES subscriber_master_rec;
REPLICO_DEV_INFO( prepaidAccountDetails.Account_id, prepaidAccountDetails.Mac_Id,channel_lineup,
prepaidAccountDetails.LOB_value, prepaidAccountDetails.outlet, prepaidAccountDetails.kit_code,
prepaidAccountDetails.serial_Number, prepaidAccountDetails.shipper,prepaidAccountDetails.estimated_recived_date);
END IF;
END LOOP;
CLOSE subs_rec;
SELECT TH_PLAN_CODE,TH_PAYMENT_MODE
INTO m_plan_code1,m_payment_mode1
FROM PAYMENT_TRANSACTION_HISTORY
WHERE TH_CUSTOMER_NO = cust_no
AND TH_LOB = LOB_VALUE
AND TH_SUBSCRIBER_NO IS NULL;
IF(LOB_VALUE = 'HSD') THEN
IF(m_plan_code1 = 'SIKI') THEN
plan_code := 'SIKI';
ELSE
plan_code := 'KIT';
END IF;
ELSE
IF(m_plan_code1 = 'SIKT') THEN
plan_code := 'SIKT';
ELSE
plan_code := 'TV';
END IF;
END IF;
UPDATE PAYMENT_TRANSACTION_HISTORY SET TH_SUBSCRIBER_NO = subs_aact_no, th_writeback_status = 'Y' WHERE TH_CUSTOMER_NO = cust_no AND TH_PLAN_CODE = plan_code;
COMMIT;
END IF;
END LOOP;
END;
END SUBSCRIBER_INS_SS;
END SUBS_INS_API_SS;
--- type object
create or replace
TYPE prepaid_act_dvc_details_obj--prepaidAccountDeviceDetailsObj
AS OBJECT ( Account_id VARCHAR2 ( 25 )
, Mac_Id VARCHAR2 ( 25 )
, Channel_Line_Up VARCHAR2 ( 25 )
, LOB_value VARCHAR2 ( 25 )
, Status_of_device VARCHAR2 ( 25 )
, outlet VARCHAR2(25)
, kit_code VARCHAR2(25)
, serial_Number VARCHAR2(25)
, shipper VARCHAR2(25)
, estimated_recived_date date )
type---
create or replace
TYPE prepaidActDeviceDetails_tabobj as table of prepaid_act_dvc_details_obj
---- i need to run this package via separate procedure. but i don't know how to pass the variable. because the passing argument contain object tab variable. please help me.. give me suggestion or procedure to run this pkg.
Maybe you are looking for
-
I was trying to transfer the music from my iPod to my new iTunes via a third party program, and I ended up erasing all of the music from my iPod. I am unable to get onto the iTunes on my old computer, where all my music was stored, and the iTunes on
-
How to get photos into photo stream?
How do you get photos from your iPhone camera roll into photo stream?
-
HTTP/1.1 400 Bad Request error in receiver REST channel
Hi Experts I am currently working on an interface in which we have created a REST communication channel on the receiver side. The below error comes up in the PI when we try to perform the GET operation on the URLs given below: Error Message: HTTP err
-
Screen ripple effect when scrolling after installing Mavericks?
Since downloading Mavericks some three weeks ago, my screen ripples (wave effect) when scrolling. Dominic kindly responded a short time ago with the suggestion it could be Autocad update related. All traces of Autocad wiped from my machine but still
-
Classic profit centers reporting full b/s below company code level
Dear Experts, we are using classic profit center. How to get Profit center wise balance sheet below company code level. Facing issues for balance sheet GL accounts as at 3KEH one profit center i can choose...my requirement is to get 2 balance sheets