Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » Can I use Upp::Oracle8 connect to Oracle10?
Can I use Upp::Oracle8 connect to Oracle10? [message #6083] Mon, 30 October 2006 06:41 Go to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
#include <Core/Core.h>
#include <Oracle/Oracle8.h>
#include <iostream>

CONSOLE_APP_MAIN
{
	Oracle8 oracle;
	Cout() << "Connecting...\n" ;
	Cout() << "Connect state: " << oracle.Open("xxx/yyy@zzz") << "\n" ;
	
	Sql sql(oracle);
	
	String cmd = "select * from tab;" ;
	Cout() << "Excuting " << cmd << "...\n" ;
	sql.Execute ( cmd ) ;
	Cout() << "Excute done...\n" ;
        // Everything right here.. 
	while( sql.Fetch() )  // this line wrong.. in the function Fetch(), a ASSERTION error...
	    Cout() << String(sql[0]) << ": " << String(sql[1]);
	
}


So.. What can I do know ^^?
Thx a lot.
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #6085 is a reply to message #6083] Mon, 30 October 2006 07:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Well, all of my money are from connecting Oracle8 to Oracle 10 Smile

ASSERT in Fetch usually indicates SQL error. Not 100% sure now, but I think that semicolon can produce it.

In any case, use sql.SetTrace() in debug mode to find out what is wrong with your SQL.

Mirek
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #6087 is a reply to message #6085] Mon, 30 October 2006 07:30 Go to previous messageGo to next message
yoco is currently offline  yoco
Messages: 25
Registered: June 2006
Location: Taiwan
Promising Member
Thank you very much.
I have succeed in connecting from Oracle8 to Oracle10. ^O^
The problem is the semicolon.
I am so glad >_< thx again.
icon9.gif  Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9168 is a reply to message #6083] Thu, 19 April 2007 21:44 Go to previous messageGo to next message
Sbleck is currently offline  Sbleck
Messages: 16
Registered: April 2007
Location: Brazil
Promising Member

Hi,

I tried to see this code running to learn more about U++ and the connection to Oracle databases, but the only result I obtained were errors (a lot of them, unfortunately...). I tried to compile with MingW (and MSC) the code below:

#include <Core/Core.h>
#include <Oracle/Oracle8.h>
#include <iostream>


CONSOLE_APP_MAIN
{
Oracle8 oracle;
Cout() << "Connecting...\n";
Cout() << "Connect state: " << oracle.Open("scott/tiger@prev") << "\n";

Sql sql(oracle);

String cmd = "select * from emp" ;
Cout() << "Executing " << cmd << "...\n";
sql.Execute ( cmd ) ;
Cout() << "Execute done...\n";
// Everything right here..
while( sql.Fetch() ) // this line wrong.. in the function Fetch(), a ASSERTION error...
Cout() << String(sql[0]) << ": " << String(sql[1]) << "\n ";

}

The code above I named it "SQL_Oracle2", because I checked the sintax and compared the code with another example, named "SQL_Oracle". Probably I'm doing something wrong, but I could't find why I had problems with a little piece of code. Please take a look in the attached file, also. If anybody could help, any advice should VERY appreciated...

Tks in adv,
Sven
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9176 is a reply to message #9168] Thu, 19 April 2007 23:05 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
There is missing

using namespace Upp;

Acutally, this code does not connect to the database:

oracle.Open("scott/tiger@cxl");

Please do not post those zips, if you are getting a lot of problem, just list them in the message. Did not had to send .pngs. Errors listing would have been enough.

Mirek
icon7.gif  Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9179 is a reply to message #9176] Fri, 20 April 2007 01:15 Go to previous messageGo to next message
Sbleck is currently offline  Sbleck
Messages: 16
Registered: April 2007
Location: Brazil
Promising Member

Hi Mirek,

Quote:


There is missing

using namespace Upp;

Actually, this code does not connect to the database:

oracle.Open("scott/tiger@cxl");

Please do not post those zips, if you are getting a lot of problem, just list them in the message. Did not had to send .pngs. Errors listing would have been enough.



Tks for your comments, because only after them was possible to see this sample code running. Sorry for my lack of enough knowledge about U++/C++, but I'm waiting for the U++ Users Manual (or other type of How-Tos), too Very Happy . But an error appeared, like "Assertion failed in C:\upp\Core/Value.h, line 431, dynamic_cast<const RichValueRep *(p)". What this problem could mean ? Confused

I couldn't understant what you said about not connecting to the database, also. Because was possible to connect... Very Happy

And regarding to the jpg images, please don't be bored about this. I sent (in compressed form, of course) it only to be possible to see what is really happening, in the screen. These files are for problem explanation purposes, only... Very Happy

Regards,
Sven
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9184 is a reply to message #9179] Fri, 20 April 2007 08:57 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Sbleck wrote on Thu, 19 April 2007 19:15


But an error appeared, like "Assertion failed in C:\upp\Core/Value.h, line 431, dynamic_cast<const RichValueRep *(p)". What this problem could mean ? Confused



This means you are retrieving incompatible type. Like Value has String inside and you are trying to convert it to int.

Quote:


And regarding to the jpg images, please don't be bored about this. I sent (in compressed form, of course) it only to be possible to see what is really happening, in the screen. These files are for problem explanation purposes, only... Very Happy



Please do not do that! Quote error messages, code, or zip your main package and post.

Mirek
icon7.gif  Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9243 is a reply to message #6083] Mon, 23 April 2007 21:07 Go to previous messageGo to next message
Sbleck is currently offline  Sbleck
Messages: 16
Registered: April 2007
Location: Brazil
Promising Member

Hi,

Quote:


Well, all of my money are from connecting Oracle8 to Oracle 10



Fortunately, I choosed a good environment. Having Oracle access through U++ was a very good thing, when looking for performance...

Quote:


ASSERT in Fetch usually indicates SQL error. Not 100% sure now, but I think that semicolon can produce it.

In any case, use sql.SetTrace() in debug mode to find out what is wrong with your SQL.



And, if you could add more details about using sql.SetTrace, should be very appreciated, also...

Sven
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9260 is a reply to message #9243] Tue, 24 April 2007 13:58 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Just use SetTrace and you will have all SQL statements issued logged (in .log file).

Mirek
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #23202 is a reply to message #9260] Fri, 25 September 2009 11:39 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello All!

Can I connect Upp::Oracle8 through Oracle10 OCI on ubuntu? I have installed Oracle client 10g2. From sqlplus connection through tnsname works fine.

I compiled the application but when I run I get the error message:
Error loading OCI8 Oracle connection dynamic library.

What I did wrong?

I see that I need to copy oci.dll in the same directory? what file from #ORACLE_HOME?

Help please!

Thanks in advance!
Previous Topic: Postgres and CurrVal
Next Topic: Linux Oracle UPP
Goto Forum:
  


Current Time: Fri Mar 29 01:11:38 CET 2024

Total time taken to generate the page: 0.02576 seconds