Logical error in join stmt
Hi,
Pls tell me whats wrong with this stmt which is giving null values .
SELECT Aaufnr Bgstri Bgstrs Aautyp Aloekz Akokrs A~abkrs
into corresponding fields of table it_aufk
FROM AUFK AS A
INNER JOIN AFKO AS B
ON Aerdat = Bgstrs
WHERE B~gstrs in s_date
AND A~WERKS = P_IWERK
AND A~AUART = S_AUART.
Just like the below Example:
Join the columns carrid, carrname and connid of the database tables scarr and spfli using an outer join. The column connid is set to the null value for all flights that do not fly from p_cityfr. This null value is then converted to the appropriate initial value when it is transferred to the assigned data object. The LOOP returns all airlines that do not fly from p_cityfr.
PARAMETERS p_cityfr TYPE spfli-cityfrom.
DATA: BEGIN OF wa,
carrid TYPE scarr-carrid,
carrname TYPE scarr-carrname,
connid TYPE spfli-connid,
END OF wa,
itab LIKE SORTED TABLE OF wa
WITH NON-UNIQUE KEY carrid.
SELECT scarrid scarrname p~connid
INTO CORRESPONDING FIELDS OF TABLE itab
FROM scarr AS s
LEFT OUTER JOIN spfli AS p ON scarrid = pcarrid
AND p~cityfrom = p_cityfr.
LOOP AT itab INTO wa.
IF wa-connid = '0000'.
WRITE: / wa-carrid, wa-carrname.
ENDIF.
ENDLOOP.
Follow your code like the below:
SELECT A~aufnr
A~autyp
A~loekz
A~kokrs
A~abkrs
B~gstri
B~gstrs
into table it_aufk
FROM AUFK AS A
INNER JOIN AFKO AS B
ON Aerdat = Bgstrs
WHERE B~gstrs in s_date
AND A~WERKS = P_IWERK
AND A~AUART in S_AUART.
Similar Messages
-
sir i write code for finding freuent pattern but it give some logical error plz see that and correct that
i send the complete information to u my input file my project code my output file and my actual output that i need ......plz sir chek it where is he logical mistak in code i completely chek lots of time i m not able to find where is the logical mistak plz sir help me
input file "transactions.xml"
<?xml version="1.0" standalone="yes"?>
<transactions>
<transaction id="1">
<items>
<item>a</item>
<item>d</item>
<item>e</item>
</items>
</transaction>
<transaction id="2">
<items>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="3">
<items>
<item>a</item>
<item>c</item>
<item>e</item>
</items>
</transaction>
<transaction id="4">
<items>
<item>b</item>
<item>c</item>
<item>d</item>
</items>
</transaction>
<transaction id="5">
<items>
<item>a</item>
<item>b</item>
</items>
</transaction>
</transactions>
coding :=
xquery version "1.0";
declare namespace local = "http://www.w3.org/2003/11/xpath-local-functions";
declare function local:join($X as element()*, $Y as element()*) as element()* {
let $items := (for $item in $Y
where every $i in $X satisfies
$i != $item
return $item)
return $X union $items
declare function local:commonIts($X as element()*, $Y as element()*) as element()* {
for $item in $X
where some $i in $Y satisfies $i = $item
return $item
declare function local:removeIts($X as element()*, $Y as element()*) as element()* {
for $item in $X
where every $i in $Y satisfies $i != $item
return $item
declare function local:candidateGen($l as element()*) as element()* {
for $freqSet1 in $l
let $items1 := $freqSet1//items/*
for $freqSet2 in $l
let $items2 := $freqSet2//items/*
where $freqSet2 >> $freqSet1 and
count($items1)+1 = count($items1 union $items2)
and local:prune(local:join($items1,$items2), $l)
return
<items>{local:join($items1,$items2)}</items>
declare function local:prune($X as element()*, $Y as element()*) as xs:boolean
every $item in $X satisfies
some $items in $Y//items satisfies
count(local:commonIts(local:removeIts($X,$item),$items/*))
= count($X) - 1
declare function local:removeDuplicate($C as element()*) as element()*
for $itemset1 in $C
let $items1 := $itemset1/*
let $items :=(for $itemset2 in $C
let $items2 := $itemset2/*
where $itemset2>>$itemset1 and
count($items1) =
count(local:commonIts($items1, $items2))
return $items2)
where count($items) = 0
return $itemset1
declare function local:getLargeItemsets($C as element()*, $minsup as xs:decimal, $total as xs:decimal, $src as element()*) as element()*
for $items in $C
let $trans := (for $tran in $src
where every $item1 in $items/* satisfies
some $item2 in $tran/*
satisfies $item1 = $item2
return $tran)
let $sup := (count($trans) * 1.00) div $total
where $sup >= $minsup
return <largeItemset> {$items}
<support> {$sup} </support>
</largeItemset>
declare function local:fp-growth($l as element()*, $L as element()*, $minsup as xs:decimal, $total as xs:decimal, $src as element()*) as element()*
let $C := local:removeDuplicate(local:candidateGen($l))
let $l := local:getLargeItemsets($C, $minsup, $total, $src)
let $L := $l union $L
return if (empty($l)) then
$L
else
local:fp-growth($l, $L, $minsup, $total, $src)
let $src := doc("transactions.xml")//items
let $minsup := 0.5
let $total := count($src) * 1.00
let $C := distinct-values($src/*)
let $l :=(for $itemset in $C
let $items := (for $item in $src/*
where $itemset = $item
return $item)
let $sup := (count($items) * 1.00) div $total
where $sup >= $minsup
return <largeItemset>
<items> {$itemset} </items>
<support> {$sup} </support>
</largeItemset>)
let $L := $l
return <largeItemsets> { local:fp-growth($l, $L,$minsup, $total, $src) }
</largeItemsets>
output that is get for running the query:=
<?xml version="1.0" encoding="UTF-8"?>
<largeItemsets>
<largeItemset>
<items>a</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>d</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>b</items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<items>c</items>
<support>0.6</support>
</largeItemset>
</largeItemsets>
but sir i want my output like that:=
<?xml version="1.0" standalone="yes"?>
<largeItemsets>
<largeItemset>
<Items>
<item>a</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>b</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>c</item>
</Items>
<support>0.6</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
<item>b</item>
</Items>
<support>0.4</support>
</largeItemset>
<largeItemset>
<Items>
<item>b</item>
<item>c</item>
</Items>
<support>0.4</support>
</largeItemset>
<largeItemset>
<Items>
<item>d</item>
<item>c</item>
<item>b</item>
</Items>
<support>0.4</support>
</largeItemset>
</largeItemsets>
sir i want that output which i shown last help me sir how i sort out this problem
thank i advance
SIR PLZ HELP ME WHAT I DO HOW I SOLVE THAT PROBLEM PLZ ANY ONE HELP ME
Edited by: MAXIMUM on Apr 9, 2012 10:43 PMThe code is unreadable. It would be great if you can explain the problem statement.
-
create table my_employee
(id number(4)primary key,
last_name varchar2(25),
first_name varchar2(25),
userid varchar2(8),
salary number(9,2)
I want to write an INSERT statement to MY_EMPLOYEE table . Concatenate the first letter of the first name and first seven characters of the last name to produce user ID using a single sql statement
I wrote the query like this and i am getting logical error
insert into my_employee
values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary);
SQL> insert into my_employee
2 values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&sal
ary);
Enter value for id: 20
Enter value for last_name: popopopp
Enter value for last_name: qwertyyuu
Enter value for salary: 300000
old 2: values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),
new 2: values(20,'popopopp','o',substr('o',1,1)||substr('qwertyyuu',1,7),300000)
1 row created.
it is asking the last_name two timesyou can do it with a .sql script
c:\my_emp.sql
PROMPT
PROMPT instering my_employees
PROMPT
ACCEPT ID NUMBER PROMPT 'ID ? : '
ACCEPT FIRST_NAME CHAR PROMPT 'FIRST_NAME ?: '
ACCEPT LAST_NAME CHAR PROMPT 'LAST_NAME ?: '
ACCEPT SALARY NUMBER PROMPT 'SALARY ? : '
insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary);
SELECT * FROM my_employee where id=&&id;
and then from sqlplus @c:\my_emp.sql
scott@ORCL> @C:\MY_EMP
instering my_employees
ID ? : 20
FIRST_NAME ?: john
LAST_NAME ?: papas
SALARY ? : 1000
old 1: insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary)
new 1: insert into my_employee values( 20,'papas','john',substr('john',1,1)||substr('papas',1,7), 1000)
1 row created.
old 1: SELECT * FROM my_employee where id=&&id
new 1: SELECT * FROM my_employee where id= 20
ID LAST_NAME FIRST_NAME USERID SALARY
20 papas john jpapas 1000
scott@ORCL> -
DNS Error while joining the machine to domain.
I get the below error while joining a new Win7 machine to the domain.
I can ping and successfully resolve nslookup on both server and client machine.
Both client and server (2008r2) are virtual machines, with private ip's on LAN...
The following error occurred when DNS was queried for the service location (SRV) resource record used to locate a domain controller for domain
magic.com:
The error was: "DNS name does not exist."
(error code 0x0000232B RCODE_NAME_ERROR)
The query was for the SRV record for _ldap._tcp.dc._msdcs.magic.com
Common causes of this error include the following:
- The DNS SRV record is not registered in DNS.
- One or more of the following zones do not include delegation to its child zone:
magic.com
com
. (the root zone)
For information about correcting this problem, click Help.
Looks like some problem with my DNS.
Also i tried to uninstall/ re-install the DNS role.
What should be the TCP/IP network configuration???
System Security analyst at CapGI get the below error while joining a new Win7 machine to the domain.
I can ping and successfully resolve nslookup on both server and client machine.
Both client and server (2008r2) are virtual machines, with private ip's on LAN...
The following error occurred when DNS was queried for the service location (SRV) resource record used to locate a domain controller for domain
magic.com:
The error was: "DNS name does not exist."
(error code 0x0000232B RCODE_NAME_ERROR)
The query was for the SRV record for _ldap._tcp.dc._msdcs.magic.com
Common causes of this error include the following:
- The DNS SRV record is not registered in DNS.
- One or more of the following zones do not include delegation to its child zone:
magic.com
com
. (the root zone)
For information about correcting this problem, click Help.
Looks like some problem with my DNS.
Also i tried to uninstall/ re-install the DNS role.
What should be the TCP/IP network configuration???
System Security analyst at CapG
Also something to look in, i do not have the usual folders below 'Forward lookup zone', i.e, Sites, Home, tcp etc..
I beleive these are required. I am not sure.!!. I did re-install the role, no change :-(
System Security analyst at CapG -
Expalin about ABAP Logical errors?
Help me sending appropriate link to understand more.
Moderator Message: Read the Rules of Engagement of this forum.
Edited by: kishan P on Dec 27, 2011 9:50 PMHi Vinay,
You can't delete the ABAP Runtime errors. But you can catch the errors using catch exception Statement.
For Example,
Class-based exceptions are handled in the following control structure:
TRY.
... " TRY block (application coding)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
CATCH cx_... cx_... ...
... " CATCH block (exception handler)
CLEANUP.
... " CLEANUP block (cleanup context)
ENDTRY.
Try This Sample Code,
*--EXAMPLE FOR RUNTIME ERROR--
*DATA : VALUE1 TYPE I.
*VALUE1 = 1 / 0. -
>>>>>> IT MAKES RUN TIME ERROR.
*WRITE : VALUE1.
*-EXAMPLE FOR HOW TO CATCH THE ARITHMETIC ERROR AT THE RUN TIME USING SUBRC----
DATA : VALUE1 TYPE I.
CATCH SYSTEM-EXCEPTIONS ARITHMETIC_ERRORS = 1.
VALUE1 = 1 / 0.
WRITE : VALUE1.
ENDCATCH.
IF SY-SUBRC = 1.
WRITE : ' IT MAKES ERROR'.
ELSE.
WRITE : VALUE1.
ENDIF.
Thanks,
Reward If Helpful. -
Hello Experts,
Please provide your guidance for the following scenario.
I need to calculate the 'Accumulated Depreciation' for every month, based on the amounts in the 'AccumDep' and the 'Depreciation' accounts.
In other words, the value of the Accumulated Depreciation for the month of Feb should be equal to (Accumulated Depreciation in Jan + Depreciation in Jan), and so on.
To accomplish this, I have written the following script logic.
*WHEN ACCOUNT
*IS AccumDep, Depreciation
*FOR %MON% = 2009.FEB,2009.MAR,2009.APR
*REC(FACTOR=1, ACCOUNT=AccumDep, TIME=%MON%)
*NEXT
*ENDWHEN
*COMMIT
The above logic was validated without any 'syntax' errors. However, I do not see the desired results, as the Accumulated Depreciation is not getting updated every month. The amount from FEB appears for MAR & APR also.
Therefore, could you please review the above script and let me know if there are any 'logical' errors?
All your guidance is greatly appreciated. Thanks...Hi,
You are not getting the desired result because you are trying to aggregate the depreciation and the accumulated depreciation of the same month and post the result again in the same month. Lets say the code is working for 2009.MAR. You are trying to add the depreciation and accumulated depreciation of 2009.MAR. However, you still dont have the acc depreciation of 2009.MAR. You basically need to take the acc depreciation of the previous month.
You can try something like:
*WHEN ACCOUNT
*IS Depreciation
*FOR %MON% = 2009.FEB,2009.MAR,2009.APR
*REC(EXPRESSION = %VALUE% + ([ACCOUNT].[AccumDep],[TIME].Previous), ACCOUNT=AccumDep)
*NEXT
*ENDWHEN
*COMMIT
You can have a property called Previous to store the previous month of each period in the time dimension.
Hope you got the idea. -
Newbie - JSP & bean shopping cart logic error?
Hello,
I am attempting to bulid a shopping cart facility on a JSP site that I am building.
I am having difficulties adding an item to the basket.
The page below (bookDetail.jsp) displays items for sale from a database. At the foot of the page, I have set up a hyperlink to add an item to a basket bean instance created in this page.
What happens is the page will load correctly, when i hover the mouse over the hyperlink to add the item to the basket, the status bar shows the URL of the current page with the details of the book appended. This is what I want. But when I click the link, the page will only reload showing 20% of the content.
Netbeans throws up no errors, neither does Tomcat, so I am assuming I have made a logical error somewhere.
I have enclosed the Book class, and the ShoppingCart class for your reference.
Any help would be really appreciated as I am at a loss here.
Cheers.
Edited highlights from bookDetail.jsp
//page header importing 2 classes - Book and ShoppingCart
<%@ page import="java.util.*, java.sql.*, com.shopengine.Book, com.shopengine.ShoppingCart" errorPage="errorpage.jsp" %>
//declare variables to store data retrieved from database
String rs_BookDetail_bookRef = null;
String rs_BookDetail_bookTitle = null;
String rs_BookDetail_author = null;
String rs_BookDetail_price = null;
//code that retrieves recordset data, displays it, and places it in variables shown above
<%=(((rs_BookDetail_bookRef = rs_BookDetail.getString("book_ref"))==null || rs_BookDetail.wasNull())?"":rs_BookDetail_bookRef)%>
<%=(((rs_BookDetail_author = rs_BookDetail.getString("author"))==null || rs_BookDetail.wasNull())?"":rs_BookDetail_author)%>
<%=(((rs_BookDetail_bookTitle = rs_BookDetail.getString("book_title"))==null || rs_BookDetail.wasNull())?"":rs_BookDetail_bookTitle)%>
<%=(((rs_BookDetail_price = rs_BookDetail.getString("price"))==null || rs_BookDetail.wasNull())?"":rs_BookDetail_price)%>
//this link is to THIS PAGE to send data to server as request parameters in Key/Value pairs
// this facilitates the add to basket function
<a href="<%= response.encodeURL(bookDetail.jsp?title=
"+rs_BookDetail_bookTitle+"
&item_id=
"+rs_BookDetail_bookRef +"
&author="+rs_BookDetail_author +"
&price=
"+rs_BookDetail_price) %> ">
<img src="images\addtobasket.gif" border="0" alt="Add To Basket"></a></td>
// use a bean instance to store basket items
<jsp:useBean id="basket" class="ShoppingCart" scope="session"/>
<% String title = request.getParameter("title");
if(title!=null)
String item_id = request.getParameter("item_id");
double price = Double.parseDouble(request.getParameter("price"));
Book item = new Book(item_id, title, author, price);
basket.addToBasket( item );
%>
ShoppingCart class that is used as a bean in bookDetail.jsp shown above
package com.shopengine;
//import packages
import java.util.*;
//does not declare explicit constructor which automatically creates a zero argument constructor
//as this class will be instantiated as a bean
public class ShoppingCart
//using private instance variables as per JavaBean api
private Vector basket;
public ShoppingCart()
basket = new Vector();
}//close constructor
//add object to vector
public void addToBasket (Book book)
basket.addElement(book);
}//close addToBasket method
//if strings are equal, delete object from vector
public void deleteFromBasket (String foo)
for(Enumeration enum = getBasketContents();
enum.hasMoreElements();)
//enumerate elements in vector
Book item = (Book)enum.nextElement();
//if BookRef is equal to Ref of item for deletion
//then delete object from vector.
if (item.getBookRef().equals(foo))
basket.removeElement(item);
break;
}//close if statement
}//close for loop
}//close deleteFromBasket method
//overwrite vector with new empty vector for next customer
public void emptyBasket()
basket = new Vector();
}//close emptyBasket method
//return size of vector to show how many items it contains
public int getSizeOfBasket()
return basket.size();
}//close getSizeOfBasket method
//return objects stored in Vector
public Enumeration getBasketContents()
return basket.elements();
}//close getBasketContents method
public double getTotalPrice()
//collect book objects using getBasketContents method
Enumeration enum = getBasketContents();
//instantiate variable to accrue billng total for each enummeration
double totalBillAmount;
//instantiate object to store data for each enummeration
Book item;
//create a loop to add up the total cost of items in basket
for (totalBillAmount=0.0D; enum.hasMoreElements(); totalBillAmount += item.getPrice())
item = (Book)enum.nextElement();
}//close for loop
return totalBillAmount;
}//close getTotalPrice method
}//close shopping cart class
Book Class that is used as an object model for items stored in basket
package com.shopengine;
import java.util.*;
public class Book{
//define variables
private String bookRef, bookTitle, author;
private double price;
//define class
public Book(String bookRef, String bookTitle, String author, double price)
this.bookRef= bookRef;
this.bookTitle=bookTitle;
this.author=author;
this.price=price;
//create accessor methods
public String getBookRef()
return this.bookRef;
public String getBookTitle()
return this.bookTitle;
public String getAuthor()
return this.author;
public double getPrice()
return this.price;
}//close classpage will only reload showing 20% of the content.Im building some carts too and I had a similiar problem getting null values from the mysql database. Are you getting null values or are they just not showing up or what?
On one of the carts I'm building I have a similiar class to yours called products that I cast onto a hashmap works alot better. Mine looks like this, maybe this is no help I don't know.......
public class Product {
/**An Item that is for sale.*/
private String productID = "Missing";
private String categoryID = "Missing";
private String modelNumber = "Missing";
private String modelName = "Missing";
private String productImage = "Missing";
private double unitCost;
private String description = "Missing";
public Product(
String productID,
String categoryID,
String modelNumber,
String modelName,
String productImage,
double unitCost,
String description) {
setProductID(productID);
setCategoryID(categoryID);
setModelNumber(modelNumber);
setModelName(modelName);
setProductImage(productImage);
setUnitCost(unitCost);
setDescription(description);
public String getProductID(){
return(productID);
private void setProductID(String productID){
this.productID = productID;
public String getCategoryID(){
return(categoryID);
private void setCategoryID(String categoryID){
this.categoryID = categoryID;
public String getModelNumber(){
return(modelNumber);
private void setModelNumber(String modelNumber){
this.modelNumber = modelNumber;
public String getModelName(){
return(modelName);
private void setModelName(String modelName){
this.modelName = modelName;
public String getProductImage(){
return(productImage);
private void setProductImage(String productImage){
this.productImage = productImage;
public double getUnitCost(){
return(unitCost);
private void setUnitCost(double unitCost){
this.unitCost = unitCost;
public String getDescription(){
return(description);
private void setDescription(String description){
this.description = description; -
Identifying syntax and logical errors
Hey guys,
I'm new to java and I can't figure out this problem as I can't make JDK work with comand prompt for some reason and when trying to write the java in a web page it won't work.
Can anyone tell me what the three syntax errors and one logical error in the following code is?
public class Add
public static void main(String[] args)
double weight1 = 85.5
double weight2 = 92.3
double averWeight = weight1 + weight2 / 2;
System.out.println("Average is " + aver);
Any help would be very much appreciated.Ok. I'm new to Java. Thanks to the both of you for your help.You're welcome of course; here's a tip: type in these little exercises
and try to compile them; carefully read what the compiler has to say
about the possible errors. Note that the compiler is totally blind to
most "logical errors".
kind regards,
Jos -
Too many logical errors (in terms of business processes); maximum was 100
hi friends !
I'm using the direct input program RMDATIND for uploading the material master data. and i'm facing the error:
"Too many logical errors (in terms of business processes); maximum was 100"
thanks and regards,
sachin soniHi,
If you checked in standard program,problem is occuring in the function module
'MATERIAL_MAINTAIN_DARK'. -
JFrames + Returning a Variable... Beginner's Logical Error
Hi,
I'm new to Java and programming in general. I'm trying to do something that seems pretty simple, but I'm making a logical error that is preventing my little program from working.
All I'm trying to do is this... I've created a little JFrame that asks a user for a university's name, address, and the number of students in the university. All of this is within a class called InputWindowSmall. I just want to be able to return those Strings, univName, univAdress, univStudents, to my main program so I can put them into a different class.
I've tried get methods, but that's silly, it doesn't work, it returns null because the program doesn't wait for the user's input.
Does anyone have any suggestions?
Also... I'm a terribly poor Object-Oriented-Thinker... If I'm doing anything that doesn't make sense in an Object-Oriented-Mindset, please point it out! I'd like to try and get better! Thanks!
CODE
InputWindowSmall
package FinalProject;
import javax.swing.JFrame;
import javax.swing.JLabel;
import java.awt.GridLayout;
import javax.swing.JTextField;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JButton;
/** Class Definition: Input Window - small input window that asks for University name and address*/
public class InputWindowSmall extends JFrame
private JLabel nameLabel;
private JLabel addressLabel;
private JLabel numberStudentsLabel;
private JLabel whiteSpace;
private JTextField nameField;
private JTextField addressField;
private JTextField numberStudentsField;
private JButton okButton;
private String univName;
private String univAddress;
private String univStudents;
/** Constructor with extra parameters */
public InputWindowSmall(University univ)
//Names title bar of window
super("Welcome!");
//Sets layout of window
setLayout(new GridLayout(4,2));
//Sets text for nameLabel and adds to window
JLabel nameLabel = new JLabel(" University Name: ");
add(nameLabel);
//Sets and adds nameField to window
nameField = new JTextField(10);
add(nameField);
//Sets text for addressLabel and adds to window
JLabel addressLabel = new JLabel(" University Address: ");
add(addressLabel);
//Sets and adds addressField to window
addressField = new JTextField(10);
add(addressField);
//Sets text for numberStudentsLabel and adds to window
JLabel numberStudentsLabel = new JLabel(" Number of Students: ");
add(numberStudentsLabel);
//Sets and adds numberStudentsField to window
numberStudentsField = new JTextField(10);
add(numberStudentsField);
//Sets and adds white space
JLabel whiteSpace = new JLabel(" ");
add(whiteSpace);
//Sets and adds button
okButton = new JButton("OK");
add(okButton);
//create new ButtonHandler for button event handling
ButtonHandlerSmall handler = new ButtonHandlerSmall();
okButton.addActionListener(handler);
}//end InputWindowSmall
private class ButtonHandlerSmall implements ActionListener
public void actionPerformed(ActionEvent event)
String univName = nameField.getText();
String univAddress = addressField.getText();
String univStudents = numberStudentsField.getText();
}//end actionPerformed
}//end ButtonHandlerSmall
public String getUniversityName()
return univName;
}//end getUniversityName
public String getUniversityAddress()
return univAddress;
public String getUniversityNumberStudents()
return univStudents;
}//ProjectTest (contains main)
/** Class Definition: ProjectTest - contains main*/
package FinalProject;
import javax.swing.JFrame;
public class ProjectTest {
public static void main(String args[])
//Creates a new university
University univ = new University();
//Instantiates and sets up the initial small window which asks for university name, address, and # students
InputWindowSmall inputWindowSmall = new InputWindowSmall(univ);
inputWindowSmall.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
inputWindowSmall.setSize(350, 120);
inputWindowSmall.setVisible(true);
inputWindowSmall.setLocationRelativeTo(null);
String univN = inputWindowSmall.getUniversityName();
String univA = inputWindowSmall.getUniversityAddress();
String univS = inputWindowSmall.getUniversityNumberStudents();
System.out.println(univN);
System.out.println(univA);
System.out.println(univS);
}//end main
}Edited by: heathercmiller on Apr 28, 2008 5:57 AM
Edited by: heathercmiller on Apr 28, 2008 5:58 AMOh! ...Here is a somewhat important detail I forgot to mention...
There's another class called University (I've included it below). The main part of the program instantiates an object of type University, and that object is passed to the InputWindowSmall class. In the end, I want those variables I mentioned above to be placed within the University object I created. ...And I've already passed a University object to InputWindowSmall... I'm just not entirely sure how to assign values to the variables within the University object while in a different class. ...Does that make any sense?
University
package FinalProject;
import java.util.Arrays;
/** Class Definition: University*/
public class University extends ProjectTest implements TuitionGenerate
private String universityName; /** refers to the name of the University */
private String address; /** refers to the address of the University */
private Student studentList[]; /** an array of Student objects */
/** Default Constructor */
University()
setuniversityName("University_of_Miami");
setaddress("555_Coral_Gables_St.");
/** Constructor with parameters */
University(String name,String add)
setuniversityName(name);
setaddress(add);
/** Constructor with extra parameters */
University(String name,String add, Student array[])
setuniversityName(name);
setaddress(add);
setstudentList(array);
/** method: gets universityName*/
public String getuniversityName()
return universityName;
/** method: gets address*/
public String getaddress()
return address;
/** method: gets studentList*/
public Student[] getstudentList()
return studentList;
/** method: sets universityName*/
public void setuniversityName(String name)
universityName=name;
/** method: sets address*/
public void setaddress(String add)
address=add;
/** method: sets studentList*/
public void setstudentList(Student array[])
studentList=new Student[array.length];
studentList=array;
/** method: returns a string representation of universityName and address*/
public String toString()
String output="University Name: " + universityName + "\nAddress: " + address + "\n\n";
return output;
/** method: sorts the array of students alphbetically by last name*/
public void studentSort()
String temp[]=new String[studentList.length];
for(int i=0;i<studentList.length;i++)
temp=studentList[i].getlastName();
Arrays.sort(temp);
Student temp2[]=new Student[studentList.length];
for(int i=0;i<temp.length;i++)
for(int j=0;j<studentList.length;j++)
if(temp[i].equals(studentList[j].getlastName()))
temp2[i]=studentList[j];
break;
studentList=temp2;
/** method: prints the list of students*/
public void printStudentList()
System.out.println("Students:\n");
for(int i=0;i<studentList.length;i++)
System.out.println(studentList[i].toString());
/** method: prints tuition from interface GenerateTuition*/
public void printTuition()
for(int i=0;i<studentList.length;i++)
System.out.println(studentList[i].toString());
System.out.println(" Tuition: $" + studentList[i].calTuition() + "0");
/** method: gets tuition from calTuition method*/
public double getTuition(Student x)
return x.calTuition();
Edited by: heathercmiller on Apr 28, 2008 6:07 AM -
File:
e:\pt849-905-R1-retail\peopletools\SRC\PSRED\psred.cppSQL error. Stmt #:
1849 Error Position: 24 Return: 3106 - ORA-03106: fatal two-task
communication protocol error
Failed SQL stmt:SELECT PROJECTNAME FROM PSPROJECTDEFN ORDER
BY PROJECTNAME
Got this error when opening the peopletools application designer 8.49. The same is working fine within the server, but not working from the client's machine.
We can still able to connect to the database & URL
Please help by throwing some lights.
Thanks,
Sarathy KLooks like a SQL error. ARe you able to connect to the database with SQL*Plus ? Probably the Oracle client is badly configured.
Nicolas. -
Logic error in a class I wrote...help
I wrote this class to filter a simplified version of Military time; basically it
returns a true or false statement to whether a specified string contains
the appropriate character sequence. My problem is that it seems to
report false even if my time format is correct.
example:
correct time: "0700"
incorrect time: "700" or invlalid characters "asdf "
maybe you all could catch me logic error...my head is bust
class SimpleMilitaryTime
//Verify that their are only 4 characters in the string
public boolean verifyLength(String time)
int textFieldLength;
boolean flag = true;
textFieldLength = time.length();
if (textFieldLength == 4)
flag = true;
else
flag = false;
return flag;
}//end verify length
//Method for comparing characters that can be used
public boolean verifyNumerals( String time )
boolean flag = true;
int flagCounter = 0;
char theChar;
//testing characters to see if they match or dont
//match the below lists of char numerals
//If they don't, the flagcounter is increased by
//one and the flag is returned as false
//because the flagcounter is greater than 0
//indicating that they are not all numerals but
//some other sort of character
for (int i = 0; i <= time.length(); i++)
theChar = (char)time.indexOf(i);
switch (theChar)
case '0':
break;
case '1':
break;
case '2':
break;
case '3':
break;
case '4':
break;
case '5':
break;
case '6':
break;
case '7':
break;
case '8':
break;
case '9':
break;
default:
flagCounter = flagCounter + 1;
}//end of switch
}//end of for loop
if (flagCounter < 0 )
flag = true;
else
flag = false;
return flag;
}//End of Method
//Method to determine numeral format
public boolean verifyFormat( String time )
boolean flag = true;
boolean hrFlag = true;
boolean minFlag = true;
String hr, min;
hr = time.substring(0, 1);
min = time.substring(2, 3);
hrFlag = verifyHrRange( hr );
//return true if its in the hour range of 0 to 23
minFlag = verifyMinRange( min );
//return true if its in the minutes range of 0 to 59
//If hrFlag or minFlag is false then format does
//not meet the Military Time Format
if (hrFlag == false || minFlag == false)
flag = false;
else
flag = true;
return flag;
}//end of Method
//Verify the Range of Hr between 0 and 23
public boolean verifyHrRange( String hr )
int hrTime;
boolean flag = true;
hrTime = Integer.parseInt( hr );
if ( hrTime >= 0 && hrTime <= 23 )
flag = true;
else
flag = false;
return flag;
}//End of Method
//Verify the Range of Minutes between 0 and 59
public boolean verifyMinRange( String min )
int minTime;
boolean flag = true;
minTime = Integer.parseInt( min );
if ( minTime >= 0 && minTime <= 59 )
flag = true;
else
flag = false;
return flag;
}//End of Method
//Method validates total time content
public boolean validateTime( String time )
boolean flag = true;
boolean flagLength = true;
boolean flagNumerals = true;
boolean flagFormat = true;
flagLength = verifyLength( time ); //Is the length == to 4 characters long
if( flagLength == true )
flagNumerals = verifyNumerals( time ); //Is the content made up of numerals
if( flagNumerals == true )
flagFormat = verifyFormat( time ); //Is the format within MilitaryTime Specs
if( flagFormat == true )
flag = true;
else
flag = false; //IF one or all are FALSE then FLAG is set to false
else
flag = false;
else
flag = false;
//return status of test run
return flag;
}//End of Method
}//End of ClassInterestingly enough, although both examples simplify the logic, I still
recieve a "false" when testing it. Here is some more code that I use
when a text field has lost focus. Right now the code is set to just test
the input.
The field is inialized to "1234". Once the field gains focus, it immediately sets to "false"...not sure why.?.? Even after resetting field
to another 4 digit numeral sequence I still get a "false" return instead of
verifying it as "true. " any ideas?
here is the code for testing the MilitaryTime class:
private class TextFieldListener extends FocusAdapter
//method that listens losing focus of textfield
public void focusLost( FocusEvent ev )
boolean flag;
String indFALSE, indTRUE;
indFALSE = "FALSE";
indTRUE = "TRUE";
int strLength;
flag = mt.isValidTime(sunMornStartTime_str); //mt is for MilitaryTime
if (flag == false)
sunMornStartTime.setText(new String(indFALSE));
if (flag == true)
sunMornStartTime.setText(new String(indTRUE));
}//End of Method
}//End of private class TextFieldAction -
Hi ,
i am getting error while joining 2 facts
relation is sales-------time---------sales1 in physical layer and then drag sale1 in sales and given time-----------sales
[nQSError: 46030] Field descriptor id 0 is beyond the maximum field count 0. (HY000)
thanksHi master,
I am referring to sh schema in which
customer,times are joined with sales table
sales1(new table created from sales and imported)
for an example sales1 is only joined with times table and there is no join between any other table
so the requirement is that
customer city year month sales sales1 required in the report how will get these 2 facts in the report when there is no joined
when it is tested from sales with sales1 it shows black data in the same report
is there any solution where it can map with time dimension with other dimensions as well
thanks -
There is a way to follow the details of each paguina Web within iExpenses, I have a logical error where I erased information already captured by pressing the button "Save" someone could mencionarme something.
Thanksyou can do it with a .sql script
c:\my_emp.sql
PROMPT
PROMPT instering my_employees
PROMPT
ACCEPT ID NUMBER PROMPT 'ID ? : '
ACCEPT FIRST_NAME CHAR PROMPT 'FIRST_NAME ?: '
ACCEPT LAST_NAME CHAR PROMPT 'LAST_NAME ?: '
ACCEPT SALARY NUMBER PROMPT 'SALARY ? : '
insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary);
SELECT * FROM my_employee where id=&&id;
and then from sqlplus @c:\my_emp.sql
scott@ORCL> @C:\MY_EMP
instering my_employees
ID ? : 20
FIRST_NAME ?: john
LAST_NAME ?: papas
SALARY ? : 1000
old 1: insert into my_employee values(&id,'&last_name','&first_name',substr('&&first_name',1,1)||substr('&last_name',1,7),&salary)
new 1: insert into my_employee values( 20,'papas','john',substr('john',1,1)||substr('papas',1,7), 1000)
1 row created.
old 1: SELECT * FROM my_employee where id=&&id
new 1: SELECT * FROM my_employee where id= 20
ID LAST_NAME FIRST_NAME USERID SALARY
20 papas john jpapas 1000
scott@ORCL> -
Essbase Internal Logic Error [7333]
We have a "backup" application to which we copy all of our applications' databases to every night.
However now when we try to start the backup application we get one or more of the following errors in the log, and the app won't start:
Unable to Allocate Aligned Memory for [pMemByte] in [adIndInitFree].
Unable to Allocate Aligned Memory for [pTct->pTctFXBuffer] in [adTmgAllocateFXBuffer].
Essbase Internal Logic Error [7333]
RECEIVED ABNORMAL SHUTDOWN COMMAND - APPLICATION TERMINATING
The other live applications that I'm copying from all start correctly. There is plenty of disk space and free memory on the server.
I've read about other people getting these errors and tried the following:
- Recreated the backup application (which cleared out any temporary files that might have been hanging around)
- Validated all the other applications that I'm copying from
It does seem to be a capacity issue because when I remove some of the larger databases from the backup application it does start. However I can't attribute the problem to an individual large database because when I copy each of them to the application by themselves then they're fine.
I'd appreciate any ideas on what to try next... could this suggest that something's wrong with the memory chips on the server?
Thanks
Mark
Update: I have used a workaround by putting half of the databases in one backup application and the other half in another application. Both of these applications start without a problem. Is there a maximum size of databases in an app? I am trying to add 21 databases with a combined .PAG file size of only 2.4GB.
Edited by: MatMark on Nov 22, 2010 2:46 PMThank you John, yes it appears to be the 2GB limit, however I'm a bit confused as to what I should be measuring that exceeds 2GB, you mentioned index cache (I assume these are IND) which total to only 140MB.
The PAG files total to 3.7GB but these would have been greater than 2GB for a long time, before this problem started occurring.
Anyway, case closed, I have to split these up into separate applications. Thanks for your help.
Maybe you are looking for
-
Lion server/Mountain Lion client connection issue
I am trying to set up our work Lion Server to use open directory. The DNS settings are fine on the server side but the Mountain Lion clients cannot bind to the server. We are hoping to get a static IP soon so the directors can access the network remo
-
Bridge preview does not match thumbnails
We've just updated the OS, and had to re-install Bridge and Photoshop (CS4). Unfortunately, the preview doesn't match the thumbnail in Bridge, nor does it match the file when I open it in Photoshop. As far as I am aware, they are both set to the same
-
Windows cannot read the application install dvd
hi i finished installing windows on my macbook pro. i m at the step where ur supposed to put the application dvd to finish the installation. but it says that the disk is damaged and something like that and windows cannot read it. but when i try to re
-
TS2755 Group text to ex-iPhone sent as iMessage
My brother switched from an iPhone to an android. My iPhone still recognizes his phone as an iPhone. When I send a group text to him and other iPhone users, it's sent as an iMessage so he doesn't get the text. I have to turn off my iMessage setting.
-
Like to send a Newsletter from Publisher 2013
i like to send a newletter from publisher, but don't have the send button only the email adres field. how can i get the send button ?