Acces to data of every field in a table using a loop

Hello:
I have the next code:
// Calling remote function
proxy.Z_Hrpfpa00105("XX", "45", out sts, ref tIVAEmp);
foreach (ZHRRESNOM row in tIVAEmp)
  { Console.WriteLine("{0} …", row.Desc2, row.Betrg, …); }
Assuming that tIVAEmp has 100 fields I need to build some loops during Console.WriteLine process, so I asked for your help for one part of the solution:
// Getting the field names and lengths of an RFC Table
Type structureType = tIVAEmp.GetElementType();
SAPField[] fields = SAPStructure.GetSAPFieldsSchema(structureType);
// Verifying
foreach (SAPField row in fields)
    Console.WriteLine(" - ", row.FieldName,  row.FieldLength);
It worked, but now I can´t find the connection between SAPField and the content of every RFC Table field for every record,  my mind is in blank and a I need  help … how can I do in C# something similar to:
foreach (ZHRRESNOM row in tIVAEmp)
+// The next is pseudo-code
   for every field F in fields
     { stri += contents of row, column F }
   Console.WriteLine(“”, stri);+</i></i>
Thanks again

E.g
proxy.Z_Hrpfpa00105("XX", "45", out sts, ref tIVAEmp);
Type structureType = tIVAEmp.GetElementType();
SAPField[] fields = SAPStructure.GetSAPFieldsSchema(structureType);
foreach (ZHRRESNOM row in tIVAEmp)
  foreach (SAPField field in fields)
    Console.WriteLine("{0}: {1}", field .FieldName, row[field.FieldName]);
Accessing fields by name may be a little bit slow. Alternatively you can access it by index, which is faster:
  for (int i=0; i<fields.Length; i++)
    Console.WriteLine("{0}: {1}", fields<i>.FieldName, row<i>);

