Problem in updating the database

hi i just want to know whether the syntax is correct or not
psmt=con.prepareStatement("update invoicetransss set description=?,quantity=?,item=?,amount=? where invoiceno=? and sno=?");.pls help me

What I meant by not being mindreaders is we can't see your code. Does your code contain something similar to the code I posted above? Such as you are catching an exception but doing nothing with it, so you have no idea if your program encountered a problem or not.

Similar Messages

  • Problem in bringing the database up

    Hi,
    I am facing this problem while bringing the database up :-
    ORA-01190: control file or data file 21 is from before the last RESETLOGS
    ORA-01110: data file 21: '/fnb/dbdevices2/ora10g_scmb/scmbdata06.dbf'
    What i did just before that was i brought two datafiles ONLINE one of them is :-
    '/fnb/dbdevices2/ora10g_scmb/scmbdata06.dbf' as given in the error.
    I have been able to mount the database and when i try to bring these datafiles offline it gives same error
    and also i tried to drop the datafile and on doing that i get disconnected from Oracle.
    Can anyone please help in this.
    Regards,
    kapil

    you'll want to log an SR to go through this with support. It looks like you took the file OFFLINE a while ago, then did an open resetlogs whilst the file was offline, and then tried the operation you described. In the case of READ-ONLY datafiles where the file header details don't get updated and a similar issue arises then there is a supported procedure to restore the file to the database. In your case I'm not sure if there is a supported route for you to go down.
    Niall Litchfield
    http://www.orawin.info/

  • Update the database table inside an user exit.

    Hi Experts,
    I have a issue where i have to update a custom table in an User exit.
    I am using Lock object for ENQUE/DEQUE.
    I have tried to use statements like UPDATE/MODIFY inside the user exit.
    But the problem is that it's not updating the database table at the same time.
    I know if i use COMMIT WORK it can update at the same time but it's not advisable to use COMMIT inside a work.and also it gives a short dump.
    The real issue is that this custom table is read for batch creation at the same time for different users.
    Now if it the program does not update the database table at the same time then other users also read the same data and create the same Batch number..
    While requirement is to create a different/unique batch numbers.
    Program is updating the table but it's taking time..so in between other users are creating the same batch number.
    Please guide me what would be the best solution for this.
    Regards,
    Amit Kumar Singh

    Thanks for your quick reply.
    My actually requirement is like that.
    I have to create a Process Order using tcode COR1.
    After passing some input value it goes inside an User Exit.
    There one Custom table is maintained which stores some fields like month,year,numeric key field,etc.
    The new batch number is created using the combination of these table fields.
    Once a new batch number is created it increment the numeric key field number by one.
    Issue is we have to update this new numeric field value into the database field so that other users can read a diffrent numeric field value.hence it will create a new/different batch number.
    Here i am not able to update the database table inside this User Exit.
    Table is geeting updated but after some time and out of this User Exit.
    Please suggest what's required in that case?
    Regards,
    Amit Kumar Singh
    Edited by: Amit  Singh on Feb 3, 2009 11:33 AM

  • An error occurred while attempting to update the database

    Hi
    the update from 2.82 to 2.9.0 fails for me with following message
    An error occurred while attempting to update the database.
    the update log ends like this
    [Microsoft][ODBC SQL Server Driver][SQL Server]DELETE failed because the
    following SET options have incorrect settings: 'QUOTED_IDENTIFIER'. Verify
    that SET options are correct for use with indexed views and/or indexes on
    computed columns and/or filtered indexes and/or query notifications and/or XML
    data type methods and/or spatial index operations.
    1> 2> 3> [16:56:20] RunShellCommand: Command: osql exited with code: 1
    [16:56:20] RunShellCommand: Exit code indicates failure.
    [16:56:20] UpdateDatabase: Failed to run database update script.
    hope that anyone can solv this for me

    It seems that my problem is with one of ldapservers.
    When the periodic update runs.
    then there will be error periodic update failed
    log file mdm_error looks like this
    [00:01:46] Failed running query:
    IF NOT EXISTS(SELECT LDAPContainerName FROM LDAPContainers WHERE LDAPContainerName=? AND LDAPServerSAKey = ?)
    BEGIN INSERT INTO LDAPContainers(LDAPContainerName, DisplayName, LDAPContainerType, ParentContainerSAKey,
    LDAPServerSAKey, LDAPMemberType, AllowHandsOffEnrollment) VALUES (?,?, 2,
    (SELECT LDAPContainerSAKey FROM LDAPContainers WHERE LDAPContainerName =? AND LDAPServerSAKey =?) , ?, 1, 1) END
    SQLError:
    I think this is the reason that the upgrade fails.
    How can i solve this?

  • Console Application not updating the database

    Dear all,
    I am new to c# development. I have a console application front end in program.cs
    I have a local database on visual studio.
    When I execute the stored procedure locally on the database the data is getting updated in the database.
    When I update the same through Console Application - the data is not appearing in the database.
    Can somebody throw light on this? Where I am missing
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Data;
    using System.Data.SqlClient;
    namespace AssetApp
    class Program
    static void Main(string[] args)
    bool value = true;
    while (value)
    value = getdisplay();
    //Console.ReadLine();
    //value = false;
    private static bool getdisplay()
    Console.WriteLine("-------------------------------------- ");
    Console.WriteLine("---------------------------------------");
    Console.Clear();
    Console.WriteLine("----------Asset Application------------");
    Console.WriteLine(" 1 Company Asset ");
    Console.WriteLine(" 2 Standby Laptop Register ");
    Console.WriteLine(" 3 Scrap Register ");
    Console.WriteLine(" 4 Purchase Register ");
    Console.WriteLine(" 5 Service Call Report ");
    Console.WriteLine(" 6 IT Helpdesk ");
    Console.WriteLine(" 7 Exit ");
    Console.WriteLine("---------------------------------------");
    string input = Console.ReadLine();
    switch (input)
    case "1":
    CompanyAsset();
    break;
    case "2":
    Console.WriteLine("Standy Laptop Register");
    break;
    case "3":
    Console.WriteLine("Scrap Register");
    break;
    case "4":
    Console.WriteLine("Purchase Register");
    break;
    case "5":
    Console.WriteLine("Service call Report");
    break;
    case "6":
    Console.WriteLine("IT Helpdesk");
    break;
    case "7":
    return false;
    default:
    break;
    return true;
    private static void CompanyAsset()
    Console.WriteLine("------Company Asset------------------------");
    Console.WriteLine("Type the Department Name");
    string departmentName = Console.ReadLine();
    Console.WriteLine("Type the First Name");
    string firstName = Console.ReadLine();
    Console.WriteLine("Type the Last Name");
    string lastName = Console.ReadLine();
    Console.WriteLine("Type the User Name");
    string userName = Console.ReadLine();
    Console.WriteLine("Type the Model Number");
    string modelNumber = Console.ReadLine();
    Console.WriteLine("Type the AssetTypeID");
    string assetTypeID = Console.ReadLine();
    Console.WriteLine("Type the SerialNumber");
    string serialNumber = Console.ReadLine();
    Console.WriteLine("Type the WarrantyStartDate");
    DateTime warrantyStartDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Type the WarrantyEndDate");
    DateTime warrantyEndDate = Convert.ToDateTime(Console.ReadLine());
    Console.WriteLine("Company");
    string company = Console.ReadLine();
    Console.WriteLine("EngineerID");
    string engineerID = Console.ReadLine();
    Console.WriteLine("ITHelpdeskID");
    string itHelpdeskID = Console.ReadLine();
    Console.WriteLine("EmpID");
    string empID = Console.ReadLine();
    //Handshake
    SqlConnection myNewConnection = new SqlConnection("Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\AssetApp.mdf;Integrated Security=True");
    //open the database
    myNewConnection.Open();
    //create command
    SqlCommand myCommand = myNewConnection.CreateCommand();
    //using the stored procedue to update the database using parameters add
    myCommand.CommandText = "InsertAsset";
    myCommand.CommandType = CommandType.StoredProcedure;
    myCommand.Parameters.Add(new SqlParameter("@DepartmentName", departmentName));
    myCommand.Parameters.Add(new SqlParameter("@FirstName", firstName));
    myCommand.Parameters.Add(new SqlParameter("@LastName", lastName));
    myCommand.Parameters.Add(new SqlParameter("@UserName", userName));
    myCommand.Parameters.Add(new SqlParameter("@ModelNumber", modelNumber));
    myCommand.Parameters.Add(new SqlParameter("@AssetTypeID", int.Parse(assetTypeID)));
    myCommand.Parameters.Add(new SqlParameter("@SerialNumber", serialNumber));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyStartDate", warrantyStartDate));
    myCommand.Parameters.Add(new SqlParameter("@WarrantyEndDate", warrantyEndDate));
    myCommand.Parameters.Add(new SqlParameter("@Company", company));
    myCommand.Parameters.Add(new SqlParameter("@EngineerID", int.Parse(engineerID)));
    myCommand.Parameters.Add(new SqlParameter("@ITHelpdeskID", int.Parse(itHelpdeskID)));
    myCommand.Parameters.Add(new SqlParameter("@EmpID", int.Parse(empID)));
    int recordsAffected = myCommand.ExecuteNonQuery();
    if (recordsAffected == 1)
    Console.WriteLine("Successful your entry");
    else
    Console.WriteLine("Your entry is not successful");
    myNewConnection.Close();
    Console.WriteLine("");
    Console.WriteLine("Press Enter to continue");
    Console.ReadLine();
    public static void StandbyLaptopRegister()
    Console.WriteLine("-------------------------------");
    Console.WriteLine("Select the Date & Time");
    string DateTime = Console.ReadLine();
    Console.WriteLine("");
    ALTER PROCEDURE dbo.InsertAsset
    @DepartmentName NVARCHAR(50),
    @FirstName NVARCHAR(50),
    @LastName NVARCHAR(50),
    @UserName NVARCHAR(50),
    @ModelNumber NVARCHAR(50),
    @AssetTypeID INT,
    @SerialNumber NVARCHAR(50),
    @WarrantyStartDate SMALLDATETIME,
    @WarrantyEndDate SMALLDATETIME,
    @Company NVARCHAR(50),
    @EngineerID INT,
    @ITHelpdeskID INT,
    @EmpID INT
    @parameter1 int = 5,
    @parameter2 datatype OUTPUT
    AS
    /* SET NOCOUNT ON */
    BEGIN
    INSERT CompanyAsset(DepartmentName,
    FirstName,
    LastName,
    UserName,
    ModelNumber,
    AssetTypeID,
    SerialNumber,
    WarrantyStartDate,
    WarrantyEndDate,
    Company,
    EngineerID,
    ITHelpdeskID,
    EmpID)
    VALUES(@DepartmentName,
    @FirstName,
    @LastName,
    @UserName,
    @ModelNumber,
    @AssetTypeID,
    @SerialNumber,
    @WarrantyStartDate,
    @WarrantyEndDate,
    @Company,
    @EngineerID,
    @ITHelpdeskID,
    @EmpID)
    /*RETURN @@IDENTITY*/
    END
    Cheers
    Sathya

    Hello,
    Usually when I see
    AttachDbFilename=|DataDirectory| ...
    The database was added into the project via the IDE add new data source and if so make sure under the property window for the database that "Copy to Output Directory" is set to either the first or last option as the default "Copy always"
    copies the database each time you build the project thus overwrites the last time you ran the project.
    I would recommend the "Copy if Newer" which means the database is only copied if you make changes to the database. Set "Copy if newer", build run check results.
    Of course this may not be the issue but may very well be too.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.

  • Problem in getting the database connection from a connection pool

    Hai All,
    I am facing a problem in getting the database connection from a connection pool created on weblogic server 8.1.
    I am using the Oracle database 8.1.7.
    I have configured my connection pool, datasource and JNDI in weblogic.
    In my java program i have the following code to retrieve the connection.
    import java.sql.*;    
    import java.util.Hashtable;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    class jdbcshp1 {
        public static void main(String[] args) {
         Connection connection = null;
         try {
               Hashtable ht = new Hashtable();
               ht.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");  // Wanna get rid of this.
               ht.put(Context.PROVIDER_URL,"t3://localhost:7001"); // wanna get rid of this.
               // Get a context for the JNDI look up
               Context ctx = new InitialContext(ht);
            javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("myjndi1");
              //Create a connection object
              connection = ds.getConnection();
         The above code is working fine but, the two ht.put statements are creating problem.
    The problem is, after converting the application into WAR file it can be deployed
    on any machine or different port on same machine. My application fails if its deployed on
    weglogicserver which is at different port.
    Is there any way that i can get rid of those ht.put statements or any other way to solve the problem.
    any help is appreciated.
    Thanks in advance
    Pooja.

    Hai All,
    Firstly, thanks for ur reply.
    Even i have seen some code which uses context constructor with out any parameter and works fine.
    i dont understand why its not working for my code.
    When i remove those ht.put code and use context constructor with out any parameter, it giving an error.
    Context ctx = new InitialContext();
    javax.sql.DataSource ds = (javax.sql.DataSource) ctx.lookup ("ocjndi");
    connection = ds.getConnection();The error is as follows:
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
    the above error is forcing me to include those code but if the port number is changed the code will not work. Plz let meknow if some setting have to be made.
    I appreciate all ur valuable help.
    Thanks once again.
    Pooja.

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • Problem while updating a database table

    Hi experts,
                         I've used the FM 'HR_INFOTYPE_OPERATION' to update the database table. In that i used the MOD operation to update the Infotype PA0315.  But it return an error message like "Infotype does not exist". What could be the reason for this error?.
    regards,
    Shanthi.

    Hi,
          Here is my code for updation.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = P0315-pernr
    IMPORTING
    RETURN = wf_returne.
    Update Mode
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0315'
    NUMBER = P0315-PERNR
    SUBTYPE = P0315-SUBTY
    OBJECTID = P0315-OBJPS
    LOCKINDICATOR = P0315-SPRPS
    VALIDITYEND = P0315-ENDDA
    VALIDITYBEGIN = P0315-BEGDA
    RECORDNUMBER = P0315-SEQNR
    RECORD = P0315
    OPERATION = 'MOD'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = wf_return.
    Dequeue
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = P0315-PERNR.

  • Problem while updating the Support Package 17 on my SAP WAS SP9

    Hi,
    I'm facing problem while updating the Support Package 17 on my SAP WAS SP9
    ERROR 2006-10-13 10:23:22
    FSL-06002  Error 2 (The system cannot find the file specified.
    ) in execution of a 'CreateProcess' function, line (284), with parameter (java.exe ...).
    Please help me in this regard.....
    Thanks in advance...
    Satya

    Hello gentlemen, I am also having problem with the following running on 64 bit Windows and SQL2005/64 bit. I am erroring in Step 8 'Updating JDBC' driver. I am attempting to update from SP9 to SP18. The WEBAS Jave installed went flawless but I seem to be stuck here. Any help is appreciated...
    ERROR 2006-11-22 10:13:57
    FSL-06002  Error 2 (The system cannot find the file specified.
    ) in execution of a 'CreateProcess' function, line (284), with parameter (java.exe ...).

  • I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error.

    I have a problem when updated the new release of iphoto version(11 jun 2012). After that I cannot open any photo libraries and program is error. I must to force quit iphoto window. There are any fixed bug update.

    If you have no photos:
    Hold down the option (or alt) key key and launch iPhoto. From the resulting menu select 'Create Library' and start.
    Regards
    TD

  • Application Compatibility does not update the database.

    Hi,
     I am using application compatibility manager 6.1, and SQL server 2012 as database. ACT run ok and it create the XML file but it does not update the database at "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA" location.
    I can see the valid XML file but somehow the MDF file of database is not updated so my ACT windows does not showing anything on it.
    Any Help would be appreciated.
    Thanks
    Rakesh Patel
    rakesh patel

    Hi Rakesh,
    I am not sure if you have resloved your issue.
    But for helping others to know what to do if they meet the same issue as yours, I consider to mark the post as answered.
    If you would like further assistance, please post back and we will be always here to help you.
    Any concern about this mark behavior, you can just unmark it.
    Thanks for your understanding.
    Regards,
    Kelvin hsu
    TechNet Community Support

  • Problem in accessing the database through VPN

    I am having problem connecting to the database through VPN but it is working perfectly fine if i connect to the network directly.
    It would be really great if you could help me to resolve this issue.
    Thanks

    I am having problem connecting to the database through VPN but it is working perfectly fine if i connect to the network directly.Fix the VPN problem.
    Check the logfiles.
    For better advice provide any meaningful detail.
    If I do not poke myself in the eye, it does not hurt.
    Tell me to to stop feeling pain.

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * to reflect the data changed into internal table
          DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
          IF ref_grid IS INITIAL.
            CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
              IMPORTING
                e_grid = ref_grid.
          ENDIF.
          IF NOT ref_grid IS INITIAL.
            CALL METHOD ref_grid->check_changed_data.
          ENDIF.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Update the database structure from entity Framework Model

    Hello !
    I'm using VB.net , EF6 with SQL server 2008R2 database.
    This is the situation :
    I have created the application. Using wizard I have created the Entity model from an existing database.
    A client start using this application using this database on his computer.
    After some month , I made some modifications on the database and I have updated the model on my application .
    Now I have a new .exe file that has the new model from the new database.
    I put the new .exe file on the client computer.
    Now on his computer : The .exe file has the new database model , but the sql server database has the old structure.
    I want to know : Is possible to update the database structure from the entity model on application ?
    I want to add a command on application that can make ( if is possible ) this update , so the database become up to date according to entity model ?
    Thank you !

    Hello,
    From your description, it seems that you want to apply a migration for a database first approach, unfortunately, as far as I know, EF Migrations is a product targeted at Code First and doesn't support Database First operations. A workaround I know is to
    use update-scripts. If your database structure would be changed frequently, it is recommended to use the Code First approach which would have a better workaround for migrations, for details, you could refer to this
    video,
     and with the
    Entity Framework Power Tools, it is easy to create a code first based project form an existing database.
    Regards.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Using Tabstrip update the database table

    Hi Guy's,
    I created two screens(100 & 110).
    Click 1 pushbutton HRP1000 related information is displayed.
    Click 2 pushbutton it displays HRP1001 relatd information.
    worked to read the data from the Database tables and output displayed sucessfuly .   However i want to entered data in those fields wants to update to database table.
    Please friends help me how to work this senario.
    Thanks and Regards,
    Sai.

    Hi Guy's,
    To update the database records, wrote the logic in PAI
       WHEN 'SAVE'.
        INSERT HRP1001.
    INSERT INTO HRP1001  VALUES wa_P2.
    it displaying an error message " the work area wa_p2 is not long enough.
    and also i tried using it_p2
    it displaying an error message " you can't use internal table as work area".
    Please help me friends  it is very urgent.
    Thanks and Regards,
    Sai.

Maybe you are looking for