MS Access Crosstab to Oracle SQL
Gurus,
I am trying to convert MS Access Query to Oracle SQL, What would be the Oracle query for this MS Access Crosstab Query?
I am working on Oracle 10g so, I can't take advantage of oracle PIVOT function.
Thank you
Edited by: 951334 on Aug 10, 2012 6:52 AM
Edited by: 951334 on Aug 13, 2012 5:51 AM
if your crosstab columns are static you can use well-known technique like
select tablespace_name,
sum(case segment_type when 'TABLE' then bytes end) TABLES_BYTES,
sum(case segment_type when 'INDEX' then bytes end) INDEXES_BYTES,
sum(case segment_type when 'LOBSEGMENT' then bytes end) LOB_BYTES
from dba_segments
group by tablespace_name;
for dynamic crosstab columns you require to build this query dynamically in application
Similar Messages
-
Migration: Access 2003 to Oracle SQL
Dear All
I would like to perform a migration from Access 2003, to Oracle 10g. I am using SQL Developer for the task, and have reached the point of capturing the XML file that I exported from Access. I need to create a migration repository on the target database, and this is causing problems as I do not have all the necessary privileges.
In the process, I have been advised that migrations from Access to Oracle are not easy to achieve, and in fact require careful planning before execution. My objective is not really to transfer the data stored within the database file. I only really want to convert Access logic into Oracle SQL code. I was wondering if anyone could advise on the typical odds of success in achieving this task.
I migrated the same Access database to MS SQL Server some time ago and the process seemed to go smoothly. Would it be reasonable then to migrate from MS SQL to Oracle SQL if this is easier?
Any feedback would be very much appreciated.
Thank you.
MThanks for your response.
I am not familiar with the intricacies of the process, I'm just following the instructions set out in the Oracle Migrating 3rd Party Databases white paper.
In this document, a process is set out consisting of steps that export an Access database, and then capture it to an Oracle user area with appropriate privileges. The process is achieved through Oracle SQL Developer.
I'd be very grateful if you could expand on your answer if there is a better way of translating Access queries into Oracle SQL. I am aware that an Access front-end is capable of connecting with an Oracle database to execute queries, however, there are considerable limitations in the use of Access that I would like to avoid - hence the migration. -
How to connect access database through oracle sql prompt
i want to connect access database via oracle , i am trying to import all the data in Access table into oracle table how it is possible .
A.RThe simplest way, if You have already created tables in Oracle DB, is to open the Access MDB, link Oracle tables via ODBC and build a query to append rows reading from Access tables to Oracle tables.
Hope this helps
Max -
MS Access 2010 and Oracle SQL Developer Version 4.0.3.16 Error
OS: Windows 7 Enterprise
System Type: 64-bit Operating System
I can not get MS Access 2010 to work/open with SQL Developer version 4.0.3.16.
ERROR when testing connection to MS Access 2010
"Status : Failure -Test failed: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified"
I added the 32-bit ODBC data source for the MS Access I am trying to use with SQL Developer version 4.0.3.16 with the "C:\Windows\SysWOW64\odbcad32.exe" application, but I still get the same error.
I appears that SQL Developer version 4.0.3.16.is looking at the 64-bit driver (ODBC Data Source) and I have no idea to direct SQL Developer version 4.0.3.16 to use the 32-bit driver (ODBC Data Source) when opening MS Access 2010.
Thank you in advance for your advice.I downloaded the SQL Developer version 4.0.3.16 "sqldeveloper-4.0.3.16.84-x64.zip" that included the jre.
How do I check which Java JDK I am running (32-bit versuns 64-bit)?
In the command prompt I use "java -version" and I get this message "java is not recognized as an internal or external command" -
Converting a MS Access Query to Oracle SQL
Hi,
We have a large number of MS Access (2000) queries (mostly select queries -Some containing sub queries-) that need to be converted to Oracle's syntax to be used on our intranet instead of the existing Access frontend.
Do you know of a tool that can do this?
We understand that conversion tools are not always reliable, but even if 75% of the queries are converted for us we can then focus on the ones that pose problems.
Regards,
Charles McGrottyHi Charles,
The next release of OMWB ( version 92017, due at the end of this year) will contain some support for Select and Action queries. In that version, we will load queries from the source MS Access database into the OMWB repository. Since the MS Access plugin for OMWB does not currently contain a parser, the query text will be commented out and surrounded in an Oracle View stub - this means that the queries can, at least, be migrated to Oracle and then manually converted by the migrator from within the Oracle database. Often, the body text for a select query exactly matches the syntax for an Oracle view, so the manual work required to convert the queries may be minimal. This will be the first step in migrating MS Access Queries that the OMWB provides.
I hope this information is useful,
Tom. -
I am trying to have access tables of the Sql Server through the Oracle
I am trying to have access tables of the Sql Server through the Oracle and this being occurred the error:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Generic Connectivity using ODBC][H006] The init parameter <HS_FDS_CONNECT_INFO> is not set.
Please set it in init <orasid>.ora file.
ORA-02063: preceding 2 lines from HSMSQL
I created the ODBC with name HSMSQL.
I made all the configurations in the archives
tnsnames.ora:
HSMSQL=
(DESCRIPTION=
(ADDRESS= (PROTOCOL = tcp)(HOST = wsus)(PORT = 1521))
(CONNECT_DATA =
(SID = HSMSQL)
(HS = OK)
listener.ora:
(SID_DESC = (SID_NAME=HSMSQL)
(ORACLE_HOME= C:\oracle\ora92)
(PROGRAM =hsodbc)
initHS_SID.ora:
HS_FDS_CONNECT_INFO = HSMSQL
HS_FDS_TRACE_LEVEL = OFF
-- Create database link
create database link HSMSQL.US.ORACLE.COM
connect to TESTE identified by TESTE2
using 'HSMSQL';
But when I execute query the error occurs:
Select * from TabTeste@HSMSQL
ORA-28500: connection from ORACLE to a non-Oracle system returned this message: [Generic Connectivity using ODBC][H006] The init parameter <HS_FDS_CONNECT_INFO> is not set.
Please set it in init <orasid>.ora file.
ORA-02063: preceding 2 lines from HSMSQL
Please they help me, thanks, Paulo.Hi,
It seems that your configuration is Ok. By the way, the workaround for this error is:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Transparent gateway for ODBC][H001] The environment variable <HS_FDS_CONNECT_INFO> is not set.
* Set HS_FDS_CONNECT_INFO in the hs{sid}init.ora file to the data source name.
Example: HS_FDS_CONNECT_INFO = <ODBC DataSource Name>
* Make sure the hs{sid}init.ora file exists in the ORACLE_HOME/hs/admin directory and has the same name as the SID in the LISTENER.ORA.
Example: If SID=hsodbc in the listener.ora file, then the hs{sid}init.ora file would be named ORACLE_HOME/hs/admin/inithsodbc.ora
For more information see if this [url http://forums.oracle.com/forums/thread.jspa?forumID=61&threadID=576975]thread can help you.
Cheers -
Oracle sql developer and access db
Hi All,
I have connection to oracle and Access dbs’ on my oracle sql developer.
When i try to create a database link from oracle db to access db i have to add Host Name.
Connection details to access looks like this :
@jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\ list.mdb;DriverID=22;READONLY=false}
I tried different variants, but it doesn’t work.
Is this possible to create database link to access db, and if yes, what i have to add for a host name and what is the syntaxes for cross table ?
Thank youGood documentation here... http://www.orafaq.com/node/60
TimS -
Migrate From MS Access 2003 to Oracle using Oracle SQL Developer 3.0
Hello All,
I am trying to migrate Access DB .mdb using the Oracle SQL Dev 3.0 Data Migration Wizard, everything go very nice and smooth until the Capture Step, for sure am using the online mode, in the Capture Step the list of available databases is empty and a Msg Box saying that the DB list should have at leats one database selected, so I don't know what's that mean or how to fix this.
in my .mdb file I have four tables and I can copy the data to Oracle using the Right click and copy to Oracle Function, but it really takes much time.
Any help would be really appreciated and thanks in advance.
yours,
HusseinJust to clarify:
You have created the migration repository and start the migration using Tools => Migration => Migrate
- now you've selected the repositiry
- specified a project
- selected the source database
=> you've choosen the ONLINE Mode
==>> and now you don't see your MS Access database in the "Connection" List
Is this correct?
If the steps you're doing match the steps I've posted above, then please be aware for MS Access migrations you need to choose the OFFLINE method. The MS Access source database information is collected by the MS Access Exporter available from Tools => Migration => MS Access Exporter
Once you've created the XML/OCP file you specify this newly created file during the OFFLINE migration mode.
If your steps differ from mine, please post yours more detailed.
Thx. -
How to use Oracle SQL Developer 4.0 to connect to Ms Access file with .accdb extension
Hi all,
I am using Oracle SQL Developer 4.0 and Ms Access 2013 under Windows 7 (64 bits)
After browsing and selecting MS Access file with accdb extention, I got an error message :[Microsoft] " Data source name not found and no default driver specified".
On Administravitve Tools=> ODBC Data Source Administrator=>Drivers I have File date
Name : Version
Microsoft Acess Driver (*.mdb, *accdb) 12.00.4518.1014 ACEODBC.DLL 26/10/2006
Would you please advise?
Thank you very much in advanceThat MS Access driver is 64-bit, I think. If SQL Developer, or JDK is 32-bit you need to use the 32-bit driver. You can see if you have a 32-bit driver installed using c:\windows\system32\odbcadm32.exe
-
As the title above suggests this is a somewhat complex problem.
I have the following expression on a field in a MS Access Make Table query.
Left([SYN4_View Invalid Last Candidates]![LastName],3). The table it is referring to: SYN4_View Invalid Last Candidates is a SQL Pass-thru query on an Oracle backend. So, when the expression attempts to evaluate in MS Access 2003 I get the following error msg:
Undefined function 'left' in expression.
I am assuming this is because LEFT function can't evaluate the output of the SQL P-T. I can't use SUBSTR as Access doesn't recognize it.
I would appreciate suggestionsrobleh7 wrote:
I don't have access to the Oracle dB. No pun intended here. Everything I do, I must do from the MS Access 2003 front-end
wow .. that's kinda like sending soldiers into a war zone with a bear trap attached to their legs. O_0
Kind of blatantly trying to hamper your ability to do your job, don't you think? -
Cannot access class oracle.sql.BLOB;
Hi,
I am trying to save a .tif file into Oracle database. When I run the program in JDeveloper I get the following errors:
Error(9,19): cannot access class oracle.sql.BLOB; file oracle\sql\BLOB.class not found
Error(59,29): class BLOB not found in class mypackage1.ImageUpload
package mypackage1;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.sql.*;
import java.util.Properties;
import oracle.sql.BLOB;
Blob imgblob = rs.getBlob(1);
OutputStream blobos = ((BLOB) imgblob).getBinaryOutputStream();
...................Any help is appreciated. ThanksWhat package do I need to include in my classpath for
this. ThanksWhy don't you inspect your JAR files? Do you have WinZip? Open them with it and find the class. -
MS Access is unable to parse Oracle SQL
I wish to execute an outer join query in Reports 3.0 using MS
Access at back end. Since MS Access has a different syntax of
outer query than Oracle Sql, it is unable to parse it.
What could be the alternative or probable solution to it.
nullHi,
Unless, you are writing dynamic queries, you might want to
define your outerj SQL in MS Access and then issue a simple
SELECT in Reports against the outerj MS Access query (to MS
Access this query is just another pseudo table).
TP.
Bramanathan K (guest) wrote:
: Rajeev Grover (guest) wrote:
: : I wish to execute an outer join query in Reports 3.0 using
MS
: : Access at back end. Since MS Access has a different syntax
of
: : outer query than Oracle Sql, it is unable to parse it.
: : What could be the alternative or probable solution to it.
: Instead of outer join why don't you try with Union, I think
Union
: will go with both
null -
Translating ms-access sql to oracle sql
I would like to translate this ms-access sql to oracle sql.
SELECT
CStr(STUDENT_ID),
FIRST_NAME,
LAST_NAME,
IIF(LEN(CLASS_CODE)=3,"Y","") AS "ELEMENTARY_SCHOOL",
IIF(LEN(CLASS_CODE)=4,"Y","") AS "MIDDLE SCHOOL",
FROM T_STUDENT
Thanks in advance for your help.
SandraFor an equivalent of IIF, look at CASE or DECODE. For LEN use LENGTH.
A business rule that says elementary and middle schools can always be identifed by the length of their codes sounds rather unreliable, though. -
Accessing MySQL InnoDB tables via JDBC using Oracle SQL Developer
I had posted a problem in the Oracle SQL Developer forum with how that application (v1.1) accesses MySQL InnoDB tables and someone replied that the "[data migration] team created the integration with MySQL", so I am posting here in hopes of learning more about the problem.
Here's a summary:
When I use Oracle SQL Developer to query MySQL InnoDB tables, I need to issue a "commit" before I do each query to ensure that I am getting current results. Otherwise, it appears to be using a snapshot as-of the last commit. Is this a problem with SQL Developer, or a JDBC configuration, or MySQL problem even?
The full details are here:
Re: MySQL InnoDB tablesHi,
I've posted a response to your original thread.
Regards,
Dermot. -
Convert IIF Access SQL to Oracle SQL...
I am in the process of converting a MS Access application to VB.Net with Oracle database behind. However I am having a problem converting an MS Access Query that contains IIF statements into an Oracle SQL command. Below is the MS Access SQL code:
SELECT PDTABLE_132.UNIQUE_CLASH_ID, CISClashStatusTbl.Approval_Type AS Clash_Status, CISClashTypeTbl.Clash_Type, *IIf([TEMP_ACTION_DISCIPLINE] Is Null,"UNALOCATED",[TEMP_ACTION_DISCIPLINE]) AS ACTION_DISCIPLINE*, *IIf([CISDisciplineTbl].[Discipline] Is Null,[PD_2910A_PDTABLE_111].[DISCIPLINE_NAME],[CISDisciplineTbl].[Discipline]) AS TEMP_ACTION_DISCIPLINE*
FROM ((((((((((((PDTABLE_132 INNER JOIN PD_2910A_PDTABLE_113 ON PDTABLE_132.MODEL_INDEX_NO_A = PD_2910A_PDTABLE_113.MODEL_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_113 AS PD_2910A_PDTABLE_113_1 ON PDTABLE_132.MODEL_INDEX_NO_B = PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 ON PD_2910A_PDTABLE_113.MODEL_INDEX_NO = PDTABLE_119.MODEL_INDEX_NO) INNER JOIN PDTABLE_119 AS PDTABLE_119_1 ON PD_2910A_PDTABLE_113_1.MODEL_INDEX_NO = PDTABLE_119_1.MODEL_INDEX_NO) LEFT JOIN CISClashStatusTbl ON PDTABLE_132.IF_APPROVAL_STATUS = CISClashStatusTbl.Approval_Code) LEFT JOIN CISClashTypeTbl ON PDTABLE_132.RECENT_CLASH_TYPE = CISClashTypeTbl.Clash_Code) INNER JOIN PD_2910A_PDTABLE_112 ON PD_2910A_PDTABLE_113.AREA_INDEX_NO = PD_2910A_PDTABLE_112.AREA_INDEX_NO) INNER JOIN PD_2910A_PDTABLE_112 AS PD_2910A_PDTABLE_112_1 ON PD_2910A_PDTABLE_113_1.AREA_INDEX_NO = PD_2910A_PDTABLE_112_1.AREA_INDEX_NO) LEFT JOIN CISOwnerTbl ON PDTABLE_132.UNIQUE_CLASH_ID = CISOwnerTbl.UNIQUE_CLASH_ID) LEFT JOIN CISDisciplineTbl ON CISOwnerTbl.Discipline_Code = CISDisciplineTbl.Discipline_Code) LEFT JOIN PD_2910A_PDTABLE_111 ON PDTABLE_132.ACTION_DISCIPLINE = PD_2910A_PDTABLE_111.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_1 ON PDTABLE_132.DISCIPLINE_INDEX_A = PD_2910A_PDTABLE_111_1.DISCIPLINE_INDX_NO) LEFT JOIN PD_2910A_PDTABLE_111 AS PD_2910A_PDTABLE_111_2 ON PDTABLE_132.DISCIPLINE_INDEX_B = PD_2910A_PDTABLE_111_2.DISCIPLINE_INDX_NO
ORDER BY PDTABLE_132.UNIQUE_CLASH_ID;
Any help would really be appreshiated.
Thanks in advance
Simon
Edited by: user8275408 on 21-Jan-2010 07:25Hi, Simon,
Welcome to the forum!
An Oracle equivalent of
IIf(TEMP_ACTION_DISCIPLINE Is Null,"UNALOCATED",TEMP_ACTION_DISCIPLINE) AS ACTION_DISCIPLINEis
CASE
WHEN TEMP_ACTION_DISCIPLINE Is Null
THEN 'UNALOCATED'
ELSE TEMP_ACTION_DISCIPLINE
END AS ACTION_DISCIPLINE, This assumes that temp_action_discipline is a string. (All THEN and ELSE clauses must return the same data type, or at least compatable types.)
CASE is the most general way of doing IF-THE-ELSE logic in Oracle SQL.
For certain special situations, there may be shorter ways.
Testing a variable to see whether it is NULL or not is one of those situations, so you could also say
NVL2 ( TEMP_ACTION_DISCIPLINE
, TEMP_ACTION_DISCIPLINE
, 'UNALOCATED'
This site noramally compresses whitespace. Whenever you post formatted text here (and code should always be formatted), type these 6 characters:
(all small letters, inside curly brackets) before and after formatted sections.
Edited by: Frank Kulash on Jan 21, 2010 10:41 AM
After reading Bluefrog's answer, I realized that you're testing and possibly returning the same thing, temp_action_discipline.
In that case, NVL, like Bluefrog suggested, is the best thing to do. CASE and NVL2, as shown above, will give the right results, but they're more complicated than you need for this job.
Maybe you are looking for
-
i cant remember my password to logon to my mac, how can i change it with out needing the old one?
-
How to get Flash player to work?
I've installed all the updates. I've restarted me machine, I've enabled the stupid add on thing, I've turned of the stupid active X filter, and I still can't get any web based flash stuff to work. "install the latest update", ok, happy to do that, bu
-
Removing "Deleting" test sites that are not published from the "Open a Recent Site" List
How can unpublished sites be removed from Muse?
-
Strange behaviour of DB_RECOVERY_FILE_DEST
Hi , Problem Description : Oracle 11.2.0.2 dataguard environment (1 primary and 1 physical standby ) At os level , /ora/TEST/arch file system is 125G on both primray and standby . The following parameter has been set on the both primary and standby d
-
Setup EWA in Solman - Service Cannot be Reached
Hi, I was trying to setup EWA in solman for my satellite system. In Dswp-> Solution->Operation Setup->Setup EarlyWatch Alert, I got the following error: Service cannot be reached What has happened? URL http://serverxxx:port/sap/bc/webdynpro/sap/dswp_