see below

At 10:43 AM 7/29/99 -0700, Steve wrote:

>My insert is not working. I get a " insert into rtoz.time.sheet 
>values(?,?,...?)" n the Log.  a ? for each field I am inserting in the 
>Oracle DB.
>//CODE
>         CSpInsert theTimeSheetInsert = (CSpInsert) 
> CSpider.getDataObject("doTimeSheetInsert");
>
>// get values user entered 1st Row
>         CSpValue CSptbSSN = getDisplayFieldValue("tbSSN");
>         CSpValue CSptbEmployeeManager = 
> getDisplayFieldValue("tbEmployeeManager");

      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      when you call getValue on a field in a multi-row situation, the 
return is a CSpVector containing the values for that field in each row that 
was returned.

Immediately below is a utility method from our hms bag o' tricks that you 
might find helpful.

-- Curt Springer, Team ND

/**
  * When you execute getValue on a CSpDisplayField, you get a 
CSpValue.  This could represent
  * a simple value, or a CSpVector of simple values, or a CSpVector 
containing CSpVectors,
  * depending on the number of rows and the hierarchical structure of the page.
  * <br><br>
  * This recursive utility method returns a Vector of simple CSpValues that 
flattens
  * out the passed CSpValue, with the values in the order in which they 
appeared on the page,
  * left to right and top to bottom.
  * @param fieldvalue Returned from getValue
  * @return Vector Contains all the simple CSpValues
  * @see getWebVarOccurrences
  */
  public static Vector extractSimpleValues(CSpValue fieldvalue) throws 
Exception
  {
     try

     {
     Vector returnvector = new Vector();
     if (!(fieldvalue instanceof CSpVector))
     {
     returnvector.addElement(fieldvalue);
     }//if (!(fieldvalue instanceof CSpVector))
     else
     {
        for (Enumeration e=((CSpVector) 
fieldvalue).elements();e.hasMoreElements();)
        {
         CSpValue nextvalue = (CSpValue) e.nextElement();
         Vector v = extractSimpleValues(caller, nextvalue);
         //add returned values to the list
         for (Enumeration f = v.elements();f.hasMoreElements();)
         {
           CSpValue anothervalue = (CSpValue) f.nextElement();
           returnvector.addElement(anothervalue);

         }//for (Enumeration f = v.elements();f.hasMoreElements;)
        }//for (Enumeration e=fieldvalue.elements();e.hasMoreElements;)

     }//else

     return(returnvector);

     }//try
     catch(Exception ex)
     {
     Exception ex1 = new Exception("extractSimpleValues, unexpected 
exception:" + ex);
     throw(ex1);
     }//catch(Exception ex)


  }//public static Vector extractSimpleValues(CSpValue fieldvalue)




>         ..
>         ...
>
>         theTimeSheetInsert.setValue("RTOZ_TIME_SHEET_EMP_ID",CSptbSSN);
>
>         theTimeSheetInsert.setValue("RTOZ_TIME_SHEET_TIME_SHEET_DT", 
> CSptbDate1);
>.
>.
>
>         try {
>                   theTimeSheetInsert.execute();
>Any advice to fix this problem would be appreciated,
>Steve
>_________________________________________________________________________
>
>For help in using, subscribing, and unsubscribing to the discussion
>forums, please go to: http://www.netdynamics.com/support/visitdevfor.html
>
>For dire need help, email: [EMAIL PROTECTED]

_________________________________________________________________________

For help in using, subscribing, and unsubscribing to the discussion
forums, please go to: http://www.netdynamics.com/support/visitdevfor.html

For dire need help, email: [EMAIL PROTECTED]

Reply via email to