What is "with"   and "Connecty By" in Oracle SQL

Hello All,
I'm Just going through the forum topics, I have seen sql queries starts like "with t as" and at the end it closes like "connect ". I have seen this kind for normal queries also. Please let me know what is the "with" concept and when do we use that?
Thanks in Advance!!!

And in 11gR2 you can combine the two with the new feature Recursive Subquery Refactoring (well sort of, because you don't need the connect by bit)
I'd link to the official docs but they seem to be suffering intermittent issues at the moment so:
http://technology.amis.nl/blog/6267/oracle-rdbms-11gr2-new-style-hierarchical-querying-using-recursive-subquery-factoring
http://technology.amis.nl/blog/6104/oracle-rdbms-11gr2-goodbye-connect-by-or-the-end-of-hierarchical-querying-as-we-know-it

Similar Messages

  • START WITH and CONNECT BY in Oracle SQL ( hierarchical relationship)

    Hi, the original table as below
    Customer_ID         Account_ID          Paying_Account_ID         Parent_Account_ID          Company_ID
    158                    158                    158                         158                     0
    159                    159                    158                         158                     0
    160                    160                    158                         158                     0
    181                    181                    181                         181                     0
    183                    183                    183                         183                     0
    24669                  24669                  24669                       24669                   0        
    24671                  24671                  24671                       24669                   0
    24670                  24670                  24670                       24669                   0    
    3385127                3385127                3385127                     24670                   0To identify the hierarchical relationship of the data, which are PARENT_ACCOUNT_ID & ACCOUNT_ID, below is the query that I was used.
    select  lpad(' ', 2*level) || A.ACCOUNT_ID AS LEVEL_LABEL, CONNECT_BY_ISCYCLE "Cycle", LEVEL, A.* from ACCOUNT A
    START WITH parent_account_id = account_id
    CONNECT BY NOCYCLE  PRIOR A.ACCOUNT_ID = A.PARENT_ACCOUNT_ID
    AND account_id != parent_account_id
    ;This is the result from the query
    Level_Label              Level          Cycle        Customer_ID             Account_ID        Paying_Account_ID      Parent_Account_ID      Company_ID
    158                         1             0              158                     158              158                   158                     0
       159                      2             0              159                     159              158                   158                     0
       160                      2             0              160                     160              158                   158                     0
    181                         1             0              181                     181              181                   181                     0
    183                         1             0              183                     183              183                   183                     0
    24669                       1             0              24669                   24669            24669                 24669                   0      
        24671                   2             0              24671                   24671            24671                 24669                   0
        24670                   2             0              24670                   24670            24670                 24669                   0
            3385127             3             0              3385127                 3385127          3385127               24670                   0My questions is how can I modified the query in order to calcuate the values for:
    My_Total_PR - Number of my child PR accounts which doest not include itself.
    Total_PR - Total number of PR accounts in the overall structure
    My_Total_NPR - Number of my child NPR accounts which doest not include itself.
    Total_NPR - Total number of NPR accounts in the overall structure
    *PR stand for payment responsible, for instance the payment responsible for Account 158 is 158 (Paying_Account_ID), so the Total_PR for 158 is 3 (158, 159, 160)
    *NPR stand for Non payment responsible, for instance the payment responsible for Account 159 is 158 (Paying_Account_ID), so the Total_NPR for 159 is 1
    This is the expected result, Any advice much appreciated. Thanks
    Level_Label                     Level           Cycle           My_Total_PR     Total_PR     My_Total_NPR     Total_NPR     Paying_Account
    158                               1                0                  2              3          0              0              158
        159                           2                0                  0              0          0              1              158
        160                           2                0                  0              0          0              1              158
    181                               1                0                  0              1          0              0              181
    183                               1                0                  0              1          0              0              183
    24669                             1                0                  0              1          3              3              24669                  
        24671                         2                0                  0              1          0              0              24671
        24670                         2                0                  0              1          1              1              24670
            3385127                   3                0                  0              1          0              0              3385127Edited by: user11432758 on 14-Feb-2012 01:00
    Edited by: user11432758 on 14-Feb-2012 07:05

    Hi,
    user11432758 wrote:
    Hi below is the DDL statment, thanks
    CREATE TABLE "SYSTEM"."ACCOUNT" ...
    Don't create your own objects in the SYSTEM schema, or any schema that comes with the database. Create a separate schema, and put your objects into it. You'll have fewer security problems, and migrating to a new database will be easier.
    Here's one way to can get the aggregates that you want:
    WITH     got_descendants          AS
         SELECT     CONNECT_BY_ROOT account_id     AS ancestor_id
         ,     paying_account_id
         ,     LEVEL                    AS lvl
         FROM     account
         CONNECT BY NOCYCLE     PRIOR account_id     = parent_account_id
              AND          account_id          != parent_account_id
    SELECT       ancestor_id
    ,       COUNT (CASE WHEN lvl             > 1
                      AND  ancestor_id  = paying_account_id THEN 1 END)     AS my_total_pr
    ,       COUNT (CASE WHEN ancestor_id  = paying_account_id THEN 1 END)     AS total_pr
    ,       COUNT (CASE WHEN lvl             > 1
                      AND  ancestor_id != paying_account_id THEN 1 END)     AS my_total_npr
    ,       COUNT (CASE WHEN ancestor_id != paying_account_id THEN 1 END)     AS total_npr
    FROM       got_descendants
    GROUP BY  ancestor_id
    ;Output:
    `             MY_         MY_
                TOTAL TOTAL TOTAL TOTAL
    ANCESTOR_ID   _PR   _PR  _NPR  _NPR
            158     2     3     0     0
            159     0     0     0     1
            160     0     0     0     1
            181     0     1     0     0
            183     0     1     0     0
          24669     0     1     3     3
          24670     0     1     1     1
          24671     0     1     0     0
        3385217     0     1     0     0This gives you the right numbers, but how can we get them in an order that reflects the hierarchy, with the columns (such as lvl) that are derived from the hierarchy?
    One way would be to do two CONNECT BY queries; one without a START WITH clause (like the one above) that gets the aggregates, and the other with a START WITH clause (like your original query), that is in the right order, and has columns such as level_label and level. We could join the result sets and get exactly what we want. I'll leave that as an exercise.
    Here's another way, that gets the right results with only one CONNECT BY query:
    WITH     got_descendants          AS
         SELECT     CONNECT_BY_ROOT account_id     AS ancestor_id
         ,     paying_account_id
         ,     account_id
         ,     LEVEL                    AS lvl
         ,     CONNECT_BY_ISCYCLE          AS cycle
         ,     CASE
                  WHEN  CONNECT_BY_ROOT account_id
                      = CONNECT_BY_ROOT parent_account_id
                  THEN  ROWNUM
              END                    AS r_num
         FROM     account
         CONNECT BY NOCYCLE     PRIOR account_id     = parent_account_id
              AND          account_id          != parent_account_id
         ORDER SIBLINGS BY     account_id     -- Optional
    ,     got_o_num     AS
         SELECT     got_descendants.*
         ,     MIN (r_num) OVER (PARTITION BY  account_id)     AS o_num
         ,     MAX (lvl)   OVER (PARTITION BY  account_id)      AS max_lvl
         FROM     got_descendants
    SELECT       LPAD ( ' '
                , 2 * (MIN (max_lvl) - 1)
                )  || ancestor_id                         AS level_label
    ,       MIN (max_lvl)                                AS "Level"
    ,       MIN (cycle)                                   AS "Cycle"
    ,       COUNT (CASE WHEN lvl             > 1
                      AND  ancestor_id  = paying_account_id THEN 1 END)     AS my_total_pr
    ,       COUNT (CASE WHEN ancestor_id  = paying_account_id THEN 1 END)     AS total_pr
    ,       COUNT (CASE WHEN lvl             > 1
                      AND  ancestor_id != paying_account_id THEN 1 END)     AS my_total_npr
    ,       COUNT (CASE WHEN ancestor_id != paying_account_id THEN 1 END)     AS total_npr
    ,       MIN (paying_account_id)                                    AS paying_account
    FROM       got_o_num
    GROUP BY  ancestor_id
    ORDER BY  MIN (o_num)
    ;Output:
    `                             MY_         MY_
                                TOTAL TOTAL TOTAL TOTAL  PAYING_
    LEVEL_LABEL     Level Cycle   _PR   _PR  _NPR  _NPR  ACCOUNT
    158                 1     0     2     3     0     0      158
      159               2     0     0     0     0     1      158
      160               2     0     0     0     0     1      158
    181                 1     0     0     1     0     0      181
    183                 1     0     0     1     0     0      183
    24669               1     0     0     1     3     3    24669
      24670             2     0     0     1     1     1    24670
        3385217         3     0     0     1     0     0  3385217
      24671             2     0     0     1     0     0    24671This is exactly what you requested, except that you posted the row with level_label='  24671' before the row with level_label='  24671'. You may not care which of those comes first, but if that's important, explain why those rows need to be in descending order by account_id, while '159 and '160' are in ascending order. You'll need to change the ORDER SIBLINGS BY clause accordingly.

  • What are the Major and Minor Diffs between oracle,sql server,MSAccess

    Hi all,
    Can any one explain or send me all the diff between
    oracle ,sql server,access..like how much data can each
    support,...
    Thanks

    Dear sir,
    here it is.
    http://www.oracle.com/database/product_editions.html

  • Extraction of data from Planning and load it into Oracle/SQL server (RDBMS)

    Hi All,
    ODI can extract data from Oracle/SQL server RDBMS and load it into Hyperion planning, but I wanted to know if it is possible to extract data from Hyperion Planning through ODI and load it into Oracle or SQL server RDMBS i.e the other way round.
    Kindly let me know if that is possible or not,If yes then please let me know what is the exact process to achieve this through ODI.
    Thanks & Regrads,
    Gurpreet

    Yes this can be done. Remember that Planning data is actually stored in Essbase so the Knowledge module you will need to use is LKM Essbase to SQL (DATA)

  • Issue with Oracle SQL Developer

    I use a oracle database for my process (LMS relared stuff)
    When i write a query which is expected to pull thousands and thousands of records. Why do i need to keep scrolling down to fetch more records.
    Why will it not pull all the records?
    I need to keep scrolling down till i get all the records.
    Any solution?
    (I'm using it for the first time in my life. i'm just 3 day old to this software)
    My O/S: Win XP Professional with 1gb of RAM.
    Oracle SQL Developer Version: 1.2.1 Build Main-32.13
    Is any other information required???
    Message was edited by:
    user599780

    This will be in the next release. However, if you want to put this in now you can make an extension ( there's examples on my blog) and put this chuck of code in:
    Connections.getInstance().addConnectionListener(new ConnectionListener() {
                   public void connectionAdded(ConnectionEvent evt) {}
                   public void connectionClosed(ConnectionEvent evt) {}
                   public void connectionModified(ConnectionEvent evt) {}
                   public void connectionOpened(ConnectionEvent evt) {
    Connection conn = Connections.getInstance().getConnection(evt.getConnectionName());
    if (conn instanceof OracleConnection){                                   
    ((OracleConnection)conn).setDefaultRowPrefetch(DBConfig.getInstance().getInt(DBConfig.ARRAYFETCHSIZE));
                   public void connectionRemoved(ConnectionEvent evt) {}
                   public void connectionRenamed(ConnectionEvent evt) {}
    });

  • How i found listener o tsnames in oracle sql developer

    Jelou, i have some troubles with the Oracle SQL Developer, i have a server with Oracle 11g, but the client (sql developer) dont connect to the server, they give me a error, the oracle error i try to search in the search pages, but they dont have a answer.
    I try to search the listener and the tsnames files, but i dont found the files, i working in Windows 7 in 32bits,
    The Oracle error is ORA-12518.
    I put a picture about error,
    [http://picasaweb.google.com/lh/photo/2dpHUn5kEIfxMDqPFM9DxpmLdaXzuCybZLuf45HwREU?feat=directlink]
    Thanks for the help,
    Edited by: user13373417 on 07-Jul-2010 08:50

    user13373417 wrote:
    Your answer is about the function to database, or for the client, because i have the trouble with the client, i used Oracle sql Developer (the last version put in oracle) in windows 7
    ok, but how i found the listener o the tsnames, because i searching in all disk (c) but i dont found them, or how i can turn on the listener o whe is the directory when i put the files, because the installation dont have the /network/adm for put the files
    Edited by: user13373417 on 07-Jul-2010 09:06It appears you don't have a very clear understanding of how the client and the server are configured to communicate with one another.
    ============
    A couple of important points.
    First, the listener is a server side only process. It's entire purpose in life is to receive requests for connections to databases and set up those connections. Once the connection is established, the listener is out of the picture. It creates the connection. It doesn't sustain the connection. One listener, running from one oracle home, listening on a single port, will serve multiple database instances of multiple versions running from multiple homes. It is an unnecessary complexity to try to have multiple listeners. That would be like the telephone company building a separate switchboard for each customer.
    Second, the tnsnames.ora file is a client side issue. It's purpose is for address resolution - the tns equivalent of the 'hosts' file further down the network stack. The only reason it exists on a host machine is because that machine can also run client processes.
    Assume you have the following in your tnsnames.ora:
    larry =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = myhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVICE_NAME = curley)
      )Now, when you issue a connect, say like this:
    $> sqlplus scott/tiger@larrytns will look in your tnsnames.ora for an entry called 'larry'. Next, tns sends a request to (PORT = 1521) on (HOST = myhost) using (PROTOCOL = TCP), asking for a connection to (SERVICE_NAME = curley).
    Where is (HOST = myhost) on the network? When the request gets passed from tns to the next layer in the network stack, the name 'myhost' will get resolved to an IP address, either via a local 'hosts' file, via DNS, or possibly other less used mechanisms. You can also hard-code the ip address (HOST = 123.456.789.101) in the tnsnames.ora.
    Next, the request arrives at port 1521 on myhost. Hopefully, there is a listener on myhost configured to listen on port 1521, and that listener knows about SERVICE_NAME = curley. If so, you'll be connected.
    What can go wrong?
    First, there may not be an entry for 'larry' in your tnsnames. In that case you get "ORA-12154: TNS:could not resolve the connect identifier specified" No need to go looking for a problem on the host, with the listener, etc. If you can't place a telephone call because you don't know the number (can't find your telephone directory (tnsnames.ora) or can't find the party you are looking for listed in it (no entry for larry)) you don't look for problems at the telephone switchboard.
    Maybe the entry for larry was found, but myhost couldn't be resolved to an IP address (say there was no entry for myhost in the local hosts file). This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe there was an entry for myserver in the local hosts file, but it specified a bad IP address. This will result in "ORA-12545: Connect failed because target host or object does not exist"
    Maybe the IP was good, but there is no listener running: "ORA-12541: TNS:no listener"
    Maybe the IP was good, there is a listener at myhost, but it is listening on a different port. "ORA-12560: TNS:protocol adapter error"
    Maybe the IP was good, there is a listener at myhost, it is listening on the specified port, but doesn't know about SERVICE_NAME = curley. "ORA-12514: TNS:listener does not currently know of service requested in connect descriptor"

  • Java.sql.SQLException: Internal Error while using oracle.sql.ARRAY.getArray

    Hello All,
    Here is the issue description. Our application uses Oracle Object Types and LIST. We deployed our application on QA environment which has Oracle 10g. Application runs fine...no issues. Now we moved to UAT. UAT environment is same as QA environment and DBA have created replica of QA database.
    Now WAR file which works fine with QA database , somehow doesnt work with UAT database. Application throws following exception when code tries to call getArray() on java.sql.Array.
    We tried to point UAT weblogic to QA database and it worked fine.....but when we point UAT weblogic to UAT database , we get following exception. So we know that this is a database issue.
    DBA claims that QA env database and UAT env database are same.
    Can anybody please tell me what wrong here? What setting is not done on UAT database which is done on QA?
    java.sql.SQLException: Internal Error at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:227) at oracle.jdbc.oracore.OracleTypeCOLLECTION.initCollElemTypeName(OracleTypeCOLLECTION.java:975) at oracle.jdbc.oracore.OracleTypeCOLLECTION.getAttributeType(OracleTypeCOLLECTION.java:1005) at oracle.jdbc.oracore.OracleNamedType.getFullName(OracleNamedType.java:96) at oracle.jdbc.oracore.OracleTypeADT.createStructDescriptor(OracleTypeADT.java:1958) at oracle.jdbc.oracore.OracleTypeADT.unpickle81(OracleTypeADT.java:1432) at oracle.jdbc.oracore.OracleTypeUPT.unpickle81UPT(OracleTypeUPT.java:426) at oracle.jdbc.oracore.OracleTypeUPT.unpickle81rec(OracleTypeUPT.java:383) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody_elems(OracleTypeCOLLECTION.java:928) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81_imgBody(OracleTypeCOLLECTION.java:872) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unpickle81(OracleTypeCOLLECTION.java:692) at oracle.jdbc.oracore.OracleTypeCOLLECTION._unlinearize(OracleTypeCOLLECTION.java:217) at oracle.jdbc.oracore.OracleTypeCOLLECTION.unlinearize(OracleTypeCOLLECTION.java:189) at oracle.sql.ArrayDescriptor.toJavaArray(ArrayDescriptor.java:663) at oracle.sql.ARRAY.getArray(ARRAY.java:282) at weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY.getArray(Unknown Source)
    Please help.

    425260 wrote:
    This can happen if you use the oracle.sql.ARRAY class with WebLogic.
    WebLogic wraps oracle.sql.ARRAY with its own class (i.e. weblogic.jdbc.wrapper.Array_oracle_sql_ARRAY). The easiest solution is to replace oracle.sql.ARRAY with the JDBC standard java.sql.Array.
    <PRE class=jive-pre><CODE class="jive-code jive-java">Object[] items = (Object[])array.getArray();
    <FONT color=navy><B>if</B></FONT> (items.length &gt; 0) <FONT color=navy>{</FONT>
    <FONT color=navy><B>for</B></FONT> (<FONT color=navy><B>int</B></FONT> i = 0; i &lt; items.length; i++) <FONT color=navy>{</FONT>
    Object arrayItem = items;
    <FONT color=navy>}</FONT>
    <FONT color=navy>}</FONT>
    </CODE></PRE>
    The <B>array</B> object is a java.sql.Array. Here no unwrapping of the WebLogic wrapper is needed.
    If you absolutely need the oracle.sql.ARRAY class than you must use an <B>unwrap</B> API on the WebLogic wrapper class.
    <PRE class=jive-pre><CODE class="jive-code jive-java"><FONT color=navy><B>if</B></FONT> (object <FONT color=navy><B>instanceof</B></FONT> weblogic.jdbc.wrapper.Array)
    array = (ARRAY) ( ((weblogic.jdbc.wrapper.Array)object).unwrap(Class.forName(<FONT color=red>"oracle.sql.ARRAY"</FONT>)) );
    <FONT color=navy><B>else</B></FONT>
    array = (ARRAY) object;
    </CODE></PRE>
    Here, <B>array</B> is an oracle.sql.ARRAY. Try to see if this <A class=bodylinkwhite href="http://www.software-to-convert.com/3gp-conversion-software/3gp-to-myspace-video-software.html"><FONT face=tahoma,verdana,sans-serif color=#000 size=1>helps</FONT></A>. Good luck.
    Thanks for your explanation! It's very valuable, It is exactly what I need, I understand this part.

  • Unable to connect to Oracle Database using Oracle Sql developer 2.1.1.64

    Hi Everyone,
    I am searching for some help regarding my problem with Oracle connectivity. I have installed Oracle 11g release 2 on my Windows XP Professional Laptop. For a few days after installation i could connect to the Oracle database with the SYSTEM account using Oracle SQL developer ( installed on the same Laptop) but now i am unable to do so.It gives me this annoying message:
    An error was encountered performing the required operation  Got a minus one from read call .Vendor code 0
    However i am able to connect using Sql Plus by supplying the username SYSTEM and the corresponding password.
    My TNSNAMES .ora file is as follows:
    ORACLE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST =localhost)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = ORACLE)
    ORACLR_CONNECTION_DATA =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (CONNECT_DATA =
    (SID = CLRExtProc)
    (PRESENTATION = RO)
    My Listener.ora file is as follows:
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = CLRExtProc)
    (ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
    (PROGRAM = extproc)
    (ENVS = "EXTPROC_DLLS=ONLY:D:\app\product\11.2.0\dbhome_1\bin\oraclr11.dll")
    (SID_DESC =
    (GLOBAL_DBNAME = Oracle)
    (ORACLE_HOME = D:\app\product\11.2.0\dbhome_1)
    (SID_NAME = Oracle)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (PROTOCOL_STACK =
    (PRESENTATION = GIOP)
    (SESSION = RAW)
    ADR_BASE_LISTENER = D:\app
    My Sqlnet.ora file is as follows:
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    NAMES.DIRECTORY_PATH= (TNSNAMES, EZCONNECT)
    I am new to Oracle and so i need someone in this forum who can help me resolve this problem. Also i even tried connecting to the database using Toad 10.5.0.41. It give me the following error:
    ORA 12537 : TNS Connection closed
    Thanks for your patience and help in advance.
    ---Prashant

    Hello Irian and Sue,
    I can connect to the Oracle database using SQL Plus. Now when i TNSPING ORACLE from command line i get the following message :
    Used parameter files:
    D:\app\product\11.2.0\dbhome_1\network\admin\sqlnet.ora
    Used TNSNAMES adapter to resolve the alias
    Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST =localhost
    *)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = ORACLE)))*
    TNS-12537: TNS:connection closed
    Thanks for your response to my initial post.Do u have any other methods to resolve this?

  • Unable to display results of multiple query in grid in Oracle SQL Developer

    Hi, I am a newbie to this forum and couldn't find the Oracle SQL Developer forum so posting it here.
    My question: How to display multiple query results in grid in Oracle SQL Developer.
    Example:
    select * from Employee;
    select * from Department;
    - when I select both the queries and hit F5 in Oracle sql developer. By default it displays in output window.
    - How to display result of both the queries in Grid.
    Any thoughts on this would be really helpful.
    Thanks in advance.
    Harsh

    Hi Harsh,
    I'd say that the Results grid is designed to only show the results of 1 query at a time. I don't know/can't see how it would display multiple queries at a time.
    I would suggest either joining your tables to create a single query or opening another SQL Worksheet for one of the queries so that you can display the results side-by-side.
    Maybe you could explain what you're trying to do. Why are you trying to display multiple results in the same query grid?

  • Importing oracle.sql.BLOB through SQL Loader

    Hello,
    Currently the system we have creates .sql files and executes them. This takes a long time, so we're attempting to change to using SQL Loader. The one problem I'm having that I can't seem to fix is finding out how to imitate the behavior of this SQL statement through SQL Loader:
    INSERT INTO KRSB_QRTZ_BLOB_TRIGGERS (BLOB_DATA,TRIGGER_GROUP,TRIGGER_NAME)
    VALUES (oracle.sql.BLOB@515263,'KCB-Delivery','PeriodicMessageProcessingTrigger')
    I tried creating a lobfile and placing the text oracle.sql.BLOB@515263 within it this way
    INTO TABLE KRSB_QRTZ_BLOB_TRIGGERS
    WHEN tablename = 'KRSB_QRTZ_BLOB_TRIGGERS'
    FIELDS TERMINATED BY ',' ENCLOSED BY '##'
    TRAILING NULLCOLS
    tablename FILLER POSITION(1),
    TRIGGER_NAME CHAR(80),
    TRIGGER_GROUP CHAR(80),
    ext_fname FILLER,
    BLOB_DATA LOBFILE(ext_fname) TERMINATED BY EOF
    However, as expected, it merely loaded the text "oracle.sql.BLOB@515263" into the database. So does anyone have any ideas of how to imitate that insert statement through SQL Loader? The only information I have available is the string "oracle.sql.BLOB@515263", no other files or anything to aid with actually getting the binary data.
    When the .sql file is run with that insert statement in it, a 1.2kb BLOB is inserted into the database versus a 22 byte BLOB that contains nothing useful when done through SQL Loader.
    Alex

    My preference is DBMS_LOB.LOADFROMFILE
    http://www.morganslibrary.org/reference/dbms_lob.html
    did you try it?

  • ' ' in Oracle sql

    Hi Gurus,
    what is the syntax for this '<>' in Oracle sql
    Thanks

    Syntax for what? Double quotes? Two single quotes? What do you mean?
    WHERE ename <> 'SCOTT'Salman
    Edited by: Salman Qureshi on Oct 21, 2010 4:16 PM -- <> is not readable and we can only see two single quotes. May be posting of this makes some thing ambiguous. So now understood the quesiton

  • Problem with java.sql.Clob and oracle.sql.CLOB

    Hi,
    I am using oracle9i and SAP web application server. I am getClob method and storing that in java.sql.Clob and using the getClass().getName() I am getting the class name as oracle.sql.CLOB. But when I am trying to cast this to oracle.sql.CLOB i am getting ClassCastException. The code is given below
    java.sql.Clob lOracleClob = lResultSet.getClob(lColIndex + 1);
    lPrintWriter = new PrintWriter(new BufferedWriter (((oracle.sql.CLOB) lOracleClob).getCharacterOutputStream()));
    lResourceStatus = true;
    can anybody please tell me the what is the problem with this and solution.
    thanks,
    Ashok.

    Hi Ashok
    You can get a "ClassCastException" when the JVM doesn't have access to the specific class (in your case, "oracle.sql.CLOB").
    Just check your classpath and see if you are referring to the correct jar files.
    cheers
    Sameer
    PS: Please award points if you find the answer useful

  • What are the API's and OS Supported by Oracle TimesTen

    1.) What are all the API supported by oracle TimesTen?
    is the below are correct and whether other than this is there any other API supports oracle TimesTen
    JDBC,
    ODBC,
    OLAP,
    ADO.net,
    C++...............
    2.) What are the Platform supports?
    is the below are correct and whether other than this is there any other OS supports oracle TimesTen
    Linux x86-32 and x86-64:
    Oracle Linux 4 and 5
    Red Hat Enterprise Linux 4 and 5
    SUSE Enterprise Server 10 and 11
    MontaVista Linux CGE 5.0 and 6.0
    Asianux 3.0
    Microsoft Windows x86-32 and x86-64:
    Windows XP, Windows Vista, Windows Server 2003, Windows Server 2003 Release 2, Windows Server 2008, Windows 7
    Solaris SPARC 64-bit:
    Oracle Solaris 10
    Solaris x86-64:
    Oracle Solaris 10
    IBM AIX 64-bit:
    AIX 6.1 and 7.1
    Solaris SPARC 32-bit (client only):
    Oracle Solaris 10
    IBM AIX 32-bit (client only):
    AIX 6.1 and 7.1
    3.) What is the latest Version in Oracle TimesTen?
    4.) Maximum number of rows in a table.     2 Power 28 = 268,435,256 for 32 Bit     / (2 power 31-1) = 2,147,483,647 for 64 Bit
    if the Row value exceeds more than the specified value what will happen ? whether we need to have multiple tables
    Say TableA reaches 268,435,256 values and if few more rows are added then the value can be kept in new table TableB and so on..... or how?
    Thanks

    Dear 933663,
    1. What are all the API supported by oracle TimesTen?
    JDBC
    ODBC
    ADO.net
    OCI
    PRO*C
    +
    PL/SQL
    SQL
    2. What are the Platform supports?
    TimesTen 11.2.2.2.0 supports - Windows (32-bit, 64-bit), Linux x86 (32-bit, 64-bit), Solaris Sparc (64-bit), Solaris x86 (64-bit), IBM AIX Power (64-bit) (http://www.oracle.com/technetwork/products/timesten/downloads/index.html)
    The detailed information I could find only in 11.2.1 documentation (http://docs.oracle.com/cd/E18283_01/timesten.112/e13063/install.htm):
    Microsoft Windows 2000, Windows XP, Windows Vista and Windows Server 2003 and 2008 for Intel IA-32 and EM64T and AMD64 CPUs.
    Asianux 2.0 and 3.0 for Intel IA-32 and EM64T and AMD64 CPUs.
    SuSE LINUX Enterprise Server 10 for Intel IA-32 and EM64T and AMD64 CPUs.
    SuSE LINUX Enterprise Server 10 for Itanium2 CPUs
    Solaris 9 and 10 for UltraSparc CPUs
    Solaris 10 for AMD64 CPUs
    Red Hat Enterprise Linux 4 and 5 for Intel Itanium2 CPUs.
    Red Hat Enterprise Linux 4 and 5 for Intel IA-32 and EM64T and AMD64 CPUs.
    Oracle Enterprise Linux 4 and 5 for Intel IA-32 and EM64T and AMD64 CPUs.
    MontaVista Linux Carrier Grade Edition Release 4.0 and 5.0 for Intel IA-32, EM64T and AMD64 CPUs.
    HP-UX 11i v2 and 11iv3 for PA-RISC
    HP-UX 11i v2 and 11iv3 for Itanium2
    AIX 5L 5.3 and 6.1 for POWER CPUs
    3.) What is the latest Version in Oracle TimesTen?
    11.2.2.2.0 (http://www.oracle.com/technetwork/products/timesten/downloads/index.html)
    4) Maximum number of rows in a table. 2 Power 28 = 268,435,256 for 32 Bit / (2 power 31-1) = 2,147,483,647 for 64 Bit
    Actually, I couldn't find any information about rows limits for TimesTen tables and I've never faced with this problem.
    Best regards,
    Gennady

  • Installing PHP OCI8 extension on SLES 11 with PHP 5.6.3 Oracle Instantclient 12.1 and APACHE2

    I am attempting to install the OCI8 extension. The OCI8 extension version is oci-2.0.8.
    The configure script to install is "./configure --with-oci8=instantclient,/usr/lib/oracle/12.1/client64/lib".
    The configure runs ok. But when I run make test, it fails on every single oci test.
    The install directory of instantclient is "/usr/lib/oracle/12.1/client64"
    I have also declared $ORACLE_HOME and $LD_LIBRARY_PATH, and also declared instantclient in the path.
    I have also installed Perl on the server and that runs script's to update the remote oracle database. So the issue is not with instantclient.
    I am not sure what to do. Have spent 2 days on this issue. Any help will be greatly appreciated.
    Thanks.

    How and where did you set the environment variables?
    How are you running the tests?
    What errors are you seeing?

  • What is the best source to learn and advice to get Oracle 12c (OCA) certificate???

    Hi there,
    I hope all are running good.
    Actually, I'm a new in a Oracle career but I know all concepts of Databases and SQL.
    I'm planning to take a Oracle 12c (1Z0-061) (SQL Fundamentals) exam to achieve 12c OCA certificate but I'm bit confused in what source is best to learn it by self and what are tips to pass those all exam to lead me OCA certificate. Please, kindly provide your valuable opinions. Look forward to hearing your replies.
    Thanks

    The Oracle Press exam guide for 1Z0-061 is written, though of course there is all sorts of production stuff still to go. The 1Z0-062 guide (a lot longer!) is done except for the last two chapters. So both should be out in the near future. I know this because my buddy Roopesh is writing 1Z0-061, and I'm writing 1Z0-062. Bob Bryla's 1Z0-063 guide is bit later, the exam isn't in beta yet.
    As Philippe says, the OCA is not simple this time. Of course I can't reveal the exam content, but I think I can say that Oracle Uni is raising the standard with 12c .
    John Watson
    Oracle Certified Master DBA

Maybe you are looking for

  • Credential Roaming failed to write to the Active Directory. Error code 5 (Access is denied.)

    Hi All, I could see following error event in all client computers , Could you please some one help me on this ? Log Name:      Application Source: Microsoft-Windows-CertificateServicesClient-CredentialRoaming Event ID:      1005 Level:         Error

  • How do I create 2 separate iCloud accounts

    My whole office uses Iphones. Recently my boss shared his icloud calander with me, so I can be updated on his where abouts. Well I don't want them swwing all of my calander. I thought if I make another itunes account, I could create a seperate icloud

  • Attaching Drawings/Document to equipment without going through DMS

    Dear all, Is it possible to attach Drawings/Document to equipment without going through DMS.If yes please answer fast..its urgent!!!! Thanks, Antara

  • Problems installation Cs5 and Cs6

    My OS is windows 7 I had  Adobe cs5.5 installed, try upgrading to Cs6 trial but got error. Then try to reinstall Cs5.5 but now I can`t do it, it always stops in "Adobe Help installing" WARNING: DS013: Payload {D38116C8-C472-4BB0-AD6F-0C1DD1320D1D} Ad

  • Problem uploading video to edge animate

    I am trying to add a video to my Edge Animate project, but every time I complete the process, it doesn't show up in the library.  Here is the process I follow: 1. In the library panel, I click the + sign next to the video tab 2. The browse dialog box