Binding done at variable declaration

What is difference between
    int x;
    x=5;
and
int x=5;
What are different binding takes place?
How Binding differs in both the cases?
Can anybody please tell me about it.

Hello Tomasz,
welcome in the SAP GUI Scripting forum.
You add at first the SAP GUI Scripting API library as reference to your VBA project from the Tools menu.
Now you can use this code with explicit variable declaration:
Option Explicit
Sub Test()
  On Error Resume Next
  Dim SapGuiAuto As Object
  Dim SAPGUIApp As SAPFEWSELib.GuiApplication
  Dim Connection As SAPFEWSELib.GuiConnection
  Dim Session As SAPFEWSELib.GuiSession
  Set SapGuiAuto = GetObject("SAPGUI")
  If SapGuiAuto Is Nothing Then
    Exit Sub
  End If
  Set SAPGUIApp = SapGuiAuto.GetScriptingEngine
  If SAPGUIApp Is Nothing Then
    Exit Sub
  End If
  Set Connection = SAPGUIApp.Children(0)
  If Connection Is Nothing Then
    Exit Sub
  End If
  Set Session = Connection.Children(0)
  If Session Is Nothing Then
    Exit Sub
  End If
  'Your Code here
End Sub
Good luck.
Cheers
Stefan

Similar Messages

  • HOw to find number of bind variables declared in current session

    Hi All,
    I want know a query to find out the number variables declared in current session.

    Note the name of this forum is "SQL Developer *(Not for general SQL/PLSQL questions)*", so only for issues with the SQL Developer tool. Please post these questions under the dedicated [SQL And PL/SQL|https://forums.oracle.com/forums/forum.jspa?forumID=75] forum (you've posted there before).
    Regards,
    K.

  • Using a static variable declared in an applet in another class

    Hi guys,
    I created an applet and i want to use one of the static variables declared in teh applet class in another class i have. however i get an error when i try to do that...
    in my Return2 class i try to call the variable infoPanel (declared as a static JPanel in myApplet...myApplet is set up like so:
    public class myApplet extends JApplet implements ActionListener, ListSelectionListener
    here are some of the lines causing a problem in the Return2 class:
    myApplet.infoPanel.removeAll();
    myApplet.infoPanel.add(functionForm2.smgframeold);
    myApplet.infoPanel.validate();
    myApplet.infoPanel.repaint();
    here are some of the errors i get
    dummy/Return2.java [211:1] package myApplet does not exist
    myApplet.infoPanel.removeAll();
    ^
    dummy/Return2.java [212:1] package myApplet does not exist
    myApplet.infoPanel.add(functionForm2.smgframeold);
    ^
    dummy/Return2.java [213:1] package myApplet does not exist
    myApplet.infoPanel.validate();
    ^
    dummy/Return2.java [214:1] package myApplet does not exist
    myApplet.infoPanel.repaint();
    ^
    please help! thanks :)

    I don't declare any packages though....i think it just doesn't recognize myApplet for some reason..
    other errors i got compiling are:
    dummy/Return2.java [82:1] cannot resolve symbol
    symbol : variable myApplet
    location: class Return2
    updateDesc.setString(3, myApplet.staticName);
    I Don't get why i'm getting this error cuase they worked fine when myApplet was a standalone application, not an applet.
    myApplet is in the same folder as Return2 and it compiles properly.

  • Why can't I move a variable declaration from inside a Sub to the Declarations area?

    I'm writing an app and so far, so good. But I need wider access to an array defined in my "Form_Load" sub.
    Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    ' Assign checkboxes to an array.
    Dim Checkboxes() As CheckBox = {chkThumb01, chkThumb02, chkThumb03, chkThumb04, _
    chkThumb05, chkThumb06, chkThumb07, chkThumb08, chkThumb09, chkThumb10}
    Moving the declaration ("Dim Checkboxes()...") from "Sub frmMain_Load" up into the Declarations space just above it breaks my program. :(
    I tried putting it in a Module and that fails too. The ONLY place it work's is in Form_Load (it's not related to being an array because at least one standard integer variable declaration has this problem too.)
    I have other variables in the Declarations area that work fine (eg: "Dim bolChanges as Boolean"), but for some reason, I can't move others out into what
    should be a more global namespace.
    Anyone know what's going on? Thx.

    No, because this makes no difference.
    Background #1: If you do not write your own constructor (=Sub New), the VB compiler adds a default constructor. It contains a call to Sub InitializeComponent. In this Sub, the controls are created and assigned to chkThumb01 etc. You see it if you type "Sub
    New[Enter]":
    Sub New()
    InitializeComponent()
    End Sub
    Background #2: If you write
    Public Class Test
    Private values As Integer() = {1, 2, 3}
    End Class
    it is identical to
    Public Class Test
    Private values As Integer()
    Sub New()
    values = New Integer() {1, 2, 3}
    End Sub
    End Class
    As you can see, the assignments that you do to fields of the class in the declaration line are actually executed in the constructor (sub new).
    Now put both backgrounds together. Consequently, this code
    Public Class Form1
    Private buttons As Button() = {Button1, Button2, Button3}
    End Class
    is identical to this one:
    Public Class Form1
    Private buttons As Button()
    Sub New()
    buttons = New Button() {Button1, Button2, Button3}
    InitializeComponent()
    End Sub
    End Class
    Obviously, the assignment to variable "buttons" is done before the call to Sub InitializeComponent. At this point, variables Button1, Button2 and  Button3 are still empty (Nothing) because they will be set in Sub InitializeComponent. Consequently,
    the array buttons contains just {Nothing, Nothing, Nothing}
    In opposite, if the array buttons is set in the Load event, Button1, Button2 and Button3 have already been set before, Consequently, the array buttons correctly contains references to the three buttons.
    Armin

  • Binding a JavaFX variable to a Java class instance variable

    Hi,
    I am pretty new to JavaFX but have been developing in Java for many years. I am trying to develop a JavaFX webservice client. What I am doing is creating a basic scene that displays the data values that I am polling with a Java class that extends Thread. The Java class is reading temperature and voltage from a remote server and storing the response in an instance variable. I would like to bind a JavaFx variable to the Java class instance variable so that I can display the values whenever they change.
    var conn: WebserviceConnection; // Java class that extends Thread
    var response: WebserviceResponse;
    try {
    conn = new WebserviceConnection("some_url");
    conn.start();
    Thread.sleep(10000);
    } catch (e:Exception) {
    e.printStackTrace();
    def bindTemp = bind conn.getResponse().getTemperature();
    def bindVolt = bind conn.getResponse().getVoltage();
    The WebserviceConnection class is opening a socket connection and reading some data in a separate thread. A regular socket connection is used because the server is not using HTTP.
    When I run the application, the bindTemp and bindVolt are not updated whenever new data values are received.
    Am I missing something with how bind works? Can I do what I want to do with 'bind'. I basically want to run a separate thread to retrieve data and want my UI to be updated when the data changes.
    Is there a better way to do this than the way I am trying to do it?
    Thanks for any help in advance.
    -Richard

    Hi,
    If you don't want to constantly poll for value change, you can use the observer design pattern, but you need to modify the classes that serve the values to javafx.
    Heres a simple example:
    The Thread which updates a value in every second:
    // TimeServer.java
    public class TimeServer extends Thread {
        private boolean interrupted = false;
        public ValueObject valueObject = new ValueObject();
        @Override
        public void run() {
            while (!interrupted) {
                try {
                    valueObject.setValue(Long.toString(System.currentTimeMillis()));
                    sleep(1000);
                } catch (InterruptedException ex) {
                    interrupted = true;
    }The ValueObject class which contains the values we want to bind in javafx:
    // ValueObject.java
    import java.util.Observable;
    public class ValueObject extends Observable {
        private String value;
        public String getValue() {
            return this.value;
        public void setValue(String value) {
            this.value = value;
            fireNotify();
        private void fireNotify() {
            setChanged();
            notifyObservers();
    }We also need an adapter class in JFX so we can use bind:
    // ValueObjectAdapter.fx
    import java.util.Observer;
    import java.util.Observable;
    public class ValueObjectAdapter extends Observer {
        public-read var value : String;
        public var valueObject : ValueObject
            on replace { valueObject.addObserver(this)}
        override function update(observable: Observable, arg: Object) {
             // We need to run every code in the JFX EDT
             // do not change if the update method can be called outside the Event Dispatch Thread!
             FX.deferAction(
                 function(): Void {
                    value = valueObject.getValue();
    }And finally the main JFX code which displays the canging value:
    // Main.fx
    import javafx.stage.Stage;
    import javafx.scene.Scene;
    import javafx.scene.text.Text;
    import javafx.scene.text.Font;
    import threadbindfx.TimeServer;
    var timeServer : TimeServer;
    var valueObjectAdapter : ValueObjectAdapter = new ValueObjectAdapter();
    timeServer = new TimeServer();
    valueObjectAdapter.valueObject = timeServer.valueObject;
    timeServer.start();
    Stage {
        title: "Time Application"
        width: 250
        height: 80
        scene: Scene {
            content: Text {
                font : Font {
                    size : 24
                x : 10, y : 30
                content: bind valueObjectAdapter.value;
    }This approach uses less cpu time than constant polling, and changes aren't dependent on the polling interval.
    However this cannot be applied to code which you cannot change obviously.
    I hope this helps.

  • Tab character in variable declaration

    Hello,
    I have a little problem with declaration of variables in scripts. I get an error when there is a TAB character between the variable name and its data type:
    VARIABLE var_name     number;
    Bind Variable "var_name     number" is NOT DECLARED
    This error occur only when I try it in SQL Developer - other tools accept it. Any suggestions how to get rid of this error?

    Couldn't find any prior bug for this, so I logged it:
    Bug 12409565 - TAB CHARACTER NOT RECOGNIZED AS WHITESPACE IN SQL*PLUS BIND VARIABLE DECLARATION
    It seems limited to SQL*Plus syntax, perhaps just the VARIABLE command, and does not replicate in PL/SQL blocks.
    Adding a blank after the tab works around the error, but won't be enough if the tab remains as part of the variable name.
    -Gary Graham, SQL Developer Team

  • Class variable declaration

    Hello.
    Just looking through some code and I see a class variable declared as so...
    static final MessageDigest digestFunction;
    static { // The digest method is reused between instances to provide higher entropy.
            MessageDigest tmp;
            try {
                tmp = java.security.MessageDigest.getInstance(hashName);
            } catch (NoSuchAlgorithmException e) {
                tmp = null;
            digestFunction = tmp;
        }I have never come accoss a variable being declared in this way and it looks strange. The use of static before the opening brace is strange to me, and just the fact that this is not inside the constructor. Would this code be run after or before code inside the class constuctor?
    Thanks for any help, just a little confused!

    Sir_Dori wrote:
    Ah yes, of course it could not be within the constructor as it is static, sorry.
    So when would the class be loaded? Could this be the first time the ClassName.staticBlockVar is accessed, Most likely, yes. The first time something else uses the class. Classloading in Java is lazy.
    Also, is the code not reevaluated every time it is referenced ?No. Only when the class is loaded (actually, when it's initialized, but usually it boils down to the same thing)
    You can write some simple tests for this, by writing a constructor and a static initializer, then instantiating it twice, for example. Don't be afraid to just play around with code to test assumptions. I find JUnit very handy for experimenting with assumptions.

  • Use buffering and psp with datasocket-VIs and without any binding and shared variable node

    Hello,
    I'm using LV 8.5.
    I'm trying to develop a multiplatform (windows and mac os x) and multi-computer application. II want to get executables running on each device, communicating through the network. Communication process includes datas (such as images) and events messages (something like "Hello, I got an error" or "youyou, my work is done" or "I'm hereeeee!!!!...."). I do need a communication without any loss of data.
    I worked a lot and wanted to test a psp-based design, without any binding nor shared variable node (mac os...) using data socket VIs and SVE buffering.
    I managed to :
    - deploy shared variable library dynamically (even in an executable)
    - communicate between two PCs with datasocket VIs
    However, I never managed to enjoy buffering (even locally with one VI doing the deployment and writing datas and another one for reading).
    I worked hard (dynamic buffering setting, dynamic buffering watching like in  http://zone.ni.com/reference/en-XX/help/371361D-01/lvconcepts/buffering_data/ and in the example "DS send image" and "DS receive image" in the labview examples, trying to use "?sync=true" in the URL, etc...) but no way to get things work.
    I attached a jpeg of an example of receiver and sender. I use wait commands in both receiver and sender to test buffering
    Receiver do receive datas (the last written) but buffering doesn't work.
    Did somebody did that before ? (better than me...)
    Thanks
    Bo
    Attachments:
    Sender.JPG ‏87 KB
    Receiver.JPG ‏96 KB

    Hello,
    Indeed my problem has been solved. My error : in the While loop of the receiver VI, I always reactualize the PacketsMaxBuffer and OctetsMawBuffer parameters, what resets the buffer and make it appears ineffective.
    I now set  the PacketsMaxBuffer and OctetsMawBuffer values only once at the begining of the VI and the psp buffering works perfectly.
    Sorry for the desagreement...
    Bo

  • Get all the variables declaration in a program

    Is there a possible way to get all the variables declarations ( name and type ) inside a java program and not only the fields that you can easily get with reflection mechanism but also local variables inside a method?

    Kayaman wrote:
    Jigsaw23 wrote:
    local variables inside a method?Nope, you'd have to get inside the call stack for that and there's no easy mechanism for that.Even that wouldn't do it, since not all code is on the call stack at all times. There are ways to do it, using bytecode engineering, but I'm not going to get into that because if you don't already know how to do it, I doubt you have a problem that genuinely requires it.
    It's a bogus requirement anyway. Whatever you're trying to do, OP, it's doomed to failure. What are you trying to do? I mean, what were you doing that led to you thinking "If I knew what those local variable were, I'd manage it!"?

  • Netbean variable declaration help

    I've been trying to crank out yet another mortgage program. The problem I have is with the declaration of the following
    double loan = Double.parseDouble(loanField.getText());
    double rate = Double.parseDouble(rateField.getText());
    double years_due = Double.parseDouble(years_dueField.getText());
    I'm not quite certain if it's the declaration itself, or if I didn't set up the GUI properly. I've been tinkering with this for 3 days so I figured I'd ask for help. I can't seem to find a post that suitably answers my question. Any help would be appreciated. Here is the code. I'm using Netbean IDE 6.0.1 if that is of any use to you.
    * week2_herbieGUI.java
    * Created on August 1, 2008, 6:45 PM
    * @author  archon
    public class week2_herbieGUI extends javax.swing.JFrame {
        /** Creates new form week2_herbieGUI */
        public week2_herbieGUI() {
            initComponents();
        /** This method is called from within the constructor to
         * initialize the form.
         * WARNING: Do NOT modify this code. The content of this method is
         * always regenerated by the Form Editor.
        // <editor-fold defaultstate="collapsed" desc="Generated Code">
        private void initComponents() {
            loanfield = new javax.swing.JTextField();
            ratefield = new javax.swing.JTextField();
            years_duefield = new javax.swing.JTextField();
            jLabel1 = new javax.swing.JLabel();
            jLabel2 = new javax.swing.JLabel();
            jLabel3 = new javax.swing.JLabel();
            jButton1 = new javax.swing.JButton();
            PaymentLabel = new javax.swing.JLabel();
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("PaymentCalculatorGUI");
            loanfield.setName("loanField"); // NOI18N
            ratefield.setText("jTextField2");
            ratefield.setName("rateField"); // NOI18N
            years_duefield.setName("years_dueField"); // NOI18N
            jLabel1.setText("Principle Loan");
            jLabel1.setName("Principle Loan"); // NOI18N
            jLabel2.setText("Interest Rate");
            jLabel2.setName("Interest Rate"); // NOI18N
            jLabel3.setText("Years of Mortgage");
            jLabel3.setName("Years of Mortgage"); // NOI18N
            jButton1.setText("Calculate");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
            PaymentLabel.setText("Monthly Payment");
            javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
            getContentPane().setLayout(layout);
            layout.setHorizontalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(22, 22, 22)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                        .addGroup(layout.createSequentialGroup()
                            .addComponent(jButton1)
                            .addGap(31, 31, 31)
                            .addComponent(PaymentLabel))
                        .addGroup(layout.createSequentialGroup()
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                                .addComponent(jLabel1)
                                .addComponent(jLabel2)
                                .addComponent(jLabel3))
                            .addGap(25, 25, 25)
                            .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                                .addComponent(ratefield, javax.swing.GroupLayout.DEFAULT_SIZE, 118, Short.MAX_VALUE)
                                .addComponent(loanfield)
                                .addComponent(years_duefield, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))))
                    .addContainerGap(180, Short.MAX_VALUE))
            layout.setVerticalGroup(
                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(layout.createSequentialGroup()
                    .addGap(18, 18, 18)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel1)
                        .addComponent(loanfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel2)
                        .addComponent(ratefield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jLabel3)
                        .addComponent(years_duefield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(26, 26, 26)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jButton1)
                        .addComponent(PaymentLabel))
                    .addContainerGap(25, Short.MAX_VALUE))
            pack();
        }// </editor-fold>
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
          //gather necessary variables from user
            double loan = Double.parseDouble(loanField.getText());
            double rate = Double.parseDouble(rateField.getText());
            double years_due = Double.parseDouble(years_dueField.getText());
          //Variables derived from user input
            double rate_total = rate/100; //Converts interest rate to decimal form
            double rate_monthly = rate_total/12; //converts to monthly interest rate
            double payment_year = years_due * 12; //Number of payments during course of mortgage.
            double payment = (loan * rate_monthly) / (1 - Math.pow(1 + rate_monthly, - payment_year)); //Calculates monthly payment
            PaymentLabel.setText("Your monthly payment is $" +payment);
         * @param args the command line arguments
        public static void main(String args[]) {
            java.awt.EventQueue.invokeLater(new Runnable() {
                public void run() {
                    new week2_herbieGUI().setVisible(true);
        // Variables declaration - do not modify
        private javax.swing.JLabel PaymentLabel;
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextField loanfield;
        private javax.swing.JTextField ratefield;
        private javax.swing.JTextField years_duefield;
        // End of variables declaration
    }

    ThousandSon wrote:
    Here is what the computer says:
    Cannot find symbol
    symbol: variable loanField
    location: class week2_herbieGUI
    Cannot find Symbol
    Symbol: method getText()
    location: class loanField
    And it says the same thing for rateField and years_dueFieldThank you for finally posting the error message--it didn't hurt a bit did it. Had you posted it in the first place you would have had your answer 6 posts ago and probably a lot more planely.
    Please take special note of how this autocode has been generated and especially close attention to naming conventions:
        // Variables declaration - do not modify
        private javax.swing.JLabel PaymentLabel;
        private javax.swing.JButton jButton1;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JTextField loanfield;
        private javax.swing.JTextField ratefield;
        private javax.swing.JTextField years_duefield;
        // End of variables declarationThere in lay your problems, please look this block of code over very carefully and compare it to the errors you are getting and the code you have cut based on this autocode.
    Look very very closely. The same error exists in every one of your problems. If that doesn't do it for you, then you can look in the initComponents method and how each of these variables are referenced there. Do you see the difference? (Hint: it is the error.)
    BTW: does it show that I really despise when someone chooses to use autogenerated code and then asks how to correct errors from using it--and especially when they don't want to give the exact errors so we don't have to fish through all of the autocode to find out what is happening?

  • Variable declaration in BEx - Business scenario's

    Hi,
        I need some documents about all kind of variable declaration with some example business scenarios in MM, FI-CO modules.
    will assign you a reasonable points
    Regards,
    Pooja.S

    Hi Pooja,
    The processing type of a variable may be varies from business requirement.
    In general we will use the processing type:
    Replacement Path : If you specify a variable as a characteristic value, you do not have to specify a text for the characteristic value right away. Instead, you can fill the text field dynamically and specifically for the characteristic that you use for the variable when you execute the query. To do this, define a text variable with automatic replacement.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/bd/589b3c494d8e15e10000000a114084/content.htm]
    Authorisations: If the user belongs to Asia PAciffic region and he must see only details of his region then we can create a variable Region vt Processing type Authorisations so that he vl able to see only that region's data.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/44/599b3c494d8e15e10000000a114084/content.htm]
    SAP EXIT: If you want to define a query that only ever displays the data from the current month, drag the delivered variable “current month” (technical name 0CMONTH) for the characteristic “calendar year/month” (technical name 0CMONTH) into the query filter.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a5702e09411d2acb90000e829fbfe/content.htm]
    Customer Exit: You want to use one characteristic value to calculate a second characteristic value. The InfoProvider only contains the calendar day. However, you now also want to display the cumulated value for the relevant period (beginning with the first day of a quarter) in a query.
    For the first day of the quarter, use a variable with customer exit processing. If you now enter the current calendar day (for example, 06/19/2000), a start date of 06/01/2000 appears in the customer exit, and the cumulated value of this period can be displayed.
    [http://help.sap.com/saphelp_nw70/helpdata/EN/f1/0a56f5e09411d2acb90000e829fbfe/content.htm]
    I hope this helps you.

  • Why can't i edit the variable declaration in Netbeans GUI Applications?

    When i drag and drop jbutton,jlabel and other tools from toolbox on the jform the code is
    automatically generated by the Netbeans.
    At bottom the variable declaration for the jbutton and for the other tools is automatically
    generated.
    The part of that declaration is shaded as grey.
    Is it possible to edit those variables from Netbeans?

    Yup, as Chuck states, it is possible to edit that region of code, since the file is nothing more than a text file, but doing so "breaks" the code so that you cannot modify the GUI content in NetBeans WYSIWYG form editor. Please note, that there are ways of changing the characteristics of those variables without editing them directly. You should look into how to change properties of your GUI with NetBeans. The online tutorials can show you how.

  • Source a file containing variable declaration in csh style into Java

    Hi ALL,
    How can java import a plain-text file which contains csh declaration statements, then simultaneously declare as the statements into the java program?
    Below is the example that the plain-text file:
    set test_1 = ('1')
    set test_234 = ('2' '3' '4')
    set test_abc = ('abc')
    Thanks,
    Alex

    I have already started learning Java from the web site of Sun Java. Thanks for your advise.
    However, let me explain more details what I want.
    Now, I have a plain-text file, such as /mnt/source.txt, which contain statement of variable declaration as below
    ====================
    set test_1 = ('1')
    set test_234 = ('2' '3' '4')
    set test_abc = ('abc')
    ====================
    These are the csh statement.
    In csh, we can use command "source [filename]" then the variable test_1, test_234 and test_abc will be declared directly. Right?
    Then, now, I have this plain-text file. Also the csh statement.
    However, I would use Java to declare the variable test_1, test_234 and test_abc from this file.
    Thanks.
    Alex

  • Invalid variable declaration:  object 'TIMESTAMP' must be a type or subtype

    Message 1: ORA-06550: line 91, column 14:
    PL/SQL: ORA-06552: PL/SQL: Compilation unit analysis terminated
    ORA-06553: PLS-488: invalid variable declaration: object 'TIMESTAMP' must be a type or subtype
    ORA-06550: line 89, column 1:
    PL/SQL: SQL Statement ignored
    I'm getting above error message when i'm trying to define one cursor from a table which has a column with data timestamp(3) in a cursor i'm not even using a column with data type timestamp .( this tables i created by importing sybase tables into oracle )
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v__Data
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    for testing purpose i even removed the cursor and make it shor to above query then also it dosent work and gave the above error . if you know the solution then please let me know . i think i've to do/change database settings but i'm not sure .

    the above code is not working but the following code is working if i open cursor from assiging select to variable , why this is happening .
    DECLARE
         v_A_REPORT_DT VARCHAR2(100);
    ls_sel VARCHAR2(900);
    i INTEGER := 1;
    TYPE dynamic_cur IS REF CURSOR;
    tb_test_cur dynamic_cur ;
    TYPE array_date_type IS TABLE OF DATE INDEX BY PLS_INTEGER;
    v1 array_date_type ;
    BEGIN
         v_A_REPORT_DT := '01-01-2007'/* VARCHAR2(2000) */;
    -- this one is not working
    SELECT to_char(sysdate) -- trunc(act.date_posted)
    INTO v_A_REPORT_DT
    from cedb.cr_ar_debit_activity act
    where rownum < 2 ;
    ls_sel := 'SELECT trunc(act.date_posted)
    from cedb.cr_ar_debit_activity act
    where rownum < 3 ' ;
    OPEN tb_test_cur FOR ls_sel;
    LOOP
    FETCH tb_test_cur INTO v1(i) ;
    EXIT WHEN tb_test_cur%notfound;
    dbms_output.put_line(to_char(v1(i)));
    i := i + 1 ;
    END LOOP;
    CLOSE tb_test_cur;
    END;

  • URGENT: problem with variable-declaration while precompiling

              Hi,
              i got a problem while precompiling my webapplication.
              i got some jsp-pages, each containing following code
              <%@ include file="/header.jsp" %>
              <% button = true; %>
              [...some code...]
              <%@ include file="/footer.jsp" %>
              The variable 'button' is defined in header.jsp and
              evaluated in footer.jsp. When i run through my application without precompiling
              it, there appear NO errors, but when i try to precompile my pages, the jsp-compiler
              reports an error in footer.jsp, because in footer.jsp is the 'button'-Variable
              used, but not defined and not included (because all other pages include footer.jsp)
              How can I tell the jsp-Compiler not to check for variable declarations, or what
              else can i do to work around this problem ?
              thanks,
              Dirk Bade
              

    Thanks for the sample. Changed it to look this way. Still getting the error message from above. Any clue?
    [ BTW: you can see the auto-fixits that Netbeans used to resolve the exception thrown errors from earlier.  Ugly ... I used Netbeans for the ease of interface generation, but I am spending a lot time chasing down little stuff like this. ]
    public class DesktopApplication1View extends FrameView {
        public DesktopApplication1View(SingleFrameApplication app) throws PortInUseException, UnsupportedCommOperationException, IOException, NoSuchPortException {
            super(app);
          initComponents();  //interface code follows this until the variables below ...
            String      defaultPort = "/dev/ttyS0";
            String      portName;
            ByteBuffer  asciiBytes = null;
            CommPort    commPort = null;
            byte[] h = new byte[asciiBytes.capacity()];
            asciiBytes.get(h, 0, h.length);
            CommPortIdentifier portIdentifier = CommPortIdentifier.getPortIdentifier(defaultPort);
                System.out.println("Default port" + defaultPort + "found.");
            if ( portIdentifier.isCurrentlyOwned() )
                System.out.println("Error: Port is currently in use");
            try {
                 commPort = portIdentifier.open(this.getClass().getName(), 200);
            } catch (NoSuchPortException e) {
            System.out.println("Whoops! Cannot identify the port.");
            }

Maybe you are looking for