I have to get data from database1 something like
select *
from tab1
where dtCol > <*dtVariable*>
The value of dtVariable comes from database2 from
select *
processdt
where proc_name = 'PROCESS1'
Can you please let me how to do this?
I am using SSIS 2008
Oracle db - 12c
Oracle Drivers - Attunity 1.2
No DBLInks ( basically, we need to avoid using db links)
You would simply need to pull the input value from Db2 to a variable in SSIS as step 1.
Step 2, you would create an expression that forms that SELECT sql call encompassing that variable.
MSDN has an article how to use Execute SQL Task.
Related
I've started learning SQL and playing with Oracle SQL Developer v22. For some reason I'm not able to retrieve value from an object table by using SELECT VALUE(A). It only gives my user ID.object_name as in the below screenshot. Any tips why?
SELECT VALUE(A) FROM table A;
If I use SELECT * FROM table; all is fine.
SELECT * FROM table A;
I've tried printing using dmbs_output, same problem.
Tried with other object tables, same behaviour.
Please share your table DDL and DML for a more accurate answer, but setting this preference should do what you're looking for
'Display Struct Value in Grid'
I talk about that here
Disclaimer: I work for Oracle and am the product manager for SQL Developer.
I have the latest version of Jaspersoft Studio and I am using Oracle's JDBC data adapter (ojdbc11.jar), but the connection is made with the default schema, while I want the queries of each report to be executed in another schema (let's call it that: "MySchema").
For example a report with this SELECT clause will not work:
select *
from myTable
while a report with this SELECT clause will work:
select *
from MySchema.myTable
I tried things like this:
jdbc:oracle:thin:#//10.1.1.55:1521/DOMAIN.COM;connectionProperties={currentSchema=MySchema}
or this:
jdbc:oracle:thin:#//10.1.1.55:1521/DOMAIN.COM;connectionProperties={CURRENT_SCHEMA=MySchema}
or this:
jdbc:oracle:thin:#//10.1.1.55:1521/DOMAIN.COM?searchpath=MySchema
or this:
jdbc:oracle:thin:#//10.1.1.55:1521/DOMAIN.COM??currentSchema=MySchema
but without success.
Do you have a solution in this direction or do you know of any other way to solve the problem?
This is an extremely big problem if you consider that I have reports that make selects to dozens of tables and functions.
I have an SSIS package that is pulling data from an oracle database using the Native OLD DB\Oracle provider for OLD DB.
My package successfully but slowly pulls the data from one view in Oracle to a staging table in my SQL Database. The problem I am having is some of fields in Oracle are 4000 char in length and in SQL Server I only need the first 255 characters. Would it be better to do a substring in my query for the oracle and only take the size i need, or to take all 4000 characters? Is there a better way to handle this data import?
here is a sample of the query I am using to extract the data from Oracle:
select a
, b
, c
, substring (c,1,255) as c, substring (d,1,255) as d
, e
, CASE WHEN EXTRACT(YEAR from LAST_TAKEN_DT) < 1900
THEN NULL
WHEN EXTRACT(YEAR from LAST_TAKEN_DT) > 2025
THEN NULL
END AS LAST_TAKEN_DT
from oracle_View1
First off if it was upto you I would suggest using the Attunity Oracle adapters over the OLEDB connection. It is definitely a lot faster and you could choose to do the substring in the Oracle query or within your SSIS package using a derived column.
I'm trying to get the actual value of OPTIMIZER_SECURE_VIEW_MERGING in Toad for Oracle but I don't know how.
Try this:
select *
from v$parameter
where upper(name) = 'OPTIMIZER_SECURE_VIEW_MERGING'
See Oracle doc for details on v$parameter
Your login would need read access to the v$parameter view. FYI, there is no dependency on TOAD for this - just a straight SQL query, can be run from any SQL client.
I am running TOAD 12, and you can also view all the current oracle parameters from the Database/Administer/Oracle Parameters menu item.
Can anyone please advise the syntax for passing a table FROM a SAS library INTO an oracle database?
example code below (although obviously the connection to the WORK library cannot be referenced in this way)
PROC SQL noprint;
connect to ODBC as X (dsn='ALIAS' uid='USER1' pwd='passwd' quote_char='');
exec (CREATE TABLE Test AS
SELECT * from WORK.MY_SAS_TABLE
)by X;
disconnect from X;
quit;
A similar question was asked here but seems to relate to a SQLSERVER connection rather than oracle..
Set up a libref to point to your Oracle database, either using the ODBC libname engine or the Oracle libname engine (which will be faster if you have the right licence and software installed):
libname X oracle username='USER1' password='passwd' path=ORCL;
If an empty table with the right columns already exists in Oracle, you can use:
proc sql noprint;
insert into X.test select * from work.my_sas_table;
quit;
If the table doesn't exist, you can use a data step:
data X.test;
set work.my_sas_table;
run;
I'm a bit rusty, but what if you set up your database as a libref?
Something like:
libname X odbc dsn='ALIAS' uid='USER1' pwd='passwd' quote_char='';
data X.test;
set work.my_sas_table;
run;