Execute an sql proc with Java

Hi all
Could anybody tell me how can I exec an sql proc with Java?
Thank you very much
Regards
chkmja
My Java code and SQL proc look like below.
Java code
m_connection.createStatement().execute("exec MSG_SNAPSHOT()");
sql Proc
CREATE OR REPLACE PROCEDURE MSG_SNAPSHOT AS
BEGIN
     EXECUTE IMMEDIATE 'TRUNCATE TABLE REVISION_MESSAGE';
     INSERT INTO REVISION_MESSAGE (PK_ID, MSGSTATE, SCHEDSTATE, EXTERN_ID, OBJECT_NAME, PROCESS_AT)
     SELECT msg.PK_ID, msg.MSGSTATE, msg.SCHEDSTATE, msg.EXTERN_ID, msg.OBJECT_NAME, msg.PROCESS_AT
     FROM MESSAGE partition (non_final) msg WHERE msg.SCHEDSTATE <> -1;
END;
Here my problem is I get --->
java.sql.SQLException: ORA-00900: invalid SQL statement

Just a quick check under java.sql.Connection found:
prepareCall
public CallableStatement prepareCall(String sql)
throws SQLException
Creates a CallableStatement object for calling database stored procedures.
Isn't this what you should be using and not createStatement() ?

Similar Messages

  • Execute a sql procedure with java?

    Hi
    Got this CREATE OR REPLACE PROCEDURE legg_til_student (p_fnavn student.fornavn%TYPE, p_enavn student.etternavn%TYPE, p_klasseid student.klasseid%TYPE) IS
    v_id student.id%TYPE;
    BEGIN
         SELECT MAX(id) +1 INTO v_id
         FROM student;     
         IF p_klasseid > 3 THEN
         DBMS_OUTPUT.PUT_LINE ('Ugyldig klasseid');
         ELSE
         INSERT INTO student VALUES (v_id, p_fnavn, p_enavn, p_klasseid);
         END IF;
    END;
    /  Procedure that are mad in sql+ , the problem is how to run this trough java ?
    Thanks :)

    Hey I wrote this :
    public void registrerStudent(StudentVO student) {
              Connection con = null;
              CallableStatement proc;
              try {
                   proc = con.prepareCall("{call legg_til_student(?, ?) }");
                   proc.setString(1, student.finnFornavn());
                   proc.setString(2, student.finnEtternavn());
                   proc.setInt(3, student.finnKlasse());
                   proc.execute();
                   proc.close();
              } catch (SQLException e) {
                   System.out.println("BLEHHH");
                   e.printStackTrace();
         }And Testing with this class :
    public class Test {
         public static void main(String args[]){
              StudentDAO dao = new StudentDAO();
              StudentVO t = new StudentVO("Arne", "Nilsen", 3);
              dao.registrerStudent(t);
    }But i am getting a
    java.lang.NullPointerException
         at ver002.student.StudentDAO.registrerStudent(StudentDAO.java:44)
         at ver002.student.Test.main(Test.java:22)
    Exception in thread "main" Any idea what i am doing wrong ?

  • How i can execute the sql query in java code

    I already have sql query in jave plateform i need to execute this code how i can do that. i have unix env and with oracle database. should i just run this query in my sqlplus. this file has extention .java. thanks

    you can create a project in JDeveloper add the java file to it, add the Oracle JDBC library to the project properties and then hit the run button.

  • Accessing MS Sql Server with Java classes - problem connecting to socket

    I found an example at this location which uses java classes to connected to MS Sql Server.
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    --bummer - it is a login location - so I will include the article
    Anyway, the example is using Websphere, but I am still on Jbuilder (will get wsad soon). So I planted the classes from the example in
    C:\Borland\JBuilder\jkd1.4\jre\lib\ext\...the classes
    Then I copied the code from the example to my jpx project and got an error that it could not connect to the socket. The only thing I changed in the code was the connection string:
    --original string from example:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    I was getting an error with the 2 argument version of DriverManager - and the second argument here was empty (properties argument). Here was my connection string:
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    I am only using the 1 argument version of DriverManager. Note that the password=" is blank because my RnD workstation is standalone - no one accesses the sql server except me - so no password. I also left out the last semicolon I noticed. Any suggestions appreciated how I could fix this.
    Thanks
    source of article:
    http://search400.techtarget.com/tip/1,289483,sid3_gci1065992,00.html
    iSeries 400 Tips:
    TIPS & NEWSLETTERS TOPICS SUBMIT A TIP HALL OF FAME
    Search for: in All Tips All search400 Full TargetSearch with Google
    PROGRAMMER
    Sample code: Accessing MS SQL Server database from the iSeries
    Eitan Rosenberg
    09 Mar 2005
    Rating: --- (out of 5)
    Nowadays with the help of Java the iSeries can be integrated with other databases quite easy. This tip shows you how. The code included here uses the free Microsoft driver that can be downloaded from here. (SQL Server 2000 Driver for JDBC Service Pack 3)
    If your SQL server does not include the Northwind Sample Database you can find it here.
    http://www.microsoft.com/downloads/details.aspx?familyid=07287b11-0502-461a-b138-2aa54bfdc03a&displaylang=en
    The download contains the following files:
    msbase.jar
    mssqlserver.jar
    msutil.jar
    Those files needs to be copied to the iSeries directories (/home/r_eitan/ExternalJARs).
    Here's the directory structure (on the iSeries) for this sample:
    /home/r_eitan/ExternalJARs - Microsoft files (msbase.jar,mssqlserver.jar,msutil.jar)
    /home/r_eitan/JdbcTest02 - My code (Main.java,Main.class)
    The Java code
    import java.sql.*;
    import java.io.*;
    class Main {
    * Connect to Microsoft SQL server and download file northWind.products as tab
    * seperated file. (products.txt)
    public static void main(String args[]) {
    try {
    PrintStream outPut = new PrintStream(new BufferedOutputStream(new FileOutputStream("products.txt")));
    Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
    //Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://1433", "");
    Connection connection = DriverManager.getConnection("jdbc:microsoft:sqlserver://Myserver:1433;User=sa;Password=");
    System.out.println("Connection Done");
    connection.setCatalog("northWind");
    String sqlCmdString = "select * from products";
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery(sqlCmdString);
    ResultSetMetaData resultSetMetaData = resultSet.getMetaData();
    int columnCount = resultSetMetaData.getColumnCount();
    // Iterate throught the rows in resultSet and
    // output the columns for each row.
    while (resultSet.next()) {
    for (int index = 1; index <=columnCount; ++index)
    String value;
    switch(resultSetMetaData.getColumnType(index))
    case 2 :
    case 3 :
    value = resultSet.getString(index);
    break;
    default :
    value = """ + resultSet.getString(index) + """;
    break;
    outPut.print(value + (index < columnCount ? "t" : ""));
    outPut.println();
    outPut.close();
    resultSet.close();
    connection.close();
    System.out.println("Done");
    catch (SQLException exception)
    exception.printStackTrace();
    catch (Exception exception)
    exception.printStackTrace();
    --------------------------------------------------------------------------------------------------

    My guess is that the server's host name isn't right. It necessarily (or even usually) the "windows name" of the computer. Try with the numeric IP address instead (type "ipconfig" to see it).
    First aid check list for "connection refused":
    - Check host name in connect string.
    - Check port number in connect string.
    - Try numeric IP address of server host in connect string, in case name server is hosed.
    - Are there any firewalls between client and server blocking the port.
    - Check that the db server is running.
    - Check that the db server is listening to the port. On the server, try: "telnet localhost the-port-number". Or "netstat -an", there should be a listening entry for the port.
    - Try "telnet serverhost the-port-number" from the client, to see if firewalls are blocking it.
    - If "telnet" fails: try it with the numeric ip address.
    - If "telnet" fails: does it fail immediately or after an obvious timeout? How long is the timeout?
    - Does the server respond to "ping serverhost" or "telnet serverhost" or "ssh serverhost"?

  • How to invoke a stored procedure on MS Sql Server with Java?

    I started writing Enterprise Java Beans and created an ODBC dsn with MS Sql Server 2000 which I can access using jdbc:odbc:mySqlDSN. This all works fine using Java Sql Statements. What kind of Java/Java Sql statement can I use to invoke a stored procedure on the Sql Server? Is it possible to use ADO/ADO command objects with Java? Is it possible to import/implement Mdac2.6 ActiveX data objects libary in Java?
    Thanks

    Thanks all for your replies. I will search the api for callable statements. I am curious though, the reply that suggests using a prepared statement - can I put the name of a stored procedure in a prepared statment or is this just suggestions an action query like Insert Into, Update, Delete? Like with ADO you can say
    cmdObject.CommandType = adStoredProcedure
    cmdObject.CommandText = "NameOfStoredProc"
    cmdObject.ExecuteNonQuery()
    Once I am calling/importing/implementing the proper libraries/interfaces in Java, can a prepared statement reference a stored procedure as above?
    Thanks

  • Execute PL/SQL block with named binds from within java code?

    Hi guys,
    Is there any good way to execute my PL/SQL code, for example
    BEGIN         :x := :x+1; END;
    from my Java code? I need nothing complicated, just static code block with named binds.
    I have tried the Oracle exetnded JDBC (setXXXbyName methods):
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password"); String SQL="begin :x:=:x+1; end;"; OracleCallableStatement stmt; stmt=(OracleCallableStatement)conn.prepareCall(SQL); stmt.setIntAtName("x", 5); stmt.registerOutParameter("x", Types.INTEGER); stmt.execute(); System.out.println(stmt.getInt("x"));     } catch (Exception x) { x.printStackTrace();    }   }
    And get the java.sql.SQLException: operation not allowed: Ordinal binding and Named binding cannot be combined!
    Then i've tried SQLJ appoach:
      public static void main(String[] args){     try {     Class.forName("oracle.jdbc.driver.OracleConnection");     Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user","password");       Oracle.connect(conn);       System.out.println("Connected!");           int x=3;       #sql { BEGIN         :x := :x+1;       END; };           System.out.println("x=" + x);     } catch (Exception x) { x.printStackTrace();    }   }
    And x=3 had retuned... Although 4 expected.
    Then, I've set parameter sqlj.bind-by-identifier=true
    And result is another exception! java.sql.SQLException: Missing IN or OUT parameter at index:: 2
    Can you please mark my mistakes/point to correct solution?
    Thanks in advance,
    Alexey

    Found another solution, this time working at least...
      public void testPLSQL() {
           String dynamicSQL=
                "declare\n" +
                "  v_CursorID  INTEGER;\n" +
                "  v_BlockStr  VARCHAR2(500);\n" +
                "  v_Dummy     INTEGER;\n" +
                "  v_x         String(18);\n" +
                "BEGIN\n" +
                "  v_CursorID := DBMS_SQL.OPEN_CURSOR;\n" +
                "  v_BlockStr :=?;" +
                "  DBMS_SQL.PARSE(v_CursorID, v_BlockStr, DBMS_SQL.V7);\n" +
                "  v_x:=?;"+
                "  DBMS_SQL.BIND_VARIABLE(v_CursorID, ':x', v_x,18);\n" +
                "  v_Dummy := DBMS_SQL.EXECUTE(v_CursorID);\n" +
                "  DBMS_SQL.VARIABLE_VALUE(v_CursorID, ':x', v_x);\n" +
                "  DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "  ?:=v_x;"+
                "  COMMIT;\n" +
                "EXCEPTION\n" +
                "  WHEN OTHERS THEN\n" +
                "    DBMS_SQL.CLOSE_CURSOR(v_CursorID);\n" +
                "    RAISE;\n" +
                "END DynamicPLSQL;";
             try {
                   Class.forName("oracle.jdbc.driver.OracleConnection");
                   Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","user", "password");
                   System.out.println("Profit");
         String SQL="begin :x:=:x+1; end;";
         OracleCallableStatement stmt;
         stmt=(OracleCallableStatement)conn.prepareCall(dynamicSQL);
         stmt.setString(1, SQL);
         int x=3;
         stmt.setInt(2, x);
         stmt.registerOutParameter(3,     Types.INTEGER);
         stmt.execute();
         x=stmt.getInt(3);
         System.out.println(x);
         assertEquals(4, x);
             } catch (Exception ex) {
                  ex.printStackTrace();
                  assertTrue(false);
      }Now the only thing I need is to code some kind of preprocessor of SQL block, to prepare the dynamicSQL lair for SQL critter...
    Please please please show me something less complicated! :8}

  • Executing sqlldr (sql loader) from java and returning the error code

    I'm wandering do sqlldr return any error code whenever it hit error while running in java.
    For example, if i run in command prompt using the command below,
    C:\ >sqlldr uid/pwd data=abc.dat control=abc.txt
    It might give me some indicator that error occurs such as
    SQL*Loader-601: For INSERT option, table must be empty. Error on table CURRENCY
    or
    SQL*Loader-500: Unable to open file (abc.txt)
    SQL*Loader-553: file not found
    SQL*Loader-509: System error: The system cannot find the file specified.
    But when i run in java using the code below,
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("sqlldr uid/pwd data=abc.dat control=abc.txt");
    int exitVal = proc.waitFor();
    System.out.println("Process exitValue: " + exitVal);
    it will only give me the same exitValue of 1(i presume its error) / 0 (i presume no error) instead of the details of the error.
    How can i get the exact error code/message if i were to execute it using java?
    Any solution?

    mg,
    I don't think user576271 wants the exit code, I think [s]he wants the error message.
    But wouldn't error messages from SQL*Loader be sent to the stderr stream, and not the stdout stream?
    In which case user576271 would need method "getErrorStream()" of class java.lang.Process, no?
    Good Luck,
    Avi.

  • Execute an SQL Script from Java (myScript.sql) ?

    Hello!
    I am a writing an SQL Script so that I can re-create my database on another server (im using my laptop to test it on first though).
    I'm connecting to mySQL server using JDBC which works fine, but I was wondering
    how can I run an entire script file, say myScript.sql from within a Java class??
    (an SQL Script is simply a file containing the regular SQL commands and expressions that you might enter at an sql command line prompt)
    example of an SQL Scritp: myScript.sql>>
    //#create new db
    CREATE DATABASE sample_db;
    //#set active db
    USE sample_db;
    //#set table paramaters
    CREATE TABLE monkeys
    (name CHAR(20),
      age INT UNSIGNED,
      sex ENUM('M','F')
    //#create standard monkeys
    INSERT INTO monkeys(name,age,sex) VALUES("Sammy",10,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Muncht",12,"M");
    INSERT INTO monkeys(name,age,sex) VALUES("Jill",8,"F");
    //#get recordset
    SELECT * FROM monkeys WHERE age < 50;Thanks for your help!

    The way I understand it is that your mysql.sql script file uses ';' as a delimeter between statements. So now what you can do is that read the whole file and put it inside a string/stringbuffer. Now put this string/stringbuffer to a stringTokenizer with delimeter set as ';'. this way you will recieve your exact statements without scratching your heads as where the statements begin/ends. :-)
    Now once you have your statements than its just a matter of executing them against the database.
    hope this helps.

  • Who use sql-mapping with java.util.regex?

    Hi everyone:
    I use the IBatis SQL-Mapping and I think it is very good.Now I want to add the search function to my BBS forum.I also want to display the content high light like jive.I mean that if I want to find the string "ibatis",then the search result "ibatis" will be high light displayed.
    So I must use the java.util.regex in jsdk1.4.But the problem is that what I get is a List if I use sql-mapping.For example:
              String resource="conf/XML/sql/lyo-sql-map.xml";
              Reader reader=Resources.getResourceAsReader(resource);
              sqlmap=XmlSqlMapBuilder.buildSqlMap(reader);
              List articlelist=sqlmap.executeQueryForList("selectSiteArticle","%"+icontent+"%");
    The result I get is a List and I have no time to use regex.
    I don't know whether I could do this:
    Iterate the List,use the regex and later place all the object back to the List.
    It's right?
    How to use regex with sql-mapping?Thks

    Any idea? :(

  • SQL Query With Java

    I have a database field with over 1000 drawing numbers. How can I write a query to only select a specified number of drawing numbers? For example, if I want to only select 50 drawing numbers instead of all 1000, how can I write this query?
    Thanks in advance.
    Dar

    The above mentioned query is not supported by all databases even though it's a valid SQL query. For me it didn't work with Oracle.
    If you are using it in a Java program, you can set the number of rows to be returned by a query on the statement (java.sql.Statement) object using the setMaxRows call.
    HTH

  • Execute simple SQL query on Java

    Hello,
    I am a newbie on ADF, I am a web developer used to work with EJBs, WebServices, Servlets and this stuff... But now I am on a project that uses ADF.
    My opinion, I don´t like this kind of development, drag and drop, I prefer to code on :) but, I need to work.
    I am developing a utility class that needs to run some SQL statements and send an email.
    I tried to work with the conventional @Resource (name...) Datasource ds; and did not worked, because it does not injected the object.
    I tried to create a java implementation of my application module, instanciate it and get a ViewObject that I created to do a select statement, and the ViewObject comes null...
    I just wanna do a simple query... just it, using simple java for web I would have already done it... How is the best way to do it?
    Thanks.

    ApplicationModuleImpl am = getApplicationModuleByName("AppModuleDataControl")
    DBTransaction dbt = am.getDBTransaction();
    CallableStatement cs = dbt.createCallableStatement(query, .......
    You can get ApplicationModule by this code. In this case there should be some binding related to this AM in pageDef. Input parameter "name" should be datacontrol name;
    public static ApplicationModuleImpl getApplicationModuleByName(String name) {
    try {
    BindingContext bc = (BindingContext)resolveExpression("#{data}");
    DCDataControl dc = bc.findDataControl(name);
    return (ApplicationModuleImpl)dc.getDataProvider();
    } catch (Exception e) {
    l.error(e);
    return null;
    public static Object resolveExpression(String expression) {
    l.debug("expression: " + expression);
    FacesContext fctx = FacesContext.getCurrentInstance();
    ELContext elctx = fctx.getELContext();
    ExpressionFactory exprFactory =
    fctx.getApplication().getExpressionFactory();
    ValueExpression ve =
    exprFactory.createValueExpression(elctx, expression, Object.class);
    Object value = ve.getValue(elctx);
    return value;
    }

  • SQLEception using Complex SQL Query with Java Studio Creator2 Build(060120)

    I am evaluating Java Studio Creator2 for a WEB base application project that will be making SQL queries to an Oracle Database but I have stumble into a problem using complex SQL queries.
    I am getting an SQLException "org.apache.jasper.JasperException: java.lang.RuntimeException: java.sql.SQLException: [sunm][Oracle JDBC Driver][Oracle]ORA-00923: FROM keyword not found where expected". I looks like it cut my sql.
    The SQL that I am trying to execute is
    Select part_name
    from table1, table2
    where table1.part_nbr = table2.part_nbr
    and table2.row_add_dt = (select max(table3.row_add_dt)
    from table3
    where table3.ser_part_id =table2.ser_part_id)
    This is a valid query that it is using 2 different selects to get a part number.
    If posible, point me to the best solution were I will be able to make complex SQL queries like the one above and bigger.
    Is there any way that I can read an SQL query file instead of inserting the SQL query string into the setCommand()?

    I have read that document looking for some anwsers on how to make this kind of query. If I try the query that I have above in the query editor ,the query editor will cut off from the last select that is between ().
    I beleave, there is a work around using the inner joint or outter join command. I will try them to see If I get the corrent result. If not, then I have to keep on asking for possible solutions.
    Anyway, someone in the Creator Team should take a note in adding something like a special criteria in the Add Query Criteria Box for cases like the one I have. The special criteria will be like using another select/from/where to get some result that will be compare.
    Girish, Are you in the Sun Creator Team?

  • SQL query with Java Server Pages

    Hey,
    I'm trying to read some information from database with SQL Query. How I can put the parameter that I get from previous *.jsp page to SQL query?
    Technologies that I use are WML, JSP and MySQL.
    I can get the parameter by method getParameter() and it is correct.
    But how to but the requested parameter into sql query and complete the sql query?
    Should I read it to some variable before putting it to sql query?
    */ this works fine */
    out.println("<p>periodi"+request.getParameter("periodi"+"loppu</p>");
    /* this doesn't work */
    ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi='+request.getParameter("periodi")+'");
    /* this doesn't work */
    String periodi=request.getParameter("periodi");
    ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi='periodi' '");
    Thanks,
    Rampe

    Hey,
    I'm trying to read some information from database
    se with SQL Query. How I can put the parameter that I
    get from previous *.jsp page to SQL query?
    Technologies that I use are WML, JSP and MySQL.
    I can get the parameter by method getParameter()
    () and it is correct.
    But how to but the requested parameter into sql
    ql query and complete the sql query?
    Should I read it to some variable before putting it
    it to sql query?
    */ this works fine */
    out.println("<p>periodi"+request.getParameter("periodi"
    "loppu</p>");
    /* this doesn't work */
    ResultSet tulokset = lause.executeQuery("select * from
    kurssi where
    periodi='+request.getParameter("periodi")+'");
    /* this doesn't work */
    String periodi=request.getParameter("periodi");
    ResultSet tulokset = lause.executeQuery("select *
    * from kurssi where periodi='periodi' '");
    Thanks,
    RampeTry this
    ResultSet tulokset = lause.executeQuery("select * from kurssi where periodi=" + "'" +request.getParameter("periodi")+"' " );this should work

  • How to use PL/SQL procs with portlet enabled CA's?

    I have written some PL/SQL procedures in a package.
    Now I would like to use this in a FOLDER-portlet (a new CA created for this purpose).
    But when I select the 'Open Item In Folder' (which should show the PL/SQL procedure results in the portlet I hope) I get:
    Call to utl_http failed (WWS-32136)
    ORA-1: User-Defined Exception (WWC-36000)
    If instead the option 'Open in new browser window' (or something like that) I get no error.
    My CA calls the PL/SQL pkg using a URL item like this:
    http://myserver/pls/dad/schema.package.procedure?p_arg=...
    It works entered directly in the address bar and if the item opens in a new window.
    But I want it to display in the SAME portlet as the link I click on.
    How is this done?
    null

    JDBC (and SQLJ) only support SQL types as stored procedure arguments, not PL/SQL types.
    If your stored procedure uses a PL/SQL-only type, such as BOOLEAN, record types, or index-by tables, then you cannot call it from Java (or, for that matter, from other languages as well).
    There is one exception: scalar index-by table arguments have been supported since JDBC 8.1.7 in the JDBC-OCI driver (refer to the JDBC manual for specifics).
    One workaround is to create wrapper PL/SQL stored procedures that take SQL arguments and convert them to PL/SQL -and vice versa- and call the original PL/SQL stored procedures. For example, a record type could be exploded into individual arguments, or it could be converted into a SQL object type, index-by tables could be represented as SQL collection types, etc.
    You can find a small example of this in the back of the JPublisher manual, where an example is given how to call a PL/SQL stored procedure that takes BOOLEAN arguments.

  • How to execute a stored proc with output params

    I have a SP that I created with 2 input varchar2s and 1 output varchar2. I developed it using PL/SQL Developer where it compiles and tests OK.
    When I try to run it using exec it fails with:
    exec validstate2('300', '5')
    BEGIN validstate2('300', '5'); END;
    ERROR at line 1:
    ORA-06550: line 1, column 7:
    PLS-00306: wrong number or types of arguments in call to 'VALIDSTATE2'
    ORA-06550: line 1, column 7:
    PL/SQL: Statement ignored
    If I try to add a set of quotes for an empty string for the output it fails as well.
    What do I need to do to get this to run? How do I handle that output parameter?
    Rick Price

    Here's the SP code, getcountry2 and get state are both functions that seem to work just fine.
    create or replace procedure ValidState2(mesgid IN varchar2, vcondition IN varchar2, valid OUT varchar2) is
    vvalid varchar2(20);
    v_temp varchar2(3);
    begin
    v_temp := getcountry2(mesgid, vcondition);
    IF v_temp = 'US' then
    vvalid := getstate(mesgid);
    valid := vvalid;
    else valid := 'Not US';
    end if;
    EXCEPTION
    when NO_DATA_FOUND THEN valid := 'No Data Found';
    end ValidState2;

Maybe you are looking for

  • Javac is working but not java

    PLEASE HELP. I've got a project due very soon, and I can't get very far until I can run my apps. Thank you, Dustin 1. I CAN compile a single .java file if it does NOT refer to any class outside of itself. 2. I CAN'T compile a .java file if it refers

  • How do I clear all songs on my ipod so that I can reload

    How can I clear all songs on my ipod. I have some Christmas music and lulibies ( mixed in ) that I want out of there.

  • Why when I drag a file to a folder it doesn't open up so I can put it in a subfolder anymore?

    Before my macbook was able to allow me to transfer files to other folders easily. My view options on the folders are columns. I was able to drag a file to a folder, and the folder opens on the next column so show it's contents and I can open as much

  • Listener not starting after restart

    Hello, After rebooting my Windows PC yesterday, I can't get the Listener to start. I've read every post I could find on this and nothing has helped so far. When I try to start the listener on the command line, I get this error: C:\Documents and Setti

  • Can't connect to other players in Borderlands 2

    I have a Home Hub 2 on Option 3 & I can't connect to either of my friends while playing Borderlands 2. Both of my friends can connect to each others' games (so the issue isn't on their end), but I can't connect to their games (either person) nor can