Similar Messages

  • Modification date of every field

    Hi gurus,
    I need to get the date of modification of every field in a specific table. I'm working under Oracle9, and the undo retention is too small to try select ... as of ...
    Restoring is not an option. I have been told that there is a way to find when was modified every field on a table, but I can't find the solution.
    Any help would be appretiated.
    Regards,
    Mario Alcaide

    Hi,
    take a look at LogMiner
    regards
    vlado

  • Updation of Custom Fields in AFRU table Using Customerexit

    Hi all,
    I added two fields in CO11n Tcode using SCREEN EXIT - CONFPP07 and iam trying to update these two fields in AFRU table
    using CONFPP05.  But iam unable to update these two field .
    see this code in CONFPP05
      LOOP AT afrud_tab.
        afrud_tab-zzshift = wa_afrud-zzshift1 .
        afrud_tab-zzoperator = wa_afrud-zzoperator1 .
        MODIFY afrud_tab.
      ENDLOOP.
    Plz help me regarding this..

    Thanks for reply
    Ya i added two fields in confpp07 .
    see the code :
    *&  Include           ZXCOFTOP
    tables : afrud.
    DATA : WA_AFRUD TYPE AFRUD,
            IT_AFRUD TYPE TABLE OF AFRUD.
    Include           ZXCOFU24
    MOVE afrud-zzshift1 TO wa_afrud-zzshift1.
    MOVE afrud-zzoperator1 TO wa_afrud-zzoperator1.
    Even though it is not updating . except these two fields.
    Regards,
    Srinivas

  • How to update a custom field of MARC table using BAPI_MATERIAL_SAVEREPLICA

    Hi,
    I want to update a custom field (Appended field) of MARC table using  BAPI_MATERIAL_SAVEREPLICA. Please help me in this issue. I cannot use BAPI_MATERIAL_SAVEDATA as this updated the MARC table record by record. I have to update bulk records at a time.
    Thanks
    Rahul.

    Hi,
    Use the Documentation given for struture in BAPI docuemntation...
    For loading data into custom fields of MARC use the structure - BAPI_TE_MARC.
    First, structures BAPI_TE_<NAME> (<NAME> = MARA, MARC, MARD, MBEW, MLGN, MLGT, MVKE, MARM, MAKT) and the appropriate check structures BAPI_TE_<NAME> (<NAME> = MARAX, for example) have to be extended by the customer to include the required fields. The structures that are delivered as standard only contain the relevant key fields. When new fields are added to this structure, you should ensure that a field has the same name as the field in the database table. Furthermore, the fields in the structures BAPI_TE_<NAME> can only be CHARACTER fields. Data element BAPIUPDATE is to be used for the fields in the check structure (exception to this: key fields.)
    Parameters EXTENSIONIN and EXTENSIONINX are used for transferring data to the method. Field STRUCTURE contains the name of the structure (for example, BAPI_TE_MARA or BAPI_TE_MARAX). This names is used to identify the work area (for example,  WA_BAPI_TE_MARA or WA_BAPI_TE_MARAX) to which the data is transferred. The remaining fields in parameters EXTENSIONIN or EXTENSIONINX contain data for the key fields (for example, the material number) and the data for customer-specific fields. The number of characters reserved in both parameters for the contents of the customer-specific fields must match the number of characters for the relevant field in the work area. If the number of required characters is less, the remaining characters are left blank. Only when all characters have been filled can the contact for an additional field be transferred. Bear in mind that only data for which an appropriate indicator has been set in the work area can be updated to the database.
    Regards,
    Bhargava

  • Error while adding user fields to user table using vb6.0

    Hi,
    I am adding a user tables using vb6.0 using DIAPI.
    I am able to add the user table successfully.
    I am getting the following error when i am adding the fields to the table.
    "The metadata object for this object cannot be updated, since it's ref count is bigger than 0."
    My code is as follows:
        oUserFieldsMD.TableName = TABLE_NAME_ITEM_LOCN
        oUserFieldsMD.Name = vTableFields(0, lCount)
        oUserFieldsMD.Description = vTableFields(1, lCount)
        oUserFieldsMD.Type = vTableFields(2, lCount)
        oUserFieldsMD.EditSize = CLng(vTableFields(3,lCount))
        lRetCode = oUserFieldsMD.Add
    This error does not come up when i try to add the field to my table using the vb sample provided by SAP.
    Your help will me much appreciated.
    Thanks.

    Hi Satish,
    The problem is that you added the table and the objetc that you used to add the table is not freed properly. You need to free the object and then the reference count to that table will be 0 - which will enable you to add the fields
    e.g
    Dim pUTables As SAPbobsCOM.UserTablesMD
    'Do your stuff
    Set pUTables = Nothing
    Dim pUFields As SAPbobsCOM.UserFieldsMD
    'Do your stuff
    Set pUFields = Nothing

  • Moving data from custom fields to ekko table

    Hi Experts,
    I added new custom tab into me21n,me22n,me23n header thro me_gui_po_cust and me_process_po_cust.
    If i enter values in my custom fields, transport_from_model this method is not triggering.i have written below code in this method.
    METHOD if_ex_me_gui_po_cust~transport_from_model.
      DATA:     l_header  TYPE REF TO if_purchase_order_mm,
                ls_mepoheader  TYPE mepoheader,
                ls_customer TYPE ci_ekkodb.
      CASE im_name.
        WHEN subscreen.
          mmpur_dynamic_cast l_header im_model.
          CHECK NOT l_header IS INITIAL.
          ls_mepoheader = l_header->get_data( ).
          CALL FUNCTION 'ZMM_GET_DATA'
            EXPORTING
              im_ebeln       = ls_mepoheader-ebeln
    *            im_ebelp       = ls_mepoheader-ebelp
           IMPORTING
             ex_data        = ls_customer .
          MOVE-CORRESPONDING ls_mepoheader TO dynp_data_pbo.
          MOVE ls_customer-ztender TO dynp_data_pbo-ztender.
          MOVE ls_customer-zemdapplicable TO dynp_data_pbo-zemdapplicable.
          MOVE ls_customer-zpbgapplicable TO dynp_data_pbo-zpbgapplicable.
          MOVE ls_customer-zemdamount TO dynp_data_pbo-zemdamount.
          MOVE ls_customer-zemdvalidity TO dynp_data_pbo-zemdvalidity.
        WHEN OTHERS.
      ENDCASE.
    ENDMETHOD.
    i cant move my values entered in custom fields to ekko table.
    please help if u know..
    regards,
    Kavitha
    Edited by: Matt on Mar 23, 2011 10:55 AM added  tags

    Hi,
    check this out.. !!
    Import data from Excel to Oracle Database and
    Added link From Ask Tom.. your requirement you would be satisfied.. I supppose.. !!
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:908428873069
    - Pavan Kumar N

  • Get Field Values from Table using Java api

    I am using the example java code "RetrieveLimitedRecords" that can be found at :
    https://help.sap.com/javadocs/MDM71/current/API/index.html
    The code give the expected result and retrieves the record count for the main table
    Now I want to get the values of the fields for one record
    I added the lines:
    Record[] records = recordResultSet.getRecords() ;
    FieldId[] fields = records[0].getFields();
    System.out.println ("Field Length = "+fields.length);
    and the output is::
    Field Length = 0
    How can I get the fields of the record and read their values?
    Thanks
    Nicolas

    Assuming you want every field, the equivalent of "SELECT *" in SQL, you can use the RepositorySchema object to get a TableSchema, and with that get all FieldIds for the table.
    If your RepositorySchema variable is rs it would be something along the lines of:
    TableSchema mainTableSchema = rs.getTableSchema(mainTableId);
    ResultDefinition rd = new ResultDefinition(mainTableId);
    rd.setSelectFields(mainTableSchema.getFieldIds());
    Hope this helps,
    Greg

  • Import data from text file to a table using t-sql

    Hi,
    I am trying to import data from a text file to a table using the below query but it is returning an error.
    SELECT *, 2 FROM OPENROWSET(BULK 'W:\file.txt',
    FORMATFILE = 'W:\format_file.xml', FIRSTROW = 1, LASTROW = 1) as f
    The error is:
    Bulk load data conversion error (truncation) for row 1, column 1 (COPYRIGHT_DETAIL_CODE).

    <BCPFORMAT xmlns="http://schemas.microsoft.com/sqlserver/2004/bulkload/format" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
     <RECORD>
      <FIELD ID="1" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="2" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="3" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="4" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="5" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="6" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="1" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="7" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="8" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="10" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="9" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="10" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="11" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="12" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="5" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="13" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="8" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="14" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="2" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="15" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="3" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="16" xsi:type="CharTerm" TERMINATOR=" " MAX_LENGTH="4" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
      <FIELD ID="17" xsi:type="CharTerm" TERMINATOR="\r\n" MAX_LENGTH="43" COLLATION="SQL_Latin1_General_CP1_CI_AS"/>
     </RECORD>
     <ROW>
      <COLUMN SOURCE="1" NAME="Name1" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="2" NAME="Name2" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="3" NAME="Name3" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="4" NAME="Name4" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="5" NAME="Name5" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="6" NAME="Name6" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="7" NAME="Name7" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="8" NAME="Name8" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="9" NAME="Name9" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="10" NAME="Name10" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="11" NAME="Name11" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="12" NAME="Name12" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="13" NAME="Name13" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="14" NAME="Name14" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="15" NAME="Name15" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="16" NAME="Name16" xsi:type="SQLVARYCHAR"/>
      <COLUMN SOURCE="17" NAME="Name17" xsi:type="SQLVARYCHAR"/>
     </ROW>
    </BCPFORMAT>
    The format file that I am using is just like the same one above.
       

  • Updating the CUstomer fields in mARC table using BAPI_MATERIAL_SAVEREPLICA

    Hi friends,
    I want to update the Zfields in MARC table .Please provide me the details for updating these fields (Extension in bapi) Using the  BAPI_MATERIAL_SAVEREPLICA
    Thanks in advance

    Hi Varsha,
    There is documentation provided for this funtion module:
    If long texts (for example, basic data texts, internal notes, purchasing info texts, material notes or sales and distribution texts) or customer-specific fields have to be created for a material, some specific characteristics have to be taken into consideration. These characteristics are detailed in the documentation for parameters MATERIALLONGTEXT and EXTENSIONIN.
    Documentation is present for the parameters by clicking on EXTENSIONIN, EXTENSIONINX
    Regards,
    Swarna Munukoti

  • Exporting data from text file to a table using utl_file

    Dear all,
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown               
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown     
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

    Dear all,
    I have a text file as below and i have a table having 12 columns. Now i need to insert this text file into the table story_books.
    CREATE TABLE story_books
    book_id NUMBER,
    Category VARCHAR2(100 BYTE),
    Book_type VARCHAR2(100 BYTE),
    Name VARCHAR2(700 BYTE),
    Location VARCHAR2(700 BYTE),
    Ownership_code VARCHAR2(700 BYTE),
    Author VARCHAR2(700 BYTE),
    Less_Sel_fact VARCHAR2(700 BYTE),
    Reason VARCHAR2(700 BYTE),
    Buying VARCHAR2(700 BYTE),
    Suspected Book VARCHAR2(700 BYTE),
    Conditions VARCHAR2(700 BYTE)
    -------------------------text file---------------
    Books Out Table: Books
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown               
    Buying (if applicable):
    Not Applicable
    Suspected Book:
    Unknown
    Conditions to increace sales:
    Advertisement in all areas
    i was able to read the data and storing if it is in the same line.But i dont know how to read below data
    Book. Type          Name          Location               Ownership Code
    Story               SL          hyd               SS-HYD
    In this data i have to search for 'Book. type' and then i need to save the word 'Story' to the column 'Book_type'
    Then i need to search for 'Name' and i need to save 'SL' into the column into 'Name'
    Then i need to search for 'Location' and i need to save 'hyd' into the column into 'Location'
    I was able to extract the data if it is in below format using utl_file.get_line
    Known Author:     Unknown               
    Less Selling Factors: Thunderstorms     
    Reason:     Unknown     
    Any one can explain me how to solve the above criteria.
    Thanks in advance.

  • Update a Table Field of QMEL Table Using Function Module

    hello Guru
    I want to update a field of QMEL table suing FM which was created by user. how to write code for that. i have some idea but it is not helpful for us.....
    Moderator Message: Searching the forums/Google is a good start.
    Edited by: kishan P on May 19, 2011 12:13 PM

    hi Ram,
    You can use update query on table setting particular field value...There is no Function module for it.
    Regards,
    Pawan.

  • Export the data with Alias from the alternative table using ODI

    Hi!
    How to export the data from Essbase with Alias from the alternative table using ODI?
    Thanks.

    Are you on 10.1.3.6.x? Then: http://john-goodwin.blogspot.com/2008/09/odi-series-part-2-agent.html
    Are you on 11g? Then: http://john-goodwin.blogspot.com/2010/12/managing-odi-11g-standalone-agents.html
    I will say with only a mild amount of shame and a large amount of gratitude that I installed both releases' agents through John's blog posts.
    Regards,
    Cameron Lackpour
    Edited by: CL on Jun 4, 2012 5:48 PM
    Whoops, had the same link in there twice.

  • I want to update date field in oracle table using database adaptor

    Hi Guys,
    I want to update date in oracle table field which is 'DATE' type , but i am getting following error.
    Pure SQL Exception.
    Pure SQL Execute of update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=? where CTRL_ID=? failed. Caused by java.sql.SQLException: ORA-01830: date format picture ends before converting entire input string
    The Pure SQL option is for border use cases only and provides simple yet minimal functionality. Possibly try the "Perform an operation on a table" option instead.
    </summary>
    </part>
    - <part name="detail">
    <detail>
    ORA-01830: date format picture ends before converting entire input string
    </detail>
    i am formated the date using following code and assigned to one variable.
    ora:formatDate(ora:getCurrentDateTime(),'dd-MMM-yyyy hh:mm:ss ')
    this is update query
    update crp3apps.IFACE_SO_DATE_CHANGES set PROCESSED_DATE=#date where CTRL_ID=#id
    Please provide solution.
    regards
    janardhan

    The thing is that XSLT often doesn't deliver the functionality required when it comes to times.
    You suggest appening "Z" to the time but this means that the time is now in UTC time. What if the system from where the date is being converted is running in NZ using local time? Other systems that recieve the date (and correctly handle the time zone) will now have a time that is out by a number of hours.
    You often can't ignore the time zone (drop the 'Z') as if you send the time to a system it has to either assume the time is local to it (which may not be the case... the other system coudl be in a different time zone) or assume the time is UTC (I think crossfire does this by default).
    Typically can't just append a time zone (e.g. +11:00) either as many places have daylight savings so the value to appended is variable (you then need some way of determining what the value is... either Java Embedding or a Service).
    As you mention it does depend on the use case but in many circumstances using Jaba Embedding, not as suggested above but with the appropriate Java.util.Calendar classes, is the best way to handle date and time in BPEL. Even still you need to ascertain the format of times external to the system and ensure you parse them correctly.
    ANd even if you do all this you can still run into problems. I've seen a real world example where two systems which both handled time zones correctly and had previously been working together for quite a while, satrted reporting different times. It turns out that only one of them had had the most recent Java Time Zone patches applied and there had been a change in the dates for daylight savings here (Australia). Be warned!

  • How to capture data in a field from a table then insert them it to a destination table

    Environment:
    SQL Server 2008 R2
    Introduction:
    I have three tables. one is staging, the other child, the last one is parent. Both parent and child table have referential integrity
    (exam_id) .  The definition of the child table is 
    CREATE TABLE [dbo].child
    [ind_id] [int] IDENTITY(1,1) NOT NULL,
    [exam_dt] [datetime] NULL, exam_id int not null, [sub_cd] [nvarchar](4) NOT NULL,
    [score] [varchar](2) NOT NULL,
    The parent table has the following definition 
    CREATE TABLE [dbo].[parent]
    [exam_id] [int] IDENTITY(1,1) NOT NULL,
    [pn_id] [char](9) NOT NULL,
    [sub_cd] [varchar](3) NULL
    when loading 1000 records to the table each record has exam_id generated. 
    Problem:
    I was able successfully to load data from staging to parent but, How would I load/copy from parent exam_id - identity (1,1 )generated upon loading data - to the destination table (child table)
    Please help 

    Environment:
    SQL Server 2008 R2
    Introduction:
    I have three tables. one is staging, the other child, the last one is parent. Both parent and child table have referential integrity
    (exam_id) .  The definition of the child table is 
    CREATE TABLE [dbo].child
    [ind_id] [int] IDENTITY(1,1) NOT NULL,
    [exam_dt] [datetime] NULL, exam_id int not null, [sub_cd] [nvarchar](4) NOT NULL,
    [score] [varchar](2) NOT NULL,
    The parent table has the following definition 
    CREATE TABLE [dbo].[parent]
    [exam_id] [int] IDENTITY(1,1) NOT NULL,
    [pn_id] [char](9) NOT NULL,
    [sub_cd] [varchar](3) NULL
    when loading 1000 records to the table each record has exam_id generated. 
    Problem:
    I was able successfully to load data from staging to parent but, How would I load/copy from parent exam_id - identity (1,1 )generated upon loading data - to the destination table (child table)
    Please help 
    I could be misunderstanding your requirements, but I get the feeling you're misunderstood. I can see the exam_id (better named parent_id) acts as a foreign key to exam_id (better named fk_parent_id) in the child table.
    Without seeing the data though, it's not immediately obvious how you identify the relationship between the two while loading. When the data is supplied, what is the format of the third, source table? Does this include parent and child as single entries including
    a relationship ie normalised data?
    I don't know if this is useful or not, but when inserting single records into a table with an identity key:
    insert into table1 (col2, col3) select 'text1','text2'
    insert into table2 (col2, col3, FK, col5) select 'text1','text2',@@identity, 'text3'
    @@identity provides the last inserted value. Obviously for larger scale operations this isn't what you're looking for.
    In the event your staging table happened to hold parent, child and a source record ID (identity column in staging, but just a secondary indexed column in the other tables) however, you would have the rather easy job of:
    update child
    set exam_id = parent.exam_id
    from child inner join parent on child.source_id = parent.source_id
    Really hard to guess without seeing more

  • How to store array of data into a single row of  table ,using any of Stmts

    HI Friends,
    Based on my requirements ,i have retrived a set of data from a XXX.jsp page using a request.getParameter() and stored into single dimenssional array . Now i am paassing that array to JAVA class to store a into some table .
    In JSP page users can add text boxes dynamically based on his intrest then those attributes will store in table .it means table attributes are not conatant , it table attributes may change at any time when user adds any textboxs or any fields on JSP page ....thats my module ..
    Now i wanted to store all array of data into Table in a single row .......thats is my requirements .
    How can we use prepareStatement and Statement to store array of results intoo table row ...on each iteration i wanted to store array of results into table atributes ..It means entire array of results should to into table row at time .....coule any one write sytax ,how we do this...
    could any one suggest me stps that i can impliment ......?....please reply ASAP

    Well ..you code can be works for constant number of attributes in table .oopss here my requirement is table attributes not fixed ,we cant put constant number of place holder(? ) in a statement ,because those are not fixed ,
    Let me explain here :
    i am doing in that way only. As i mentioned you Table attributes are not constant .It may very if users add any fields dynamically on JSP page .If users have option to add any text box on Jsp page ,then that attribute will store in table as a attribute .
    Now i amable fetching the all dyamic form data and stored in a Result Array below ...in this iteration all form result data are from jsp page as suggestion form ,it should stored in table in single row on corrsponding attribtes ......next time when users fills FROM ,then those data i am fetching and storing in a Result Array as below and need to store in corrsponding table attributes in a single row ....
    for(int i=0;i<result.length;i++)
                   System.out.println(result);
                   pst3=connection.prepareStatement("insert into *emprecord* values(?)");
                   if(!result[i].equals(""))
                        System.out.println(result[i]);
                             pst3.setString(1,result[i]);
                             pst3.executeUpdate();
    Thnks in advance ....let me know the the way we can store dynamic form data into dyanamic table ...

Maybe you are looking for

  • JDBC Connector error in Visual Admin

    Hi I am trying to create and DBlookup using the JDBC Connector service in visual admin folowing this blog https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/9aedca11-0d01-0010-3b90-9ea04182875f when i try to create the data source na

  • Why can't I use a Date in a component?

    When I try to use the Date class in a component I get an error: 1046: Type was not found or was not a compile-time constant: Date. zForm.mxml Zilch/components ... How can this be? Is there an import I need to use?

  • Assigning and exporting podcast artwork

    The podcast artwork that is exporting with my episodes seems to be stuck on the same one all the time.  I'm not sure how to place the correct episode artwork for each new episode of my podcasts in the GarageBank window.  For instance I have one Garag

  • Multiple Guest Accounts / Behind-the-scenes Login

    How would we go about logging a visitor in as a specific user behind-the-scenes (without them even seeing the Login Screen)? This question is driven from a requirement where we need to display a replica of the subportal branding at the guest view lev

  • About between usuage in form for date range

    I have a form in which the values should be displayed according to the range of date given.Ie between a particular range of date