Retrieve data from a synonym in oracle database through db connect

Hi Everyone,
I have created certain synonym for some tables in oracle. I want to retrieve data from it through db connect but where through source system and then selecting database tables, only tables and views are available.
Synonyms are not available to create data sources and retrieve the data from it. Why is it so. Is this a limitation of db connect.
Can anyone please let me know about it.
Thanks,
Joshua.

Hi,
You want to import data from an external Oracle database into your BW 3.X. To do this, you can connect the external database to the BW 3.X release as a source system using the external database connect. BW 3.X here represents BW 3.0, BW 3.1 and BW 3.5 because in other (DB relevant) parts, all 3 versions are based on the same source code.
General information
The above function allows you to load data from an external Oracle database (not a BW database) into your BW 3.0 system.
There may also be constellations which cannot be used directly through the DB Connect access. However, it should be possible to find an adequate, customer-specific solution for most of these scenarios.
In such situations, the resulting work falls into the area of Consulting and cannot be handled via Support.
Successful implementation of a connection requires corresponding expertise and experience in the use of the source database in the areas:
                - Tools
                - SQL syntax
                - DB-specific functions
Corresponding knowledge of the source application is also required to ensure that semantically relevant data arrives in the BW system.
Procedure
You should execute the following steps to connect the source system (Q) to the BW system (BW):
Installing the client software on an BW application server
                     Of course, you only need to install the client software if you are using BW with a non-Oracle database.
                     Use the Oracle setup program on the database CD (runInstaller on Unix) to start the OracleInstaller. Follow the program instructions and the DB installation instructions to install the Oracle Client software on BW.
Testing connection setup from BW to Q
                     After you install the client software on BW, try to set up a connection from BW to the server on Q. You may need to adjust the tnsnames.ora or sqlnet.ora files for this, to introduce the Oracle systems (to which contact should be made) to BW. You can test the connection by executing the command "tnsping QDB" on BW to check whether the client has established contact to the QDB database on the Q system.
Creating a separate U user in Q
                     We recommend that you create a separate U user in Q for connection to BW. This means that authorization and administration questions can be solved centrally.
Displaying data sources in Q for the U user
                     To provide U data for users other than U, you can create views on other user tables as user U:
                     CREATE OR REPLACE VIEW viewname AS
                       SELECT * FROM QDB.tablename
                     You may have to grant SELECT privileges to user U in the QDB schema:
                        GRANT select ON QDB.tablename TO U
                     Of course, you can also restrict or reformat data in the view arrangement (for example, change from internal date format into the SAP date format). JOIN operations using several tables are also available.
                     !!! Synonyms do not yet work!!!
                     Synonyms that you can create as described below are another option for providing a complete table for the user U:
                       CREATE SYNONYM synoname FOR QDB.tablename
                     !!! Synonyms do not (yet) work!!!
                     After you have displayed the require data for user U, you can simply use
                       SELECT * FROM <view or table>
                     on the Q system to check which data is returned.
                     You can now open a link to Q as user U in the BW system with SQLPLUS and check, using the same SELECT, whether this data is also seen in the Oracle client. If this is not the case, there is probably a connection problem.
Creating a connection from BW to Q in BW
Including data sources of user U user in Q in BW.
Solution
Supported BW, Basis and BW 3.0B database versions, Basis 6.20 Support Package 2 (or higher)
      Oracle 8.1 (or higher, see below)
Possible problems
- Synonyms do not (yet) work!
Up to now, only tables and views have been used as data sources for the DB Connect from the R3 Basis. As soon as synonyms are also used in the Basis, you will be able to convert created views (or even replicated tables) to synonyms as a workaround.
With Basis 6.40 at the earliest, therefore as of BW 3.5, you will also be able to use synonyms. Until then, the following will help:
  CREATE VIEW <view_on_synonym> AS SELECT * FROM <synonym>
