Syntax to print out variable

I need to know the syntax to print out bind variable to
xterm. ( :import.out := outdir ).
I believe forms doesn't have the dbms package but
does have the text_io. I would like to know the
syntax for both as I want to monitor a variable's contents
from unix script through forms and through a stored procedure.

> I want to use the select statement instead of anonymous block.
Like I wrote above, functions with out parameters is poor programming practice. Oracle won't let you use a function with an out parameter in a select statement. You MUST use PL/SQL. See this example:
SQL> Create or replace function ABC(i in number, o out number)
  2    return number is
  3  Begin
  4    o := 2 * i;
  5    Return 3 * i;
  6  End;
  7  /
SQL> variable o1 number
SQL> select ABC( 5, :o1 ) from dual;
select ABC( 5, :o1 ) from dual
ERROR at line 1:
ORA-06572: Function ABC has out arguments
SQL> variable r1 number
SQL> Begin
  2    :r1 := ABC( 5, :o1 );
  3  End;
  4  /
SQL> print :r1
        R1
        15
SQL> Print :o1
        O1
        10
SQL> drop function ABC;
SQL>

Similar Messages

  • Printing OUT variables from a Stored Procedure

    Hi all,
    I'm running an SQL command that calls a Stored Procedure and passes in some value. I've pasted in the important parts of it below. What I am trying to do is access the OUT variables that have been assigned to the DECLARED variables. I come from a SQL Server background and there we can do "SELECT @variable" which will print it to screen. I'm trying to do something similar here.
    I need to access the contents of the three variables declared at the top of the script.
    Thanks in advance.
    DECLARE
    l_error_value NUMBER;
    l_error_product VARCHAR2 (10);
    l_CE_DOC_ID number;
    BEGIN
    PEM.create_enquiry   
         (      ce_cat => 'COMP'
                   , ce_class => 'FRML'
                   , error_value => l_ERROR_VALUE
                   ,error_product => l_ERROR_PRODUCT
                   , ce_doc_id => l_ce_doc_id
    END;

    Ah yes I see. Sorry I misunderstood what you were suggesting. I'm currently working on a test script that uses an approach similar to the one you mentioned, but I'm having trouble resolving foreign key relationships with test data.
    I've no access to the tables or anything so it's proving to be a time consuming task!!
    Is it required that all fields are given a value, even if they have a "DEFAULT" defined for them within the procedure. At the moment I'm using a rather cumbersome approach to this:
    i.e.
    With cmmAddRequest
        .ActiveConnection = strConnect
        .CommandType = adCmdText
        .CommandText = strSQL
        .Parameters(0).Direction = adParamInput
        .Parameters(1).Direction = adParamInput
        .Parameters(2).Direction = adParamInput
        .Parameters(3).Direction = adParamOutput
        .Parameters(4).Direction = adParamOutput
        .Parameters(5).Direction = adParamOutput
        .Parameters(0).Value = "COMP"
        .Parameters(1).Value = "FRML"
        .Parameters(2).Value = "1"
        .Execute
        WScript.Echo(.Parameters(5).Value)
    End With

  • Printing out variable types

    how do i output the type(int, string,etc) of variable my program returns. i just want to know what type its returning because i'm getting a compiler error "incompatible types". thx.

    i understand what u'r saying, but i don't understand why the compiler is telling me "incompatible types" when it looks as if i've returned the correct data types! u may have to excuse me bcuz i'm a beginner, but here is the code, there are 3 different parts to it. . .
    thx again & forgive me if i've confused you at all
    ** this is the method that fails
    public Student setupStudent(String studentName, int studentAge)
         String newName;
         int newAge;
         newAge = studentAge;
    newName = studentName;
    return newName;
    return newAge;
    ** this is the statement that calls SETUPSTUDENT
    Student aStudent = setupStudent(studentNameField.getText(),
                                  Integer.parseInt(studentAgeField.getText()));
    *** this is the class that is called & where the method is failing ***because of what is returned from this class.
    import java.awt.*;
    import java.lang.*;
    public class Student
    Student(String studentName, int studentAge)
    Name = studentName;
    Age = studentAge;
    public void setName(String newName)
    Name = newName;
    public String getName()
    return Name;
    public void setAge(int newAge)
    Age = newAge;
    public int getAge()
    return Age;

  • Syntax to print to bind variable to screen

    I need to know the correct syntax to print out the bind variable contents to the xterm screen.

    Hi Veeranagi,
    To print Dashed line, either you can use
    WRITE: '----
    If you dont want to use such statement, simply create a text element with
    TEXT-001   '----
    ' and then use
    WRITE: TEXT-001
    Reward if useful.
    Best Regards,
    Ram.

  • Executing a Stored Procedure with OUT Variables

    When you execute a stored proc withi OUT variables, do you have to add in the "Declare" section and "Begin/End" sections? Or can you just use "EXECUTE <stored proc>"??

    When you execute a stored proc withi OUT variables, do you have to add in the "Declare" section and "Begin/End" sections?
    Or can you just use "EXECUTE <stored proc>"?? You mean this?:
    michaels>  create or replace procedure p (o out varchar2)
    as
    begin
       o := 'Some out variable';
    end p;
    Procedure created.
    michaels>  var o varchar2(50)
    michaels>  exec p(:o)
    PL/SQL procedure successfully completed.
    michaels>  print o
    o                                                
    Some out variable                                

  • Printing out results in case of object-relational table (Oracle)

    I have made a table with this structure:
    CREATE OR REPLACE TYPE Boat AS OBJECT(
    Name varchar2(30),
    Ident number,
    CREATE OR REPLACE TYPE Type_boats AS TABLE OF Boat;
    CREATE TABLE HOUSE(
    Name varchar2(40),
    MB Type_boats)
    NESTED TABLE MB store as P_Boat;
    INSERT INTO House VALUES ('Name',Type_boats(Boat('Boat1', 1)));
    I am using java to print out all the results by calling a procedure.
    CREATE OR REPLACE package House_boats
    PROCEDURE add(everything works here)
    PROCEDURE results_view;
    END House_boats;
    CREATE OR REPLACE Package.body House_boats AS
    PROCEDURE add(everything works here) AS LANGUAGE JAVA
    Name House_boats.add(...)
    PROCEDURE results_view AS LANGUAGE JAVA
    Name House_boats.resuts_view();
    END House_boats;
    However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
    CALL House_boats.results_view();
    House_boats.java file which is loaded using LOADJAVA:
    import java.sql.*;
    import java io.*;
    public class House_boats {
    public static void results_view ()
       throws SQLException
       { String sql =
       "SELECT * from House";
       try { Connection conn = DriverManager.getConnection
    ("jdbc:default:connection:");
       PreparedStatement pstmt = conn.prepareStatement(sql);
       ResultSet rset = pstmt.executeQuery();
      printResults(rset);
      rset.close();
      pstmt.close();
       catch (SQLException e) {System.err.println(e.getMessage());
    static void printResults (ResultSet rset)
       throws SQLException { String buffer = "";
       try { ResultSetMetaData meta = rset.getMetaData();
       int cols = meta.getColumnCount(), rows = 0;
       for (int i = 1; i <= cols; i++)
       int size = meta.getPrecision(i);
       String label = meta.getColumnLabel(i);
       if (label.length() > size) size = label.length();
       while (label.length() < size) label += " ";
      buffer = buffer + label + " "; }
      buffer = buffer + "\n";
       while (rset.next()) {
      rows++;
       for (int i = 1; i <= cols; i++) {
       int size = meta.getPrecision(i);
       String label = meta.getColumnLabel(i);
       String value = rset.getString(i);
       if (label.length() > size) size = label.length();
       while (value.length() < size) value += " ";
      buffer = buffer + value + " ";  }
      buffer = buffer + "\n";   }
       if (rows == 0) buffer = "No data found!\n";
       System.out.println(buffer); }
       catch (SQLException e) {System.err.println(e.getMessage());}  }
    How do I print out the results correctly in my case of situation?
    Thank you in advance

    I have made a table with this structure:
    I am using java to print out all the results by calling a procedure.
    However, I am not able to get Results.view working in case of object-relation table. This is how I do it in the situation of relational table.
    How do I print out the results correctly in my case of situation?
    There are several things wrong with your code and methodology
    1. The code you posted won't even compile because there are several syntax issues.
    2. You are trying to use/test Java in the database BEFORE you get the code working outside the DB
    3. Your code is not using collections in JDBC properly
    I suggest that you use a different, proven approach to developing Java code for use in the DB
    1. Use SIMPLE examples and then build on them. In this case that means don't add collections to the example until ALL other aspects of the app work properly.
    2. Create and test the Java code OUTSIDE of the database. It is MUCH easier to work outside the database and there are many more tools to help you (e.g. NetBeans, debuggers, DBMS_OUTPUT windows, etc). Trying to debug Java code after you have already loaded it into the DB is too difficult. I'm not aware of anyone, even at the expert level, that develops that way.
    3. When using complex functionality like collections first read the Oracle documentation (JDBC Developer Guide and Java Developer's Guide). Those docs have examples that are known to work.
    http://docs.oracle.com/cd/B28359_01/java.111/b31225/chfive.htm
    http://docs.oracle.com/cd/E11882_01/java.112/e16548/oraarr.htm#sthref583
    The main issue with your example is #3 above; you are not using collections properly:
    String value = rset.getString(i);
    A collection is NOT a string so why would you expect that to work for a nested table?
    A collection needs to be treated like a collection. You can even treat the collection as a separate result set. Create your code outside the database and use the debugger in NetBeans (or other) on this replacement code for your 'printResults' method:
    static void printResults (ResultSet rset) throws SQLException {
        try {
           ResultSetMetaData meta = rset.getMetaData();
           while (rset.next()) {
               ResultSet rs = rset.getArray(2).getResultSet();
               rs.next();
               String ndx = rs.getString(1);
               Struct struct = (Struct) rs.getObject(2);
               System.out.println(struct.getSQLTypeName());
               Object [] oa = struct.getAttributes();
               for (int j = 0; j < oa.length; j++) {
                  System.out.println(oa[j]);
        } catch  (SQLException e) {
           System.err.println(e.getMessage());
    That code ONLY deals with column 2 which is the nested table. It gets that collection as a new resultset ('rs'). Then it gets the contents of that nested table as an array of objects and prints out the attributes of those objects so you can see them.
    Step through the above code in a debugger so you can SEE what is happening. NetBeans also lets you enter expressions such as 'rs' in an evaluation window so you can dynamically try the different methods to see what they do for you.
    Until you get you code working outside the database don't even bother trying to load it into the DB and create a Java stored procedure.
    Since your current issue has nothing to do with this forum I suggest that you mark this thread ANSWERED and repost it in the JDBC forum if you need further help with this issue.
    https://forums.oracle.com/community/developer/english/java/database_connectivity
    When you repost you can include a link to this current thread if you want. Once your Java code is actually working then try the Java Stored procedure examples in the Java Developer's Guide doc linked above.
    At the point you have any issues that relate to Java stored procedures then you should post them in the SQL and PL/SQL forum
    https://forums.oracle.com/community/developer/english/oracle_database/sql_and_pl_sql

  • PO print OUT And material Document Print Out is coming In English

    HI all.
    I have Created Vendor In ZH(chinese Language,)and in material master I have maintained description in Chinese language.
    I'M taking PO and material Documents print outs  in Chinese Server log-in.
    even Though Im taking Print outs in Chinese Log-In server, IM getting Print outs in English Language only not In chines language..
    At the Time Of PO creation the Communication Language is ZH(Chines)..
    I have read some related post even 89899..
    But I have not find solution
    plz help me.
    thanks and regards
    ramesh reddy.'

    Check SAP Note 894444 - Tool for server-based printing on Windows (SAPSprint) for your requirement,
      Installation
    Before you install SAPSprint, delete SAPLPD manually. To do this, you normally need to completely delete the installation directory only. If you installed SAPLPD as a service using the srvany tool, you can remove the service by calling 'Instsrv SAPLPD remove'.
    You can download SAPSprint as a self-extracting executable file from SAP Service Marketplace:
    1. Entry by Application Group (on the left)
    2. SAP Frontend Components (on the right)
    3. SAPSPRINT (on the right)
    4. SAPSPRINT <Release> (on the right)
    5. SAPSPRINT <Release> (on the right)
    6. Win32 (on the right)
    Start the program. After you enter the installation path, the system prompts you to enter the TCP/IP port.
    Normally, the default setting of 515 is suitable for the port. You should only change this setting if the Windows TCP/IP print service is also running on the computer. The SAPSprint Windows service starts as soon as the installation is over.
    We recommend that you set up the following options for the service in the Windows Service Control Manager:
    The service should run under a domain user that has the relevant authorizations for the required printers. After the installation, the service runs under "Local system account". This can access locally-defined printers only. You can set the user in the Windows Service Control Manager, in the options of the SAPSprint service.
    If you want to delete SAPSprint, you can do so using the normal Windows uninstall tool.
    We recommend that you install the SAPSprint service on a separate computer and not together with a SAP system, especially if you use a large number of printers. All printers that SAPSprint uses must be installed on the SAPSprint computer. This applies particularly to released printers from other computers. These should be installed as a queue on the SAPSprint server.
    Also note further settings in accordance with Note 1069483.
    Settings
    You can display the call parameters available for SAPSprint by calling 'sapsprint -?' on the command line. The most important parameters are those that set options, especially log options for troubleshooting.
    You can set the log level to 5 by specifying 'sapsprint -oi LogLevel 5'. Immediately after installation, no log level is set up, which means that no log file is created. By setting the log level to 1, 5, or 9, you can ensure that more information is available in the directory that you specified during the installation. A file called sapsprint.dbg and a print job specific file with a variable name are generated. The second file is deleted after successful printing. It is only retained if the printout is recognized as incorrect. If you set the option 'sapsprint -oi KeepFile 1', then both this file and the print file are retained. This is primarily intended for troubleshooting by SAP Support.
    All options are case-sensitive. You can display the most important SAPSprint options by calling 'sapsprint -?'. All possible options are described in Note 85469. Normally, the options described there are not necessary - you should use them only in exceptional circumstances.

  • Print out of report

    hi experts ,,,,
      1)...i am taking the print out of report.
      i given the horizantal and vertical lines......
    i did not want them in output(lines)....
    how can i do this, any option is available.
    2) how to delete the leading zeroes...
      i jave number like this 00000876. i need only 876.
    how can i get it. any command u can suggest me..
    thanks in advance.
    Message was edited by:
            dasr r

    hi,
    U can either use this function module also
    CONVERSION_EXIT_ALPHA_OUTPUT
    or
    SHIFT <yourField> LEFT DELETING LEADING '0'
    or
    try NO-ZERO option of WRITE statement
    or
    Another way is to create another variable of type I and assign the value into it
    example:
    DATA: L_NUMC(08) TYPE N.
    DATA: L_INT TYPE I.
    L_NUMC = '00000018'.
    L_INT = L_NUMC.
    Result will be = 18.
    Hope this helps
    regards.

  • Print out Standard text in Task description

    Hi All,
    is it possible print out the standard text in the workflow task description?
    I need to display some information in the business workplace, but i don't know how to print out the standard text in task description.
    Regards,
    Luke

    Hi Luke,
    Are you lloking to print Standard texts in Workitem...
    You can do that... you will have to first create a method to read SO standard text using READ_TEXT and pass it on to a multiline container which you will have to mention in the Task description.
    For syntax please search relevant threads...
    Rgds
    Gautam

  • Print out table desc from sql/plus

    Hello,
    I'm trying to print out the desc table from the database .
    What is the syntax for it in the sql/plus ?
    Thanks very much.
    TPham
    null

    tpham (guest) wrote:
    : Hello,
    : I'm trying to print out the desc table from the database .
    : What is the syntax for it in the sql/plus ?
    : Thanks very much.
    : TPham
    Jerome wrote:
    Hi! Tipham!
    Here is the command:
    In Sql/plus
    1. spool on --these command set spool on
    2. spool c:\desc_table.sql -- these command open desc_table.sql
    file for spooling. It is
    user-defined it will be created if
    it is not existin
    3. desc table_name -- the result will be recorded to
    desc_table file. Open it in any text
    editor and print it.
    from [email protected]
    null

  • Print out array

    The code does not print out like it shoud. What am I doing wrong? Thank you for help
    public class test {
        public static void main(String ... args) {
            String text = "array";
            char[] textArray = text.toCharArray();
            System.out.println("     text >" + text);
            System.out.print("textArray >" + textArray);
    }output:
         text >array
    textArray >[C@addbf1

    Once again this is printing out correctly, to get your desired syntax you could loop through the array e.g
    public class test {   
       public static void main(String ... args) {
             String text = "array";
             char[] textArray = text.toCharArray();
             System.out.println("text > " + text);
             System.out.print("textArray > ");
             for(int i = 0;i<textArray.length;i++){
                 System.out.print(textArray);
    }Calypso                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Sapscript - print out seperate labels for multiple delivery items

    Hello,
    we do have an output type that prints barcode labels for deliveries (VL02n).
    Now if there are more than one delivery item on the delivery, it will only print out a label for the first item.
    How can I trigger that all items will be printed out on a seperate label each?
    thanks
    Anne

    Hi,
    Just open the script which prints the lables and check for the variable name used for label printing
    Check the script for variables and pass the value to that avriables and those to be declred in your print/driver program.
    when you call write_from in the loop  there you give a window name what ever the value in the variable it will pass to script
    Regards
    Krishna

  • Array keeps printing out null

    I have an array that continues to print out null but when I trace it exactly after I store it, it stores what I want it to store. "White Bread"
    Here is where the errors at:
    int orderNum = 0;
                   while(orderNum < cartItems)
                        printItems = "<html>" + printItems + "<br>1" + itemNameStrings[orderNum] + "</html>";
                        System.out.println(printItems);//Trace
                        System.out.println(cartItems);//Trace
                        System.out.println(orderNum);//Trace
                        System.out.println(itemNameStrings[orderNum]);//Trace
                        orderNum++;
                   }And here is the whole project:
    import java.io.*;
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    import java.util.*;
    import javax.swing.border.*;
    import java.text.*;
    public class AdrianP1 implements ActionListener
         //---------------GLOBAL DECLARING------------------
         DecimalFormat Currency = new DecimalFormat("#0.00 dollars");//Currency
         //Changing Variables (void)
         String printItems = "Items";
         int arraySize = 2;
         String[] itemNameStrings;
         boolean first = true;
         boolean order = false;
         String itemName = "Error";
         double itemCost = 0.00;
         int cartItems = 0;
         //Main Frames
         final JFrame frame = new JFrame("Subway Sandwich Store");
         JFrame mainFrame = new JFrame("Subway Sandwich Store | Welcome");
         JFrame menuFrame = new JFrame("Subway Sandwich Store | Main Menu");
         JFrame instrucFrame = new JFrame("Subway Sandwich Store | Instructions");
         JFrame playFrame = new JFrame("Subway Sandwich Store | Play Game");
         JFrame breadFrame = new JFrame("Subway Sandwich Store | Order Bread");
         JFrame toppingFrame = new JFrame("Subway Sandwich Store | Order Toppings");
         JFrame condimentFrame = new JFrame("Subway Sandwich Store | Order Condiments");
         JFrame confirmFrame = new JFrame("Subway Sandwich Store | Confirm Your Order");
         JFrame cartFrame = new JFrame("Subway Sandwich Store | Your Cart");
         //---Main Buttons---
         final JButton mainMenuButton = new JButton("Main Menu");
         final JButton mainMenuButton1 = new JButton("Main Menu");
         final JButton mainMenuButton2 = new JButton("Main Menu");
         final JButton mainMenuButton3 = new JButton("Main Menu");
         final JButton goBackButton = new JButton("Go back");
         final JButton goBackButton1 = new JButton("Go back");
         final JButton goBackButton2 = new JButton("Go back");
         final JButton goBackButton3 = new JButton("Go back");
         final JButton goBackButton4 = new JButton("Go back");
         final JButton playButton1 = new JButton("Order Now!");
         final JButton playButton2 = new JButton("Order Now!");
         final JButton instrucButton = new JButton("Instructions");
         final JButton exitButton = new JButton("Exit");
         //---Play Buttons---     
         final JButton checkButton = new JButton("Check Out");
         final JButton checkButton1 = new JButton("Check Out");
         final JButton cartButton = new JButton("Cart (" + cartItems + ")");
         final JButton breadButton = new JButton("Bread");
         final JButton toppingsButton = new JButton("Toppings");
         final JButton condimentsButton = new JButton("Condiments");
         //-------Bread------
         double bwCost = 0.50, bwlCost = 0.50, biCost = 0.75, bhCost = 0.50;
         boolean whiteB = false, wholeB = false, italB = false, harvestB = false;
         final JButton whiteBreadButton = new JButton("Order White");
         final JButton wholeBreadButton = new JButton("Order Wheat");
         final JButton italianBreadButton = new JButton("Order Italian");
         final JButton harvestBreadButton = new JButton("Oder Harvest");
         //-----Toppings-----
         JButton orderTopButton = new JButton("Order the Selected Topping");
         JLabel pictureTop;
         JComboBox toppingList;
         //----Condiments----
         final JButton ketchupButton = new JButton("Order Ketchup");
         final JButton mustardButton = new JButton("Order Mustard");
         final JButton relishButton = new JButton("Order Relish");
         //-----Confirm------
         final JLabel confirmTextLabel;
         final JButton acceptButton = new JButton("Accept");
         final JButton declineButton = new JButton("Decline");
         //----Cart Screen---
         final JLabel cartItemLabel = new JLabel("<html><u>Items</u><br>No Items.</html>", JLabel.LEFT);
         final JLabel cartPriceLabel = new JLabel("<html><u>Price</u><br>No Items.</html>");
         //-------------END GLOBAL DECLARING-----------------     
         //ActionPerformed Method
         public void actionPerformed(ActionEvent event)
              if(event.getSource()==mainMenuButton || event.getSource()==mainMenuButton1 || event.getSource()==mainMenuButton2 || event.getSource()==mainMenuButton3)
                   playFrame.setVisible(false);
                   mainFrame.setVisible(false);
                   instrucFrame.setVisible(false);
                   menuFrame.setVisible(true);
              if(event.getSource()==goBackButton || event.getSource()==goBackButton1 || event.getSource()==goBackButton2 || event.getSource()==goBackButton3 || event.getSource()==goBackButton4)
                   cartFrame.setVisible(false);
                   confirmFrame.setVisible(false);
                   condimentFrame.setVisible(false);
                   toppingFrame.setVisible(false);
                   breadFrame.setVisible(false);
                   instrucFrame.setVisible(false);
                   playFrame.setVisible(true);
              if(event.getSource()==instrucButton)
                   menuFrame.setVisible(false);
                   instrucFrame.setVisible(true);
              if(event.getSource()==playButton1 || event.getSource()==playButton2)
                   instrucFrame.setVisible(false);
                   menuFrame.setVisible(false);
                   playFrame.setVisible(true);
              if(event.getSource()==breadButton)
                   playFrame.setVisible(false);
                   menuFrame.setVisible(false);
                   breadFrame.setVisible(true);
              if(event.getSource()==toppingsButton)
                   playFrame.setVisible(false);
                   toppingFrame.setVisible(true);
              if(event.getSource()==condimentsButton)
                   playFrame.setVisible(false);
                   condimentFrame.setVisible(true);
              if(event.getSource()==acceptButton)
                   ++arraySize;
                   itemNameStrings = new String[arraySize];
                   itemNameStrings[cartItems] = itemName;
                   System.out.println(itemNameStrings[cartItems]);
                   cartItems++;
                   cartButton.setText("Cart (" + cartItems + ")");
                   confirmFrame.setVisible(false);
                   playFrame.setVisible(true);
              if(event.getSource()==declineButton)
                   confirmFrame.setVisible(false);
                   playFrame.setVisible(true);
              if(event.getSource()==cartButton)
                   int orderNum = 0;
                   while(orderNum < cartItems)
                        printItems = "<html>" + printItems + "<br>1" + itemNameStrings[orderNum] + "</html>";
                        System.out.println(printItems);//Trace
                        System.out.println(cartItems);//Trace
                        System.out.println(orderNum);//Trace
                        System.out.println(itemNameStrings[orderNum]);//Trace
                        orderNum++;
                   cartItemLabel.setText(printItems);
                   System.out.println(printItems);
                   playFrame.setVisible(false);
                   cartFrame.setVisible(true);
              if(order==true)
                   if(event.getSource()==whiteBreadButton)
                        whiteB = true;
                        itemName = "White Bread";
                        itemCost = bwCost;
                        confirmTextLabel.setText("<html>Would you like to purchase <u>" + itemName + "</u> <br>for a cost of <u>$" + Currency.format(itemCost) + "</u>?</html>");
                        breadFrame.setVisible(false);
                        confirmFrame.setVisible(true);
                   if(event.getSource()==wholeBreadButton)
                        wholeB = true;
                        confirmFrame.setVisible(true);
                   if(event.getSource()==italianBreadButton)
                        italB = true;
                        confirmFrame.setVisible(true);
                   if(event.getSource()==harvestBreadButton)
                        harvestB = true;
                        confirmFrame.setVisible(true);
              if(event.getSource()==exitButton)
                   System.exit(0);
              if(event.getSource()==toppingList)
                   JComboBox cb = (JComboBox)event.getSource();
                 String toppingName = (String)cb.getSelectedItem();
                 updateLabel(toppingName);
         //Main Method   
        public static void main(String[] args) throws Exception
             new AdrianP1();         
        //Constructive and Starting Method
        AdrianP1()
             //--------------------------Action Listeners----------------------------------
             //Creates all action listeners
             mainMenuButton.addActionListener(this);
             mainMenuButton1.addActionListener(this);
             mainMenuButton2.addActionListener(this);
             mainMenuButton3.addActionListener(this);
             goBackButton.addActionListener(this);
             goBackButton1.addActionListener(this);
             goBackButton2.addActionListener(this);
             goBackButton3.addActionListener(this);
             goBackButton4.addActionListener(this);
             exitButton.addActionListener(this);
              instrucButton.addActionListener(this);
              playButton1.addActionListener(this);
              playButton2.addActionListener(this);
              breadButton.addActionListener(this);
              toppingsButton.addActionListener(this);
              condimentsButton.addActionListener(this);
              //Bread buttons
              whiteBreadButton.addActionListener(this);
              //Final buttons
              cartButton.addActionListener(this);
              acceptButton.addActionListener(this);
              declineButton.addActionListener(this);
              //--------------------------Splash Screen----------------------------------
             //Declaring
             order = false;
             final ImageIcon welcomePic = new ImageIcon("welcome.jpg");
             final JPanel sMainPanel = new JPanel(new BorderLayout());
             final JPanel sTopPanel = new JPanel(new BorderLayout());  
             final JPanel sButtonPanel = new JPanel(new FlowLayout ());
             final JLabel sTextLabel = new JLabel("Please click the button below", JLabel.CENTER);     
             final JLabel label = new JLabel("Subway Sandwich Store");
             final JLabel welcomeLPic = new JLabel(welcomePic);
              sTopPanel.add(welcomeLPic , BorderLayout.NORTH);
              sTopPanel.add(sTextLabel);
              sButtonPanel.add(mainMenuButton1);
              sMainPanel.add(sTopPanel , BorderLayout.CENTER);
              sMainPanel.add(sButtonPanel , BorderLayout.SOUTH);
                 mainFrame.setContentPane(sMainPanel);
             mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             mainFrame.pack();
             mainFrame.setVisible(true);
             mainFrame.setSize(350,390);
              //--------------------------Main Menu----------------------------------
              //Declaring
              order = false;
              final ImageIcon mainMenuImage = new ImageIcon("mainMenuImage.jpg");
              final JPanel mMainPanel = new JPanel(new BorderLayout());
              final JPanel mTopPanel = new JPanel(new BorderLayout());
              final JPanel mButtonPanel = new JPanel(new FlowLayout());
              final JLabel imageLabel = new JLabel(mainMenuImage);
              final JLabel textLabel = new JLabel("Please click a button", JLabel.CENTER);
              mTopPanel.add(imageLabel , BorderLayout.NORTH);
              mTopPanel.add(textLabel , BorderLayout.CENTER);
              mButtonPanel.add(playButton1);
              mButtonPanel.add(instrucButton);
              mButtonPanel.add(exitButton);
              mMainPanel.add(mTopPanel, BorderLayout.CENTER);
              mMainPanel.add(mButtonPanel, BorderLayout.SOUTH);
                 menuFrame.setContentPane(mMainPanel);
             menuFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             menuFrame.pack();
             menuFrame.setVisible(false);
             menuFrame.setSize(350,390);
              //--------------------------Instructions----------------------------------
              //Declaring
              order = false;
              final JPanel iTopPanel = new JPanel(new BorderLayout());
              final JPanel iButtonPanel = new JPanel(new FlowLayout());
              final JPanel iMainPanel = new JPanel(new BorderLayout());
              final JLabel iTextLabel = new JLabel("Instructions go HRER!", JLabel.CENTER);
              iTopPanel.add(iTextLabel);
              iButtonPanel.add(mainMenuButton3);
              iButtonPanel.add(playButton2);
              iMainPanel.add(iTopPanel, BorderLayout.CENTER);
              iMainPanel.add(iButtonPanel, BorderLayout.SOUTH);
              iTopPanel.setBorder(BorderFactory.createTitledBorder("Instructions"));
              instrucFrame.setContentPane(iMainPanel);
             instrucFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             instrucFrame.pack();
             instrucFrame.setVisible(false);
             instrucFrame.setSize(350,390);
              //--------------------------Play Game----------------------------------
              //Declaring
              order = false;
              final ImageIcon playImage = new ImageIcon("playGameImage.jpg");
              final JPanel pTopPanel = new JPanel(new BorderLayout());
              final JPanel pInstrucPanel = new JPanel(new FlowLayout());
              final JPanel pButtonPanel = new JPanel(new FlowLayout());
              final JPanel pButton1Panel = new JPanel(new FlowLayout());
              final JPanel pButton2Panel = new JPanel(new FlowLayout());
              final JPanel pMainPanel = new JPanel(new BorderLayout());
              final JLabel pImageLabel = new JLabel(playImage);
              final JLabel pTextLabel = new JLabel("Click below to customize your sandwich; or check out", JLabel.CENTER);
              pTopPanel.add(pButton2Panel, BorderLayout.NORTH);
              pTopPanel.add(pImageLabel, BorderLayout.CENTER);
              pInstrucPanel.add(pTextLabel, BorderLayout.SOUTH);
              pButton1Panel.add(breadButton);
              pButton1Panel.add(toppingsButton);
              pButton1Panel.add(condimentsButton);
              pButton2Panel.add(checkButton);
              pButton2Panel.add(cartButton);
              pButton2Panel.add(mainMenuButton2);
              pButtonPanel.add(pButton1Panel);
              pMainPanel.add(pTopPanel, BorderLayout.NORTH);
              pMainPanel.add(pInstrucPanel, BorderLayout.CENTER);
              pMainPanel.add(pButtonPanel, BorderLayout.SOUTH);
              pInstrucPanel.setBorder(BorderFactory.createTitledBorder("Instructions"));
              playFrame.setContentPane(pMainPanel);
             playFrame.setDefaultCloseOperation(playFrame.EXIT_ON_CLOSE);
             playFrame.pack();
             playFrame.setVisible(false);
             playFrame.setSize(350,390);
              //--------------------------Order Bread----------------------------------
              //Declaring
              order = true;
              final ImageIcon whiteBImage = new ImageIcon("whiteB.jpg");
              final ImageIcon wheatBImage = new ImageIcon("wheatB.jpg");
              final ImageIcon italianBImage = new ImageIcon("italianB.jpg");
              final ImageIcon harvestBImage = new ImageIcon("harvestB.jpg");
              final JPanel bTopPanel = new JPanel(new GridLayout(0,2));
              final JPanel bCenterPanel = new JPanel(new FlowLayout());
              final JPanel bButtonPanel = new JPanel(new FlowLayout());
              final JPanel bMainPanel = new JPanel(new BorderLayout());
              final JLabel whiteBLabel = new JLabel(whiteBImage);
              final JLabel wheatBLabel = new JLabel(wheatBImage);
              final JLabel italianBLabel = new JLabel(italianBImage);
              final JLabel harvestBLabel = new JLabel(harvestBImage);
              final JLabel bInstrucTextLabel = new JLabel("Please click the button below a bread to choose", JLabel.CENTER);
              bTopPanel.add(whiteBLabel);
              bTopPanel.add(wheatBLabel);
              bTopPanel.add(whiteBreadButton);
              bTopPanel.add(wholeBreadButton);
              bTopPanel.add(italianBLabel);
              bTopPanel.add(harvestBLabel);
              bTopPanel.add(italianBreadButton);
              bTopPanel.add(harvestBreadButton);
              bCenterPanel.add(bInstrucTextLabel);
              bButtonPanel.add(goBackButton1);
              bMainPanel.add(bTopPanel, BorderLayout.NORTH);
              bMainPanel.add(bCenterPanel, BorderLayout.CENTER);
              bMainPanel.add(bButtonPanel, BorderLayout.SOUTH);
              bTopPanel.setPreferredSize(new Dimension(200, 270));
              bTopPanel.setMinimumSize(new Dimension(200,270));
              bTopPanel.setMaximumSize(new Dimension(200,270));
              bCenterPanel.setBorder(BorderFactory.createTitledBorder("Instructions"));
              breadFrame.setContentPane(bMainPanel);
             breadFrame.setDefaultCloseOperation(breadFrame.EXIT_ON_CLOSE);
             breadFrame.pack();
             breadFrame.setVisible(false);
             breadFrame.setSize(350,390);
             //--------------------------Order Toppings----------------------------------
              //Declaring
              order = true;
              final JPanel tTopPanel = new JPanel(new FlowLayout());
              final JPanel tCenterPanel = new JPanel(new FlowLayout());
              final JPanel tActionPanel = new JPanel(new BorderLayout());
              final JPanel tButtonPanel = new JPanel(new FlowLayout());
              final JPanel tMainPanel = new JPanel(new BorderLayout());
              final JLabel tInstrucTextLabel = new JLabel("<html>Please select a topping from the drop down list above<br> and then click order</html>");
              //Creates list of toppings - file paths must match name
              String[] toppingStrings = { "Olives", "Tomatoes", "Lettuce", "Turkey", "Ham", "Select a Topping"};
              pictureTop = new JLabel();
              //Selects item at index 5
              toppingList = new JComboBox(toppingStrings);
              toppingList.setSelectedIndex(5);
              tActionPanel.add(toppingList , BorderLayout.NORTH);
              tActionPanel.add(pictureTop , BorderLayout.CENTER);
              tActionPanel.add(orderTopButton , BorderLayout.SOUTH);
              tCenterPanel.add(tInstrucTextLabel);
              tButtonPanel.add(goBackButton2);
              tMainPanel.add(tActionPanel , BorderLayout.NORTH);
              tMainPanel.add(tCenterPanel , BorderLayout.CENTER);
              tMainPanel.add(tButtonPanel , BorderLayout.SOUTH);
              //Must go in this method, do not put in main
              toppingList.addActionListener(this);
            pictureTop.setFont(pictureTop.getFont().deriveFont(Font.ITALIC));
            pictureTop.setHorizontalAlignment(JLabel.CENTER);
            updateLabel(toppingStrings[toppingList.getSelectedIndex()]);
            pictureTop.setBorder(BorderFactory.createEmptyBorder(10,0,0,0));
            //Preferred size - widest image and the height of the tallest image
            pictureTop.setPreferredSize(new Dimension(177, 132));
            tCenterPanel.setBorder(BorderFactory.createTitledBorder("Instructions"));
              toppingFrame.setContentPane(tMainPanel);
             toppingFrame.setDefaultCloseOperation(toppingFrame.EXIT_ON_CLOSE);
             toppingFrame.pack();
             toppingFrame.setVisible(false);
             toppingFrame.setSize(350,390);
              //--------------------------Order Condiments----------------------------------
              //Declaring
              order = true;
              final ImageIcon condimentsImage = new ImageIcon("condiments.gif");
              final JPanel cTopPanel = new JPanel(new FlowLayout());
              final JPanel cCenterPanel = new JPanel(new FlowLayout());
              final JPanel cButtonPanel = new JPanel(new BorderLayout());
              final JPanel cMainPanel = new JPanel(new BorderLayout());
              final JLabel cInstrucTextLabel = new JLabel("<html>Please select a button below to order a Condiment</html>", JLabel.CENTER);
              final JLabel condimentsLabel = new JLabel(condimentsImage);
              cTopPanel.add(goBackButton3);
              cTopPanel.add(condimentsLabel);
              cCenterPanel.add(cInstrucTextLabel);
              cButtonPanel.add(mustardButton , BorderLayout.WEST);
              cButtonPanel.add(ketchupButton , BorderLayout.CENTER);
              cButtonPanel.add(relishButton , BorderLayout.EAST);
              cMainPanel.add(cTopPanel , BorderLayout.NORTH);
              cMainPanel.add(cCenterPanel , BorderLayout.CENTER);
              cMainPanel.add(cButtonPanel , BorderLayout.SOUTH);
              cCenterPanel.setBorder(BorderFactory.createTitledBorder("Instructions"));          
              condimentFrame.setContentPane(cMainPanel);
             condimentFrame.setDefaultCloseOperation(condimentFrame.EXIT_ON_CLOSE);
             condimentFrame.pack();
             condimentFrame.setVisible(false);
             condimentFrame.setSize(350,390);                    
              //--------------------------Confirmation Screen----------------------------------
              final JPanel coMainPanel = new JPanel(new BorderLayout());
              confirmTextLabel = new JLabel("<html>Would you like to purchase <u>" + itemName + "</u> <br>for a cost of <u>$" + Currency.format(itemCost) + "</u>?</html>", JLabel.CENTER);
              final JPanel coTopPanel = new JPanel(new FlowLayout());
              final JPanel coButtonPanel = new JPanel(new FlowLayout());
              final JPanel coCenterPanel = new JPanel(new FlowLayout());
              coTopPanel.add(goBackButton);
              coCenterPanel.add(confirmTextLabel);
              coButtonPanel.add(acceptButton);
              coButtonPanel.add(declineButton);
              coMainPanel.add(coTopPanel , BorderLayout.NORTH);
              coMainPanel.add(coCenterPanel , BorderLayout.CENTER);
              coMainPanel.add(coButtonPanel , BorderLayout.SOUTH);          
              coCenterPanel.setBorder(BorderFactory.createTitledBorder("Correct?"));     
              confirmFrame.setContentPane(coMainPanel);
             confirmFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             confirmFrame.pack();
             confirmFrame.setVisible(false);
             confirmFrame.setSize(350,390);
             //------------------------------Cart Screen----------------------------------
              final JPanel caMainPanel = new JPanel(new BorderLayout());
              final JPanel cartRPanel = new JPanel(new BorderLayout());
              final JPanel caButtonPanel = new JPanel(new FlowLayout());
              final JPanel caCenterPanel = new JPanel(new FlowLayout());
              caCenterPanel.add(cartRPanel);
              cartRPanel.add(cartItemLabel , BorderLayout.WEST);
              cartRPanel.add(cartPriceLabel , BorderLayout.EAST);
              caButtonPanel.add(goBackButton4);
              caButtonPanel.add(checkButton1);
              caMainPanel.add(caCenterPanel , BorderLayout.CENTER);
              caMainPanel.add(caButtonPanel , BorderLayout.SOUTH);          
              //cartItemLabel.setAlignmentX(Component.LEFT_ALIGNMENT);
              //cartItemLabel.setHorizontalTextPosition(SwingConstants.LEFT);
              caCenterPanel.setBorder(BorderFactory.createTitledBorder("Your Items"));     
              cartFrame.setContentPane(caMainPanel);
             cartFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
             cartFrame.pack();
             cartFrame.setVisible(false);
             cartFrame.setSize(350,390);     
             //--------------------------End of Constructive Method---------------------------
         //Updates the label when combo box is changed
         protected void updateLabel(String name)
            ImageIcon icon = createImageIcon("images/" + name + ".jpg");
            //Sets the image of the icon
            pictureTop.setIcon(icon);
            if (icon != null)
                pictureTop.setText(null);
            else
                pictureTop.setText("Image not found");
        //Returns an ImageIcon, or null if the path was invalid to the icon
        protected static ImageIcon createImageIcon(String path)
            java.net.URL imgURL = AdrianP1.class.getResource(path);
            if (imgURL != null)
                return new ImageIcon(imgURL);
            else
                 //Prints out if file is not found in system window
                System.out.println("Couldn't find file: " + path);
                return null;
         public void updateConfirm()
              //------------------NOT IN USE-------------------
              if(whiteB==true)
                   itemName = "White Bread";
                   itemCost = bwCost;
              if(wholeB==true)
              if(italB==true)
              if(harvestB==true)
              //------------------NOT IN USE-------------------
         public void receiptPrint ()
              //------------------NOT IN USE-------------------
              final JLabel receiptLabel = new JLabel("<html>Your PST:<br>Your GST:<br>Your Total:</html>");
              final JPanel receiptPanel = new JPanel(new FlowLayout());
              receiptPanel.add(receiptLabel);
              receiptLabel.setFont(new Font("Serif", Font.PLAIN, 15));
              receiptPanel.setBorder(BorderFactory.createTitledBorder("Your Receipt"));
              //------------------NOT IN USE-------------------
    }

    I'm certainly not going to read all of that, perhaps someone else here will.You really think so? I seriously doubt it.
    @OP: Please go through these links:
    [How to ask questions the smart way|http://catb.org/~esr/faqs/smart-questions.html]
    SSCCE
    db

  • Can we print boolean variable in dbms_output_put_line ?

    Hi
    Can any one please tell me Can we print boolean variable in dbms_output_put_line ?
    Is it possible or not ?
    Thanks,
    Sanjeev.

    user13483989 wrote:
    Hi
    Can any one please tell me Can we print boolean variable in dbms_output_put_line ?
    Is it possible or not ?
    Thanks,
    Sanjeev.The answer is in the package definition (or the documentation) if you just look:
    SQL> desc dbms_output
    PROCEDURE DISABLE
    PROCEDURE ENABLE
    Argument Name                  Type                    In/Out Default?
    BUFFER_SIZE                    NUMBER(38)              IN     DEFAULT
    PROCEDURE GET_LINE
    Argument Name                  Type                    In/Out Default?
    LINE                           VARCHAR2                OUT
    STATUS                         NUMBER(38)              OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          TABLE OF VARCHAR2(32767) OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE GET_LINES
    Argument Name                  Type                    In/Out Default?
    LINES                          DBMSOUTPUT_LINESARRAY   OUT
    NUMLINES                       NUMBER(38)              IN/OUT
    PROCEDURE NEW_LINE
    PROCEDURE PUT
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    PROCEDURE PUT_LINE
    Argument Name                  Type                    In/Out Default?
    A                              VARCHAR2                IN
    SQL>PUT_LINE - argument type is VARCHAR2. Simples.

  • How to control print-out in GI Slip based on storage location

    Hi Experts,
    Presently my smartform - GI Slip is giving print out for each line item. But the requirement is: no. of print out will depend on no. of storage location, independent of line item. Since GI Slip is a collective slip hence its showing same details for each line item. The print out are first taken from MB1A and then MB90 is for reprocessing.
    How can I control the no. of printouts based on storage location
    Please help me in this issue...
    Thanks in Advance...
    Pinki.

    You have to modify your driver program,
    Ex: Loop at < internal table>
    AT NEW <storage location>
    <New-page>
    End at.
    End loop.
    The above syntax will help you to close the issue.
    Rgds,
    SR

Maybe you are looking for

  • How to update field LEDAT in VETVG table(, Purchase order creation)

    Hi all, I am calculating delivery creation date in BADI:ME_PROCESS_PO_CUST. In ME23 transaction, i am able to see the date field with the correct date. But the table VETVG(LEDAT-delivery date) is not updating. Anybody knows, is there is any enhanceme

  • My vocal track has sped up for no reason

    I was mixing a song today, went to the beginning of the song to listen to it and when the vocals came in they were about twice as fast as they were recorded and had previously played back. i had probably listened to it 10 times and it was fine, then

  • How can I set up a share virtual printer on my macbook to print to pdf from my iPhone 5 or iPad?

    I've never had the occassion to use a virtual printer setup but I've seen where other people have when they need to print to pdf and have no printer available where they are.  So, my question is really a spin off of that type of situation, except I h

  • SAP Netweaver 7.2 CE Software Units required for install

    Hi, can someone tell me what software units are required for the install of Netweaver CE 7.2 for a Nakisa installation? Options being as follows with the top 2 being the core components- CE Product Description Application Server Java    Composite App

  • Add new info block in Tcode VC/2

    Hello All, Could someone guide me how to add new intoblock in tcode VC/2. Currently SAP provide 22 info blocks. I need to add new infoblock This is what I do. Go to tcode VC/2 enter information and execute . Click on infoblock this will give list of