Hello,
in my application, the user will insert some data into the text boxes, and, after 
clicking
"Insert" button,  the data has to be inserted into the database and User Session 
Object at the same time .  Then this data will be displayed on the next "Confirmation" 
page where it will be taken from the User Session Object.  

The code that I'm using seems almost there, but it doesn't work.  The "Confirmation" 
page 
gives me the following error code:
This is an error associated w/ the 'DataObjectExecuteImmediate' method - SQL Error 
(-3502): 37000.

The attached is the ND  java page page with the code  I'm using to insert the data and 
put 
it into the session object.  I'm also pasting it below.  

Thanks in advance for your help.


//[[SPIDER_EVENT<Insert_onWebEvent>
        public int Insert_onWebEvent(CSpWebEvent event)
        {
                int command = PROCEED;
                                
                CSpDBResult             resultSet               = null;
                CSpDBResultStatus       resultStatus    = null;
                
                String businesses = 
getDisplayFieldValue("cbBusinesses").stringValue().trim();
CSpHtml.sendMessage("<BR>Businesses - " + businesses);
                CSpider.putUserSessionObject("sesBusinesses", (CSpValue) new 
CSpString(businesses));

                String titleQuote = 
getDisplayFieldValue("dfTitleQuote").stringValue().trim();
                CSpider.putUserSessionObject("sesTitleQuote", (CSpValue) new 
CSpString(titleQuote));

                String sourceName = 
getDisplayFieldValue("dfSourceName").stringValue().trim();
                CSpider.putUserSessionObject("sesSourceName", (CSpValue) new 
CSpString(sourceName));

                String articleText = 
getDisplayFieldValue("dfArticleText").stringValue().trim();
                CSpider.putUserSessionObject("sesArticleText", (CSpValue) new 
CSpString(articleText));

                CSpValue date = CSpider.getUserSessionObject("sesDate");
                
                String sql = "INSERT INTO textArticles";
                
                sql = sql + "VALUES (";
                sql = sql + "'" + date + "'";
                sql = sql + ", '" + businesses + "'";
                sql = sql + ", '" + titleQuote + "'";
                sql = sql + ", '" + sourceName + "'";
                sql = sql + ", '" + articleText + "'";
                sql = sql + ")";
//CSpHtml.sendMessage("<BR>SQL - " + sql);

                resultSet = CSpDataObject.executeImmediate("dsDailyNews", sql);
                resultStatus = resultSet.getResultStatus();
                if (resultStatus.getVendorErrorCode1() == resultStatus.SUCCESS)
                {
                        
                        //CSpCommonPage pgConfirmInput = 
CSpider.getCommonPage("ConfirmInput");
                        //pgConfirmInput.load(false);
                        return(PROCEED);
                }
                else
                {
                        CSpCommonPage pgError = CSpider.getCommonPage("pgError");
                        pgError.setDisplayFieldValue("stMessage", new CSpString("This 
is an error associated
         w/ the 'DataObjectExecuteImmediate' method - SQL Error 
("+resultStatus.getVendorErrorCode1()+"):
         "+resultStatus.getVendorErrorMessage1()+".  Please contact the Internet 
Services
         Group for help."));
                        pgError.load(false);
                        return(STOP);
                }
                //return(command);
        }
        //]]SPIDER_EVENT<Insert_onWebEvent>
_________________________________________________________________________

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