p2p.wrox.com Forums

Need to download code?

View our list of code downloads.


Go Back   p2p.wrox.com Forums > Database > Oracle ASP
I forgot my password Register Now
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Oracle ASP Using ASP with Oracle databases. For Oracle discussions not specific to ASP, please see the Oracle forum. For more ASP discussions, please see the ASP forum category.

Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle ASP section of the Wrox p2p Programmer to Programmer discussion community. This is a community of more than 40,000 computer programmers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining our free Wrox p2p community you can post your own programming questions and respond to other programmers’ questions. Registered users also don't have to see the ads that are displayed to guests. Registration is fast, simple and absolutely free so please, join today!
Join today and post to win prizes! Post more to increase your chances of being Wrox’s top poster of the month.

Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 16th, 2006, 11:05 AM
Registered User
 
Join Date: May 2006
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ORA-00911: invalid character

I'm getting this error with my code below. However the error is only there when I have my WHERE statement. Any help would be appreciated.
Code:
<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection"); 
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;"); 

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = 0031635500;"; 
  Cust = db.Execute(query1);        

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>
Code:
<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection"); 
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;"); 

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = '0031635500';"; 
  Cust = db.Execute(query1);        

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>
Code:
<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection"); 
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;"); 

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = ' + 0031635500 + ';"; 
  Cust = db.Execute(query1);        

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>
Code:
<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection"); 
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;"); 

  var numtest = 0031635500;

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = ' + numtest + ';"; 
  Cust = db.Execute(query1);        

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>
Those are all variations that I had tried and the only one I can do and not get the error is
Code:
<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection"); 
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;"); 

  var query1 = "SELECT AREA FROM ADDN;"; 
  Cust = db.Execute(query1);        

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #2 (permalink)  
Old July 22nd, 2006, 05:10 PM
Authorized User
 
Join Date: Apr 2006
Location: Edmonton, , Canada.
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I noticed in one case you encase your PARID value in single quotes (i.e. a string/varchar datatype) and in the first instance, you have it as an integer (no single quotes).

Could that possibly be the cause of your problem? (i.e. if PARID is an integer, don't encase it in single quotes, if PARID is supposed to be a varchar/string then encase it in single quotes).

Also, beyond that, maybe I'm just not familiar with what you're doing, but within the single quotes you have + 0031635500 + , as though you are inserting a variable in there. What was the purpose of the single quotes and plus symbols?

Also, further down, you have ' + numtest + '

numtest is a variable in your C# code. What you really want here I believe is:

var query1 = "SELECT AREA FROM ADDN WHERE PARID = " + numtest + ";";


So correct me if I'm wrong, but I think your code should look like this (assuming PARID is of an integer datatype):
[code]

<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection");
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;");

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = 0031635500;";
  Cust = db.Execute(query1);

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>




<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection");
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;");

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = 0031635500;";
  Cust = db.Execute(query1);

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>





<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection");
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;");

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = 0031635500;";
  Cust = db.Execute(query1);

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>





<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection");
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;");

  var numtest = 0031635500;

  var query1 = "SELECT AREA FROM ADDN WHERE PARID = " + numtest + ";";
  Cust = db.Execute(query1);

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>



Those are all variations that I had tried and the only one I can do and not get the error is


<% @Language = JScript %>
<html>
<head>
<%
  var db=Server.CreateObject("ADODB.Connection");
  db.Open("Provider=OraOLEDB.Oracle;Data Source=IAS4;User Id=client;Password=password;");

  var query1 = "SELECT AREA FROM ADDN;";
  Cust = db.Execute(query1);

%>
</head>

<body>

<%=Cust("AREA")%>

</body>

</html>

[code]
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
  #3 (permalink)  
Old August 18th, 2008, 07:52 AM
Registered User
 
Join Date: May 2007
Location: bangalore, karnataka, India.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Remove the semi-colon; It will work.

Mohammed Ayyub
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit!
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Invalid Character in the given encoding mswin XSLT 3 November 28th, 2008 06:01 AM
% is an invalid character? owoade .NET Web Services 1 August 12th, 2007 01:32 PM
ORA-14100 auxiora_nemesis Oracle 0 April 6th, 2007 05:25 AM
[Oracle][ODBC][Ora][ORA-01013 Corey Access 1 December 15th, 2006 10:29 AM
An invalid character was found in text content crmpicco Excel VBA 2 May 4th, 2005 05:43 AM



All times are GMT -4. The time now is 02:32 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
© 2008 Wiley Publishing, Inc