473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
OracleConnectio n(Configuration Settings.AppSet tings("connecti onstring"))

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

myconnection.Op en()

cmdsetdefineoff .ExecuteNonQuer y()

myconnection.Cl ose()

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.Ora cleClient.Oracl eException: 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.Ora cleClient.Oracl eConnection.Che ckError(OciErro rHandle
errorHandle, Int32 rc) +174
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
rowidDescriptor , ArrayList& refCursorParame terOrdinals) +1919
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor ) +32
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQueryIntern al(Boolean
needRowid, OciHandle& rowidDescriptor ) +170
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQuery() +56
Global.SetDefin eOff() in C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSu bmitNotesLink_C lick(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.432 2.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********@hotm ail.com
http://www.nathansokalski.com/
Nov 10 '05 #1
3 8412
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
OracleConnectio n(Configuration Settings.AppSet tings("connecti onstring"))

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

myconnection.Op en()

cmdsetdefineoff .ExecuteNonQuer y()

myconnection.Cl ose()

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.Ora cleClient.Oracl eException: 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.Ora cleClient.Oracl eConnection.Che ckError(OciErro rHandle
errorHandle, Int32 rc) +174
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
rowidDescriptor , ArrayList& refCursorParame terOrdinals) +1919
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor ) +32
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQueryIntern al(Boolean
needRowid, OciHandle& rowidDescriptor ) +170
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQuery() +56
Global.SetDefin eOff() in C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSu bmitNotesLink_C lick(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.432 2.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********@hotm ail.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
OracleConnect ion(Configurati onSettings.AppS ettings("connec tionstring"))

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

myconnection. Open()

cmdsetdefineo ff.ExecuteNonQu ery()

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.Ora cleClient.Oracl eException: 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.Ora cleClient.Oracl eConnection.Che ckError(OciErro rHandle
errorHandle , Int32 rc) +174
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavi or behavior, Boolean isReader, Boolean needRowid, OciHandle&
rowidDescript or, ArrayList& refCursorParame terOrdinals) +1919
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavi or behavior, Boolean needRowid, OciHandle& rowidDescriptor ) +32
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQueryIntern al(Boolean
needRowid, OciHandle& rowidDescriptor ) +170
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQuery() +56
Global.SetDefin eOff() in C:\Documents and Settings\Nathan
Sokalski\VSWe bCache\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSu bmitNotesLink_C lick(Object sender, EventArgs e) in
C:\Document s and Settings\Nathan
Sokalski\VSWe bCache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument ) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl , String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.4 322.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********@ho tmail.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
OracleConnectio n(Configuration Settings.AppSet tings("connecti onstring"))

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

myconnection.Op en()

cmdsetdefineoff .ExecuteNonQuer y()

myconnection.Cl ose()

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.Ora cleClient.Oracl eException: 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.Ora cleClient.Oracl eConnection.Che ckError(OciErro rHandle
errorHandle, Int32 rc) +174
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean isReader, Boolean needRowid, OciHandle&
rowidDescriptor , ArrayList& refCursorParame terOrdinals) +1919
System.Data.Ora cleClient.Oracl eCommand.Execut e(OciHandle statementHandle ,
CommandBehavior behavior, Boolean needRowid, OciHandle& rowidDescriptor ) +32
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQueryIntern al(Boolean
needRowid, OciHandle& rowidDescriptor ) +170
System.Data.Ora cleClient.Oracl eCommand.Execut eNonQuery() +56
Global.SetDefin eOff() in C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...bal.asax.vb:32
newsadmin.btnSu bmitNotesLink_C lick(Object sender, EventArgs e) in
C:\Documents and Settings\Nathan
Sokalski\VSWebC ache\http://www.webdevlccc.com\lvbeporgte...min.aspx.vb:71
System.Web.UI.W ebControls.Butt on.OnClick(Even tArgs e) +108
System.Web.UI.W ebControls.Butt on.System.Web.U I.IPostBackEven tHandler.RaiseP ostBackEvent(St ring
eventArgument) +57
System.Web.UI.P age.RaisePostBa ckEvent(IPostBa ckEventHandler
sourceControl, String eventArgument) +18
System.Web.UI.P age.RaisePostBa ckEvent(NameVal ueCollection postData) +33
System.Web.UI.P age.ProcessRequ estMain() +1292

--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.432 2.2300; ASP.NET
Version:1.1.432 2.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********@hotm ail.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
3070
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 I have (Connection object has been crreated.) then.. LnDetail = "{ call IPV$po.getPOLine(?,?, {resultset 1, "& _ " p_orderType, p_orderID, p_reqNum, p_nsn, "& _ " p_reqStatus, p_priceStatus, p_errFlag, p_errMsg})}"
2
1798
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 server but none of my queries seem to work. What happens is that ASP/IIS times out. In an effort to see what's really happening, I put the following code in to see how many records were being returned by the query. In EVERY CASE, the number of...
125
15414
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 searches. Scott has heard a lot of hype about DB2 and Oracle and is trying to understand the pros and cons of each product. I'm quite familiar with DB2 but have never used Oracle so I can't make any meaningful comparisons for him. He does not have...
2
1677
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 (but obviously with much more code): <% Option Explicit Call X
1
9190
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 will work for 9i and even 10g ) No one had what I needed, so I wrote it myself. I Rule. This code isn't going for efficiency, and isn't trying to be dynamic. It doesn't create the table structure in Oracle, that's up to you. (I
3
1635
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 OracleConnection(ConfigurationSettings.AppSettings("connectionstring")) Dim cmdsetdefineoff As New OracleCommand("SET DEFINE OFF", myconnection)
7
20317
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, if they do not already exist. In terms of ASP/ADO, that would be fine in a SQL Server Sense by a simply ASP/Server-Side JavaScript as such: var cnTemp = Server.CreateObject("ADODB.Connection");
2
1345
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 You can see that the procedure refers to Form2. I want to use the exact same procedure to refer to Form3 too. I want something like this:
2
3560
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 rd@stat2.scn.ru:/usr/src/sys/i386/compile/RDSTAT2-ORACLE i386 uname -a under oracle user : Linux stat2.scn.ru 2.4.2 FreeBSD 5.2.1-RELEASE-p3 #2: Fri Apr 23 19:19:43 KRAST 2004 i686 unknown
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8626
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6178
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.