Subprocedure for Oracle's SET DEFINE OFF command

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Subprocedure for Oracle's SET DEFINE OFF command

    I want to create a procedure in ASP.NET to run the "SET DEFINE OFF" command
    in an Oracle database. I tried the following:

    Public Shared Sub SetDefineOff()

    Dim myconnection As New
    OracleConnection(ConfigurationSettings.AppSettings ("connectionstring"))

    Dim cmdsetdefineoff As New OracleCommand("SET DEFINE OFF", myconnection)

    myconnection.Open()

    cmdsetdefineoff.ExecuteNonQuery()

    myconnection.Close()

    End Sub


    But I recieve the following error:

    Server Error in '/lvbeporgtest' Application.
    --------------------------------------------------------------------------------

    ORA-00922: missing or invalid option
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Data.OracleClient.OracleException: ORA-00922:
    missing or invalid option

    Source Error:

    An unhandled exception was generated during the execution of the
    current web request. Information regarding the origin and location of the
    exception can be identified using the exception stack trace below.

    Stack Trace:

    [OracleException: ORA-00922: missing or invalid option
    ]
    System.Data.OracleClient.OracleConnection.CheckErr or(OciErrorHandle
    errorHandle, Int32 rc) +174
    System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
    rowidDescriptor, ArrayList& refCursorParameterOrdinals) +1919
    System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor) +32
    System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean
    needRowid, OciHandle& rowidDescriptor) +170
    System.Data.OracleClient.OracleCommand.ExecuteNonQ uery() +56
    Global.SetDefineOff() in C:\Documents and Settings\Nathan
    Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\Global.asax.vb:32[/url]
    newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
    C:\Documents and Settings\Nathan
    Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\newsadmin.aspx.vb: 71[/url]
    System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
    eventArgument) +57
    System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    sourceControl, String eventArgument) +18
    System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    System.Web.UI.Page.ProcessRequestMain() +1292



    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
    Version:1.1.4322.2300


    Can someone tell me what I am doing wrong or what is causing the error and
    what I can do to fix it? Thanks.
    --
    Nathan Sokalski
    [email]njsokalski@hotmail.com[/email]
    [url]http://www.nathansokalski.com/[/url]


    Nathan Sokalski Guest

  2. Similar Questions and Discussions

    1. how to define new dataypes
      Hello, I would like to define a new datatype, the datatype gender should only include either m or f. how can i do this? thank you very much, ...
    2. Using Oracle's Instant Client
      I am experiencing the EXACT same issue on Win2k3 Standard w/ CFMX 7 Standard - does anyone have any ideas on this?
    3. Windows Explorer Right Click Command (+ Custom Command Script)
      Ok got a tricky question about custom scripts, I would like to add a Windows Explorer Right Click Command - that allows me to select an image/s...
    4. Multi command files and running them from the command prompt
      Use the -td§ option . Details are in the section titled Command Line Processor Options in the Command Reference. "Derek Clarkson"...
    5. Stopping Oracle's Event Logging in Win2000
      Hi all, How can I stop the event logging for my Oracle Database in Win2000? As my event log is growing rapidly. Thanks~!
  3. #2

    Default RE: Subprocedure for Oracle's SET DEFINE OFF command

    Hi Nathan,

    I am no Oracle expert but I can tell you two things:

    1. Your code is fine, you aren't doing anything wrong.
    2. "SET DEFINE OFF" is not a SQL command, it is a SQL *Plus command. It
    just won't work Oracle has no idea what you mean.

    Tim

    "Nathan Sokalski" wrote:
    > I want to create a procedure in ASP.NET to run the "SET DEFINE OFF" command
    > in an Oracle database. I tried the following:
    >
    > Public Shared Sub SetDefineOff()
    >
    > Dim myconnection As New
    > OracleConnection(ConfigurationSettings.AppSettings ("connectionstring"))
    >
    > Dim cmdsetdefineoff As New OracleCommand("SET DEFINE OFF", myconnection)
    >
    > myconnection.Open()
    >
    > cmdsetdefineoff.ExecuteNonQuery()
    >
    > myconnection.Close()
    >
    > End Sub
    >
    >
    > But I recieve the following error:
    >
    > Server Error in '/lvbeporgtest' Application.
    > --------------------------------------------------------------------------------
    >
    > ORA-00922: missing or invalid option
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.Data.OracleClient.OracleException: ORA-00922:
    > missing or invalid option
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the
    > current web request. Information regarding the origin and location of the
    > exception can be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    > [OracleException: ORA-00922: missing or invalid option
    > ]
    > System.Data.OracleClient.OracleConnection.CheckErr or(OciErrorHandle
    > errorHandle, Int32 rc) +174
    > System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    > CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
    > rowidDescriptor, ArrayList& refCursorParameterOrdinals) +1919
    > System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    > CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor) +32
    > System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean
    > needRowid, OciHandle& rowidDescriptor) +170
    > System.Data.OracleClient.OracleCommand.ExecuteNonQ uery() +56
    > Global.SetDefineOff() in C:\Documents and Settings\Nathan
    > Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\Global.asax.vb:32[/url]
    > newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
    > C:\Documents and Settings\Nathan
    > Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\newsadmin.aspx.vb: 71[/url]
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    > System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
    > eventArgument) +57
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > sourceControl, String eventArgument) +18
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    > System.Web.UI.Page.ProcessRequestMain() +1292
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
    > Version:1.1.4322.2300
    >
    >
    > Can someone tell me what I am doing wrong or what is causing the error and
    > what I can do to fix it? Thanks.
    > --
    > Nathan Sokalski
    > [email]njsokalski@hotmail.com[/email]
    > [url]http://www.nathansokalski.com/[/url]
    >
    >
    >
    timkling Guest

  4. #3

    Default Re: Subprocedure for Oracle's SET DEFINE OFF command


    I would recommend that rather than making this a separate command he
    include this line at the beginning of whatever stored procedure on
    Oracle that he wants to run.

    Sort of like in a SQL procedure where you start with SET ANSI OFF.


    timkling wrote:
    > Hi Nathan,
    >
    > I am no Oracle expert but I can tell you two things:
    >
    > 1. Your code is fine, you aren't doing anything wrong.
    > 2. "SET DEFINE OFF" is not a SQL command, it is a SQL *Plus command. It
    > just won't work Oracle has no idea what you mean.
    >
    > Tim
    >
    > "Nathan Sokalski" wrote:
    >
    >
    >>I want to create a procedure in ASP.NET to run the "SET DEFINE OFF" command
    >>in an Oracle database. I tried the following:
    >>
    >>Public Shared Sub SetDefineOff()
    >>
    >>Dim myconnection As New
    >>OracleConnection(ConfigurationSettings.AppSettin gs("connectionstring"))
    >>
    >>Dim cmdsetdefineoff As New OracleCommand("SET DEFINE OFF", myconnection)
    >>
    >>myconnection.Open()
    >>
    >>cmdsetdefineoff.ExecuteNonQuery()
    >>
    >>myconnection.Close()
    >>
    >>End Sub
    >>
    >>
    >>But I recieve the following error:
    >>
    >>Server Error in '/lvbeporgtest' Application.
    >>--------------------------------------------------------------------------------
    >>
    >>ORA-00922: missing or invalid option
    >>Description: An unhandled exception occurred during the execution of the
    >>current web request. Please review the stack trace for more information
    >>about the error and where it originated in the code.
    >>
    >>Exception Details: System.Data.OracleClient.OracleException: ORA-00922:
    >>missing or invalid option
    >>
    >>Source Error:
    >>
    >> An unhandled exception was generated during the execution of the
    >>current web request. Information regarding the origin and location of the
    >>exception can be identified using the exception stack trace below.
    >>
    >>Stack Trace:
    >>
    >>[OracleException: ORA-00922: missing or invalid option
    >>]
    >> System.Data.OracleClient.OracleConnection.CheckErr or(OciErrorHandle
    >>errorHandle, Int32 rc) +174
    >> System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    >>CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
    >>rowidDescriptor, ArrayList& refCursorParameterOrdinals) +1919
    >> System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    >>CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor) +32
    >> System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean
    >>needRowid, OciHandle& rowidDescriptor) +170
    >> System.Data.OracleClient.OracleCommand.ExecuteNonQ uery() +56
    >> Global.SetDefineOff() in C:\Documents and Settings\Nathan
    >>Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\Global.asax.vb:32[/url]
    >> newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
    >>C:\Documents and Settings\Nathan
    >>Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\newsadmin.aspx.vb: 71[/url]
    >> System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    >> System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
    >>eventArgument) +57
    >> System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    >>sourceControl, String eventArgument) +18
    >> System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    >> System.Web.UI.Page.ProcessRequestMain() +1292
    >>
    >>
    >>
    >>--------------------------------------------------------------------------------
    >>Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
    >>Version:1.1.4322.2300
    >>
    >>
    >>Can someone tell me what I am doing wrong or what is causing the error and
    >>what I can do to fix it? Thanks.
    >>--
    >>Nathan Sokalski
    >>njsokalski@hotmail.com
    >>[url]http://www.nathansokalski.com/[/url]
    >>
    >>
    >>
    John A. Bailo Guest

  5. #4

    Default RE: Subprocedure for Oracle's SET DEFINE OFF command

    You might need to wrap the SET DEFINE OFF in a BEGIN/END block:
    BEGIN SET DEFINE OFF; END;

    I've not used Oracle for a couple of years so the syntax might not be correct.

    "Nathan Sokalski" wrote:
    > I want to create a procedure in ASP.NET to run the "SET DEFINE OFF" command
    > in an Oracle database. I tried the following:
    >
    > Public Shared Sub SetDefineOff()
    >
    > Dim myconnection As New
    > OracleConnection(ConfigurationSettings.AppSettings ("connectionstring"))
    >
    > Dim cmdsetdefineoff As New OracleCommand("SET DEFINE OFF", myconnection)
    >
    > myconnection.Open()
    >
    > cmdsetdefineoff.ExecuteNonQuery()
    >
    > myconnection.Close()
    >
    > End Sub
    >
    >
    > But I recieve the following error:
    >
    > Server Error in '/lvbeporgtest' Application.
    > --------------------------------------------------------------------------------
    >
    > ORA-00922: missing or invalid option
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.Data.OracleClient.OracleException: ORA-00922:
    > missing or invalid option
    >
    > Source Error:
    >
    > An unhandled exception was generated during the execution of the
    > current web request. Information regarding the origin and location of the
    > exception can be identified using the exception stack trace below.
    >
    > Stack Trace:
    >
    > [OracleException: ORA-00922: missing or invalid option
    > ]
    > System.Data.OracleClient.OracleConnection.CheckErr or(OciErrorHandle
    > errorHandle, Int32 rc) +174
    > System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    > CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
    > rowidDescriptor, ArrayList& refCursorParameterOrdinals) +1919
    > System.Data.OracleClient.OracleCommand.Execute(Oci Handle statementHandle,
    > CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor) +32
    > System.Data.OracleClient.OracleCommand.ExecuteNonQ ueryInternal(Boolean
    > needRowid, OciHandle& rowidDescriptor) +170
    > System.Data.OracleClient.OracleCommand.ExecuteNonQ uery() +56
    > Global.SetDefineOff() in C:\Documents and Settings\Nathan
    > Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\Global.asax.vb:32[/url]
    > newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
    > C:\Documents and Settings\Nathan
    > Sokalski\VSWebCache\[url]www.webdevlccc.com\lvbeporgtest\newsadmin.aspx.vb: 71[/url]
    > System.Web.UI.WebControls.Button.OnClick(EventArgs e) +108
    > System.Web.UI.WebControls.Button.System.Web.UI.IPo stBackEventHandler.RaisePostBackEvent(String
    > eventArgument) +57
    > System.Web.UI.Page.RaisePostBackEvent(IPostBackEve ntHandler
    > sourceControl, String eventArgument) +18
    > System.Web.UI.Page.RaisePostBackEvent(NameValueCol lection postData) +33
    > System.Web.UI.Page.ProcessRequestMain() +1292
    >
    >
    >
    > --------------------------------------------------------------------------------
    > Version Information: Microsoft .NET Framework Version:1.1.4322.2300; ASP.NET
    > Version:1.1.4322.2300
    >
    >
    > Can someone tell me what I am doing wrong or what is causing the error and
    > what I can do to fix it? Thanks.
    > --
    > Nathan Sokalski
    > [email]njsokalski@hotmail.com[/email]
    > [url]http://www.nathansokalski.com/[/url]
    >
    >
    >
    Simon Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139