PL/Sql concurent program in Oracle 10.7
Hi
I am creating a PL/SQL concurrent program in Oracle version 10.7. I need to write some messages to the log file. I know this can easily be done in 11i using FND_FILE.
In 10.7, I am trying to use UTL_FILE. I get the logfile name from FND_CONCURRENT_REQUESTS using following cursor:
SELECT logfile_name
FROM fnd_concurrent_requests
WHERE request_id = fnd_global.conc_request_id;
This gives the correct name, when i try to open the file for writing after parsing, i get an error. The system is not able to open the file in Append mode, when i open the file in read mode, it does not give any errors.
Same is the case for the outfile as well.
Is it possible to write to the log file in 10.7. I used the append mode, since the concurrent manager also write to the same file.
Any pointers ?
thanks and regards
utl_file_dir = * --> This is valid and can be used, but its not recommended to use it since it makes any directory accessible to the UTL_FILE function. Instead use utl_file_dir = path1, path2, .. etc (use an absolute directory path).
I am not sure about 10.7, but for 11.0.x you have to verify that APPLPTMP is included in the setting of the utl_file_dir. Once you change this, restart the concurrent manager and make sure that the user who start the CM has read/write priviliges on APPLPTMP and utl_file_dir.
You can verify that the PL/SQL runs properly for reading/writing from/to utl_file_dir from SQL*Plus
Similar Messages
-
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 -
XML file from PL/SQL Executable Program
Hi all,
I have to solve this issue. I registered a concurrent program based on a PL/SQL Stored Procedure which extracts data in CSV format. The output is ok and ready to be imported in an excel worksheet and this is ok.
But, I wanted to create also an rtf template to associate to this concurrent, so the output is in more readable PDF format with table and clear formatting.
The problem is the publisher doesn't recognize the CSV datas and doesn't create the pdf. Is there any PL/SQL command to translate CSV to XML output? Thanks, MicheleMichele, I have a suggestion for you. It's not the exact solution you're looking for, but it may work for you.
I use Oracle Reports to create both XML data and CSV data. The output is a single formula field within the lowest level group that displays all of the data, delimited field by field. I define two concurrent programs based on this executable -- one with output format XML and one with output format Text. That way I can associate templates with the first program, and can use the second program to produce my CSV file which is ready for import to Excel.
You can either convert your PL/SQL stored procedure to Oracle Reports, or use a temporary table to store the data that the procedure is displaying, then call the procedure in an Oracle Reports trigger and select the data in the Data Model.
HTH.
Carrie Hollack -
MS SQL Server/VB6 to Oracle 8i using OBDC
OMW,
I presently connect to MS SQL in Visual Basic 6.0 using ODBC. I
would like to connect to Oracle in the same manner. Does the OMW
do this, and if so are there any things I should know before
attempting to use it in this application? I have purchased and
installed a trial version of Oracle 8i, but I am experiencing
some slight difficulties in the way Oracle handles Resultsets
(RDO Components) compared to MS SQL.
thanks
g
nullGary,
There is some information in the faq (reproduced below), showing
how the application may not need to be changed.
Some of the functionality provided by the intersolve driver is
now available in the oracle 8.1.5.3 odbc driver.
Turloch
Oracle Migration Workbench team
from the faq (shipped with the workbench):
How are result sets/dynasets returned to the calling program?
The Oracle Migration Workbench parser adds an extra argument
of type REF CURSOR for result sets/dynasets. This type is
understood and can be
manipulated by both PL/SQL and Oracle JDBC. Oracle8 release
8.0.5 ODBC drivers support REF CURSORs which means that the
additional argument must
be explicitly handled by the application, and the client
application code must be changed. However, some third-party
vendors such as Intersolv supply ODBC
drivers for Oracle that support REF CURSORs and can, in
addition, implicitly make use of REF CURSORs for using result
sets/dynasets. Therefore, no
change is required in the client application code. This is
illustrated in the following examples of an MS SQL Server stored
procedure and its equivalent Oracle
package and stored procedure as generated by the Oracle
Migration Workbench parser.
MS SQL Server Stored Procedure
CREATE PROCEDURE byroyalty
AS
select au_id from titleauthor
GO
Oracle8i Package and Stored Procedure
PACKAGE BYROYALTYPkg AS
TYPE RT1 IS RECORD (
au_id titleauthor.au_id%TYPE
TYPE RCT1 IS REF CURSOR RETURN RT1;
END;
PROCEDURE byroyalty(
RC1 IN OUT byroyaltyPkg.RCT1)
AS
StoO_selcnt INTEGER;
StoO_error INTEGER;
StoO_rowcnt INTEGER;
StoO_errmsg VARCHAR2(255);
StoO_sqlstatus INTEGER;
BEGIN
OPEN RC1 FOR
SELECT au_id FROM titleauthor;
END byroyalty;
The following example illustrates the typical ODBC code used
by Intersolv to call the above MS SQL Server stored procedure.
This code also works for the
above Oracle8i package and stored procedure. Note that error
handling must be added in a real application:
SQLPrepare(...,'{call byroyalty()}',...)
SQLExecute()
SQLBindCol()
SQLFetch()
Comments:
SQLPrepare(...,'{call byroyalty()}',...) is the ODBC SQL
syntax used to execute stored procedures.
SQLExecute()executes the stored procedure.
SQLBindCol()assigns storage for result column 1 in the
result set (au_id).
SQLFetch() fetches the first record from the result set
generated by the stored procedure.
The following examples illustrate how to call the above MS
SQL Server stored procedure with result sets/dynasets in Visual
Basic using DAO and RDO on
top of ODBC. This code works for Oracle8i packages and
stored procedures if you use an Intersolv ODBC driver to
understand Oracle REF CURSORs.
DAO
Private Sub Command2_Click()
Dim sSql As String
sSql = "{call byroyalty()}"
'In Oracle ODBC driver use refcusor argument to get
result set
Set rCustomers = dbsServer.OpenRecordset(sSql,
dbOpenDynamic)
Text4 = rCustomers.Fields(0)
theend:
End Sub
Please note, this example assumes that a DAO connection has
been set up already.
RDO
Private Sub Command1_Click()
StrSql = "{call byroyalty}"
'in oracle odbc driver uses refcusor argument to get
result set
Set Ps = connx1.CreatePreparedStatement("PsTest",
StrSql)
Set Rs = Ps.OpenResultSet(rdOpenStatic
Text3 = Rs!au_id
Rs.Close
End Sub
Please note, this example assumes that an RDO connection has
been set up already.
Gary (guest) wrote:
: OMW,
: I presently connect to MS SQL in Visual Basic 6.0 using ODBC. I
: would like to connect to Oracle in the same manner. Does the
OMW
: do this, and if so are there any things I should know before
: attempting to use it in this application? I have purchased and
: installed a trial version of Oracle 8i, but I am experiencing
: some slight difficulties in the way Oracle handles Resultsets
: (RDO Components) compared to MS SQL.
: thanks
: g
Oracle Technology Network
http://technet.oracle.com
null -
Hi Oracle Gurus!
Currently, I am designing an ETL solution that transforms and loads a lot of data from flat files and sends it to an SQL Server 2008 R2 database for storage. However, at a future point of time, it may be decided to add or even replace SQL Server with an Oracle 11g database.
Currently, I am writing script transforms in C# to dynamically generate SSIS packages to tansform and load the data into SQL Server. But considering that in future, an Oracle 11g or 12c database might be added to, or replace the SQL Server database, how do I make my script transforms (or whatever else I am developing currently for SQL Server) reusable to the extent possible?
Or more precisely, what steps do I take, from an Oracle point of view, to ensure that any future migration of data to an Oracle database would be smooth to the extent possible?
Looking up to my Oracle Gurus for enlightenment in this matter!
Novice KidWhen you're writing your on C# code to load data into the SQL Server you have to modify the routines so that they will work with Oracle.
One approach is to use the extproc agent which would allow you to directly call external programs with all the logic in it to perform the load of your files and to put the data into the Oracle database. Another option would be to use utl_file package (or equivalents) which will allow you to open external files from your Oracle database and to directly read its content and then to pass it to the related tables. -
Read SQL Server table from Oracle
Hi,
Oracle 11.2.0.1
Windows XP Prof Edition
After creating DSN name opd when I tried to connect sql server Enterprise Edition 2005 database on the same PC, I failed to establish connectivity.
Here it is what I have and done :
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\listener.ora
# listener.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
# Generated by Oracle configuration tools.
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(SID_NAME = CLRExtProc)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM=extproc)
(ENVS = "EXTPROC_DLLS=ONLY:C:\app\Administrator\product\11.2.0\dbhome_1\bin\oraclr11.dll")
(SID_DESC=
(SID_NAME = opd)
(ORACLE_HOME = C:\app\Administrator\product\11.2.0\dbhome_1)
(PROGRAM = dg4odbc)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4)(PORT = 1521))
ADR_BASE_LISTENER = C:\app\Administrator
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\tnsnames.ora
# tnsnames.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.
ORACLR_CONNECTION_DATA =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
(CONNECT_DATA =
(SID = CLRExtProc)
(PRESENTATION = RO)
LISTENER_ORCL =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
ORCL =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = newserver4)(PORT = 1521))
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = orcl)
opd =
(DESCRIPTION=
(ADDRESS_LIST=
(ADDRESS=
(PROTOCOL=TCP)
(HOST=newserver4)
(PORT=1521)
(CONNECT_DATA=(SID=opd))
(HS=OK)
C:\Documents and Settings\Administrator>type %oracle_home%\network\admin\sqlnet.ora
# sqlnet.ora Network Configuration File: C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
# Generated by Oracle configuration tools.
# This file is actually generated by netca. But if customers choose to
# install "Software Only", this file wont exist and without the native
# authentication, they will not be able to connect to the database on NT.
SQLNET.AUTHENTICATION_SERVICES= (NTS)
NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
C:\Documents and Settings\Administrator>lsnrctl status
LSNRCTL for 32-bit Windows: Version 11.2.0.1.0 - Production on 31-DEC-2013 18:26:13
Copyright (c) 1991, 2010, Oracle. All rights reserved.
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=IPC)(KEY=EXTPROC1521)))
STATUS of the LISTENER
Alias LISTENER
Version TNSLSNR for 32-bit Windows: Version 11.2.0.1.0 - Production
Start Date 31-DEC-2013 18:05:31
Uptime 0 days 0 hr. 20 min. 43 sec
Trace Level off
Security ON: Local OS Authentication
SNMP OFF
Listener Parameter File C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\listener.ora
Listener Log File c:\app\administrator\diag\tnslsnr\newserver4\listener\alert\log.xml
Listening Endpoints Summary...
(DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1521ipc)))
(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=newserver4)(PORT=1521)))
Services Summary...
Service "CLRExtProc" has 1 instance(s).
Instance "CLRExtProc", status UNKNOWN, has 1 handler(s) for this service...
Service "opd" has 1 instance(s).
Instance "opd", status UNKNOWN, has 1 handler(s) for this service...
Service "orcl" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
Service "orclXDB" has 1 instance(s).
Instance "orcl", status READY, has 1 handler(s) for this service...
The command completed successfully
C:\Documents and Settings\Administrator>tnsping opd
TNS Ping Utility for 32-bit Windows: Version 11.2.0.1.0 - Production on 31-DEC-2013 18:26:29
Copyright (c) 1997, 2010, Oracle. All rights reserved.
Used parameter files:
C:\app\Administrator\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION= (ADDRESS_LIST= (ADDRESS= (PROTOCOL=TCP) (HOST=newserver4) (PORT=1521))) (CONNECT_DATA=(SID=opd)) (HS=OK))
OK (40 msec)
C:\Documents and Settings\Administrator>type %oracle_home%\hs\admin\initopd.ora
# This is a sample agent init file that contains the HS parameters that are
# needed for the Database Gateway for ODBC
# HS init parameters
HS_FDS_CONNECT_INFO = opd
HS_FDS_TRACE_LEVEL = off
# Environment variables required for the non-Oracle system
#set <envvar>=<value>
C:\Documents and Settings\Administrator>sqlplus scott/tiger
SQL*Plus: Release 11.2.0.1.0 Production on Tue Dec 31 18:27:18 2013
Copyright (c) 1982, 2010, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop database link opd;
Database link dropped.
SQL> create database link opd connect to "sa" identified by "girish" using 'opd';
Database link created.
SQL> select count(*) from ny@opd;
select count(*) from ny@opd
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified {IM002}
ORA-02063: preceding 2 lines from OPD
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
C:\Documents and Settings\Administrator>
PS : I don't know why I am not able to see my above question on Heterogeneous Connectivity forum, while the thread has been generated :https://community.oracle.com/thread/2616787
Thanks and Regards
Girish SharmaThanks Sb.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> drop database link opd;
Database link dropped.
SQL> create database link opd connect to "SA" identified by "girish" using 'opd';
Database link created.
SQL> select count(*) from ny@opd;
select count(*) from ny@opd
ERROR at line 1:
ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
[Microsoft][ODBC Driver Manager] Data source name not found and no default
driver specified {IM002}
ORA-02063: preceding 2 lines from OPD
Regards
Girish Sharma -
Error in SQL Server Migration to Oracle
Hi,
I'm trying to migrate from SQL Server 2000 to Oracle 10g. I'm using SQL Developer 1.2 for the migration. After creating the Migration Repository in a new Oracle instance, I'm getting the following error when I execute Capture for any of the objects :
oracle.dbtools.metadata.persistence.PersistenceException: ORA-04063: package body "MENTORADM.MD_META" has errors ORA-06508: PL/SQL: could not find program unit being called: "MENTORADM.MD_META" ORA-06512: at "MENTORADM.MD_PROJECTS_TRG", line 3 ORA-04088: error during execution of trigger 'MENTORADM.MD_PROJECTS_TRG'
I looked at MENTORADM.MD_META, the package has compile errors. It is in wrapped binary format and is generating an error - ORA-01031: insufficient privileges when you try to compile it. My DBA has given the id I use for the migration all the privileges stated in the SQL Developer User's Guide - Migrating Third Party Databases - 2.4.2 Requirements for Creating Destination Oracle Objects but this does not resolve the error.
Can you please advise on how I can resolve this?
Thanks,
Uriel1996I looked at the current code in development and the help seems unclear what is needed for the migration repository, what privileges are you usng?
-Turloch
I used the generation user privileges in the current documentation and the wrapped packages in development built with no errors.
The privileges granted were:
CREATE USER migrations IDENTIFIED BY migrations
DEFAULT TABLESPACE users TEMPORARY TABLESPACE temp;
GRANT CONNECT, RESOURCE, CREATE VIEW, CREATE PUBLIC SYNONYM TO
migrations WITH ADMIN OPTION;
GRANT ALTER ANY ROLE, ALTER ANY SEQUENCE, ALTER ANY TABLE, ALTER TABLESPACE,
ALTER ANY TRIGGER, COMMENT ANY TABLE, CREATE ANY SEQUENCE, CREATE ANY TABLE,
CREATE ANY TRIGGER, CREATE ROLE, CREATE TABLESPACE, CREATE USER, DROP ANY
SEQUENCE, DROP ANY TABLE, DROP ANY TRIGGER, DROP TABLESPACE, DROP USER, DROP ANY
ROLE, GRANT ANY ROLE, INSERT ANY TABLE, SELECT ANY TABLE, UPDATE ANY TABLE TO
migrations;
Note that oracle has released oracle XE as a free download which you can use on your own desktop [you are the dba] as long as you use less than 4 gigs disk space - plenty for a repository. -
Hello,
I posted here yesterday about locating the Database connection string of a JSP program that I'm currently fixing.
A little background though, I'm actually an asp.net developer so some of these things in JSP is still new to me.
Anyway I found two files that may be connected to the database connection:
jdbc.properties :
jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.password=password
jdbc.url=jdbc\:sqlserver\://xx.x.x.xxx\:1433;DatabaseName\=Database1;failoverPartner\=xx.x.x.xxx;charset\=utf-8
jdbc.username=sa
and
jdbc_master.properties
jdbc.master.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver
jdbc.master.password=password
jdbc.master.url=jdbc\:sqlserver\://xx.x.x.xxx\:1433;DatabaseName\=Database2;failoverPartner\=xx.x.x.xxx;charset\=utf-8
jdbc.master.username=sa
Now what I need is now convert the connection string to connect to a converted Oracle Database. I have all the needed parameters such as the username, password, database name, ip address, etc.
Do I just change the driverClassName for this to an oracle string for me to connect to the new database?
Need expert advice, thanks!You need to have classes12.jar in you classpath.then this will work
<%@ page import = "java.sql.*"%>
<%
//String driverclass="oracle.jdbc.driver.OracleDriver";
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@<ipaddress>:<portnumber>:<schema name>","<userid>","<password>");
Statement st=con.createStatement();
ResultSet rs=null;
rs=st.executeQuery("select");
%> -
API's used in Interface programs of Oracle Applications
hi
can any one let me know about the PL/SQL API's that are used in interface programs of oracle applications.
in what cases we are using them
and if possible their syntax
thanks in advance
byePl Sql APIs are used for uploading / correcting the mass Data of Oracle HRMS and Oracle Payroll , For Technical person they are Fast and Easy for data Migration Purpose
You Can Seach more on Metalink.
You can search these APIs from your Data Base where name like '%API' -
[b]Unable to connect a Jdbc Program to Oracle database.[/b]
Hi all,
i am able to access Oracle database from server to my machine(client) without any connectivity of java.now,I am trying to connect my java program to Oracle database. i have no idea about any other driver.when i am trying to execute this code then it is showing fatal error: java.sql.SQLException: No suitable driver
at java.sql.DriverManager.getConnection(Unknown Source)
my code is here.if anyone is having idea then plz sort out it.
Thanks n Regards,
Abhi
class Jdbc{ public static void main (String args [])throws SQLException, IOException{
System.out.println ("Loading Oracle driver...");
try {
Class.forName ("sun.jdbc.odbc.JdbcOdbc");
System.out.println("Driver Loaded!");}
catch (ClassNotFoundException e) {
System.out.println ("Could not load the driver");
e.printStackTrace (); }
System.out.println ("Connecting to the Oracle database...");
String url = "Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
//10.10.0.78 is oracle server IP address and rf is oracle instance.
Connection conn = DriverManager.getConnection(url);Hi all,
i am able to access Oracle database from server to my
machine(client) without any connectivity of
java.now,I am trying to connect my java program to
Oracle database. i have no idea about any other
driver.when i am trying to execute this code then it
is showing fatal error: java.sql.SQLException: No
suitable driver
at java.sql.DriverManager.getConnection(Unknown
n Source)
my code is here.if anyone is having idea then plz
sort out it.
Thanks n Regards,
Abhi
class Jdbc{ public static void main (String args
[])throws SQLException, IOException{
System.out.println ("Loading Oracle driver...");
try {
Class.forName ("sun.jdbc.odbc.JdbcOdbc");
System.out.println("Driver Loaded!");}
catch (ClassNotFoundException e) {
System.out.println ("Could not load the driver");
e.printStackTrace (); }
System.out.println ("Connecting to the Oracle
database...");
String url =
"Jdbc:Odbc:[email protected]:1521:rf","scott","tiger"
//10.10.0.78 is oracle server IP address and rf is
oracle instance.
Connection conn = DriverManager.getConnection(url);
Hi , I dont know if u got the answer but couple of things i wanted to let u know.
1. the driver u r using make it a thin driver as u r specifying that in the url .
http://www.oracle.com/technology/software/tech/java/sqlj_jdbc/htdocs/winsoft.html
loading class 'oracle.jdbc.driver.OracleDriver'
and url u have to change a little, this depends on the driver u use.
"jdbc:oracle:thin:@balrog:1521:testJdbc"
Regards,
Lakshmi Narayana
/********************* the code which i have tested **************************/
public class Jdbc {
* @param args
public static void main(String[] args) throws SQLException, IOException{
System.out.println ("Loading Oracle driver...");
try {
Class.forName ("oracle.jdbc.driver.OracleDriver");
System.out.println("Driver Loaded!");}
catch (ClassNotFoundException e) {
System.out.println ("Could not load the driver");
e.printStackTrace (); }
System.out.println ("Connecting to the Oracle database...");
String url = "\"Jdbc:Odbc:[email protected]:1521:rf\",\"scott\",\"tiger\"";
// 10.10.0.78 is oracle server IP address and rf is oracle instance.
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@balrog:1521:testJdbc","ispsapp","ispsappbalrog");
Statement st = conn.createStatement();
ResultSet rs = st.executeQuery("select * from BC_PMT_APPLN");
if (rs.next()){
System.out.println("Column Count ="+rs.getMetaData().getColumnCount());
} -
Calling Java programs from Oracle Stored Procedure
Is it possible to call Java programs from Oracle stored procs? If possible Can this be used to exchange data from other applications? Is there a better method/feature in oracle for doing data exchange with other apps?
If what you mean by Oracle stored procedures is pl/sql then yes.
You can create a "wrapper" this way:
CREATE OR REPLACE FUNCTION xmlXform
in_mapUrl IN VARCHAR2,
in_inputUrl IN VARCHAR2
RETURN VARCHAR2
AS
LANGUAGE JAVA NAME
'com.yourcompany.xml2any.xform(java.lang.String,java.lang.String)
RETURN java.lang.String';
Then load the java as:
loadjava -user youruser/youruserpasswd -resolve -verbose lib/xmlparserv2.jar classes/com/yourcompany/xform.class classes/com/yourcompany/xml2any.class
The java, given the correct permissions, can do anything java can do including communicate with outside applications.
Is this the "best" way... depends on what you are trying to accomplish. -
PL/SQL Object Type - Java oracle.jbo.domain
PL/SQL Object Type <-> Java oracle.jbo.domain
can anybody help me, getting my domains to work?
Following scenario:
in pl/sql we have an object type called MULTI_LANGUAGE. This type is used for storing multilingual texts as nested table in one(!) column.
So the object MULTI_LANGUAGE contains a member variable LANGUAGE_COLLECTION of type LANGUAGE_TABLE, which itself is a nested table of objects
of the type LANGUAGE_FIELD (this again is only a language id and the corresponding content)
Also the methods setContent(langID, langContent) and getContent(langId) are defined on Object MULTI_LANGUAGE.
For example: Table having primary key, 2 other columns and one column of object type MULTI_LANGAGE (=nested table of objects)
|ID|Column1|Column2| multilingual Column |
|--|---------------------------------------|
| | | | ------------------- |
| | | | | 1 | hello | |
| | | | ------------------- |
|1 | foo | bar | | 2 | hallo | | <- Row Nr 1
| | | | ------------------- |
| | | | | 3 | ola | |
| | | | ------------------- |
|--|-------|-------|-----------------------|
| | | | ------------------- |
| | | | | 1 | world | |
| | | | ------------------- |
|2 | abc | def | | 2 | welt | | <- Row Nr 2
| | | | ------------------- |
| | | | | 3 | ??? ;-) | |
| | | | ------------------- |
|--|-------|-------|-----------------------|Now i've tried to modell this structure as an oracle.jbo.domain.
class MultiLanguage extends Struct having this StructureDef:
attrs[(0)] = new DomainAttributeDef("LanguageColl", "LANGUAGE_COLL", 0, oracle.jbo.domain.Array.class, 2003, "ARRAY", -127, 0, false, "campusonlinepkg.common.LanguageField");
and
class LanguageField extends Struct having this StructureDef:
attrs[(0)] = new DomainAttributeDef("Id", "ID", 0, oracle.jbo.domain.Number.class, 2, "NUMERIC", -127, 0, false);
attrs[(1)] = new DomainAttributeDef("Content", "CONTENT", 1, java.lang.String.class, 12, "VARCHAR", -127, 4000, false);
Is there anything wrong with this StructureDef?
When running the BC-Browser with -Djbo.debugoutput=console -Djbo.jdbc.driver.verbose=true parameters I get suspect warnings when browsing the records
[196] Executing FAULT-IN...SELECT NR, NAME FROM B_THESAURI BThesauri WHERE NR=:1
[197] SQLException: SQLState(null) vendor code(17074)
[198] java.sql.SQLException: Ungültiges Namensmuster: XMLTEST.null
...snip: detail of stack...
[240] SQLException: SQLState(null) vendor code(17060)
[241] java.sql.SQLException: Deskriptor konnte nicht erstellt werden: Unable to resolve type "null"
...snip: detail of stack...
[280] Warning:No element type set on this array. Assuming java.lang.Object.
(XMLTEST is the name of the schema)
Seems as if the framework can't read the TypeDescriptor or does not know which descriptor to read (XMLTEST.null??)
Do I have to implement my own JboTypeMap?
Please help, I'm stuck.
Thanks in advance, ChristianThanks for your suggestion, but it seems to me as if there is one level missing.
in pl/sql I have following structure:
Struct MULTI_LANGUAGE (Object type) - outermost
Array LANGUAGE_TABLE (nested table type)
Struct LANGUAGE_FIELD (Object type simple) - innermostthe reason why i had to wrap another struct around the array was because it is not possible to define methods on a nested table. this is only possible on objects.
on the outermost object type (which holds the array of language fields) I needed to define following 2 methods for direct access:
getContent (langId in number) returns varchar2
setContent (langId in number, langContent in varchar2)
I would like to rebuild the same structure in java, because newly written java code should live in perfect harmony with legacy pl/sql code ;-)
Both applications (Java and pl/sql) have to access the same data as long as migration to java goes on.
Is this nested structure too much for a Domain?
Any other suggestions?
Thanks again, Christian -
General question on SQL Server 2000 to Oracle 10g
Hello all,
I just have a general question on migration from SQL Server 2000 to Oracle 10g using SQL Developer.
How does it migrate Users with proper privileges from SQL Server to Oracle? Follow the interface steps? Or should the users be created on destination Oracle side?
Thank you.Hi,
It depends which type of migration you are making.
For a 'Standard' migration when you migrate data a 'create user' statement is created as part of the migration and you will see this in the generated code.
If you are using the 'Quick' migration option then you need to create the Oracle user or use an existing user to receive the data.
Your best option is to review the documentation available from -
http://www.oracle.com/technology/tech/migration//workbench/index_sqldev_omwb.html
or directly from -
http://download.oracle.com/docs/cd/E12151_01/index.htm
and then get back with specific questions if this does not give you the information you need.
Review the chapter -
2. Migrating Third-Party Databases
in -
Oracle® Database SQL Developer User’s Guide Release 1.5
Regards,
Mike -
Problem in Loading Data from SQL Server 2000 to Oracle 10g
Hi All,
I am a university student and using ODI for my final project on real-time data warehousing. I am trying to load data from MS SQL Server 2000 into Oracle 10g target table. Everything goes fine until I execute the interface for the initial load. When I choose the CKM Oracle(Create unique index on the I$ table) km, the following step fails:
21 - Integration - Prj_Dim_RegionInterface - Create Unique Index on flow table
Where Prj_Dim_Region is the name of my target table in Oracle.
The error message is:
955 : 42000 : java.sql.SQLException: ORA-00955: name is already used by an existing object
java.sql.SQLException: ORA-00955: name is already used by an existing object
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:316)
at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:282)
at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:639)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:185)
at oracle.jdbc.driver.T4CPreparedStatement.execute_for_rows(T4CPreparedStatement.java:633)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1086)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:2984)
at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3057)
at com.sunopsis.sql.SnpsQuery.executeUpdate(SnpsQuery.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.execStdOrders(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTaskTrt(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSqlI.treatTaskTrt(SnpSessTaskSqlI.java)
at com.sunopsis.dwg.dbobj.SnpSessTaskSql.treatTask(SnpSessTaskSql.java)
at com.sunopsis.dwg.dbobj.SnpSessStep.treatSessStep(SnpSessStep.java)
at com.sunopsis.dwg.dbobj.SnpSession.treatSession(SnpSession.java)
at com.sunopsis.dwg.cmd.DwgCommandSession.treatCommand(DwgCommandSession.java)
at com.sunopsis.dwg.cmd.DwgCommandBase.execute(DwgCommandBase.java)
at com.sunopsis.dwg.cmd.e.i(e.java)
at com.sunopsis.dwg.cmd.g.y(g.java)
at com.sunopsis.dwg.cmd.e.run(e.java)
at java.lang.Thread.run(Unknown Source)
I am using a surrogate key column in my target table alongwith the natural key. The natural key is populated by the primary key of my source table, but for the surrogate key, I have created a sequence in my oracle schema where the target table exists and have used the following code for mapping:
<%=snpRef.getObjectName( "L" , "SQ_PRJ_DIM_REGION" , "D" )%>.nextval
I have chosen to execute this code on target.
Among my attempts to solve this problem was to set Create Index option of the CKM Oracle(Create Index for the I$ Table) to No so that it wont create any index on the flow table. I also tried to use the simple CKM Oracle km . Both solutions allowed the interface to execute successfully without any errors, but the data was not loaded into the target table.
When I right-click on the Prj_Dim_Region data store and choose Data, it shows empty. Pressing the SQL button in this data store shows a dialog box " New Query" where I see this query:
select * from NOVELTYFURNITUREDW.PRJ_DIM_REGION
But when i press OK to run it, I get this error message:
java.lang.IllegalArgumentException: Row index out of range
at javax.swing.JTable.boundRow(Unknown Source)
at javax.swing.JTable.setRowSelectionInterval(Unknown Source)
at com.borland.dbswing.JdbTable.accessChange(JdbTable.java:2959)
at com.borland.dx.dataset.AccessEvent.dispatch(Unknown Source)
at com.borland.jb.util.EventMulticaster.dispatch(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.open(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.refresh(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.refresh(Unknown Source)
at com.borland.dx.sql.dataset.QueryDataSet.executeQuery(Unknown Source)
at com.sunopsis.graphical.frame.a.cg.actionPerformed(cg.java)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
I do not understand what the problem is and wasting days to figure it out. Any help will be highly appreciated as my deadline is too close for this project.
Thank you so much in advance.
NeelHi Cezar,
Can u plz help me with this scenario?
I have one Oracle data model with 19 source tables and one SQL Server data model with 10 target tables. I have created 10 interfaces which use JournalizedDataOnly on one of the tables in the interface; e.g in interface for DimCustomer target table, I have 2 tables, namely Customer and Address, but the journalizing filter appear only on Customer table and this option is disabled for Address automatically.
Now I want to create a package using OdiWaitForLog event detection. Is it possible to put all these 10 interfaces in just one package to populate the target tables? It works fine when I have only one interface and I use the name of one table in the interface for Table Name parameter of OdiWaitForLogData event, but when I try a comma seperated list of table names[Customer, Address] this error happens
java.sql.SQLException: ORA-00942: table or view does not exist
and if I use this method <%=odiRef.getObjectName("L","model_code","logical_schema","D")%>, I get this error
"-CDC_SET_NAME=Exception getObjectName("L", "model_code", "logical_schema", "D") : SnpLSchema.getLSchemaByName : SnpLschema does not exist" "
Please let me know how to make it work?
Do I need to create separate data models each including only those tables which appear in their corresponding interface and package? Or do I need to create multiple packages each with only one journalized interface to populate only one target table?
Thank you for your time in advance.
Regards,
Neel -
Move data from sql server v8 to oracle 10g
I just got urgent projects to migrate the data from MS SQL server 2000 to oracle 10g. The following are requirements:
Source data/table: MS sql server 2k (version 8) on MS 2000 machine.
Destination Data/table: oracle 10g (10.1.0.4) on Redhat version 3.
Total number of tables: < 10 tables and < 1000 rows each tables.
This is only one time data extraction. No periodically data extraction need.
Questions:
What connect method I should use? (odbc or jdbc)
What if I have image datatype?
Thanks in advance.Use the Oracle Migration Workbench.
http://www.oracle.com/technology/tech/migration/workbench/index.html
I think IMAGE will be migrated to BLOB by default.
Donal
Maybe you are looking for
-
Time Machine and File Transfer to a new hard drive -- Permissions
24May2011 Apple Discussions: I have a 2 TByte external hard drive that I use to back up a 1TB internal hard drive. I use time machine. I got a serious warning that my 2 TB drive is going bad and i need to reformat the disk AFTER I st
-
Result set looping and arrays??????????
Hey i have a result set problem in using an applet connected to a database. After i have accessed a database, i am using a result set to store these values, then put them into arrays to out put to screen. im using: count = 0; while(rs.next()) lecture
-
I am using ALSB 3.0 If I parse the query string using the following: $inbound/ctx:transport/ctx:request/http:query-string/text() when the passed data is the following: https://webservicesdev.someplace.com/testing/order/163625/results?p1=Normal&p2=Com
-
ESB Webservice call from Java client
Hi, i need to call webservice from Java client which inturn will call ESB I tried creating proxy from the WSDL in jDeveloper and tried setting the following end points My concrete WSDL path :http://10.237.25.63:8889/esb/wsil/SubroCaseESBSystem/InputR
-
Iphone4s - because I use pass lock I cannot decline a call such as a blocked number. If I can't see who is calling then I don't want to answer it. But due to having my phone on lock - i can see its a blocked number but there is no option to decline