473,804 Members | 3,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Help using Oracle Sequence

Hello:

I am running VB.Net to access a oracle 10g table that has a sequence.

This is what I tried:

Dim liID As Integer = 0
Dim lodcCMD As OleDbCommand = New OleDbCommand("S ELECT
SUGGEST_SEQ.Nex tVal FROM DUAL;", odcMain)
odcMain.Open()
liID = CType(lodcCMD.E xecuteScalar(), Integer)

I get the following exception that I really don't understand:

Run-time exception thrown : System.Data.Ole Db.OleDbExcepti on - One or more
errors occurred during processing of command.
ORA-00911: invalid character

Please help.

venki

Nov 21 '05 #1
2 6402
I found the problem. It was the semicolon that was the culprit.

"vvenk" wrote:
Hello:

I am running VB.Net to access a oracle 10g table that has a sequence.

This is what I tried:

Dim liID As Integer = 0
Dim lodcCMD As OleDbCommand = New OleDbCommand("S ELECT
SUGGEST_SEQ.Nex tVal FROM DUAL;", odcMain)
odcMain.Open()
liID = CType(lodcCMD.E xecuteScalar(), Integer)

I get the following exception that I really don't understand:

Run-time exception thrown : System.Data.Ole Db.OleDbExcepti on - One or more
errors occurred during processing of command.
ORA-00911: invalid character

Please help.

venki

Nov 21 '05 #2
Too much SQL*Plus? ;-)

Yes, that error is so common switching from Oracle SQL*Plus to ODBC / OLEDB
that it would be a good idea for Microsoft to ignore that semicolon in its
ODBC drivers, OLEDB Providers and .NET Data Providers for Oracle.

BTW, why are you using the OLEDB Provider? There are at least 2 free native
..NET data providers for Oracle: the one from Microsoft and the one from
Oracle (ODP.NET) which are a better alternative.

--

Best regards,

Carlos J. Quintero

MZ-Tools: Productivity add-ins for Visual Studio .NET, VB6, VB5 and VBA
You can code, design and document much faster.
Free resources for add-in developers:
http://www.mztools.com

"vvenk" <vv***@discussi ons.microsoft.c om> escribió en el mensaje
news:FF******** *************** ***********@mic rosoft.com...
I found the problem. It was the semicolon that was the culprit.

"vvenk" wrote:
Hello:

I am running VB.Net to access a oracle 10g table that has a sequence.

This is what I tried:

Dim liID As Integer = 0
Dim lodcCMD As OleDbCommand = New OleDbCommand("S ELECT
SUGGEST_SEQ.Nex tVal FROM DUAL;", odcMain)
odcMain.Open()
liID = CType(lodcCMD.E xecuteScalar(), Integer)

I get the following exception that I really don't understand:

Run-time exception thrown : System.Data.Ole Db.OleDbExcepti on - One or
more
errors occurred during processing of command.
ORA-00911: invalid character

Please help.

venki

Nov 21 '05 #3

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

Similar topics

1
3706
by: pleake | last post by:
Following is a logon.asp script. This script works when IIS is reset each day. The epapi object is a vendor api program I do not have the code for! The logon process involves three servers: the IIS server, a Novell Server with executable programs on it including the API program, and an Oracle server. The logon sequence is to use the IIS anonymous user account to access the Novell Server which in turn instructs the API programs as to...
1
3482
by: Uma | last post by:
Hi.. here is my question.. these are my Oracle scripts . I want the similar concepts in DB2 connect system/manager /********************************************/ /* Create the two roles used by MWMS system */
2
2532
by: Ken | last post by:
I got an Access database that need to be converted to Oracle 9i. Somehow the Trigger we created to simulate the "AUTO NUMBER" on Access could not create the sequence number as soon as the value has been inserted. The sequence number can only be created after we go to the second line. Please see the trigger below. Is there anyway we could create a trigger that could create the sequence number as soon as we enter a value? It should be...
15
4194
by: marvado | last post by:
Hi, can I run phpinfo(); or any php code from an oracle plsql package using htp.p from the oracle web toolkit owa? what I need is to run any php code using htp.p() I might be missing something, in my oracle/apache/php configuration I can only run flat .php files from /htdocs but can't run any php from a plsql procedure to display on a browser with htp.p
14
6417
by: ruediger.michels | last post by:
hi, 1. is there a statement in ms sql, what creates a sequence? cant find anything in web :-( -oracle: CREATE SEQUENCE XYZ INCREMENT BY 1 START WITH 1 NOCYCLE CACHE 20; -ms sql: ??? 2. hwo do i create a link to another ms-sql database
0
1432
by: saraths007 | last post by:
I am using oracle 10g database...i have two oracle instances(SID)...I want to migrate data from one instance to the other...There is one problem while importing a particular table....say Table 'ABC' The primary key of that table ABC is a sequence number...my current database table ABC has records up to values 8000 ...The same table ABC in the other instance has records up to 6000...the first 4000 values are same in both the tables ...so i...
2
4811
by: mattynott | last post by:
Hi I've created a sequence on a table using oracle 10g express edition by using the following code: create sequence referee_seq START WITH 1 INCREMENT BY 1 I then add a row to my table by using the following code: insert into referee values(referee_seq.NEXTVAL,'','','','','','','','','','')
0
3485
debasisdas
by: debasisdas | last post by:
PL/SQL: Sequences ================ In Oracle, the sequences object provides a sequential series of numbers to applications without the overhead of disk I/O or transaction locking. These values are often used for primary and unique keys. In the previous release of Oracle Database, You can refer the sequence values in SQL statements with following pseudocolumns: CURRVAL returns the current value of a sequence. NEXTVAL
11
7883
by: tracy | last post by:
Hi, I really need help. I run this script and error message appeal as below: drop trigger log_errors_trig; drop trigger log_errors_trig ERROR at line 1: ORA04080: trigger 'LOG_ERRORS-TRIG' does not exist drop table log_errors_tab;
0
9579
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
10575
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
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10076
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...
0
6851
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
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
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
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
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.