This is a migrated thread and some comments may be shown as answers.

ORA-01036: illegal variable name/number on Batch edit mode

3 Answers 102 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 26 Aug 2013, 10:26 PM

I'm using Batch edit mode.  My insert command is very simple:
InsertCommand="INSERT INTO "WFM_CAT_RECURRENCE_DT" VALUES (:DIVISION, :DISTRICT, :LOCATION, :FROM_YEAR, :FROM_WEEK, :TO_YEAR, :TO_WEEK, :USERID, :USERNAME, SYSDATE)" but  it gives me an error:ORA-01036: illegal variable name/number.  Can anyone help?
My aspx is as follow:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Copy_To_Maintenance.aspx.vb"
    Inherits="Copy_To_Maintenance" %>


<asp:Content ID="Content2" ContentPlaceHolderID="MainContentPlaceHolder" Runat="Server">

    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
   
<telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True"
            CellSpacing="0" DataSourceID="OracleDatabase1" GridLines="None"
            AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" AutoGenerateColumns="False"
            AllowFilteringByColumn="True" Width="1250px">
            <mastertableview
                datakeynames="USERID,USERNAME,CREATE_DATE"
                datasourceid="OracleDatabase1" commanditemdisplay="TopAndBottom"
                EditMode="Batch" BatchEditingSettings-EditType="Cell"
                autogeneratecolumns="False" >
                <RowIndicatorColumn Visible="False">
                </RowIndicatorColumn>
                <ExpandCollapseColumn Created="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn DataField="DIVISION"
                        FilterControlAltText="Filter DIVISION column" HeaderText="DIVISION"
                        ReadOnly="False" SortExpression="DIVISION" UniqueName="DIVISION" AllowFiltering="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="DISTRICT"
                        FilterControlAltText="Filter DISTRICT column" HeaderText="DISTRICT"
                        SortExpression="DISTRICT" UniqueName="DISTRICT" ReadOnly="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="LOCATION"
                        FilterControlAltText="Filter LOCATION column" HeaderText="LOCATION"
                        SortExpression="LOCATION" UniqueName="LOCATION" ReadOnly="False">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FROM_YEAR" DataType="System.Decimal"
                        FilterControlAltText="Filter FROM_YEAR column" HeaderText="FROM_YEAR"
                        SortExpression="FROM_YEAR" UniqueName="FROM_YEAR">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="FROM_WEEK" DataType="System.Decimal"
                        FilterControlAltText="Filter FROM_WEEK column" HeaderText="FROM_WEEK"
                        SortExpression="FROM_WEEK" UniqueName="FROM_WEEK">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TO_YEAR" DataType="System.Decimal"
                        FilterControlAltText="Filter TO_YEAR column" HeaderText="TO_YEAR"
                        SortExpression="TO_YEAR" UniqueName="TO_YEAR">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TO_WEEK" DataType="System.Decimal"
                        FilterControlAltText="Filter TO_WEEK column" HeaderText="TO_WEEK"
                        SortExpression="TO_WEEK" UniqueName="TO_WEEK">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="USERID"
                        FilterControlAltText="Filter USERID column" HeaderText="USERID"
                        SortExpression="USERID" UniqueName="USERID" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="USERNAME"
                        FilterControlAltText="Filter USERNAME column" HeaderText="USERNAME"
                        SortExpression="USERNAME" UniqueName="USERNAME" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CREATE_DATE" DataType="System.DateTime"
                        FilterControlAltText="Filter CREATE_DATE column" HeaderText="CREATE_DATE"
                        SortExpression="CREATE_DATE" UniqueName="CREATE_DATE" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
                </Columns>
            </mastertableview>
           
        </telerik:RadGrid>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
        </telerik:RadWindowManager>
   
    <asp:SqlDataSource ID="OracleDatabase1" runat="server"
            ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
            DeleteCommand="DELETE FROM &quot;WFM_CAT_RECURRENCE_DT&quot; WHERE &quot;DIVISION&quot; = :DIVISION AND &quot;DISTRICT&quot; = :DISTRICT AND &quot;LOCATION&quot; = :LOCATION AND &quot;FROM_YEAR&quot; = :FROM_YEAR AND &quot;FROM_WEEK&quot; = :FROM_WEEK AND &quot;TO_YEAR&quot; = :TO_YEAR AND &quot;TO_WEEK&quot; = :TO_WEEK AND &quot;USERID&quot; = :USERID AND &quot;USERNAME&quot; = :USERNAME AND &quot;CREATE_DATE&quot; = :CREATE_DATE"
            InsertCommand="INSERT INTO &quot;WFM_CAT_RECURRENCE_DT&quot; VALUES (:DIVISION, :DISTRICT, :LOCATION, :FROM_YEAR, :FROM_WEEK, :TO_YEAR, :TO_WEEK, :USERID, :USERNAME, SYSDATE)"
            ProviderName="<%$ ConnectionStrings:ConnectionString.ProviderName %>"
            SelectCommand="SELECT &quot;DIVISION&quot;, &quot;DISTRICT&quot;, &quot;LOCATION&quot;, &quot;FROM_YEAR&quot;, &quot;FROM_WEEK&quot;, &quot;TO_YEAR&quot;, &quot;TO_WEEK&quot;, &quot;USERID&quot;, &quot;USERNAME&quot;, &quot;CREATE_DATE&quot; FROM &quot;WFM_CAT_RECURRENCE_DT&quot;"
           
            UpdateCommand="UPDATE &quot;WFM_CAT_RECURRENCE_DT&quot; SET &quot;LOCATION&quot; = :LOCATION, &quot;FROM_YEAR&quot; = :FROM_YEAR, &quot;FROM_WEEK&quot; = :FROM_WEEK, &quot;TO_YEAR&quot; = :TO_YEAR, &quot;TO_WEEK&quot; = :TO_WEEK, &quot;USERID&quot; = 'ID', &quot;USERNAME&quot; = 'NAME', &quot;CREATE_DATE&quot; = SYSDATE WHERE &quot;DIVISION&quot; = :DIVISION AND &quot;DISTRICT&quot; = :DISTRICT AND &quot;LOCATION&quot; = :LOCATION AND &quot;USERID&quot; = :USERID AND &quot;USERNAME&quot; = :USERNAME AND &quot;CREATE_DATE&quot; = :CREATE_DATE">

            <DeleteParameters>
                <asp:Parameter Name="DIVISION" Type="String" />
                <asp:Parameter Name="DISTRICT" Type="String" />
                <asp:Parameter Name="LOCATION" Type="String" />
                <asp:Parameter Name="FROM_YEAR" Type="Decimal" />
                <asp:Parameter Name="FROM_WEEK" Type="Decimal" />
                <asp:Parameter Name="TO_YEAR" Type="Decimal" />
                <asp:Parameter Name="TO_WEEK" Type="Decimal" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="USERNAME" Type="String" />
                <asp:Parameter Name="CREATE_DATE" Type="DateTime" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="DIVISION" Type="String" />
                <asp:Parameter Name="DISTRICT" Type="String" />
                <asp:Parameter Name="LOCATION" Type="String" />
                <asp:Parameter Name="FROM_YEAR" Type="Decimal" />
                <asp:Parameter Name="FROM_WEEK" Type="Decimal" />
                <asp:Parameter Name="TO_YEAR" Type="Decimal" />
                <asp:Parameter Name="TO_WEEK" Type="Decimal" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="USERNAME" Type="String" />
                <asp:Parameter Name="CREATE_DATE" Type="DateTime" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="DIVISION" Type="String" />
                <asp:Parameter Name="DISTRICT" Type="String" />
                <asp:Parameter Name="LOCATION" Type="String" />
                <asp:Parameter Name="FROM_YEAR" Type="Decimal" />
                <asp:Parameter Name="FROM_WEEK" Type="Decimal" />
                <asp:Parameter Name="TO_YEAR" Type="Decimal" />
                <asp:Parameter Name="TO_WEEK" Type="Decimal" />
                <asp:Parameter Name="USERID" Type="String" />
                <asp:Parameter Name="USERNAME" Type="String" />
                <asp:Parameter Name="CREATE_DATE" Type="DateTime" />
            </InsertParameters>
        </asp:SqlDataSource>
</asp:Content>

 

 

 

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 29 Aug 2013, 02:36 PM
Hi Allen,

It looks like there is a syntax error in the InsertCommand. I would like to ask you is Oracle being used? Please remove the semicolons from the command text and test whether this resolves the problem.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
Allen
Top achievements
Rank 1
answered on 29 Aug 2013, 02:41 PM
If I change the SYSDATE to :CREATE_DATE, it works just fine.  Why?
0
Angel Petrov
Telerik team
answered on 02 Sep 2013, 12:45 PM
Hi Allen,

This is due to the fact that data field which is used is named CREATE_DATE and the insert parameter defined is also named the same way. Moreover there is no insert parameter named SYSDATE and this is causing the problem.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Allen
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Allen
Top achievements
Rank 1
Share this question
or