How to insert

Hi,
I have a table in mysql. It has 4 attributes: int(11), varchar(50), longtext and date 0000-00-00.
int(11) is primary key, auto-increment and null value.
I use a JSP page to pass the parameters to the servlet as follows:
pstmt = conn.prepareStatement("insert into report values(?,?,?)");
pstmt.setString(1,CurReportItem.getName());
pstmt.setString(2,CurReportItem.getContent());
pstmt.setString(3,CurReportItem.getReportDate());It throws SQL exception.
I tried to test the mysql on command line as follows:
insert into report values (Robert,This is a test.,2003-06-26);
It showed an error 1064.
How can I fix it?
I can insert into report (reportdate) values ('2003-06-26');
I can insert into report (reportcontent) values ('This is a test.');
Thanks for help

insert into report(reportname, reportdate, reportcontent) values (?,?,?)
You have to specify each column to insert because you are using an auto increment. The number of columns is incorrect witht the original statement. The database expects for entries for this insert into report values(?,?,?) not three.

Similar Messages

  • How to Insert Image in a Column of a table

    Hi
    I have read several documentations but still could not find any relevant one that can help me in inserting a image in a BLOB column of a table.I have read about DBMS_LOB but still not clear how to insert an image in the table.
    I followed following steps :
    create table Emp_Identity(Id Number,Photo BLOB);
    Insert Into Emp_Identity(1,'d:\vishal.bmp');
    Please tell me steps to be followed.
    Regards
    Vishal Chaudhry
    null

    I am using Developer 2000 Forms 6i as Front End (Oracle 8.1.6)
    My table structure is:
    SQL> desc test_lob
    Name Data Type
    ID NUMBER
    NAME VARCHAR2(100)
    PHOTO BLOB
    SOUND BINARY FILE LOB
    IS there any way to display the BFILE contents on the frontend.....?
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by vishal chaudhry ([email protected]):
    Hi,
    I could actually insert an image in a BLOB type column from the backend(Sql plus) not directly but by using BFILE and see that image on the frontend (Forms 6i Developer 2000,Item type is Image as there is nothing like BLOB/BFILE in front end) using the following procedure :
    IS there any way I can insert an image directly in a BLOB column from the backend rather than using BFILE?
    CREATE OR REPLACE PROCEDURE loadLOBFromBFILE_proc IS
    Dest_loc BLOB;
    Src_loc BFILE := BFILENAME('SOUND_DIR', '123w.bmp');
    ** SOUND_DIR is a logical directory created by giving path of the server
    ** Create Directory SOUND_DIR as 'd:\u020\o816\ctx\test'
    ** d:\u020\o816\ctx is the physical path of the server \\pslndb\ctx$
    ** test is the dummy testing directory created on the server
    ** 123w.bmp is lying in the test directory
    Amount INTEGER ;
    BEGIN
    Amount := DBMS_LOB.GETLENGTH(Src_loc);
    SELECT photo INTO Dest_loc FROM test_lob
    WHERE ID = 1
    FOR UPDATE;
    /* Opening the source BFILE is mandatory: */
    DBMS_LOB.OPEN(Src_loc, DBMS_LOB.LOB_READONLY);
    /* Opening the LOB is optional: */
    DBMS_LOB.OPEN(Dest_loc, DBMS_LOB.LOB_READWRITE);
    DBMS_LOB.LOADFROMFILE(Dest_loc, Src_loc, Amount);
    /* Closing the LOB is mandatory if you have opened it: */
    DBMS_LOB.CLOSE(Dest_loc);
    DBMS_LOB.CLOSE(Src_loc);
    COMMIT;
    END;
    <HR></BLOCKQUOTE>
    null

  • How to insert horizontal lines in alv report?

    hi,
        i have to insert horizontal lines in alv report.( RM07MLBB )
            actually my requirement is:
                               basis list = RM07MLBB.
    first secondary list = another report is called here ( RM07DOCS )
                      i want to insert horizontal lines in the first secondary list, when i execute individually RM07DOCS , i can get horizontal lines, but when i dounle click in the basic list --> in the first secondary list , i am not getting the horizontal lnes.
    functional modules used are REUSE_ALV_HIERSEQ_LIST_DISPLAY & REUSE_ALV_GRID_DISPLAY.
        here in this program,
                        is_layout = alv_layout.
    hence i tried to give     
                  alv_layout-no_hline = ' '. 
    but not effecting.
              can some one please tell me , how to insert lines in the alv report.
    thanks in advance,
    Dastagir.

    hello,
         so i cannot insert horizontal lines in the first secondary list according to my sorting condition, i.e., in a single block there should be :
           if same delivery challan number is repeating they should come in the same block,
    for the corresponding delivery challen number, if have po number, is repeating , they also should come in the same block.
                       in this way i have to seperate the blocks containing EXNUM , EBELN CONDITIONED.

  • How to insert data into the mysql table by giving as a text file

    Hi,
    Any one know's how to insert data into the mysql table by giving as a text file as the input in JSP.Please respond ASAP.
    Thanks:)

    At least you can try StringTokenizer to parse your text files. Or download a text JDBC driver to parse your files, for instance, HXTT Text(www.hxtt.net) or StelsCSV(www.csv-jdbc.com).

  • How to insert a picture into excel file using ALE AUTOMATION

    Hi every body,
    I have to write report that export data from abap to exel the data contain a logo but I don't know how to insert picture to excel using ALE AUTOMATION.
    Please help me!
    Thank you!

    Hi,
    you have to join into SAP Code Exchange and download this zip:
    [ABAP2XLSX_daily.nugg.zip|http://code.sdn.sap.com/spaces/abap2xlsx/documents/btFzHQ3vKr36tCeJe7bhNc/download/btFzHQ3vKr36tCeJe7bhNc]
    Regards,
    Ivan

  • I have an ipod touch and lyrics dont show up when i play a song. i know how to insert lyrics they  just dont show up. what can i do?

    i  have an ipod touch and lyrics dont show up when i play a song. i know how to insert lyrics they  just dont show up. what can i do?

    Are you trimming the videos on the iPod?
    http://blogs.vancouversun.com/2010/09/20/how-to-fix-out-of-sync-audio-on-videos- taken-with-your-iphone-or-ipod-touch-4g/
    Also see:
    https://discussions.apple.com/message/12873340#12873340

  • How to insert a number using ADO or OLEDB by oracle provider

    I create a talbe .
    Create Table A
    (id number(7));
    I use ADO to access the table a;
    _ConnectionPtr pConn=NULL;
    pConn.CreateInstance(__uuidof(Connection));
    _RecordsetPtr pRst=NULL;
    pRst.CreateInstance(__uuidof(Recordset));
    pConn->Provider="OraOLEDB.Oracle.1";
    try
         pConn->Open("","ISVISION","ISVISION",NULL);
         pRst->CursorLocation=adUseClient;
         pRst->Open("A",pConn.GetInterfacePtr(),adOpenStatic,adLockOptimistic,adCmdTable);
         pRst->AddNew();
         pRst->Fields->Item[0L]->Value=100L;
    //It raise a exception,why?
    //If I convert the datetype of "ID" to CHAR(7)
    //and pRst->Fields->Item[0L]->Value=L"100",it is ok.
         pRst->Update();
         pRst->Close();
         pConn->Close();
    catch (_com_error& e)
         MessageBox(e.Description(),"error",MB_OK|MB_ICONWARNING);
         return ;
    if (pConn)
    pConn.Release();
    if (pRst)
    pRst.Release();
    I create a table A。
    create table A
         ID number(7)
    Now ,I use OLE DB to access the table A;
    struct CIsA
         CIsA()
              memset(this, 0, sizeof(*this));
    public:
         DB_NUMERIC m_ID;
         BEGIN_COLUMN_MAP(CIsA)
              COLUMN_ENTRY_PS(1, 7, 0, m_ID)
         END_COLUMN_MAP()
    DEFINE_COMMAND(CIsA, _T("SELECT ID FROM A"))
    CDataSource DataSource;
    HRESULT hrt=DataSource.Open(_T("OraOLEDB.Oracle.1"),NULL,_T("ISVISION"),_T("ISVISION"));
    CSession Session;
    hrt=Session.Open(DataSource);
    CDBPropSet propset(DBPROPSET_ROWSET);
    propset.AddProperty(DBPROP_IRowsetChange, true);
    propset.AddProperty(DBPROP_UPDATABILITY,
         DBPROPVAL_UP_INSERT | DBPROPVAL_UP_CHANGE | DBPROPVAL_UP_DELETE);
    CCommand<CAccessor<CIsA> > Command;
    Command.Open(Session,NULL,&propset);
    tcscpy((TCHAR*)Command.mID.val,_T("1245"));
    Command.m_ID.sign=1;
    hrt=Command.Insert();//It is wrong,why?
    Command.Close();
    Session.Close();
    DataSource.Close();
    In Fact,the two problems is the same. The key of problem is how to insert a number into oracle.
    help me! thank you.

    hi
    create a table something like this.
    create table image(
    Image_Id number(5),
    Image    blob);create a form with the same table and use the following code.
    when-button-pressed trigger.
    read_image_file('c:\image_name.jpg' , 'jpg' , 'image.image');if its correct/helpful please mark it thanks.
    sarah

  • How to insert sales text (MM02) into a single record of a Ztable.

    Hi,
    I'm extracting data from different data base tables and populating a Ztable which has Matnr as primary key and sales text as a field.
    I have already used READ_TEXT to display the text and it is displayed in multiple records which in turn leads to duplication of Material numbers.
    Now I want to avoid duplication of records (Matnr) as this being a primary record, and display the sales text of a particular material number into one single record.
    Can anyone tell me how to insert sales text (MM02) transaction into one single record.
    Thanks,
    Govind

    sorry i am not enough clear about your requirement...
    as i can understand i am explaining to you.
    suppose your itab contains repaeating matnr.
    matnr
    1
    1
    2
    2
    2
    3
    3
    like this.
    data : text(200),
             matnr like mara-matnr.
    loop at itab.
    call READ_TEXT fnmodule.
    loop at tline.
    concatenate text tline-tdline into text.
    endloop.
    matnr = itab-matnr.
    at end of matnr.
    itab1-matnr = matnr.
    itab1-text = text.
    append itab1.
    clear text.
    endat.
    endloop.
    NB change the code as per your requirement
    regards
    shiba dutta

  • How to Insert the Text in Selected Text Frame-Reg.

    Dear all,
    I am using the SnipperRunner - SDK, and create the TextFrame, but I can't insert the Text in the Particular Frame. so please give me the soultions,
    (*) Create TextFrame is ok,
    (*) Select TextFrame is also ok,
    (*) now, my Query ->
    How to Insert the Text in the Selected Frame?. (or)
    How to Link the Selectable Frame and my Text.? (or)
    How come to know the TextFrame is select?.
    Please any one can suggest me through the Coding....I will appreciate you...
    Thanks & Regards,
    T.R.Harihara SudhaN

    Hi,
    you have to get the TextModel associated with the textframe. Once you got that, ITextModel has an Insert()-method. You could also process kInsertTextCmdBoss - there are quite a few examples around. I believe WriteFishPrice also inserts text into a frame, just as an example. Good luck ...
    Bernt

  • How to insert check box fields in a htmlb: tableview

    Hi,
    Can anybody tell me how to insert check box fields in a htmlb: tableview in a sequence of rows in a table view. How to generate the sequence no for the checkbox inorder to know the row that is checked.
    Thanks in advance,
    Aruna.

    Here is the code which has the custom "Checkbox" in the tableview & Triggers the event. <b>You can identify the checkbox based on cell ID (p_cell_id)</b> in the method "IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START" & Based on the event name + Cell ID. Look at the code & let me know if you any issue.
    <b>Layout:</b>
    <%@page language="abap" %>
    <%@extension name="htmlb" prefix="htmlb" %>
    <htmlb:content id               = "content"
                   design           = "design2002+design2003"
                   controlRendering = "SAP"
                   rtlAutoSwitch    = "true"
                   forceEncode      = "ENABLED" >
      <htmlb:page title="Test " >
        <htmlb:form>
          <%
      data TV_ITERATOR Type Ref To zcl_itr.
      data iterator type ref to IF_HTMLB_TABLEVIEW_ITERATOR.
      create object tv_iterator exporting appl_cons = application.
      iterator = tv_iterator.
          %>
          <htmlb:tableView id              = "fligts"
                           headerText      = "Flight"
                           width           = "100"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "10"
                           fillUpEmptyRows = "true"
                           showNoMatchText = "true"
                           filter          = "server"
                           sort            = "server"
                           onHeaderClick   = "MyEventHeaderClick"
                           table           = "<%= APPLICATION->itab %>"
                           iterator        = "<%= ITERATOR %>" />
        </htmlb:form>
      </htmlb:page>
    </htmlb:content>
    <b>Event Handling:</b>
    DATA: EVENT_ID1 TYPE REF TO IF_HTMLB_DATA.
    EVENT_ID1 = CL_HTMLB_MANAGER=>GET_EVENT_EX( REQUEST ).
    CASE EVENT_ID1->EVENT_SERVER_NAME.
    IF NOT event_id1 IS INITIAL.
       if event_id1->server_event+0(9) = 'chkevent'.
      SPLIT event_id1->server_event AT '-' INTO v_event v_dummy v_row v_col.
      endif.
    endif.
    method IF_HTMLB_TABLEVIEW_ITERATOR~GET_COLUMN_DEFINITIONS.
         CLEAR p_column_definitions.
        CLEAR p_overwrites.
        DATA: tv_column  TYPE TABLEVIEWCONTROL.
        tv_column-COLUMNNAME  = 'FLDATE'.
        tv_column-edit        = 'X'.
        tv_column-sort        = 'X'.
        tv_column-TITLE               = 'Flight Date'.
        tv_column-WIDTH  = '100'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CONNID'.
        tv_column-TITLE               = 'Conn.ID'.
        tv_column-WIDTH  = '70'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
        CLEAR tv_column.
        tv_column-edit        = 'X'.
        tv_column-COLUMNNAME          = 'CHECKBOX1'.
        tv_column-TITLE               = 'Check Box'.
        tv_column-WIDTH  = '30'.
        tv_column-HORIZONTALALIGNMENT = 'center'.
        APPEND tv_column TO p_column_definitions.
    endmethod.
    METHOD IF_HTMLB_TABLEVIEW_ITERATOR~RENDER_CELL_START.
           DATA: L_EVENT TYPE STRING.
      CASE P_TABLEVIEW_ID.
        WHEN 'fligts'.
          CASE P_COLUMN_KEY.
            WHEN 'CHECKBOX1'.
    *          CONCATENATE 'chk_event' '123' '2323' INTO L_EVENT SEPARATED BY '-' .
    CONCATENATE 'chkevent' p_cell_id INTO l_event SEPARATED BY '-'.
              P_REPLACEMENT_BEE = CL_HTMLB_CHECKBOX=>FACTORY( ID = P_CELL_ID
            ONCLICK = L_EVENT CHECKED = 'false' ).
          ENDCASE.
      ENDCASE.
    ENDMETHOD.
    Hope this will solve your problem.
    <b><i>* Reward each helpful answer.</i></b>
    Raja T
    Message was edited by:
            Raja T

  • How to insert check box value in table?

    Hi all
    kindly help me how to insert check box value in database. what code i have to use as i am new in programing.
    thanx in advance

    Hi,
    There is no "Check box" in a table, a check box is a GUI (Graphical user interface) item.
    What you want is to store a boolean value in a table. For that you can use the varchar2(1) datatype and store Y or N. (or anything else)
    (you cannot define boolean as a datatype for a column).
    If you're using a front-end application like apex then it might be useful for you to read the documentation about chekc boxes :
    http://download.oracle.com/docs/cd/E10513_01/doc/appdev.310/e10497/check_box.htm#CHDDFBFH
    (for the rest if it's Oracle Forms then everything is already said).
    Edited by: user11268895 on Aug 17, 2010 10:44 AM

  • How to insert check box in pages?

    This may be a dumb question, but how to insert  check box in Pages?  Thanks

    Hi ...
    Try this thread >  Checkboxes in Pages?: Apple Support Communities

  • How to insert new line in a text file

    hi all,
    i wnat to know how can i insert a new line in a text file using java.
    for example i want the formate of the text like this
    1 2 3
    4 5 6
    until now i know only how to insert data but not new line.
    Thanks in advandce

    Hi you can put a new line in a text file using System.getProperty("line.separator"). This implementation will work for every OS.
    import java.io.*;
    class Demo{
    public static void main(String args[]) throws Exception {
    FileWriter fr = new FileWriter("FileDemo.txt");
         fr.write("AAAAAAAAAA");
    fr.write(System.getProperty("line.separator"));
    fr.write("AAAAAAAAAAA");
    fr.close();
    }

  • How to insert new line in the copied schema with transaction code PE01?

    Dear Experts,
             I have copied HKT0 to ZKT0 , i want to insert new line between  line 150 and line 160 in ZKT0, I don't know how to insert new line 160, who can tell me ?
             Looking forward to your reply.
    Best Regards,
    Merry

    Hi,
    1. Open your schema,
    2. In first colume "Line" select line where you want to add new line,
    3. Replace first value in the column field (that indicates number of line) with character I (means insert),
    4. Press enter
    The line will be added. The same way you can add lines to PCR.
    To delete use character D.
    Cheers

  • How to insert the style in sap-script? and in smart form?

    how to insert the style in sap-script? and in smart form?

    Hi..,
    For SAP scripts u need to create them in SE72 ...
    and u can include them in the script editor as..
    /: STYLE <STYLE-NAME>
    P1 text...............  (*** P1 is the Paragraph format created in SE72 )
    /: STYLE *
    For smartforms u need to go for the transaction (tcode) SMARTSTYLES... here u can create paragraph and character formats globally...
    <b>Sunil, plz do remember to close all your threads, when ur problem is solved !!</b>
    reward all helpful answers,
    sai ramesh

  • How to insert a row in oracle

    how to insert a row in oracle if we have three colums all are number datatype i want one of the column blank;

    Hi,
    James has replied to your question ..
    you seem to be new to sql
    just adding to it for you information.. that in this case col2 will have NULL value.
    I suggest you may please read the startup docs... They shall help you to unserdstand the sql better.
    http://www.w3schools.com/sql/default.asp
    Regards

Maybe you are looking for