473,385 Members | 1,528 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebCache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
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
nj********@hotmail.com
http://www.nathansokalski.com/
Nov 10 '05 #1
3 8385
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\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebCache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
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
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 11 '05 #2

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\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebCache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
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
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 11 '05 #3
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\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSubmitNotesLink_Click(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebCache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
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
nj********@hotmail.com
http://www.nathansokalski.com/

Nov 11 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: cschang | last post by:
My system is on a NT4 (w/SP6a) running IIS 4. I am developing a page that query one record from my Oracle DB 8.1.6 on a separate machine. I am using the MS ODBC for Oracle drive. In my ASP page...
2
by: mike | last post by:
Ok, I'll admit I'm VERY new to ASP but I simply cannot seem to get this to work. The problem is probably obvious but I just can't seem to find it. I'm trying to query an Oracle DB on another...
125
by: Rhino | last post by:
One of my friends, Scott, is a consultant who doesn't currently have newsgroup access so I am asking these questions for him. I'll be telling him how to monitor the answers via Google Newsgroup...
2
by: steve | last post by:
I have Option Explicit ON by the way. I have declared a variable in one subprocedure which is being used by another subprocedure. But it doesn' seem to work. I am doing something similar to this...
1
by: Andrew Arace | last post by:
I scoured the groups for some hands on code to perform the menial task of exporting table data from an Access 2000 database to Oracle database (in this case, it was oracle 8i but i'm assuming this...
3
by: Nathan Sokalski | last post by:
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...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
2
cindy2
by: cindy2 | last post by:
Hi everybody, In my vb2005-project I have a subprocedure (in a MODULE) like this: Public Sub MakeInputArray() Input(0) = Form2.TextBox1.Text Input(1) = Form2.TextBox2.Text End Sub...
2
by: Ruslan A Dautkhanov | last post by:
Hello ! I'm about to install O9i on FreeBSD box. uname -a: FreeBSD stat2.scn.ru 5.2.1-RELEASE-p3 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.