Error solving sql

Msg 1767, Level 16, State 0, Line 1
Foreign key 'FK_thiru' references invalid table 'pice'.
Msg 1750, Level 16, State 0, Line 1
Could not create constraint. See previous errors.
that is my sql error 
my query below
/*cottage Table */
create table cottage 
cottage_ID varchar (50),
invoice_ID varchar (50),
booking_ID varchar (50),
cottageName char (50),
phoneNumber varchar (50),
Email char (50),
postAddress char (50),
streetAddress char (50),
city char(50),
country char (50),
primary key (cottage_ID))
 select *from cottage
 /* client */
 create table client 
 client_ID varchar (50),
 booking_ID varchar (50),
 client_firstName char (50),
 client_LastName char (50),
 phoneNumber varchar (10),
 Email char (50),
 postAddress char (50),
 streetAddress char(50),
 city char (50),
 country char (50),
 primary key (client_ID))  
 select *from client
 /* facilities */
 create table facilities
 facilities_ID varchar (50),
 facilities_description char (70),
 RoomNumber int,
 primary key ( facilities_ID))
 select *from facilities
 /* Band Rating */
 create table Band_Rating
 ID varchar (50),
 cottage_ID varchar (50),
 Rating int,
 primary key ( ID))
 select * from Band_Rating
 /* price*/
 create table price 
 invoice_ID varchar(50),
 price money,
 startDate date,
 Enddate  date,
 primary key (invoice_ID ))
 select * from   price
 /* Regions*/
 create table Regions 
 Id varchar (50),
  cottage_ID varchar (50),
 Regions_Name char (50),
 Regions_Specification  char (70),
 primary key (Id))
 select * from Regions   
  /* booking*/
  create table  booking 
  booking_ID varchar (50),
  Discount char (20) ,
  date_booked date ,
  time_booked time ,
  startdate  date ,
  End_date date,
  primary key (booking_ID))
  select * from booking 
  create table cottage_facilities
     facilities_ID varchar (50),
cottage_ID varchar (50))
select * from cottage_facilities
  /*cottage Table foreign key */
 alter table cottage  add constraint FK_thiru
foreign key (invoice_ID ) references pice(invoice_ID) 
 /*cottage Table foreign key */
alter table cottage  add constraint FK_thiru1
foreign key (booking_ID) references booking  (booking_ID) 
 /*client  Table foreign key */
alter table client   add constraint FK_thiru2
foreign key (booking_ID) references booking  (booking_ID) 
 /*cottage_facilities  Table foreign key */
alter table cottage_facilities  add constraint FK_thiru3
foreign key (facilities_ID) references facilities  (facilities_ID) 
/*cottage_facilities  Table foreign key */
alter table cottage_facilities  add constraint FK_thiru4
foreign key ( cottage_ID) references cottage  (cottage_ID) 
/*Band_Rating  Table foreign key */
alter table Band_Rating  add constraint FK_thiru5
foreign key ( cottage_ID) references cottage  (cottage_ID)
/*Regions   Table foreign key */
alter table Regions   add constraint FK_thiru6
foreign key ( cottage_ID) references cottage  (cottage_ID)
/* insert cottage table */
insert into cottage values ('100','10','01','AidaHotel','0771234569','[email protected]','Kalutara 5/3','vilem_street','Kalutara ','srilanka')
insert into cottage values ('101','11','02','Airport Garden Hotel','0772636478','Airport Garden [email protected]','Seeduwa 5/3','royal_street','Seeduwa ','srilanka')
insert into cottage values ('102','12','03','Alpine Hotel','0773246258','Alpine [email protected]','112/3, Glenfall Road, ','via Queen Elizabeth Drive','Nuwara Eliya ','srilanka')
insert into cottage values ('103','13','04','Ambalama Leisure Lounge',' (036)2254377','Ambalama Leisure [email protected]','Ihala Hanwella, ','Avissawella','Avissawella ','srilanka')
insert into cottage values ('104','14','05','Austrian Beach Resort',' (041)2257360','Austrian Beach [email protected]','Kemagoda ','Dickwella','udugampola ','srilanka')
 select *from cottage
 /* insert price table */
 insert into price values ('10',10000,'2014/01/01','2014/01/03')
 insert into price values ('11',15000,'2014/01/10','2014/01/20')
 insert into price values ('12',11000,'2014/01/25','2014/01/30')
 insert into price values ('13',12000,'2014/02/10','2014/02/15')
 insert into price values ('14',13000,'2014/02/20','2014/02/25')
 select * from price 
 /* insert booking table  */
 insert into booking values ('01','10%','2013/12/30','10:30:30','2014/01/01','2014/01/03')
 insert into booking values ('02')
 insert into booking values ('03')
 insert into booking values ('04')
 insert into booking values ('05')
