Update ztable from database table directly

hi all,
can u tell me the possible ways to update a ztable from database table directly.
i mean is there anyway to update ztable whenever entry is created in database table .
i dont want to update using insert,modify statements.
points will be rewarded to all hlpful answers.

A slightly dirty solution:
Use SAP functions for reading from CDHEADER and CDPOS tables [with enough filters such that you extract minimum records possible] to read changes to MARA table fields since last run of your program. Use this information to update your ZTABLE. I would recommend having a table maintainance generator on ZTABLE. The actual update should be by a BDC by calling transaction SM30 for ZTABLE maintainance. Now the program may be set up as a batch job running 1ce an hour. You get updates to the extent of 1 hour latency.
Alternatively, you may look if an opportunistic BADI / user Exit is there alongside MM01/02 transactions - assuming the latter are the only ones updating MARA. In this BADI you may write the code to update ZTABLE- again, look to do it by BDC call transaction sm30 to maintain ZTable. To lighten up the code -load on BADI you may simply raise a custom event and move on. You will configure a job that runs your program when that particular event is raised. This will need the 'burden' of figuring out the changes, though.
An elegant way would be to fire a MATMAS fIDOC for every change to Material, capture that and turn back the changes to ZTABLE. This will facilitate the delta load.

Similar Messages

  • Update ztable from internal table

    I want to update the Ztable from internal table datas.
    what is the syntax to update.
    Its urgent send with coding example is better

    Hi
    PARAMETERS: p_carrid TYPE sflight-carrid,
                percent(1) TYPE p DECIMALS 0.
    DATA sflight_tab TYPE TABLE OF sflight.
    FIELD-SYMBOLS <sflight> TYPE sflight.
    SELECT *
           FROM sflight
           INTO TABLE sflight_tab
           WHERE carrid = p_carrid AND
                 fldate = sy-datum.
    IF sy-subrc = 0.
      LOOP AT sflight_tab ASSIGNING <sflight>.
        <sflight>-price =
          <sflight>-price * ( 1 - percent / 100 ).
      ENDLOOP.
    ENDIF.
    <b>UPDATE sflight FROM TABLE sflight_tab.</b>
    Thanks
    Vijay
    PLZ reward points if helpful

  • Update JList from database table

    Hi! I have a JList that take some value from a mysql table. I want that the JList add or remove value when insert or delete row from db table.
    Can you help me?

    Well then you need to write the add/remove code of the JList yourself. So when ever you updated the database you update the ListModel as well.
    Read the JList API and follow the link to the Swing tutorial on "How to Use Lists" for a working example that dynamically updates a ListModel.

  • Updating ztable from the table maintenance

    hi,
           I want to knw how and where to check , whether the records which user has entered in the table control of new entries screen exists in the ztable table or not . if the same record exists then that record should not go for saving it shd be deleted when it is detected that it exists in the ztable . can any one tell me how . where and what code to be written . so that the duplicate entries are deleted and others entries get appended in the database.
    thank you.

    Hi
    if you have declared some Primary key fields then by default when you enter the records in the Table maintenance using SM30 it will not allow duplicate records with the same key fields
    You can check the Table entries in SE16 Tcode
    go to Se16 enter table name execute and see the table records
    Reward points for useful Answers
    Regards
    Anji

  • Need to update Ztable from final internal table

    Hi,
    ITAB   = Final internal table has 9 fields : 1 2 3 4 5 6 7 8 9
    Ztable = Ztable has 6 fields ex : 1 3 4 6 7 8
    Structure of both Itab and Ztable are different.
    I have data in the Final Internal table and needs to update data into a ztable.
    If condition is true...
      Modify ztable from itab
    endif.
    Any suggestions how I can update Ztable from the INternal table
    Regards,
    Kittu

    Hello,
    First keep the loop to the final internal table then move all the records to the work area after moving to workarea then create another workarea for the Ztable then move only the field values which are there in Ztable then use modify keyword.
    example
    move:
    y_wa_final_itab-kdauf to y_wa_zhr_item-vbeln,
    y_wa_final_itab-kdpos to y_wa_zhr_item-posnr,
    y_wa_final_itab-receiptno to y_wa_zhr_item-receiptno
    modify zhr_item from y_wa_zhr_item

  • Updating SAP-HR database(Oracle) directly

    Hi All,
    Please let me know the pros and cons of updating the SAP-HR infotypes (database tables directly in oracle through backgound). Can the user licensing cost can be reduced with this Approach.?
    Regards,
    J.S

    Hi Dirk,
    Thanks for your reply. "You can easily get access at table level by using it as source in a dataflow. This works fine for extracting data from a single table. "  I do not have experience on DS 4.2. Does the table refer to SAP Dictionary table or data base table? As I know, there is a RFC since DS 4.1. But it still extracts data from SAP ERP application table (first sap application connection, not database). Someone told me it is possible extracting data directly from database table on DS 4.2. Just wonder about it. Can you clear it for me? Thanks.

  • Updating values in database table through Transaction

    Hi,
    Actually We have one transaction named EWAWA01. In that when we display the values from the transaction, there is a netweight field. The transaction displaying netweight values, but that value is not updated in the database table named EWA_WA_WEIGHPROC. How can i update that netweight value in the table.

    data:v_v_EWA_WA_WEIGHPROC type  (v_EWA_WA_WEIGHPROC lenth) c.
    decleare the data in charter type.
    after pass the data charter type.
    v_EWA_WA_WEIGHPROC = EWA_WA_WEIGHPROC
    update db.

  • Dynamic record deletion from database table

    Hi,
    I need to delete selected records from database table(dynamic names). Table names are being passed from main program with some of their field names. The record to be deleted from the database table is being decided based on the fields passed for the table and their contains passed from the main program.
    It is not possible to write dynamic where clause for DELETE statement directly.
    So, I created a dynamic internal table and i am trying to fetch all records using SELECT statement(for which we can write dynamic where condition, something like...SELECT...WHERE (itab).  ) which need to be deleted in the iternal table.
    Piece of code :
              CONCATENATE c_im v_tablefield1 INTO v_imprtfield1.
              CONCATENATE v_tablefield1 c_in v_imprtfield1
                       into s_condition separated by space.
              APPEND s_condition TO t_condition.
              PERFORM GET_DYNAMIC_ITAB USING s_flds_agtab-tabname
                                    changing t_itab.
              ASSIGN t_itab->* TO <itab>.
    *Select the data (to be deleted) from the database table
               SELECT * FROM (s_flds_agtab-tabname) INTO TABLE <itab>
                 WHERE (t_condition).
    *Delete the records from the table
               IF SY-SUBRC = 0.
                 DELETE (s_flds_agtab-tabname) FROM TABLE <itab>.
               ENDIF.
    Here t_condition is of standard table of WHERETXT.
    t_condition at the run time before giving dump was:
    SPART IN IM_SPART
    AND KUNNR IN IM_KUNNR
    Here IM_SPART is renge type of SPART and IM_KUNNR is renge of KUNNR.
    I am getting a DUMP:
    The WHERE condition has an unexpected format.
    Error analysis                                                                               
    The current ABAP/4 program attempted to execute an ABAP/4 Open SQL
    statement containing a WHERE condition of the form WHERE (itab) or
    WHERE ... AND (itab). The part of the WHERE condition specified at
    runtime in the internal table itab contains the operator         
             IN (v1, ..., vn)                                        
    in incomplete form.                                              
    How to correct the error
    If the error occurred in a non-modified SAP program, you may be  
    able to find a solution in the SAP note system.                  
    If you have access to the note system yourself, use the following
    search criteria:                                                 
    "SAPSQL_IN_ILLEGAL_LIST"                               
    "SAPLZSD_TAB_REFRESH " or "LZSD_TAB_REFRESHU01 "       
    "Z_SD_REFRESH_AGTABLES"                                
    If you cannot solve the problem yourself, please send the
    following documents to SAP:                             
    I would like to know whether "IN" operator is allowed in (itab) of WHERE clause. While testing I changed the "IN" to "=" specifying a suitable value there. It worked. So please let me know if i can give "IN" operator using renge table in the dynamic where clause.
    Thanking you,
    Surya

    Hi again,  so if you can not use the IN in a dynamic where clause you might be forced to dynamically build the entire select statement,  Here is a sample program which may give you some ideas, notice that we are writing the select statement code, putting it in another program and generating the subroutine at runtime, then call this routine.  I'm sure that this will help you see what you need to do.
    report zrich_0003 .
    tables: kna1.
    types: t_source(72).
    data: routine(32) value 'DYNAMIC_SELECT',
                 program(8),
                 message(128),
                 line type i.
    data: isource type table of t_source,
                xsource type t_source.
    ranges:
            r_kunnr for kna1-kunnr.
    data: ikna1 type table of kna1.
    data: xkna1 type kna1.
    r_kunnr-sign = 'I'.
    r_kunnr-option = 'EQ'.
    r_kunnr-low    = '0001000500'.
    append r_kunnr.
    xsource = 'REPORT ZTEMP.'.
    insert xsource  into isource index 1.
    xsource = 'FORM dynamic_select'.
    insert xsource  into isource index 2.
    xsource = 'Tables r_kunnr ikna1.'.
    append xsource to isource.
    xsource = 'select * into table ikna1 from kna1'.
    append xsource to isource.
    xsource = 'where kunnr in r_kunnr.'.
    append xsource to isource.
    xsource = 'ENDFORM.'.
    append xsource to isource.
    generate subroutine pool isource name program
                             message message
                             line line.
    if sy-subrc = 0.
      perform (routine) in program (program) tables r_kunnr
                                                    ikna1.
    else.
      write:/ message.
    endif.
    loop at ikna1 into xkna1.
      write:/ xkna1-kunnr.
    endloop.
    Regards,
    Rich Heilman

  • Creating a external content type for Read and Update data from two tables in sqlserver using sharepoint designer

    Hi
    how to create a external content type for  Read and Update data from two tables in  sqlserver using sharepoint designer 2010
    i created a bcs service using centraladministration site
    i have two tables in sqlserver
    1)Employee
    -empno
    -firstname
    -lastname
    2)EmpDepartment
    -empno
    -deptno
    -location
    i want to just create a list to display employee details from two tables
    empid firstname deptno location
    and same time update  in two tables
    adil

    When I try to create an external content type based on a view (AdventureWorks2012.vSalesPerson) - I can display the data in an external list.  When I attempt to edit it, I get an error:
    External List fails when attached to a SQL view        
    Sorry, something went wrong
    Failed to update a list item for this external list based on the Entity (External Content Type) 'SalesForce' in EntityNamespace 'http://xxxxxxxx'. Details: The query against the database caused an error.
    I can edit the view in SQL Manager, so it seems strange that it fails.
    Any advice would be greatly GREATLY appreciated. 
    Thanks,
    Randy

  • How to update Ztable from Excel file and how to check conditions ,

    HI this uday,
    pls help me how can i update Ztable from Excel file and how to check conditions .
    regards
    uday
    Moderator message: please (re)search yourself before asking.
    Edited by: Thomas Zloch on Jul 13, 2010 12:00 PM

    Hi
    Use Fm : ALSM_EXCEL_TO_INTERNAL_TABLE.
    L_INTERN : internal table with your fields .
    make sure that the fields in the Excel should be formatted (as numeric , characher ) depending upon the data types .
    LOOP AT L_INTERN INTO WA_LINTERN .
            MOVE WA_LINTERN-COL TO L_INDEX.
            ASSIGN COMPONENT  L_INDEX OF STRUCTURE WA_INREC TO <FS> .
            IF SY-SUBRC = 0.
              MOVE WA_LINTERN-VALUE TO <FS>.
            ENDIF.
            AT END OF  ROW .                                    "#EC *
              APPEND WA_INREC TO IT_DATA.  "
              CLEAR WA_INREC.
            ENDAT.
         ENDLOOP.
    Regards
    Swapnil

  • Efficient way of updating data to database table

    what is the efficient way of updating data to database table  .
    i have huge amount of data in my internal table  , how to use update statement in this case .
    1. database table having 20 fields  ,
    2. one is key field and suppose 20 th field i want to change  .
    3. I have data for only 2 fields , i.e for ( 1 st and last 20 th field ) .
    i can't use update statement in loop , as it is not good practice(hits database several times ) .
    do it effects all the 20 fields for  particular record .

    Hi,
    Use UPDATE statement , check below description from SAP help.
    UPDATE dbtab FROM TABLE itab. or UPDATE (dbtabname) FROM TABLE itab.
    Effect
    Mass update of several lines in a database table.Here, the primary key for identifying the lines tobe updated and the values to be changed are taken from the lines of theinternal table itab. 
    The system field SY-DBCNT contains the number of updated lines,i.e. the number of lines in the internal table itab which havekey values corresponding to lines in the database table.
    Regards
    L Appana

  • Delete entries from Database table  t71inp1

    Hi,
    I want to Delete entries from Database table  t71inp1. Its a H R Table. I want to know the exact code.
    i saw the cide delete bkpf where usnam = p_name.
    Will it work the same here. Also.
    Please let me know.
    I hope to get reply from you soon.
    where should i write the code. i.e. Tcode SE38 and directly deeleting write the code.
    Please give me some inputs. I am new to H R ABAp
    Shivakumar K B
    919886920258

    hi
    You can write a program in se38.
    create a program.
    use delete from t71inp1 where<condition> command in it.

  • Extract data from database tables and download in pdf and csv

    extract data from database tables and download in pdf and csv
    hi how can i re-write my old form procedure in adf java. the procedure used to extract data from diffirent table and dowload the data in pdf and csv.am not downloading image, i what to extract data from diffirent tables in my database and download that data in pdf and csv. i would like to write this in java adf.i just what direction am not asking anyone to do my work this is my learning curve
    the form code is
    function merge_header3 return varchar2 is
    begin
         return '~FACILITY DESCRIPTION~ACCOUNT NO~BRANCH CODE~BANK REF NO.~P/P/ AMOUNT~Postal Address 1~Postal Address 2~Box Postal Code~Dep. Date~Month~BANK NAME~BRANCH NAME~ACCOUNT TYPE~DESCRIPTION~OBJECTIVE DESCRIPTION';
    end;
    procedure download_file (i_pbat integer) is
      dir varchar2(80);
      file_name1 varchar2(80);
      file_name2 varchar2(80);
      appl_code varchar2(80);
      fil1 client_text_io.file_type;
      fil2 client_text_io.file_type;
      dat varchar2(1000);
      DATA VARCHAR2(1000);
      bvspro varchar2(100);
      ssch   varchar2(100);
      bvspro_total number(20,2);
      ssch_total   number(20,2);
      grand_total  number(20,2);
      cnt    integer;
      cursor pbat is
           select *
           from sms_payment_batches
           where id = i_pbat
      cursor pay  (pb_id integer) is
           select *
           from sms_payment_vw
           where pbat_id = pb_id
           order by subsidy ASC,programme,beneficiary_name
      cursor cgref (low varchar2) is
           select *
           from cg_ref_codes
           where rv_domain ='SMS'
           and rv_low_value = low
      success boolean;     
      begin  
           set_application_property(cursor_style,'busy');
           appl_code := sms_global.ref_code('SMS','APP_CODE','SMS',0);
        dir       := sms_global.ref_code('SMS','PAY_DIR','c:\sms\batch_payments',0);
             success := webutil_file.create_directory(dir);
         if webutil_file.file_is_directory(dir) then
             null;
    --         message ('directory exists');
        else
    --                  message ('create directory ');
             success := webutil_file.create_directory(dir);
    --         if success then        message ('directory exists');    end if;
        end if;     
        for c_pbat in pbat loop
             file_name1 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'pay.txt';
             file_name2 := dir ||'\' || appl_code||c_pbat.batch_number||'-'||to_char(c_pbat.batch_dt,'yyyymmdd')||'merge.txt';
    --message('create files ');
    --         fil1  := client_text_io.fopen (file_name1,'W');
    --         fil2  := client_text_io.fopen (file_name2,'W');
        fil1  := client_text_io.fopen (file_name1,'W','');
        fil2  := client_text_io.fopen (file_name2,'W','');
                   dat :=                       'FROM ACCOUNT NUMBER'
                                                                ||'~'||'FROM ACCOUNT DESCRIPTION'
                                                                ||'~'||'MY STATEMENT DESCRIPTION'
                                                                ||'~'||'BENEFICIARY ACCOUNT NUMBER'
                                                                ||'~'||'BENEFICIARY SUB ACCOUNT NUMBER'        
                                                                ||'~'||'BENEFICIARY BRANCH CODE'
                                                                ||'~'||'BENEFICIARY NAME'
                                                                ||'~'||'BENEFICIARY STATEMENT DESCRIPTION'
                                                                ||'~'||'AMOUNT';
             --     client_text_io.put_line(fil1,dat);
             bvspro:= null;
             ssch  := null;
             cnt := 0;     
             dat := '~'||lpad('~',16,'~');
             for c_pay in pay(c_pbat.id) loop
    --message('cpay loop ' || cnt);              
               if bvspro is null then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     grand_total := 0;
                     bvspro_total := 0;
                     ssch_total := 0;
               end if;
               if bvspro <> c_pay.programme then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,bvspro_total,dat,'~');
               dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                     client_text_io.put_line(fil2,dat);
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
                     dat := utility.put_field(1,c_pay.programme,dat,'~');     
               client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     bvspro := c_pay.programme;
                     ssch := c_pay.subsidy;
                     bvspro_total := 0;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
               if ssch <> c_pay.subsidy then
                     dat := lpad('~',16,'~');
                     dat := utility.put_field(5,ssch_total,dat,'~');
                     dat := lpad('~',16,'~');
               client_text_io.put_line(fil2,dat);
               dat := utility.put_field(1,c_pay.subsidy,dat,'~');
               client_text_io.put_line(fil2,dat);
               dat := merge_header3;
                     client_text_io.put_line(fil2,dat);
                     ssch := c_pay.subsidy;
                     ssch_total := 0;
                     cnt :=0;
             end if;                           
            bvspro_total := bvspro_total + c_pay.amount;
            ssch_total   := ssch_total   + c_pay.amount;              
                  grand_total  := grand_total  + c_pay.amount;              
            cnt := cnt +1;
    --message('bfore write file 2 ' );              
            client_text_io.put_line(fil2
                                   ,cnt
                            ||'~'|| c_pay.beneficiary_name
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER ||''            
                                                                ||'~'||c_pay.BRANCH_CODE             ||''           
                                                                ||'~'|| c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'|| c_pay.AMOUNT                                
                            ||'~'|| c_pay.address_line1
                            ||'~'|| c_pay.address_line2
                                                    ||'~'|| c_pay.postal_code
                                                    ||'~'|| TO_CHAR(c_pay.deposit_date,'DD-Mon-YYYY')
                                                    ||'~'|| c_pay.month
                                                    ||'~'|| c_pay.bank
                                                    ||'~'|| c_pay.bank_branch
                                                    ||'~'|| c_pay.account_type
                                                    ||'~'|| c_pay.subsidy
                                                    ||'~'|| c_pay.programme)
                  DATA :=                                  c_pay.FROM_ACCOUNT_NUMBER                   
                                                                ||'~'||c_pay.FROM_ACCOUNT_DESCR                    
                                                                ||'~'||c_pay.MY_STATEMENT_DESCR                    
                                                                ||'~'||c_pay.BENEFICIARY_ACCOUNT_NUMBER
                                                                ||'~'
                                                                ||'~'||c_pay.BRANCH_CODE            
                                                                ||'~'||c_pay.BENEFICIARY_NAME                      
                                                                ||'~'||c_pay.BENEFICIARY_STATEMENT_DESC            
                                                                ||'~'||c_pay.AMOUNT;                                
            DATA := REPLACE(DATA, ',' , ' ' );
            DATA := REPLACE(DATA, '~' , ',' );
    --message (cnt ||' ' || data);       
    --message('bfore write file 1 ' );              
                  client_text_io.put_line(fil1, data);
             end loop;
    --message ('end of write');         
                 dat := lpad('~',16,'~');
                 dat := utility.put_field(6,ssch_total,dat,'~');
                 dat := lpad('~',16,'~');
           dat := utility.put_field(1,'Total:' || bvspro,dat,'~');
                 dat := utility.put_field(5,bvspro_total,dat,'~');
              client_text_io.put_line(fil2,dat);
              dat := lpad('~',16,'~');
           client_text_io.put_line(fil2,dat);
           dat := utility.put_field(1,'Grand Total:' ,dat,'~');
                 dat := utility.put_field(5,grand_total,dat,'~');
              client_text_io.put_line(fil2,dat);
             -- close file
    for i in 1..50 loop  
           if substr(i,-1) = 0 then
                 message ('flush ' || i);
           end if;                 
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
                  client_text_io.put_line(fil1, lpad(' ',2000));
                  client_text_io.put_line(fil2, lpad(' ',2000));
    end loop;
             client_text_io.fclose(fil1);
             client_text_io.fclose(fil2);
        end loop;
       set_application_property(cursor_style,'default');
        exception
             when others then
                  message(sqlcode ||' ' ||sqlerrm);
       end download_file;    i try this but this code onlydownload image not data from database tables
        public void downloadImage(FacesContext facesContext, OutputStream outputStream)
            BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
            // get an ADF attributevalue from the ADF page definitions
            AttributeBinding attr = (AttributeBinding) bindings.getControlBinding("DocumentImage");
            if (attr == null)
                return;
            // the value is a BlobDomain data type
            BlobDomain blob = (BlobDomain) attr.getInputValue();
            try
            {   // copy the data from the BlobDomain to the output stream
                IOUtils.copy(blob.getInputStream(), outputStream);
                // cloase the blob to release the recources
                blob.closeInputStream();
                // flush the output stream
                outputStream.flush();
            catch (IOException e)
                // handle errors
                e.printStackTrace();
                FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR, e.getMessage(), "");
                FacesContext.getCurrentInstance().addMessage(null, msg);
            }

    You should ask your forum in the ADF-forum.

  • How to get string value from database table using Visual Studio 2005?

    Hi,
    Im developing plugin in illustrator cs3 using visual studio 2005. I need to get the values eneterd in database. Im able to get the integer values. But while getting string values it is returning empty value.
    Im using the below code to get the values from database table
    bool Table::Get(char* FieldName,int& FieldValue)
        try
            _variant_t  vtValue;
            vtValue = m_Rec->Fields->GetItem(FieldName)->GetValue();
            FieldValue=vtValue.intVal;
        CATCHERRGET
        sprintf(m_ErrStr,"Success");
        return 1;
    Im using the below code to get the values.
    AIErr getProjects()
        char buf[5000];
        int i;   
        std::string  catName;
        ::CoInitialize(NULL);
        Database db;
        Table tbl;
        errno_t err;
        err = fopen(&file,"c:\\DBResult.txt","w");
        fprintf(file, "Before Connection Established\n");
        //MessageBox(NULL,CnnStr,"Connection String",0);
        if(!db.Open(g->username,g->password,CnnStr))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        fprintf(file, "After Connection Established\n");
    if(!db.Execute("select ProjectID,ProjectName from projectsample",tbl))
            db.GetErrorErrStr(ErrStr);
            fprintf(file,"Error: %s\n",ErrStr);
        int ProjectID;
        int UserID;
        int ProjectTitle;
        char ProjectName[ProjectNameSize];
        if(!tbl.ISEOF())
            tbl.MoveFirst();
        ProjectArrCnt=0;
        for(i=0;i<128;i++)
            buf[i]='\0';
            int j=0;
        while(!tbl.ISEOF())
            if(tbl.Get("ProjectID",ProjectID))
                fprintf(file,"Project ID: %d ",ProjectID);
                ProjectInfo[ProjectArrCnt].ProjectID = ProjectID;
                sprintf(buf,"%d",ProjectID);
                //MessageBox(NULL, buf,"f ID", 0);
                j++;
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            //if(tbl.Get("ProjectTitle",ProjectName))
            if(tbl.Get("ProjectName",ProjectName))
                MessageBox(NULL,"Inside","",0);
                fprintf(file,"ProjectTitle: %s\n",ProjectName);
                //catName=CategoryName;
                ProjectInfo[ProjectArrCnt].ProjectName=ProjectName;
                //sprintf(buf,"%s",ProjectName);
                MessageBox(NULL,(LPCSTR)ProjectName,"",0);
            else
                tbl.GetErrorErrStr(ErrStr);
                fprintf(file,"Error: %s\n",ErrStr);
                break;
            ProjectArrCnt++;
            //MessageBox(NULL, "While", "WIN API Test",0);
            tbl.MoveNext();
        //MessageBox(NULL, ProjectInfo[i].ProjectName.c_str(),"f Name", 0);
        ::CoUninitialize();
        //sprintf(buf,"%s",file);
        //MessageBox(NULL,buf,"File",0);
        fprintf(file, "Connection closed\n");
        fclose(file);
        for(i=0;i<ProjectArrCnt;i++)
            sprintf(buf,"%i",ProjectInfo[i].ProjectID);
            //MessageBox(NULL,buf,"Proj ID",0);
            //MessageBox(NULL,ProjectInfo[i].ProjectName.c_str(),"Project Name",0);
        return 0;
    In the above code im geeting project D which is an integer value. But not able to get the project name.
    Please some one guide me.

    As I said in the other thread, this really isn't the place to ask questions about a database API unrelated to the Illustrator SDK. You're far more like to find people familliar with your problem on a forum that is dedicated to answering those kinds of questions instead.

  • How to delete a row from database table in facade client

    Hi all,
    I followed the tutorial in creating a persistence entity from database table, then a session facade. Then I followed the tutorial to create a sample client to test the model. In the session facade, I could use persistEntity method to insert a record to the database. I am just thinking of an extension to the tutorial, i.e., being able to delete the record too. So I created a new method removeEntity in the session facade
    public void removeEntity(Object entity) {
    entity=em.merge(entity);
    em.remove(entity);
    em.flush();
    and called it in the sample client. It was executed without any error, but the record in the table still exists.
    I tried to look around for a solution, but I did not find one. Would anybody here please help out? Many thanks in advance!

    Hi Frank,
    I tried the code snippet, but I got the following exception when executing this code:
    javax.ejb.EJBException: EJB Exception: ; nested exception is:
         java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.; nested exception is: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
    java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
         at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
         at $Proxy141.getTransaction(Unknown Source)
         at model.SessionEJBBean.removeEntity(SessionEJBBean.java:60)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy143.removeEntity(Unknown Source)
         at model.SessionEJB_qxt9um_SessionEJBImpl.removeEntity(SessionEJB_qxt9um_SessionEJBImpl.java:142)
         at model.SessionEJB_qxt9um_SessionEJBImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    javax.ejb.EJBException: EJB Exception: ; nested exception is:
         java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.; nested exception is: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.unwrapRemoteException(RemoteBusinessIntfProxy.java:109)
         at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:91)
         at $Proxy0.removeEntity(Unknown Source)
         at model.SessionEJBClient.main(SessionEJBClient.java:71)
    Caused by: java.lang.IllegalStateException: The method public abstract javax.persistence.EntityTransaction javax.persistence.EntityManager.getTransaction() cannot be invoked in the context of a JTA EntityManager.
         at weblogic.deployment.BasePersistenceContextProxyImpl.validateInvocation(BasePersistenceContextProxyImpl.java:121)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:86)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:91)
         at weblogic.deployment.BasePersistenceContextProxyImpl.invoke(BasePersistenceContextProxyImpl.java:80)
         at weblogic.deployment.TransactionalEntityManagerProxyImpl.invoke(TransactionalEntityManagerProxyImpl.java:26)
         at $Proxy141.getTransaction(Unknown Source)
         at model.SessionEJBBean.removeEntity(SessionEJBBean.java:60)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.bea.core.repackaged.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.jee.spi.MethodInvocationVisitorImpl.visit(MethodInvocationVisitorImpl.java:37)
         at weblogic.ejb.container.injection.EnvironmentInterceptorCallbackImpl.callback(EnvironmentInterceptorCallbackImpl.java:55)
         at com.bea.core.repackaged.springframework.jee.spi.EnvironmentInterceptor.invoke(EnvironmentInterceptor.java:50)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:131)
         at com.bea.core.repackaged.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:119)
         at com.bea.core.repackaged.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
         at com.bea.core.repackaged.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
         at $Proxy143.removeEntity(Unknown Source)
         at model.SessionEJB_qxt9um_SessionEJBImpl.removeEntity(SessionEJB_qxt9um_SessionEJBImpl.java:142)
         at model.SessionEJB_qxt9um_SessionEJBImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    Process exited with exit code 0.

Maybe you are looking for

  • The Airplay menu shows an Airport Express that is no longer in use.

    The Airplay menu in iTunes shows an old Airport Express that is no longer in use. How do I remove it from the list?

  • How to execute a Unix Command in java

    Hi, Iam trying to execute a unix command on Sun Solaris by passing that command to a java program. How can I achieve this? Thanks in advance.

  • MR11 and F.19

    Hi GURUu2019S what is the different between MR11, F.19 and F.13 Could some one expalin me in details with examole value points will be assigned thanks sunitha Edited by: sunitha reddy on Mar 20, 2009 10:17 AM

  • Error in executing Database Check on SRM Server (BRCONNECT)

    Dear All, When executing the Database check by DB13 or BRTOOLS I am getting the following Error. BR0477I Oracle pfile /oracle/FRP/102_64/dbs/initFRP.ora created from spfile /oracle/FRP/102_64/dbs/spfileFRP.ora BR1301W Error message from likeywlib: ==

  • Time Capsule, Time Machine, Indexing

    When I installed Lion, Time Machine would get stuck on backing up (Console would report "waiting for index to be ready over and over).  I erased the the existing Time Machine Back up and started over to see if that Fixed the problem.  While it does b