- The source DB must have at least the release version of the BW DB.
Oracle only ensures the support of client-server links if the version of the client is not higher than that of the server. So if BW has Oracle version 8.1 and, as in the case of Dbconnect, is run as a client against the server of the source database, the source database must have at least release Oracle 8.1 or higher.
Of course, you have the option to install the Oracle client software of a lower version and then use this for the DB connect. This is also the procedure used to work with a DB connect on external databases of other vendors.
Furthermore, the implementation of the DBconnect function in BW uses SAP Basis functions. Specifications of Oracle 8.1 database catalogs are used here. The source database must therefore have at least Version 8.1.
- Oracle Client Software Version
If you want to connect from an Oracle BW DB to an Oracle source DB, for the DB connect you naturally use the client software that you already installed on each application server.
If you want to connect from a non-Oracle BW DB to an Oracle source DB, check item 3 of note 521230 to see which Oracle client software version is released with your BW R3 kernel and use this version.
- Date and time fields in Oracle and their conversion into SAP-compatible column formats
Example with a DATE field:
Since a SAP table does not have a DATE field (date values are NUMC(8) and time specifications are NUMC(6)), we will use the Oracle DBA_TABLES system table as an example.
    SQL> desc dba_tables;
The Oracle DBA_TABLES system table has a LAST_ANALYZED field. This is a DATE type field and is recognized as a date field of 7 characters by DBA_CONNECT. However, the import does not work because the DATE is a 7-byte conglomerate of "...century, year, month, date, hour, minute and second." (extract from the Oracle documentation).
To make this DATE field legible for DB connect, you must use the TO_CHAR function in a VIEW. This should display the following examples:
SQL> select LAST_ANALYZED from dba_tables
      where table_name like 'RS%' and rownum < 10 ;
The formatting used here is the default used implicitly by SQLPLUS.
SQL> select  to_char(LAST_ANALYZED,'YYYYMMDD') as dat from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format YYYYMMDD and should be loaded correctly by the DB connect as a date.
SQL> select  to_char(LAST_ANALYZED,'HH24MISS') as tim from dba_tables where table_name like 'RS%' and rownum < 10 ;
The result now has the SAP compatible format HHMMSS and should be loaded correctly by the DB connect as a time.
You can use the following example for more detailed experiments:
SQL> select  to_char(
       TO_DATE('03-FEB-2001 04:05:06','DD-MON-YYYY HH24:MI:SS'),
       'YY-MM-DD HH24-MI-SS') as datim from dual;
with the result:
  DATIM
  01-02-03 04-05-06
When you create a VIEW and use the TO_CHAR function (or other functions), you should easily be able to avoid problems with the interpretation of date/time specifications (and other reformatting).
Details about the functions and the formats are contained in the Oracle documentation.
- Special characters
A words that contain special characters can only be imported correctly if the code pages in BW and in the source system are identical. If the code pages are not the same, DB Connect can be used if the characters to be imported appear under the first 127 characters of the character set.
The use of multibyte code pages in the source system for saving data using character sets with more than 256 characters (Kanji, Katakana, Hiragana, Korean, Chinese, Tagalog, Khmer, Arabic, Cherokee, and so on) can cause the characters to become corrupt.
For questions concerning the code pages, also refer to the FAQ note 606359 and question/answer 19 that appears there.