please help me anybody i hope all 
                 

Its obvious you've a typo in below statement hence its refering to a nonexistent table
alter table cottage add constraint FK_thiru
foreign key (invoice_ID ) references price(invoice_ID)
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Error: java.sql.SQLException; must be caught or declared to be thrown.

    in a servlet, I have a class like:
    class mydb
    public static Connection conn;
    public static void init() throws SQLException
    // Load the Oracle JDBC driver
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    conn = DriverManager.getConnection ("jdbc:oracle:oci8:@baby", "scott", "tiger");
    public static String getValue() throws SQLException
    String curValue="";
    // Create a Statement
    Statement stmt = conn.createStatement ();
    // Select the ENAME column from the EMP table
    ResultSet rset = stmt.executeQuery ("select ENAME from EMP");
    // Iterate through the result and print the employee names
    if (rset.next ())
    curValue = rset.getString (1);
    // Close the RseultSet
    rset.close();
    // Close the Statement
    stmt.close();
    return(curValue);
    public static void destroy() throws SQLException
    // Close the connection
    conn.close();
    but when it is called, errors "java.sql.SQLException; must be caught or declared to be thrown." encountered, how to solve this problem? please help.

    This is part of the Java language.
    If a method throws an exception, then
    it is telling you that the exception is
    something that you should be aware of.
    If you call a method which throws this exception, then the method must either catch this exception, or you may decide that this exception should be caught by the calling method.
    So, your choices are:
    1. Wrap the method call in a try{...} catch block
    -or-
    2. Change the (calling) method's signature to reflect the fact that this method can cause this exception to be thrown (add a 'throws SQLException' ) at end of signature.
    -John
    null

  • Brconnect error BR0301E SQL error -1017

    Hi All,
    I am having errors issuing the brconnect commands. For example, brconnect  -f check is returning the error: *BR0301E SQL error -1017 at location db_connect-2, SQL statement:'CONNECT system/*******  .*
    I appreciate the fact that this may be a case of logon denied with the default user 'system' that brconnect uses. Issuing the same command as brconnect -u / -c -f check works fine and returns no error.
    How do I fix this error? The platform is Oracle 10.2.0.2.0, Windows 2003 Server, ECC 6.0 Kernel 700-Patch Level 146.
    Thanks in anticipation.
    Akin.
    Edited by: Akintunde Olorunsola on Oct 4, 2008 7:35 PM

    Hi,
    I believe you havent used the right way to change the password of the database connect user SAPSR3 ,probably you have just changed it from the database level using an "alter user ..."
    To allow continued logon of the R/3 work processes using the OPS$ mechanism, you must also change the password in the SAPUSER table. The simplest way of making a consistent change in the Oracle dictionary and in the
    SAPSR3 table is to use the " -f chpass" option of brconnect, for example:
    brconnect -f chpass -o sapsr3 -p <new_password>
    Hope this will solve your issue. Also check the following notes for reference:
    https://service.sap.com/sap/support/notes/562863
    https://service.sap.com/sap/support/notes/400241
    - Regards, Dibya

  • Internal Memory Error During SQL Generation

    Hi,
    Please find below the details:
    Issue: I am using BO XI R3 DeskI.
    When I try to refresh/edit the Dataprovider of a report, it says "Internal Memory Error During SQL Generation"
    I am sure that there is no case of Multiple contexts with this report and its a very simple one too.
    I get this error in WebI as well
    Workaround: Restarting the DesktopIntelligence Processing Server solves the issue for some time but then it reoccurs-for some other report -at a later time.  
    Could anyone please explain the root cause of this and is there a permanent solution to this problem.
    Thanks
    Prabhat Jha

    Hi,
    I investigated further and if the previous solution doesn't help you to resolve the issue please test the below mentioned solution.
    When several contexts are possible for a query, the system tests if they produce the same set of tables. If they are identical, it is not necessary to prompt the user. It is the default behavior. But for some particular universes, the designer defines different contexts with the same tables, but with a different set of joins. This will compare the context with the joins. When this happens, InfoView fails with this error.
    Resolution
    1. Import the universe.
    2. Modify the following parameter:
    COMPARE_CONTEXTS_WITH_JOINS = No
    3. Export the universe.
    4. Open the Desktop Intelligence report in InfoView and refresh it.
    It will refresh successfully
    Regards,
    Sarbhjeet Kaur

  • Error #3115: SQL Error.', details:'no such table

    Hi,
    I'm creating my Adobe Air App using Flash CS5 Professional and facing exactly the following error.
    SQLError: 'Error #3115: SQL Error.', details:'no such table: 'categories'', operation:'execute', detailID:'2013'
    My SQLite Db has been created using Firefox extension - SQLite Manager. The db file is placed into the same folder as the .fla and .swf files. The db has three tables namely: categories, period and activity. I don't understand why I'm getting this error. I have even tried copy pasting other source code from AS 3.0 reference guide but same error every time.
    The code below is a modified version of example code in AS 3.0 reference documentation. Can you suggest how the above error can be fixed?
    /you can also reply to me directly at [email protected]
    /regards
    import flash.data.SQLConnection;
    import flash.data.SQLResult;
    import flash.data.SQLStatement;
    import flash.display.Sprite;
    import flash.events.SQLErrorEvent;
    import flash.events.SQLEvent;
    import flash.filesystem.File;
    var conn:SQLConnection;
    var insertCategory:SQLStatement;
    var dbFile:File;
    databaseConnect();
    function databaseConnect():void
    // define where to find the database file
    var appStorage:File = File.applicationStorageDirectory;
    dbFile = appStorage.resolvePath("MyBudgetCalc.db");
    // open the database connection
    conn = new SQLConnection();
    conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);
    conn.addEventListener(SQLEvent.OPEN, openHandler);
    trace("dbFile.exists:"+ dbFile.exists);
    conn.openAsync(dbFile);
    // Called when the database is connected
    function openHandler(event:SQLEvent):void
    conn.removeEventListener(SQLEvent.OPEN, openHandler);
    // start a transaction
    //Object(this).inputfield.text = "openHandler called.. ";
    conn.addEventListener(SQLEvent.BEGIN, beginHandler);
    conn.begin();
    trace("exiting openHandler..");
    // Called when the transaction begins
    function beginHandler(event:SQLEvent):void
    conn.removeEventListener(SQLEvent.BEGIN, beginHandler);
    //trace("beginHandler - SQLEvent message: "+SQLEvent.message);
    Object(this).inputfield.text = "beginHandler called.. ";
    insertCategory = new SQLStatement();
    insertCategory.sqlConnection = conn;
    insertCategory.text = "INSERT INTO categories(id, name) VALUES (', Auto')";
    insertCategory.execute();
    insertCategory.addEventListener(SQLEvent.RESULT, insertCategoryHandler);
        insertCategory.addEventListener(SQLErrorEvent.ERROR, errorHandler);
    trace("exiting beginHandler..");
    // Called after the phone number record is inserted
    function insertCategoryHandler(event:SQLEvent):void
    insertCategory.removeEventListener(SQLEvent.RESULT, insertCategoryHandler);
    insertCategory.removeEventListener(SQLErrorEvent.ERROR, errorHandler);
    // No errors so far, so commit the transaction
    conn.addEventListener(SQLEvent.COMMIT, commitHandler);
    conn.commit();
    trace("exiting insertCategoryHandler after conn.commit()..");
    // Called after the transaction is committed
    function commitHandler(event:SQLEvent):void
    conn.removeEventListener(SQLEvent.COMMIT, commitHandler);
    trace("exiting commitHandler(): Transaction complete..");
    // Called whenever an error occurs
    function errorHandler(event:SQLErrorEvent):void
    trace("entering errorHandler()..");
    // If a transaction is happening, roll it back
    if (conn.inTransaction)
    conn.addEventListener(SQLEvent.ROLLBACK, rollbackHandler);
    conn.rollback();
    trace(event.error.message);
    trace(event.error.details);
    trace("exiting errorHandler()..");
    // Called when the transaction is rolled back
    function rollbackHandler(event:SQLEvent):void
    conn.removeEventListener(SQLEvent.ROLLBACK, rollbackHandler);

    Can you try creating the table using the AIR ActionScript APIs? It is possible the SQLLite Manager program that you are using is creating a database that isn't compatible with AIR.

  • FRM-40734: internal error: pl/sql error occurred

    I am getting this error [FRM-40734: internal error: pl/sql error occurred] while running a form (FMX) developed in Forms 6i. The form is running on machines having Win XP, Win 2k, and Win 98. But not running on the same operating system of the other machines.
    * I have completely uninstalled Developer 2000 both Forms 6i and Report 6i, and installed again.
    * The "Start in" Path and "Bin" path for the application is also correct.
    If anybody have idea kindly reply me quickly.
    [email protected]

    just some remote ideas :
    any PLLs involved ?
    any changes done on PLLs ?

  • Error in SQL Statement: SAPSQL_INVALID_FIELDNAME F~/BIC/ZREVISQTY

    Dear Guys,
                    Regards..In the "Listcube" transaction and "Manage Contents" of the cube,whenver i execute the transaction to get the 'Output List' ,i get the following error : " Error in SQL Statement : SAPSQL_INVALID_FIELDNAME"..with the following obj : ZREVISQTY............But when i remove the "ZREVISQTY" from the selection screen in both "LISTCUBE" and "MANAGE" of the cube,the output works fine......It would be great if somone can throw light on this...........
    Manythanks
    Arun

    Dear Guys,
                    Regards..In the "Listcube" transaction and "Manage Contents" of the cube,whenver i execute the transaction to get the 'Output List' ,i get the following error : " Error in SQL Statement : SAPSQL_INVALID_FIELDNAME"..with the following obj : ZREVISQTY............But when i remove the "ZREVISQTY" from the selection screen in both "LISTCUBE" and "MANAGE" of the cube,the output works fine......It would be great if somone can throw light on this...........
    Manythanks
    Arun

  • Error in SQL Statement: SAPSQL_INVALID_TABLENAME

    Hello all,
    While displaying contents of infocube i am getting strange error ..
    Error in SQL Statement: SAPSQL_INVALID_TABLENAME ABC
    Message no. DBMAN256
    ( Table name length is 16 )
    I am able to see the contents of Fact table.
    Could not found any solution till now.. Any lights , views will be very much helpful.
    Regards
    Nimesh

    hi Nimesh,
    check oss note 835816
    Symptom
    When you execute a query, a data-mart, SEM, APO or similar access, an SQL error 4004 occurs "Unknown table name" Open SQL: Short dump with UNCAUGHT_EXCEPTION CX_RSR_X_MESSAGE in the ABAP Call Stack, you find the RSDRC_BASIC_DB_QUERY_DATA_GET function module.
    Prior to this, relatively large datasets (more than 10%) were deleted from the InfoCube.
    Other terms
    Business Information Warehouse, Factview, DBMAN256, DBMAN
    256, SAPLRSDRS, DELETE, DELETE_FACTS, RSDRD_DELETE_FACTS
    Reason and Prerequisites
    During the purge, the fact tables are rebuilt again as of a certain percentage, for performance reasons. The factview is then not created again.
    Solution
    Views that are already missing can be compiled again with the SAP_FACTVIEWS_RECREATE report.
    The correction prevents the problem reappearing.
    BW 3.0B
               Import Support Package 27 for 3.0B (BW3.0B Patch27 or SAPKW30B27) into your BW system. The Support Package is available whennote 0723258 with the short text "SAPBWNews BW3.0B Support Package 27", which describes this Support Package in more detail, is released for customers.
    BW 3.10 Content
               Import Support Package 21 for 3.10 (BW3.10 Patch21 or SAPKW31021) into your BW system. The Support Package is available whennote 0723263 with the short text "SAPBWNews BW3.1 Content Support Package 21", which describes this Support Package in more detail, is released for customers.
    BW 3.50
               Import Support Package 13 for 3.5 (BW3.50 Patch13 or SAPKW35013) into your BW system. The Support Package is available when note 0765114 with the short text "SAPBWNews BW Support Package 13 NetWeaver'04  Stack 13", which describes this Support Package in more detail, is released for customers.
    In urgent cases you can use the correction instructions.
    These notes may already be available before the Support Package is released, to make information available in advance. However, the short text then still contains the words "preliminary version".

  • How to resolve ORA-00001 Error in SQL Insert?

    Hi all, I need your appreciated help.
    I make a plsql procedure that is inserting a row according cursor value, I'm having oracle error ORA-00001: unique constraint (constraint_name) violated.
    You may see this message if a duplicate entry exists at a different level: in RDBMS MySQL I have the syntax IGNORE to resolve this duplication error... and in Oracle ?
    Thanks for your time and hints.
    Miguelito

    user6317803 wrote:
    How to resolve ORA-00001 Error in SQL Insert?ORA-00001 means table has unique/primary key/index and you are trying to insert a row with key value that already exists in the table. I'll assume table COUNTRIES has primary key on COUNTRY_ID. Then change SQL to:
    SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ')"There is a good chance table COUNTRIES also has unique key/index on COUNTRY_NAME. If so use:
    SQL = "INSERT INTO COUNTRIES(COUNTRY_ID,COUNTRY_NAME,REGION_ID) SELECT 'BZ','BLZ',3 FROM DUAL WHERE NOT EXISTS(SELECT 1 FROM COUNTRIES WHERE COUNTRY_ID = 'BZ' OR COUNTRY_NAME = 'BLZ')"SY.

  • Strange error in SQL 2014 - is it a bug?

    Hi everybody,
    I was writing a query to help in a recent thread and then got a very strange error:
    declare @dt date = CURRENT_TIMESTAMP;
    select convert(varchar(10), 103, @dt);
    Run this code in SQL 2014 and see if it works for you or not. In BOL I didn't find anything indicating that CONVERT is not going to work with DATE type. Can you point me to BOL explaining the problem or confirm it's a bug?
    UPDATE. Same error in SQL 2012. Does it mean I can not use CONVERT function with DATE type or some styles are not available? If yes, which codes I can use and which I can not?
    UPDATE 2. I tried a few different styles and I got the same error message every time. That's new to me, looks like DATE type is not supported by CONVERT function at all?
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

    It should be declare @dt date = CURRENT_TIMESTAMP;
    select convert(varchar(10), @dt,103);Correct me if I'm wrong.--Prashanth

  • FRM-40734:Internal Error:PL/SQL error occurred in Adjustment to invoice

    Hello All
    I have problem in AR Trasactions >> Transactions >>Query the invoice >>Actions >> Adjust FRM-40734:Internal Error:PL/SQL error occurred.
    EBS R 12.1.2
    SO. Enterprise Linux Enterprise Linux AS release 4 (October Update 7)
    Last night was generated forms with utility adadmin.
    I hope you can help me my enviorment is PROD
    Regards

    Last night was generated forms with utility adadmin.Was the form generated successfully?
    Have you applied any patches recently?
    If you have any other identical instance (same patchset), rename the form you have in production instance and replace it with the one from the other instance and see if you can reproduce the issue.
    Could you please confirm that you have no invalid objects in the database?
    I hope you can help me my enviorment is PRODPlease log a SR for production issues.
    You may also obtain the FRD file to get more details about the error.
    Steps To Take FRD Trace in 11.5.10 & R12 [ID 867943.1]
    R12: Forms Runtime Diagnostics (FRD), Tracing And Logging For Forms In Oracle Applications [ID 438652.1]
    Thanks,
    Hussein

  • VMware SQL 2008R2 bcp error - SQLState = 08001, NativeError = 0 Error = [Microsoft][SQL Server Client 10.0] Client unable to establish connection due to prelogin failure

    Can someone help me resolve this error?   Thanks  
    Windows Server 2008 R2  Standard SP1 64-bit -  SQL Server 2008R2 Standard 64-bit 
    VMware vCenter Server Version 5.1.0
    SQLState = 08001, NativeError = 0
    Error = [Microsoft][SQL Server Native Client 10.0]Client unable to establish connection due to prelogin failure
    bcp program: 
    bcp SYM.dbo.ACCOUNT in "D:\Data\SQLExtract\EXTRACT.ACCOUNT" -f"D:\Data\SQLCommands\FMT.ACCOUNT" -S DEV-DATA\TEST\ -T -oSYMLOAD.LOG Type SYMLOAD.LOG >> SYMLOAD.LOG.CUMULATIVE
    The bcp program executes successfully on a local instance of SQL Server.

    The error has nothing to do with BCP as such, but it is a connection problem. That is, for some reason you cannot connect to your instance from the VM. I would exect that you face a similar problem if you tried SSMS.
    It could be a firewall issue, but prelogin suggests that you reach the instance. But possibly you don't come far enough for the login failure to be recorded. Possibly the instance is not configured to audit login failures.
    The message you would see would be similar to
    2010-08-18 14:11:30.91 Logon       Error: 17809, Severity: 20, State: 3
    Possibly followed by a a line that details the message. The error number may be different.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Weird errors in sql logs

    I started seeing this kind of errors in sql logs after i moved databases to this server 
    The activated proc '[SQLDependency].[SqlQueryNotificationStoredProcedure-9c377656-a13c-4732-a5a2-177bbc45c565]' running on queue 'EmailValidator.SQLDependency.SqlQueryNotificationService-9c377656-a13c-4732-a5a2-177bbc45c565' output the following:  'Cannot
    drop the service 'SqlQueryNotificationService-9c377656-a13c-4732-a5a2-177bbc45c565', because it does not exist or you do not have permission.'
    Any help !!
    Thanks in Advance

    Hello,
    That is coming from a service broker activated stored procedure in the database which looks like it is there because of notification services. Since you've just moved the database to another server, chances are the broker IDs aren't correct:
    http://technet.microsoft.com/en-us/library/ms166057(v=SQL.105).aspx
    Sean Gallardy | Blog
    MCM 2008
    MCSM:Data Platform Charter Member

  • 500 Internal Server Error - java.sql.SQLException: Invalid column index

    500 Internal Server Error
    java.sql.SQLException: Invalid column index     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:137)     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:174)     at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:239)     at oracle.jdbc.driver.OracleResultSetImpl.getObject(OracleResultSetImpl.java:851)     at com.stardeveloper.servlets.db.InsertServlet.doPost(InsertServlet.java:88)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)     at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)     at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:285)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.run(HttpRequestHandler.java:126)     at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)     at java.lang.Thread.run(Thread.java:534)
    This is the connection part of the java code
         // connecting to database
              Connection con = null;
              Statement stmt = null;
              ResultSet rs = null;
              PreparedStatement ps = null;
              try {
                   Class.forName("oracle.jdbc.driver.OracleDriver");
              con=DriverManager.getConnection("host:port:sid, userName, password");
                   String sql;
              sql = "INSERT INTO USERSS(user_id, username) VALUES (?,?)";
                   ps = con.prepareStatement(sql);
                   stmt = con.createStatement();
                   // inserting records
                   if(proceed) {
                        ps.setString(1, user_id);
                        ps.setString(2, username);
                        ps.executeUpdate();
    desc userss;
    Name Null? Type
    USER_ID NOT NULL NUMBER(5)
    USERNAME VARCHAR2(15)
    Index_Name table_name
    USERSS_PK1 USERSS
    when I try to insert values, it is inserting, but at the end I am getting the above error. I am using JDeveloper 10g and database [Oracle9i Enterprise Edition Release 9.2.0.7.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.7.0 - Production]

    I suggest you should alter the JDBC Driver and select one for Oracle 9i.
    Which version is your JDev10g?

  • What may be the cause of this error java.sql.SQLException: invalid sql type passed to callable statement in iplanet ussing JNDI

     

    Hi,
    The possibilities can be of various reasons, with the sql statements,
    xml descriptors, data sources, improper drivers anything. To crack down
    the solution, kindly let me know the error messages and what exactly are
    you trying to accomplish.
    Thanks & Regards
    Raj
    manimaran t wrote:
    what may be the cause of this error java.sql.SQLException: invalid sql
    type passed to callable statement in iplanet ussing JNDI
    Try our New Web Based Forum at http://softwareforum.sun.com
    Includes Access to our Product Knowledge Base!

Maybe you are looking for