Query works in SQL Developer but not in a pass through query in Access - sql

I want to extract data from an Oracle 11g R2 database and import it in a table in Ms Access 2007.
I have a query that looks like :
SELECT * FROM aPublicSynonym
on the Oracle db using a READONLY user and it works fine in Oracle SQL Developer.But when I execute it as a pass-through query in ms Access I get:
[Oracle][ODBC][Ora] Ora-00942: table/view does not exist(#942)
I use the same ODBC data source with both sql developer and access and when I query in access :
select sys_context( 'userenv', 'current_schema' ) from dual;
It works and returns the same user schema as in sql developer.
Can someone give me a hint about why i don't seem to have the privilege to access the public synonym when connecting with Access?
Thanks

Related

PowerBI - Execute MO_GLOBAL.SET_POLICY_CONTEXT() on Connect

I connecting to an Oracle database with an read only account through PowerBI. I am looking to run a query on tables/views that the account may not have the correct view privileges. I can run the query under the same account by using the statement below in Oracle SQL Developer.
begin
MO_GLOBAL.SET_POLICY_CONTEXT('S', #MY NUMBER HERE#);
end;
Is there a way to do this in PowerBI, or in the ODBC Oracle Driver setup, so it executes on connect or in line with my SQL statement that I am running to get my data?

Oracle dmp imported by Oracle Sql Developer

I'm just new with Oracle DB, I have used Oracle Sql Developer to import dmp file (oracle 11.2.0.2.0, Oracle Sql Developer 19.2.1.247)
Everything work ok, but i got IMP_SD_41-10_20_50 table inserted
Can anyone give me a sugggestion!

Save results of a Access query to SQL Server

I have a query in Access which does some calculations which (I think) can't be done in SQL Server directly because of a vital local table in Access. I used to use a append query in Access to save this data. I'm now working on replacing the Access database with a SQL Server database.
Is there a way to get the Access query results saved in SQL Server?
Thanks in advance,
Access can directly execute INSERT INTO queries to SQL server tables.
The easiest way is to use a linked table, but if that's undesirable for whatever reason, you can use the connection string in the query. It has to be a valid string for DAO (e.g. ODBC string starting with ODBC;).
INSERT INTO [ODBC;Driver={SQL Server};Server=myServerAddress;Database=myDataBase;Trusted_Connection=Yes;].[My Table] (Column1, Column2)
SELECT Column1, Column2
FROM SomeQuery

How to select a different schema in Oracle SQL Developer?

I am using Oracle SQL Developer 4.1.3 and I have connected to MySQL database.
I want to select a different schema in Oracle SQL Developer but it is giving an error.
Here is my syntax:
ALTER SESSION SET CURRENT_SCHEMA = classicmodels;
I found this syntax on Docs.Oracle but still wondering why it is not working!
Thanks in advance!

Using SQL user defined function in MS Access 2007

I am very new to Access and need a bit help over here.
I was working on MS Access 2007 (in VB) with SQL 2008 Server as my database.
I wanted to show a SQL table in the frontend of Access but faced the problem while using SQL user defined function with my SQL query in Access 2007. I wrote this function and the query in SQL Query design of Access and tried to Run it.. but its showing error (Userdefined "timepart" function not recognized) !!
CREATE function dbo.timepart (#date as SMALLDATETIME)
RETURNS SMALLDATETIME
AS
BEGIN
RETURN #date - DATEADD(d, DATEDIFF(d,0,#date), 0)
END
SELECT * FROM TABLENAME WHERE dbo.timepart(FIELDNAME) Between '9:30' AND '17:30';
I guess MS Access doesn't allow to write UDF SQL functions! I tried this same query in my local SQL Server 2008 database (SQL management studio) and is working perfectly fine.
You should create a pass-through query. With a pass-through query, the code is run on SQL Server and the results are returned to MS Access. You can therefore use SQL Server T-SQL.
Also access-SQL pass-through query (creating SP) error