Similar Messages

  • Extract data from XML file to Oracle database

    Dear All
    Please let me know, how to extract data from XML file to Oracle database which includes texts & images.
    Thanking You
    Regards Lakmal Marasinghe

    I would do it from the database, but then again, I am a database / PL/SQL guy.
    IMHO the database will deliver you with more options. I don't know about "speed" between the two.

  • Loading data from SQL server to Oracle database

    i want to create one table in oracle db from table in sql server. Table is huge it got 97,456,789 records.
    I created db link (HS) in oracle database which is pointing to sql server. i can select that table from oracle thru db link.
    select * from "dbo"."t1@dblink;
    i fired below create table.
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...
    is there any alternate method to do this and and populate table in oracle db faster.
    Please advise. thanks.

    vhiware wrote:
    create table t2 nologging parallel (degree=3) as select * from "dbo"."t1@dblink;
    and its taking long time.... but its running...I doubt that parallel processing will be used as this is unique to Oracle (using rowid ranges typically) and not SQL-Server.
    is there any alternate method to do this and and populate table in oracle db faster.Part of the performance overhead is pulling that data from SQL-Server to Oracle across the network link between them. This can be sped up by compressing the data first - and then transferring that across the network.
    For example: using +bcp+ to export the data on the SQL-Server box to a CSV file, compress/zip the file, scp/sftp the file to Oracle, and then unzipping it there. Parallel and direct load processing can now be done using SQL*Loader to load the CSV into Oracle.
    If this is a Linux/Unix base system, then the unzip/decompress process can be run in parallel with the SQL*Loader process by creating a pipe between the two - where the unzip process writes uncompressed data into the pipe and SQL*Loader reads and loads data as it becomes available via the pipe.
    Alternatively, you can do you own PQ processing. Let's say the data is date ranged. You can create a procedure on Oracle that looks something like this:
    {code}
    create or replace procedure CopyDay( day date ) is
    begin
    insert /*+ append */ into local_tab select * from remote_tab@remotedb where col_day = day;
    -- add logging info, commit, etc.
    end;
    {code}
    You can now start 10 or more of these for different days and run it in the background using DBMS_JOB.

  • Periodic Importing of data from SQL Server into Oracle Database

    I would like to know how I can use the SQL Developer tool to import data from a SQL Server database across the internet into an Oracle Database on a periodic basis? I understand there is a Migration Workbench, but it seems to be only a one off activity.
    What I would really like is to be able to import data for example, very 30 minutes from multiple tables/views in a SQL Server Database into an Oracle Database (overwriting or modifying existing same data) without the need for Heterogeneous Connectivity, as my Oracle Database is not my LAN.
    Thank you for your kind ideas and suggestions.

    To be honest the best way to do it is DG4ODBC or DG4MSQL. All other solutions need manual interaction.
    The gateways DG4ODBC and DG4MSQL are independant from the Oracle database and also from the SQL Server location. In a worst case scenario you have an Oracle database on machine A, the gateway on machine B and the SQL Server on machine C.
    Gateways were built to exactly do what you want. As you have access to the Oracle database the only part you need to define within the Oracle database is a db link. If you specify the full tns connect identifier there is even no need to edit the tnsnames.ora file.
    Even if you excluded the gateway in your last sentence the best solution would be the gateway.
    Another option you can use is the SQL Server linked server mechanism. It allows you to link another server using OLEDB driver. In your case you can then link the Oracle db into your SQL Server and then insert/update/delete and select Oracle tables from the SQL Server. Using now a trigger will replicate the data immediately to the Oracle db.

  • How to merge data from SQL server to Oracle Database

    Dear Expert,
    I am having problem with SQL server with Oracle.
    Problem: I want to merge table records from SQL server to Oracle Table. Which License free tool I can use to achive the goals.
    If I able to make a free DB link from Oracle to SQL server , then we can select table and will be able to update.
    Right now I have made a DB link from SQL server to Oracle, Using that I can see the records from oracle database but I can't update them.
    Thanks,
    Sher

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • How to join data from SAP BW and Oracle database from Webi?

    Hi,
    Need to  create a Web Intelligence Report connecting to multiple data sources.        
    Ø SAP-BW contains the data (All units).                                                                               
    Ø Oracle db contains the access security data (respective units                                                                    
    for the user).               
    Since Universe can only connect to a single data-source we have to create two universes connecting to SAP-BW and Oracle db respectively and then create a webi report to point the two universes to retrieve the equi-join data on the report.
    May I know which layer I can join the data? What kind of data I can join?
    Can I merge dimensions from both the data sources? What about measures?
    How I can create SQL query in Webi in order to simulate the join to the two data source?
    Appreciate any info related.
    thanks and regards
    nora

    Hi Nora,
    You can use Data Federator technology to federate multi-sources such as SAP BW and Oracle.
    Las you just have to create a universe on the Data Federator data source and the universe isee the data source as a single source whereas it is not.
    Then any clainet that consume uninverses can take advantage of this solution.
    Regards;
    Didier

  • Problems with retrieving data from tables with 240 and more records

    Hi,
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.
    I installed Oracle 11.2.0 Client and I started to have problems with retrieving data from tables.
    First I used the same connection string, driver and so on (O10 Oracle 10g) then I tried ORA Oracle but with no luck. The result is like this:
    I'm able to connect to database. I'm able to retrieve data but from small tables (e.g. with 110 records it works perfectly using both O10 and ORA drivers). When I try to retrieve data from tables with like 240 and more records retrieval simply hangs (nothing happens at all - no error, no timeout). Application seems to hang forever.
    I'm using Powerbuilder to connect to Database (either PB10.5 using O10 driver or PB12 using ORA driver). I used DBTrace, so I see that query hangs on the first FETCH.
    So for the retrievals that hang I have something like:
    (3260008): BIND SELECT OUTPUT BUFFER (DataWindow):(DBI_SELBIND) (0.186 MS / 18978.709 MS)
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=1
    (3260008): ,len=160,type=DECIMAL,pbt=4,dbt=0,ct=0,prec=0,scale=0
    (3260008): EXECUTE:(DBI_DW_EXECUTE) (192.982 MS / 19171.691 MS)
    (3260008): FETCH NEXT:(DBI_FETCHNEXT)
    and this is the last line,
    while for retrievals that end, I have FETCH producing time, data in buffer and moving to the next Fetch until all data is retrieved
    On the side note, I have no problems with retrieving data either by SQL Developer or DbVisualizer.
    Problems started when I installed 11.2.0 Client. Even if I want to use 10.0.1 Client, the same problem occurs. So I guess something from 11.2.0 overrides 10.0.1 settings.
    I will appreciate any comments/hints/help.
    Thank you very much.

    pgoel wrote:
    I've been connecting to Oracle 11g Server (not sure exact version) using Oracle 10.1.0 Client and O10 Oracle 10g driver. Everything was ok.Earlier (before installing new stuff) did you ever try retrieving data from big tables (like 240 and more records), if yes, was it working?Yes, with Oracle 10g client (before installing 11g) I was able to retrieve any data, either it was 10k+ records or 100 records. Installing 11g client changed something that even using old 10g client (which I still have installed) fails to work. The same problem occur no matter I'm using 10g or 11g client now. Powerbuilder hangs on retrieving tables with more than like 240 records.
    Thanks.

  • Show data from sql server to oracle db

    Hi,
    I am using oracle 10g R1 on windows 2003 platform. On one machine database 10gR1 is running and on other machine sql server is running. I want to retrieve some data from sql server to oracle database. Please tell me how I can show data from sql server to oracle db.
    Thanks

    To make heterogeneous connection with oracle:
    1.First make an ODBC connection, make entry in System DSN(to create a data source)
    2.Make an entry in tnsnames.ora
    3.Make an entry in listener.ora under SID_LIST_LISTENER
    4.Make an entry in file named init<HS>.ora file located "oracle_base\oracle_home\db\hs\admin"
    5.Restart the listener
    e.g:
    1. create a odbc system dsn named like 'sqlserver'
    2. sqlserver= (DESCRIPTION=
    (ADDRESS=(PROTOCOL=tcp) (HOST=xx.xx.xx.xx) (PORT=1521))
    (CONNECT_DATA = (SERVICE_NAME=sqlserver))
    (HS = OK)
    3. (SID_DESC = (SID_NAME = sqlserver) (ORACLE_HOME = oracle_base\oracle_home\db) (PROGRAM = hsodbc) )
    4.Create a file named initsqlserver.ora and make the following entry:
    HS_FDS_CONNECT_INFO = sqlserver
    Alternatively, you can copy the file named inithsodbc.ora and rename it to initsqlserver.ora
    and edit as HS_FDS_CONNECT_INFO = sqlserver
    5. lsnrctl reload listener_name
    regards
    adnan kaysar

  • Insert and update tables from SQL server to oracle database tables

    Hi,
    I am having problem while update data from sql server to oracle database tables.
    I am doing one way insert +updates that is from SQL Server tables ==> Oracle database tables
    I am using tools Sql server Integration service. I can insert data from sql server to oracle but update can't. Please help me how can I update + insert from sql server to oracle database tables easily.
    Thanks in advance.

    Hi,
    What about using Oracle SQL Developer for migration
    http://www.oracle.com/technetwork/database/migration/sqlserver-095136.html
    HTH

  • Storing data from XML files in Oracle DB

    Hi!
    I just started to work with XML and need to save data from XML files into Oracle database. I tried to run sample from Oracle web site. The code was following:
    public class xmlwritedb
    public static void main(String args[]) throws SQLException
    String tabName = "EMP"; // Table into which to insert XML data
    String fileName = "emp.xml"; // XML document filename
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    // Initialize a JDBC connection
    Connection conn =
    DriverManager.getConnection("jdbc:oracle:oci8:scott/tiger@");
    // Insert XML data from file (filename) into
    // database table (tabName)
    OracleXMLSave save = new OracleXMLSave(conn, tabName);
    URL url = save.createURL(fileName);
    int rowCount = save.insertXML(url);
    System.out.println(" successfully inserted "+rowCount+
    " rows into "+ tabName);
    conn.close();
    But it does not work.
    OracleXMLSave object does not see file name.
    Please, help me solve this problem. Also,where is it possible to find any documentation on oracle.xml.* classes API.
    Thank you.
    Maya.
    null

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by sudeepk:
    If a java exception is thrown probably during ur install u might have forgotten
    grant javauserpriv to scott;
    grant javasyspriv to scott;
    Thanks
    [email protected]
    <HR></BLOCKQUOTE>
    Thank you!!!

  • Oracle form: how to retrieve data from database to pop list

    I have problem in retrieving data from database to item list in
    oracle forms.
    Can anyone help me.
    thanks.

    The next is an example but you can find this information in
    Forms Help:
    DECLARE
         G_DESCS RECORDGROUP;
         ERRCODE NUMBER;
         rg_id RECORDGROUP;
         rg_name VARCHAR2(40) := 'Descripciones';
    BEGIN
         rg_id := FIND_GROUP(rg_name);
         IF Id_Null(rg_id) THEN
         G_DESCS := Create_Group_From_Query (rg_name, 'SELECT
    DESCRIPCION DESCRIPCION, DESCRIPCION DESC2 FROM FORMAS_PAGO);
         ERRCODE := POPULATE_GROUP(G_DESCS);
         POPULATE_LIST('FORMAS_PAGO.CMBDESCRIPCION',G_DESCS);
         END IF;
    END;
    Saludos.
    Mauricio.

  • Retrieving data from oracle database and displaying using servlets

    //DataRetrieving.class file
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DataRetrieving extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws
    ServletException, IOException{ 
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("A program for connecting oracle database");
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL", "scott","tiger");
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery ("SELECT ename,job,sal,comm,deptno FROM emp");
    while ( r.next() )
         String bar = r.getString("ename");
         String bar1 = r.getString("job");
         float bar2 = r.getInt("sal");
         float bar3 = r.getInt("comm");
         int bar4 = r.getInt("deptno");
         //out.println(r.getString(0)+" "+r.getString("ename"));
         out.println("hi");
         out.println(bar1);
    r.close();
    stmt.close();
    con.close();
    catch (Exception e)
    out.println("ERROR : " + e);
    //web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
    <web-app>
    <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>DataRetrieving</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/DataRetrieval</url-pattern>
    </servlet-mapping>
    </web-app>
    while running the servlet , i am unable to retrieve the data
    The error message i am getting is
    A program for connecting oracle database
    ERROR : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    after running the servlet.
    what could be the problem?

    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class myserv extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter pw=res.getwriter();
    pw.println("Connecting data base");
         try
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=Drivermanager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
         Stamtenet st=con.createStament();
         Resultset rs=con.executeQurey("select * from emp");
         while(rs.next())
         rs.getInt("empno")+" "+rs.getDouble("sal"));
         }catch(Exception e)
    }

  • ClickOnce WinForms Application to retrieve data from an Oracle Database

    I am hoping someone can help us.
    We are trying to create a ClickOnce WinForms Application that will allow our Customer Service group to retrieve data from an Oracle Database.
    We are currently able to use such a ClickOnce WinForms Application to allow our Customer Service group to retrieve data from SQL Server 2000 databases and even to a PICK Basic database. We use ole db drivers for these connections and keep the connection strings in a configuration file.
    Our primary question now is:
    1) What files would be needed on each client machine?
    Thanks for any pointers.
    :) Anne

    The problem has been fixed.
    If you wanna to load data from Oracle DB,the connect String should be like this:
    cnss.open "Provider=OraOLEDB.Oracle.1;data source=orcl;User Id=fdmitf;Password=fdmitf"
    besides, you should assign a value (True/False) to your function, as TonyScalese said in this post:
    Import from RDB Fails with "Error:Import failed.Invalid data or Empty..."
    Problem solved is always a great joy! Thanks!

  • Retrieve data from a large table from ORACLE 10g

    I am working with a Microsoft Visual Studio Project that requires to retrieve data from a large table from Oracle 10g database and export the data into the hard drive.
    The problem here is that I am not able to connect to the database directly because of license issue but I can use a third party API to retrieve data from the database. This API has sufficient previllege/license permission on to the database to perform retrieval of data. So, I am not able to use DTS/SSIS or other tool to import data from the database directly connecting to it.
    Here my approach is...first retrieve the data using the API into a .net DataTable and then dump the records from it into the hard drive in a specific format (might be in Excel file/ another SQL server database).
    When I try to retrieve the data from a large table having over 13 lacs records (3-4 GB) in a data table using the visual studio project, I get an Out of memory exception.
    But is there any better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?
    Any help on this problem will be highly appriciated.
    Thanks in advance...
    -Jahedur Rahman
    Edited by: Jahedur on May 16, 2010 11:42 PM

    Girish...Thanks for your reply...But I am sorry for the confusions. Let me explain that...
    1."export the data into another media into the hard drive."
    What does it mean by this line i.e. another media into hard drive???
    ANS: Sorry...I just want to write the data in a file or in a table in SQL server database.
    2."I am not able to connect to the database directly because of license issue"
    huh?? I never heard this question that a user is not able to connect the db because of license. What error / message you are getting?
    ANS: My company uses a 3rd party application that uses ORACLE 10g. And my compnay is licensed to use the 3rd party application (APP+Database is a package) and did not purchased ORACLE license to use directly. So I will not connect to the database directly.
    3.I am not sure which API is you are talking about, but i am running an application of the visual studio data grid or similar kind of controls; in which i can select (select query) as many rows as i needed; no issue.
    ANS: This API is provided by the 3rd party application vendor. I can pass a query to it and it returns a datatable.
    4."better way to retrieve the records chunk by chunk and do the export without loosing the state of the data in the table?"
    ANS: As I get a system error (out of memory) when I select all rows in a datatable at a time, I wanted to retrieve the data in multiple phases.
    E.g: 1 to 20,000 records in 1st phase
    20,001 to 40,000 records in 2nd phase
    40,001 to ...... records in 3nd phase
    and so on...
    Please let me know if this does not clarify your confusions... :)
    Thanks...
    -Jahedur Rahman
    Edited by: user13114507 on May 12, 2010 11:28 PM

  • Need Sample code to retrieve Data from Portal DB(Oracle)

    Would anyone provide me steps to create application with a sample code to retrieve data from portal DB which is oracle and see the output in table format.

    Hi Bris ,
    The sample code , you didnt specified from where do u want to access the oracle thorough java code or through webdynpro .
    Sample code to access through Java
    import java.sql.*;
    class Customer
    public static void main(String args[]) throws SQLException
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    System.out.println("Connecting to the database...");
    try
    Connection cn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","t");
    Statement st=cn.createStatement();
    ResultSet rs=st.executeQuery("select 'Connected' from dual");
    rs.next();
    String s=rs.getString(1);
    System.out.println(s);
    st.close();
    cn.close();
    catch(Exception ex)
    System.out.println("The exception raised is:" + ex);
    [code]
    If accessing through JDBC datasorce.
    https://www.sdn.sap.com/irj/sdn/thread?threadID=328550
    https://www.sdn.sap.com/irj/sdn/thread?threadID=309386
    [code]
    package com.dhl.employeemodel;
    import java.sql.Connection;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    public class DBConnectionManager {
         Connection connection;
          * @return
         public Connection getConnection() {
              try
                   Context jndiContext = new InitialContext();
                   DataSource ds = (DataSource)jndiContext.lookup("jdbc/MyAlias");
                   connection = ds.getConnection();
             catch(Exception connectionErrEx)
                   //connectionErrEx.printStackTrace();
                   return null;
              return connection;
    Thanx
    Pankaj

Maybe you are looking for