|
|
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 |
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 #9168 is a reply to message #6083] |
Thu, 19 April 2007 21:44 |
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 #9179 is a reply to message #9176] |
Fri, 20 April 2007 01:15 |
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 . 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 ?
I couldn't understant what you said about not connecting to the database, also. Because was possible to connect...
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...
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 |
|
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 ?
|
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...
|
Please do not do that! Quote error messages, code, or zip your main package and post.
Mirek
|
|
|
Re: Can I use Upp::Oracle8 connect to Oracle10? [message #9243 is a reply to message #6083] |
Mon, 23 April 2007 21:07 |
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 #23202 is a reply to message #9260] |
Fri, 25 September 2009 11:39 |
|
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!
|
|
|
Goto Forum:
Current Time: Fri Mar 29 01:11:38 CET 2024
Total time taken to generate the page: 0.02576 seconds
|
|
|