SQL & PL/SQL :: Connecting From Oracle To Excel To Copy Results In Cell Value
Aug 29, 2012
How can I connect excel from pl / sql to copy results from the query. I was trying with OLE2 but it is throwing error as "invlid Identifier". Then how to include OLE2 in oracle.
I want to copy some rows in one column from Excel and Paste it in a Oracle Forms Progam. Normaly with the clipboard. But my Oracle Forms 6i Program copy alle the rows in one Field, separated with a | character. But I need it in several rows.
I'm trying to make a connection to sql server from an ORACLE 8.0.4 (I know, it's ancient) but can't seem to get it to work. I've read a lot of articles on the internet regarding the Heterogeneous Services but just can't get it to work on my system. Therefor I tried an example on connecting to an Excel workbook I found on another forum [URL] but that gives me the same problem as with connecting to sql server.
Here is what I've got: initFRUIT.ora CODEHS_FDS_CONNECT_INFO = SPONGE HS_FDS_TRACE_LEVEL = OFF LISTENER.ORA CODESTARTUP_WAIT_TIME_LISTENER = 0
[code]....
One thing I noticed is that I do not have an hsodbc.exe file in my \bin, should it be there? (I also tried Tgmsql80 in stead of hsodbc as program in Listener, resulting in an extended time of testing the connectivity but with the same result)
Is there any way I can test parts of the connection to limit the location of the problem? (e.g. does the listener get to the TNS)
I am building the Oracle on RHEL 5(on Virtual machine with fixed disk space). I could install, after configuring and tried to connect to the database using "sqlplus system" on the command prompt(logged in as root), I get the following error message:
ORA-01034: ORACLE not available ORA-27101: shared memory realm does not exist Linux Error: 2: No such file or directory
My Oracle user which i created 5-6 months ago is not getting today when i tried to connect.But sys is getting connected.Also i queried dba_users in which my user was present. Also i did Alter user to change its password successfully., but it is not connecting.
I have been trying to connect to an remote oracle db from c# .Net . I believe I have the proper code (Cos when the user id and password strings were omitted , it threw an error of invalid user Id and password).
Once this was properly provided , the connection is now throwing "TNS Error : No Listener " error . The same remote DB is perfectly connecting through TOAD and it is from the tnsnames.ora file of the local file that i got the connection string from . Hence , I don't thing its a problems with that as well.
I am trying to learn Oracle and trying to use Visual Basic 7 to connect to an Oracle database, upload a text file to an empty table and then update a second Oracle table based on the info in the first table. I know you can do this with SQL*Loader, but how about VB? I did some research and found this posting: Re: Using Bulk insert or SQL Loader in VB6 I borrowed the code from there and altered it for my application (see below).
Dim con As New ADODB.ConnectionDim rst As New ADODB.RecordsetDim rst2 As New ADODB.RecordsetDim rst3 As New ADODB.Recordset con.ConnectionString = "Provider=OracleDB;User ID=john;Password=doe;Data Source=TestDB;"con.Open 'open the text filerst.Open "C:OracleTestCombinedCombined.txt" 'rst2 is an empty recordset because TempTable is empty at this time.rst2.Open "select * from TempTable", con, adOpenDynamic, adLockOptimistic 'adding rows into TempTable.Do Until rst.EOFrst2.AddNew Array("PACKET", "DATERET"), Array(rst.Fields("PACKET"), rst.Fields("DATERET"))rst.MoveNextLoop rst.Closerst2.Closecon.Close
My second question is this - say I had a second Oracle table in the same DB called "MasterTable", with the same two fields as "TempTable" (PACKET and DATERET). I want to update the DATERET field in "MasterTable" with the DATERET field in "TempTable" ONLY when the "PACKET" field matches in both tables.
I know how to create a database link between two oracle servers, but problem is that SID is same for both servers, Is there any other way to connect two servers without using only 'SID' ..here are TNSNAMES.ORA FILE i HAVE
Im trying to connect a benchmarking application (benchmark factory) from my windows 32bit laptop to Oracle on my linux desktop.
When connecting I am supplying the following details: (im getting the error: ORA 12170 : TNS connect timeout occurred)
User/Schema : matt Password: **** Host: 192.168.1.9 Port: 1521 SID: orcl Connect as : SysDBA Connect Using: Instant Client (selected from a drop down) ----------------------------------------------------
I have installed Oracle 10g in Windows XP which is in 'VMware' as guest OS. share the procedure if we can connect to the oracle installed in Guest OS from the main operating system.
i am using windows xp home edition (with oracle 11g r2). oracle installed with out any problems but when i click get started internet explorer it says(internet explorer cannot display the webpage) this is the address get started open up to [URL]...but does not work.
i am a Microsoft SQL Server user,and I recently thought of migrating to Oracle.So to give it I try I downloaded the following files : [URL]
But for the past two days I am heck stuck with making a Proper Installation ! I have swept the Internet and the Oracle Forums but there is not single tutorials on how to 'INSTALL' these products completely.(All tutorials are on on 10 XE and dont cover Dev Tools installation)
For eg. I installed Oracle 11 XE and ODAC 11.2 Release 5 (11.2.0.3.20) with Oracle Developer Tools for Visual Studio but still the database was not connecting.A blog suggested that I should edit and place the tnsname.ora files in the correct location then I should configure the machine.config file.But Oracle says that its universal installer automatically configures the config file.
Honestly,I love tough things but its stupid the way oracle is deploying its products. how to install and configure Oracle 11 XE with Visual Studio 2010.
dont get me wrong but this is way too outdated: [URL]
connecting two oracle database in two different server.I installed Oracle 10g XE in both system.Both system act as Server.I need to connect both server using database link concept.
how to use the tnsnames,ora and listener.ora file for connecting both system.
I am using OCI and instant_client (11.2.0.3.0) in my C++ program (on Windows 7) to connect remotely to 11G database. While doing a connection using server name as well as servername:port/service_name as connection strings, I am getting error of ORA-12504 TNS:listener was not given the SERVICE_NAME in CONNECT_DATA. According to instant client FAQ & white paper at [URL]..., no tnsnames.ora is required for instant client. Then why could I be getting this error? I ensured that only the instant client directory is in Path environment variable. There was a ODBC driver installed on this same host.
I'm using following connection string: +connectionString="Driver={Oracle ODBC Driver};Server=someDb;Uid=useruidr;Pwd=password"+
when I call method "Open" on "OdbConnection" I get following exception: +ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified+
"someDb" is specified correctly in tsnames.ora, "...client" and "...clientin" are added to PATH environmental variable ORACLE_HOME is set to "...client"
I have Oracle Client 11.2.0.3.0 installed Operating system is Windows 7 32 bit
When I change Driver to "Microsoft ODBC for Oracle" it works fine. However I want to use Oracle ODBC Driver.
Oracle 11g on linuxdestination : ms sql server 2005 i need to create the db link from oracle to ms sql server to view the tables , is it posibble without configuring the gateways( as looks like it is licenced product)
"instantclient" already downloaded and configured as below :
dll files like "oci.dll,... etc" are here : C:Oracleinstantclientinstantclient_11_2 Created both tnsnames.ora & listener.ora are here : C:Oracleinstantclient etworkadmin
And did the below in user/system variables :
User Variables : ========= TNS_ADMIN with value "C:Oracleinstantclient etworkadmin"
System Variables : =========== TNS_ADMIN with value "C:Oracleinstantclient etworkadmin" ORACLE_HOME with value "C:Oracleinstantclient" Path edited and added this value "C:Oracleinstantclientinstantclient_11_2"
Connecting Oracle to SQL Server via database link.
I am trying to connect from Oracle 10G to a SQL Server database. I have looked at the manual and i will admit that i am finding the documentation quite difficult to follow. There seems to be several options to use but none of the documentation describe how each option works.
As an example, i have been given the following information on the database i need to connect to (i.e. the SQL Server database)
- Username - Password - Database Name [lets assume the database name is data_extract]
Note: In listener.ora, i only added the last SID_DESC entry. I then went on and created the database link as shown below
create database link sqlservdb using 'sqlserver.db';
When i try to access a table i get the following error
sqlplus> select * from TESTTABLE@sqlservdb; select * from TESTTABLE@sqlservdb * ERROR at line 1: ORA-28545: error diagnosed by Net8 when connecting to an agent Unable to retrieve text of NETWORK/NCR message 65535 ORA-02063: preceding 2 lines from ORASQLSERVER
A couple of things i am not sure of:
- Where do i specify the username and password to access the sql server from the oracle db to the sql server db
- Having read around on the internet, i can see some people refering to a DSN datasource. I am told that the information that i have is all i need. Is this correct or do i need something else?
- The sid i specified in inithsodbc.ora and tnsnames.ora is actually the sql server database. Is this correct?
connecting to an oracle db with the instant client 11.01.06. I can connect to the db via other tools like sqldbx or SqlTools 1.5 which are also using oci. So now I tried it with c++ using Visual Studio 2005 SP1.
where tnsservice-name is the name I specified in the tnsnams.ora, and which I used with the other tools working fine -> same error.My username is only 4 long, so I thought it might have something to do with the string. So I tried:
now it returned the error "TNS:connect descriptor too long". Can't have anything to do with the .ora file, since it worked fine for the other tools. Plus it didn't matter if I renamed the .ora file or removed it from the TNS_ADMIN directory..So I searched a little more for a solution and so an example, where the the last argument is missing. So I tried
It returns: "TNS: protocol Adapter error" which I somehow can understand, since the adapter doesn't know to wich db to connect.I also tried to use some frameworks like soci or otl but was never able to compile them... (link errors, unknown data types etc...).
On our production servers we have simple function with result_cache, like this:
create or replace function f_rc(p_id number) return number result_cache is ret number; begin select t.val into ret from rc_table t where t.id=p_id; return ret; exception when no_data_found then return null; end;
/And its results frequently invalidates without any changes in table or function. I found only 2 cases when oracle invalidates result_cache results without any changes in table:
1. "select for update" from this table with commit; 2. deletion of unrelated rows from parent table if there is unindexed foreign key with "on delete cascade".
I test it on 11.2.0.1, 11.2.0.3, on solaris x64 and windows. Test cases:
[URL]......
But none of them can be the cause of our situation: we have no unindexed fk, and even if i lock all rows with "select for update", it still does not stop invalidating. In what other cases this happens? Am I right that the oracle does not track any changes, but the captures of the locks and "commits"?
I've migrated from Oracle 9i to Oracle 11gR2, when i'm checking my application on Oracle 11gR2, i found that some of the query result are differed from the previous version of Oracle 9i, which is very illogical to me. I've checked the data for all related tables which are involved in one of the query. I've checked all indexes also. Still i'm not convinced that Oracle is doing anything wrong. I cannot recreate the whole scenario here, because of many tables involved in that query.
One of the sample query code.
select 'ProductMaster' producttype,e.schemecd,e.SCHEMESHORTDESC as SCHEMEDESC,to_char(e.schemefrdate,'dd/MM/yyyy')as schemefrdate, to_char(e.schemetodate,'dd/MM/yyyy') as schemetodate,e.mkid ,e.countrycd,e.statecd,e.districtcd,f.schemetype, a.productcd,a.packsizecd,a.packtypecd,a.sortorder1, a.countrycd,a.statecd,a.districtcd,a.p_uniqueid,a.mrp, (a.productcd ||'-'||b.countryname||'-'||c.statename||'-'||d.districtname|| ' -pkt.prc:'||a.pktprice ||' -mrp:'||a.mrp) as pcode from wb.wbproductdetails a
I use sqlplus in oracle (linux). I have a table and the string cell have long string . Like below :
CODEcolumn A Column B
A BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB .....................................BBBBBBBBBBB
So, I need to edit/update the row A and the value in Column B. But the string in Column B is so long and I only need to edit one character. IF I use update command , I need to type very long string and it is easy to wrong edit .