Wat is wrong with this simple query ???

I am using 10gxe.
Below is the query which is not working
Whenever i am executing it a pop up windows is coming up
and asking me to enter bind variables ..wat shall i do ???
Here is a prntscrn of the issue .
http://potupaul.webs.com/at.html
VARIABLE g_message VARCHAR2(30)
BEGIN
:g_message := 'My PL/SQL Block Works';
END;
PRINT g_message
Edited by: user4501184 on May 18, 2010 12:42 AM

sqlplus "system/sm@test"
SQL*Plus: Release 10.2.0.2.0 - Production on Tue May 18 12:45:05 2010
Copyright (c) 1982, 2005, Oracle. All Rights Reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> VARIABLE g_message VARCHAR2(30)
SQL> BEGIN
2 :g_message := 'My PL/SQL Block Works';
3 END;
4 /
PL/SQL procedure successfully completed.
SQL> PRINT g_message;
G_MESSAGE
My PL/SQL Block Works
SQL>

Similar Messages

  • What is wrong with this simple query

    Hi,
    I am writting a simple code just to get the maximum no values from a database table
    The query is
    ResultSet = stm.executeQuery("SELECT MAX(column_name) FROM Database_table ");
    it seems to be a simple one but i am getting the message
    column not found
    Please answer soon

    Well, it depends on how your resultset is retrieving the results. If you retrieve by column name, then that's your problem. You need to do something like this:
    ResultSet = stm.executeQuery("SELECT MAX(column_name) AS myColumnName FROM Database_table ");
    String myResult = ResultSet.getString(myColumnName);Using MAX, COUNT, etc, will return your result with a mangled or no actual column name to retrieve from. Optionally, you can solve your problem by:
    ResultSet.getString(1);Michael Bishop

  • What's wrong with this simple code?

    What's wrong with this simple code? Complier points out that
    1. a '{' is expected at line6;
    2. Statement expected at the line which PI is declared;
    3. Type expected at "System.out.println("Demostrating PI");"
    However, I can't figure out them. Please help. Thanks.
    Here is the code:
    import java.util.*;
    public class DebugTwo3
    // This class demonstrates some math methods
    public static void main(String args[])
              public static final double PI = 3.14159;
              double radius = 2.00;
              double area;
              double roundArea;
              System.out.println("Demonstrating PI");
              area = PI * radius * radius;
              System.out.println("area is " + area);
              roundArea = Math.round(area);
              System.out.println("Rounded area is " + roundArea);

    Change your code to this:
    import java.util.*;
    public class DebugTwo3
         public static final double PI = 3.14159;
         public static void main(String args[])
              double radius = 2.00;
              double area;
              double roundArea;
              System.out.println("Demonstrating PI");
              area = PI * radius * radius;
              System.out.println("area is " + area);
              roundArea = Math.round(area);
              System.out.println("Rounded area is " + roundArea);
    Klint

  • What's wrong with this ejb-query?

    Hi people,
    may be i worked too much, may be i've just missed something, but guys, can enyone tell me what the hell is wrong with this GOD DAMNED query?
    <ejb-ql>Select Object(adt) From AddrDataTable AS adt, IN (adt.addresseeQualities) AS aq WHERE adt.season.id = ?1 And aq.aQTemplate.id=?2</ejb-ql>
    That JBoss throws following exception:
    org.jboss.deployment.DeploymentException: Error compiling EJB-QL statement 'Select Object(adt) From AddrDataTable AS adt, IN (adt.addresseeQualities) AS aq WHERE adt.season.id = ?1 And aq.aQTemplate.id=?2'; - nested throwable: (org.jboss.ejb.plugins.cmp.ejbql.ParseException: Encountered "1" at line 1, column 103.
    Was expecting one of:
    "ABS" ...
    "LENGTH" ...
    "LOCATE" ...
    "SQRT" ...
    "+" ...
    <INTEGER_LITERAL> ...
    <FLOATING_POINT_LITERAL> ...
    <NUMERIC_VALUED_PARAMETER> ...
    <NUMERIC_VALUED_PATH> ...
    at org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.<init>(JDBCEJBQLQuery.java:50)
    The worst thing is that when i remove WHERE clause JBoss keeps silence like a fish - it works fine!
    So, any ideas about this?
    Thank you

    Are you sure the ?1 and ?2 parameters exist in the method for which the query is addressed.
    In the statement adt.season.id I guess season is a CMR field and then season has a CMP field called id
    and the same for aq.aQTemplate.id, aQTemplate being the CMR field and the is being a CMP field in the CMR.
    and in adt.addresseeQualities is a CMR field?
    Looks like a complex query
    SELECT OBJECT(adt) from BEAN AS adt,
    IN(adt.CMR_FIELD) AS aq
    WHERE
    adt.ANOTHER_CMR.ANOTHER_AMR_CMP_FIELD=?1
    AND
    aq.2_CMR_FIELD.2_CMP_FIELD =?2

  • Can someone tell me what's wrong with this LOV query please?

    This query works fine..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = 'ADAM'
    But this one..
    select FILTER_NAME display_value, FILTER_ID return_value
    from OTMGUI_FILTER where username = apex_application.g_user
    Gives the following error.
    1 error has occurred
    * LOV query is invalid, a display and a return value are needed, the column names need to be different. If your query contains an in-line query, the first FROM clause in the SQL statement must not belong to the in-line query.
    Thanks very much,
    -Adam vonNieda

    Ya know, I still don't know what's wrong with this.
    declare
    l_val varchar2(100) := nvl(apex_application.g_user,'ADAM');
    begin
    return 'select filter_name display_value, filter_id return_value
    from otmgui_filter where username = '''|| l_val || '''';
    end;
    Gets the same error as above. All I'm trying to do is create a dropdown LOV which selects based on the apex_application.g_user.
    What am I missing here?
    Thanks,
    -Adam

  • What's wrong with this simple method

    i'm having compile troubles with this simple method, and i think it's got to be something in my syntax.
    public String setTime()
    String timeString = new String("The time is " + getHours() + ":" + getMinutes() + ":" + getSeconds() + " " + getIsAM());
    return timeString;
    this simple method calls the get methods for hours, minutes, seconds, and isAM. the compiler tells me i need another ) right before getSeconds(), but i don't believe it. i know this is a simple one, but i could use the advice.
    thanks.

    Hi,
    I was able to compile this method , it gave no error

  • What's wrong with this sql query?  Help

    hi
    i am having difficulty executing this query
    ResultSet s=st.executeQuery("select * from employee where iden = ?"+id);
    here in my program st is statement obg
    iden is attribute name in table
    id i am getting at run time from user
    please help...it says wrong number of parameters
    thank you

    That's correct, get rid of the Question mark. Questions marks are used in PreparedStatements, but they are also used in pattern matching. I am assuming the iden is the table identity. Therefore, I am assuming it is numeric. If so, you can't use the question mark because pattern matching is only done with strings. If you are treating your statement as a PreparedStatement, then you have done it wrong. (See the API) Here is a code snippet from the API:PreparedStatement pstmt =     
       con.prepareStatement("UPDATE EMPLOYEES SET SALARY = ? WHERE ID = ?");
    pstmt.setBigDecimal(1, 153833.00)
    pstmt.setInt(2, 110592)It seems you are using a Statement object, so, you need to get rid of that question mark.
    tajenkins

  • What is wrong with this simple PL/SQL..

    Hello,
    I made a PL/SQL to recreate user (if user exits already, then drop/recreate)
    I run this script and it won't drop the existed user as expected, what is wrong..?
    run like:
    $ sqlplus system/password@dbname @create_user.sql 'A1' --A1 is a user who already existed.
    conn /as sysdba
    SET FEEDBACK OFF SERVEROUTPUT ON VERIFY OFF TERMOUT OFF
    DECLARE
    v_count INTEGER := 0;
    v_statement VARCHAR2 (200);
    BEGIN
    SELECT COUNT (1)
    INTO v_count
    FROM dba_users
    WHERE username = UPPER ('&1');
    IF v_count != 0
    THEN
    EXECUTE IMMEDIATE ('DROP USER &1 CASCADE');
    END IF;
    v_statement :=
    'CREATE USER &1 IDENTIFIED BY &1'
    || ' DEFAULT TABLESPACE USER_DATA'
    || ' TEMPORARY TABLESPACE TEMPORARY_DATA'
    || ' PROFILE DEFAULT ACCOUNT UNLOCK';
    EXECUTE IMMEDIATE (v_statement);
    -- Grant permissions
    EXECUTE IMMEDIATE ('GRANT READ_USER TO &1 WITH ADMIN OPTION');
    EXECUTE IMMEDIATE ('ALTER USER &1 DEFAULT ROLE ALL');
    EXECUTE IMMEDIATE ('GRANT CREATE PUBLIC SYNONYM TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE DATABASE LINK TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE SNAPSHOT TO &1');
    EXECUTE IMMEDIATE ('GRANT CREATE TABLE TO &1');
    EXECUTE IMMEDIATE ('GRANT DROP PUBLIC SYNONYM TO &1');
    EXECUTE IMMEDIATE ('GRANT QUERY REWRITE TO &1');
    EXECUTE IMMEDIATE ('GRANT RESTRICTED SESSION TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ANY DICTIONARY TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ANY TABLE TO &1');
    EXECUTE IMMEDIATE ('GRANT UNLIMITED TABLESPACE TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.CHANGE_TABLES TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.DBA_SUBSCRIBED_TABLES TO &1');
    EXECUTE IMMEDIATE ('GRANT SELECT ON SYS.DBA_SUBSCRIPTIONS TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_PUBLISH TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_SUBSCRIBE TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_CDC_UTILITY TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_LOCK TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_SYSTEM TO &1');
    EXECUTE IMMEDIATE ('GRANT EXECUTE ON SYS.DBMS_UTILITY TO &1');
    EXECUTE IMMEDIATE ('GRANT READ, WRITE ON DIRECTORY SYS.PUBLIC_ACCESS TO &1 WITH GRANT OPTION');
    DBMS_OUTPUT.put_line (' ');
    DBMS_OUTPUT.put_line ('User &1 created successfully');
    DBMS_OUTPUT.put_line (' ');
    EXCEPTION
    WHEN OTHERS
    THEN
    DBMS_OUTPUT.put_line (SQLERRM);
    DBMS_OUTPUT.put_line (' ');
    END;
    Exit;
    EOF
    Thank you
    Jerry

    Hi,
    I try to run this command in a shel scriptl, following this pl/sql excuting is a exp core shcema/imp to this user by using pipe.
    (--this part is working well)
    so I try to debug the pl/sql part first that is why I didn't use & or &&, which need to interactive with computer on scene, but this shell script will run automatically by scheduler.
    this is the whole shell,
    #!/bin/ksh
    INPUT_DATABASE_SCHEMA=$1
    OUTPUT_DATABASE_SCHEMA=$2
    TARGET_DATABASE=$3
    #drop/recreate user $2
    sqlplus system/$3@$3 @create_user.sql '$2' ---this is also the question? how make it as real variable $2, not literal
    #exp
    mknod ./$1_exp p
    gzip < $1_exp > ./$1_exp.dmp.gz &
    exp \
    rows=y \
    userid=system/$3@$3 \
    owner=$1 \
    log=$1_exp.log \
    file=$1_exp \
    direct=y \
    recordlength=65535 \
    statistics=none \
    consistent=y \
    compress=n \
    grep 'ORA-' $1_exp.log
    if [ $? = 0 ]
    then
    mail -s "Problem in regression snapshort export" email < $1_exp.log
    fi
    #imp
    mknod ./$1_exp p
    gunzip < $1_exp.dmp.gz > $1_exp &
    imp \
    userid=system/$3@$3 \
    file=$1_exp \
    log=$2_IMP.log \
    buffer=500000000 \
    ignore=y \
    commit=y \
    fromuser=$1 \
    touser=$2 \
    feedback=100000 \
    GRANTS=n \
    grep 'ORA-' $2_IMP.log
    if [ $? = 0 ]
    then
    mail -s "Erros found in regression snapshort import" email < $2_IMP.log
    else
    mail -s "regression snapshort is done sucessfully" email < $2_IMP.log
    fi
    #recompile invalid
    sqlplus system/$3@$3 << EOF
    conn /as sysdba
    @?/rdbms/admin/utlrp.sql
    Exit;
    EOF
    thank you in advance

  • Anything obviously wrong with this SQL query?

    Hey guys
    I can insert single data into my SQL DB, but multi line is throwing an error:
    This works:
    "INSERT INTO tester3 (Genre, DiscID) VALUES ('yeah', 'SF001');"
    This doesn't:
    "INSERT INTO tester3 (Genre, DiscID) VALUES ('X', 'none'),('X', 'none'),('X', 'none');"
    Throws the error:
    Error message: Error #3115: SQL Error.
    Details: near ',': syntax error
    I'm guessing there's something simple I'm overlooking?
    Thank you

    Nevermind - you do it like this:
    INSERT INTO "testerTable" (rowID, Column1, Column2)
    SELECT NULL,  "testData1", "moreData1"
    UNION SELECT NULL, "testData2", "moreData2"
    UNION SELECT NULL, "testData3", "moreData3"
    Also, I found a REALLY good article at http://stackoverflow.com/questions/1711631/how-do-i-improve-the-performance-of-sqlite that compares different ways of inserting over 800 000 rows of data, that results in insert speeds anywhere from 85 inserts per second all the way up to 96 700!!!
    It's written for C, and I'm unsure how much of the SQLLite syntax they have in the article will work in AIR, but I'll see how far I get with it.

  • What is wrong with this simple CFIF statement?

    Hi, I've included a simple cfif statment to check to see if a
    user is already in the database, for some reaons the <cfelse>
    part of the statement does not work. that is, if the user is there
    it returns the recordcount and ID etc. but if it is a new user (no
    records found) it is just blank (without the nothing doing !!!) any
    ideas?
    Thanks
    Yankee

    Based strictly on the code you have shown, you do not need
    the query="getuser" in your cfoutput tag.
    Also, I would check to see if the value is greater than zero
    rather than equal to one. What if the person has more than one
    record in the database?
    Try this...
    <CFIF getuser.recordcount GT 0>
    #GetUser.RecordCount# Records Found
    <CFELSE>
    Doing Nothing
    </CFIF>

  • What's wrong with this simple java file

    I am learning java input methods. When I tried to compile the below simple java file, there were two errors.
    import java.io.*;
    public class MainClass {
       public static void main(String[] args)  {
        Console console = System.console();
        String user = console.readLine("user: ");
        System.out.println(user);
    }The compiler errors:
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : class Console
    location: class MainClass
    Console console = System.console();
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : method console ()
    location: class java.lang.System
    Console console = System.console();
    ^
    2 errors
    Could anyone take a look and shed some lights on this?

    I have changed to "import java.io.Console;" but this below errors:
    h:\java\MainClass.java:1: cannot resolve symbol
    symbol : class Console
    location: package io
    import java.io.Console;
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : class Console
    location: class MainClass
    Console console = System.console();
    ^
    h:\java\MainClass.java:5: cannot resolve symbol
    symbol : method console ()
    location: class java.lang.System
    Console console = System.console();
    ^
    3 errors
    -----------

  • What is wrong with this simple JSP code?

    Whenever I run it on a browser it goes the SQL exception, but when I run it in a Java compiler it works fine.
    Any help very much appreciated
    <head>
    <%@ page
         import = "java.io.*"
         import = "java.lang.*"
         import = "java.sql.*"
    %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 2</h1>
    <%
    try
    // Load the driver class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
         try
         // Define the data source for the driver
              String sourceURL = "jdbc:odbc:my_library";
         // Create a connection through the DriverManager
              Connection databaseConnection = DriverManager.getConnection(sourceURL,"","");
              out.println("Here");
         Statement statement = databaseConnection.createStatement();
         ResultSet authorNames = statement.executeQuery("Select * from tblAvailable_Items");
         catch (SQLException s)
              out.println("SQL Error<br>");
         catch (ClassNotFoundException err)
              out.println("Class loading error");
    %>
    </body>
    </html>

    Hi...
    I have made some modifications to your code.. Try this. I assume, you would configured the system dsn as my_library, a table name "Table1" with one of the fields name as "name"
    <head>
    <%@ page import = "java.io.*,java.lang.*,java.sql.*" %>
    <title>
    JSP Example 2
    </title>
    </head>
    <body>
    <h1>JSP Example 2</h1>
    <%
    try
    // Load the driver class
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    try
    // Define the data source for the driver
    String sourceURL = "jdbc:odbc:my_library";
    // Create a connection through the DriverManager
    Connection databaseConnection = DriverManager.getConnection(sourceURL,"","");
    out.println("Here");
    Statement statement = databaseConnection.createStatement();
    String sql = "select * from Table1";
    ResultSet authorNames = statement.executeQuery(sql);
    while (authorNames.next()){
                             String Name = authorNames.getString("name");
    out.println(Name);
    catch (SQLException s)
    out.println("SQL Error<br>");
    catch (ClassNotFoundException err)
    out.println("Class loading error");
    %>
    </body>
    </html>
    Regds
    Vasi

  • What am I doing wrong with this simple array?

    I have an array that I need to add single characters to slowly.
    So the array is wordToCheck and I have some "drop places" to check and see if a letter has been "dropped off." Each drop point is assigned an index and I just want to add the letter to the proper index of the array so that I can push it into a string.
    This is my code:
    wordToCheck[currentBlank.register] = currentLetter.letter.toLowerCase();
    So you can see that if "A" was dropped at the blank spot with the register 2 it would return "- - A".
    The problem is that it's deleting it every time I add a letter. So if I put "A" in register 2 and then "M" in register 3 it returns "- - - M".
    How do I get it to not override itself each time?

    I tried making it an object but I guess I'm confused how that is supposed to work.
    When I tried to parse my array to a string it had a bunch of ","'s in it. So if I got it to be myArray["a" "b" "c"] it returns the string "a,b,c" instead of "abc."
    Why is that? Would using an object fix it? How is using an object different than using an array?
    I've read dozens of forums on this and I just can't figure out the difference except that in an object you are allowed to use a letter as the reference instead of a number.

  • What is wrong with this simple for loop?

    long number = 12345678;
            for(int i=1;i<=numberOfDigits;i++)
                int i = number/(i);
            System.out.println(i);
            Basically, I want to take to assign int 1 = , int 2 = , int 3 = up until the number of digits.
    I still have to manipulate it, so the code makes no sesne, but how would I do that?
    So, i want to assign ints up until 8 but the manipulation I have also involves i up until the number of digits.
    Yhank you.

    Fredddir_Java wrote:
    I see that, but I just wanted to declare 8 ints (in this example, number of digits is 8) using a for loop, so I wanted to use the loop to assign these values one at a time. You know...but don't declare a variable with the same name as the loop variable. That just won't compile. Use an array as mentioned above.
    How would you do that?If you are trying to find the digit at a certain point in your number, probably the easiest way is to translate the number to a Stirng and use String methods (if allowed) such as charAt(...). If not, then look at the mod operator "%" and at integer division.
    Can anyone provide a basic loop for this task?Best not to ask for a code solution to homework here. We'll tolerate specific questions but not requests for code.

  • What is wrong with this simple getText

    Alright, all im trying to do now is to have the user enter in a c d or f for their seat. If they do and everything else is correct, it should place an X in the array. However, even if i do a c d or f, it still goes to the else clause and never performs the intended if structure. I tried with integers and it worked fine, but our prof
    insists we use letters. Please help
    public void actionPerformed (ActionEvent actionEvent) {
    int RowNumber = 0, Section = 0;
    String Seat = "a"; <------------------------------------------declare seat as a string initiated as "a"
    if (actionEvent.getSource() == btnClear){
    txtSeat.setText("");
    txtSection.setText("");
    txtRow.setText("");
    if (actionEvent.getSource() == btnReserve){
    try{
    Section = Integer.parseInt(txtSection.getText());
    RowNumber = Integer.parseInt(txtRow.getText());
    Seat = (txtSeat.getText());<--------------------------------------get the text from txtSeat and put in Seat
    catch(Exception exception){
    JOptionPane.showMessageDialog(null, " Please enter a valid input in each box.");
    if(Section == 1){
    if(RowNumber >= 1 && RowNumber <= 3){
    if(Seat == "a" || Seat == "c" || Seat == "d" || Seat == "f"){<--------------Skips this even if its acd or f
    if(Business[(RowNumber-1)][0] == '0'){
    Business[(RowNumber-1)][0] = 'X';
    JOptionPane.showMessageDialog(null, "Seat has been Reserved.");
    displayChart();
    else JOptionPane.showMessageDialog(null, "Seat is already Reserved.");
    else
    { JOptionPane.showMessageDialog(null, "Please enter a seat A, C, D, or F" + <---------goes here
    " for Business class.");

    1) When posting code use the [url http://forum.java.sun.com/features.jsp#Formatting]Formatting Tags so the code is readable.
    2) if(Seat == "a" || Seat == "c" || Seat == "d" || Seat == "f")
    You don't use "==" when comparing equality of two Objects you use the equals(...) method.
    if (seat.equals("a") ....
    The "==" operator is only used when comparing primitive data types (int, char, long...)
    3) Variable names should not start with an upper case character. Normally class names would start with an upper case character (look at all the classes in the API).

Maybe you are looking for

  • System Image Utility always fails, why?

    Hi everyone, on my clean and fresh install of 10.7.4 Server the System Image Utility always fails to create an image. I want to create a NetInstall image and have put the OS X Lion Installer in /Applications. I can select it in SIU and choose to crea

  • Trouble adding comments using Reader X from enabled comments in Acrobat 9

    I am a Technical Writer with Acrobat 9. Regularly I make my documents comment enabled for reader. IT has been updating systems and some of my recipients now have Reader X. Because of the difficulty they have, when they open the commentable PDF they a

  • Where do I find my APPLE NETWORK WPA2 PASSWORD

    Hi, a basic question. How do  find my WPA2. Am trying to connect a new  computer.

  • Update is not applicable while installing Camera Raw

    Hello internet. I just bought a new camera, Nikon D3100. I shoot with RAW files, and therefore I need to open them in PS CS5. To do this, I need the newest update of Camera Raw, the Camera Raw 6.3. When I try to update it, my Adobe Application Manage

  • FCP Viewer Problems

    when watching my clips in the viewer clip play for a few then the picture pauses but the play head keeps moving then it starts up again then pauses... what settings in the preferences am i missing? also i was getting dropped frames alot [even when on