Set operators in PLSQL

Hi All,
Can we use set operators in PLSQL. I hope we can not use it in PLSQL. But just wanted to check with you all.
Begin
select 1 into n from dual
union
select 2 into n from dual;
end;
Thanks

Not using that syntax you won't in PL/SQL as it's just wrong.
As you're querying multiple rows you'd have to either loop or collect it in to a collection e.g.
SQL> declare
  2    type aNums is table of number;
  3    vNums aNums;
  4  Begin
  5    select n
  6      bulk collect into vNums
  7    from
  8      (
  9      select 1 as n from dual
10      union
11      select 2 from dual
12      );
13  end;
14  /
PL/SQL procedure successfully completed.
But yes, you can use any SQL statements in SQL that you use in PL/SQL.

Similar Messages

  • What is use of set operators in OBIEE

    Hi Guys,
    Colud you please tell me what is main use of Set Operators (Intersection,Union,Union all)in OBIEE.
    Is it mandatory to use them in reports?
    Pls tell me.
    Regards,
    siva

    Hi,
    What scenario we are using set operators.
    For Eg.
    Col 1 is having values:
    A
    B
    C
    Col 2 is having values:
    1
    2
    3
    I have to create a new column in answers having values
    A
    B
    C
    1
    2
    3
    solution:
    You can use SET operators in OBIEE and it's really easy to set it in answers section. So create one request and then add other similar request to it by using UNION operator.
    or
    we can use case statement also.
    2. Is it mandatory to use them in reports?
    Normal reports not mandatory.
    Hope it helps.
    Thanks,
    satya

  • Creating measure using set operators in BO Xi 3.0

    Hi All,
    I am trying to create a measure like this in BO XI 3.0 Designer.
    Select count(*) from
    select id from table1 where Name=<Prompt Value>
    INTERSECT
    select id from table1 where Name=<Prompt Value>
    But I don't know how to use set operators in Designer.
    Can someone please help or any pointer would help.
    Thanks,
    Kuldeep
    Edited by: Kuldeep Chitrakar on Apr 2, 2009 4:06 PM

    Create a derived table with same SQL and drag the table into universe pane to create object.

  • Set Operators - Clarification needed

    This is my query. I am executing this in HR Schema Oracle 11g.
    SELECT HIRE_DATE, EMPLOYEE_ID, to_char(null) FROM EMPLOYEES WHERE LAST_NAME='Taylor'
    UNION ALL
    SELECT SYSDATE, TO_CHAR(NULL), 1+1 FROM DUALIt gives ORA-01790: expression must have same datatype as corresponding expression error. What data type is mismatching here? I don't seem to understand. HIRE_DATE and SYSDATE - DATE data type. Is something wring with my other two columns? I read that TO_CHAR(NULL) can be used for filling missing values. That's why I tried this way.
    Any guidance, please?

    Hi,
    whenever you use set operators there has to be ont to one datatype correspondance of the columns you define in all the select statements.
    Here the first select statement's employee_id number is conflicting with to_char(null) and to_char(null) is conflicting with 1+1.
    Hence try out this
    SELECT HIREDATE, Empno, to_char(null) FROM EMP WHERE ename='Taylor'
    UNION ALL
    SELECT SYSDATE, 1+1,TO_CHAR(NULL) FROM DUAL
    or use
    SELECT HIRE_DATE, EMPLOYEE_ID, to_NUMBER(null) FROM EMPLOYEE WHERE LAST_NAME='Taylor'
    UNION ALL
    SELECT SYSDATE, TO_NUMBER(NULL), 1+1 FROM DUAL

  • Set operators over ore.frame

    Is there a way to make set operators work with ore.objects without ore.pull?
    EXAMPLE:
    > df1 <- data.frame(ID=c(1:3),A=rep(1,3))
    > df2 <- data.frame(ID=c(2:4),B=rep(1,3))
    > class(df1)
    [1] "data.frame"
    > # Union
    > union(df1$ID,df2$ID)
    [1] 1 2 3 4
    > # Minus
    > setdiff(df1$ID,df2$ID)
    [1] 1
    > #Intersect
    > intersect(df1$ID,df2$ID)
    [1] 2 3
    > #-------------------------------------------------
    > of1 <- ore.push(df1)
    > of2 <- ore.push(df2)
    > class(of1)
    [1] "ore.frame"
    attr(,"package")
    [1] "OREbase"
    > # Union
    > union(of1$ID,of2$ID)
    integer(0)
    > # Minus
    > setdiff(of1$ID,of2$ID)
    integer(0)
    > #Intersect
    > intersect(of1$ID,of2$ID)
    integer(0)
    > #-------------------------------------------------
    > vec1 <- ore.push(df1$ID)
    > vec2 <- ore.push(df2$ID)
    > class(vec1)
    [1] "ore.integer"
    attr(,"package")
    [1] "OREbase"
    > union(vec1,vec2)
    integer(0)

    Many of the commonly used base R functions are overloaded in the Oracle R Enterprise transparency layer to work with ore.frame objects.  These functions are located in the OREbase and OREstats packages.
    For example, to get the union, use merge, as it has been overloaded to operate on ore.frame objects:
    R> find("merge")
    [1] "package:OREbase" "package:base"  
    merge(x = of1, y = df2, all = TRUE)
    R> merge(x = of1, y = of2, all = TRUE)
    ID  A  B
    1|NA  1  1 NA
    2|1   2  1  1
    3|2   3  1  1
    NA|3  4 NA  1
    to subtract:
    R> find("Arith")
    [1] "package:OREbase" "package:methods"
    of1$A - of2$B
    R> of1$A - of2$B
    [1] 0 0 0
    There is no need to pull the data if the function is overloaded to work with ore.frame objects.  More examples can be found in the ORE 1.4 Training Materials: Oracle R Enterprise 1.4 Transparency Layer: http://www.oracle.com/technetwork/database/database-technologies/r/r-enterprise/learnmore/ore-1-4-transparency-layer-215…
    You can view the functions in the OREbase and OREstats packages by typing:
    ls("package:OREbase")
    ls("package:OREstats")
    Sherry

  • SELECTing records from two tables. Set Operators, CASE, DECODE, ...

    Hi all,
    I have two tables:
    CRETE TABLE T1 (T1_COL1 NUMBER, T1_COL2 NUMBER)
    CRETE TABLE T2 (T2_COL1 NUMBER, T2_COL2 NUMBER)
    T1 may or may not have records. T2 always has records. There are two scenarios.
    Scenario 1:
    =======
    SELECT * FROM T1 returns five rows, and SELECT * FROM T2 returns 10 rows.
    Now I need the five rows from T1.
    Scenario 2:
    =======
    SELECT * FROM T1 returns zero rows, and SELECT * FROM T2 returns 10 rows.
    Now I need the 10 rows from T2.
    In other words, if records present in T1, I need them all. If not, I need records from T2.
    There are no common columns (for joins).
    Now need a single query to achive this. I tried set operators, CASE and DECODE. But I'm unable to solve it.
    Please help. Thanks in advance.

    Iniyavan wrote:
    Yes, Justin. I'm sure that this is the way it's modelled. I also find it's tough and odd.Are you sure it's the right way for that data to be modeled? I understand that's the way it is being modeled, but a data model change may be the best option.
    Is there any other way, which is simpler, without using RANK?That's the simplest option I can think of. You could also do something like
    SELECT t1_col1, t1_col2
      FROM (
        SELECT t1_col1, t1_col2, rownum rn
          FROM (
            SELECT t1_col1, t1_col2
              FROM (
                SELECT t1_col1, t1_col2, 1 tbl
                  FROM t1
                UNION ALL
                SELECT t2_col2, t2_col2, 2 tbl
                  FROM t2       
             ORDER BY tbl
    WHERE rn = 1I'm not sure that's any simpler...
    Justin

  • Joins subqueries set operators

    Hi All,
    I am new to oracle SQL, Could any body tell me what is the differences between Joins, subqueries, set operators ? What is the benifits or advantages and dis-advantages comparing the above three.
    Thanks in advance
    Mahesh Ragineni

    Not using that syntax you won't in PL/SQL as it's just wrong.
    As you're querying multiple rows you'd have to either loop or collect it in to a collection e.g.
    SQL> declare
      2    type aNums is table of number;
      3    vNums aNums;
      4  Begin
      5    select n
      6      bulk collect into vNums
      7    from
      8      (
      9      select 1 as n from dual
    10      union
    11      select 2 from dual
    12      );
    13  end;
    14  /
    PL/SQL procedure successfully completed.
    But yes, you can use any SQL statements in SQL that you use in PL/SQL.

  • SET OPERATORS IN ABAP

    Hi Friends,
    I  want to compare a variable has any of the 25 stored values in internal table or any variable?
    Is there any SET operation possible using ABAP like IN , UNION, NOT IN etc.,
    Thanks in advance,
    Durai.

    Hi,
    Set Operations Using Bit Sequences
    If you have a set of m elements, you can represent any subset as a sequence of bits. If the nth element of the set is present in a subset, the n th bit is set to 1, otherwise, it is set to 0. The universal set therefore contains no zeros.
    In ABAP, you can represent a set of m elements using a field with type X and length of at least m/8. To include a member of the universal set in a set, use the SET BIT statement. To check which members of the universal set are included in a particular set, use the GET BIT statement. You can use bit operations for the following set operations:
    Set operation
    Bit operation
    Intersection
    BIT-AND
    Union
    BIT-OR
    Symmetrical difference
    BIT-XOR
    You can also use the O operator when comparing bit sequences to determine whether a particular set is a subset of another.
    DATA: FRANKFURT(4) TYPE X,
          FRISCO(4)    TYPE X,
          INTERSECT(4) TYPE X,
          UNION(4)     TYPE X,
          BIT          TYPE I.
    DATA: CARRID TYPE SPFLI-CARRID,
          CARRIER LIKE SORTED TABLE OF CARRID
                              WITH UNIQUE KEY TABLE LINE.
    DATA WA TYPE SPFLI.
    SELECT CARRID FROM SCARR INTO TABLE CARRIER.
    SELECT CARRID CITYFROM FROM SPFLI
                           INTO CORRESPONDING FIELDS OF WA.
      WRITE: / WA-CARRID, WA-CITYFROM.
      READ TABLE CARRIER FROM WA-CARRID TRANSPORTING NO FIELDS.
      CASE WA-CITYFROM.
        WHEN 'FRANKFURT'.
          SET BIT SY-TABIX OF FRANKFURT.
        WHEN 'SAN FRANCISCO'.
          SET BIT SY-TABIX OF FRISCO.
      ENDCASE.
    ENDSELECT.
    INTERSECT = FRANKFURT BIT-AND FRISCO.
    UNION     = FRANKFURT BIT-OR  FRISCO.
    SKIP.
    WRITE 'Airlines flying from Frankfurt and San Francisco:'.
    DO 32 TIMES.
      GET BIT SY-INDEX OF INTERSECT INTO BIT.
        IF BIT = 1.
          READ TABLE CARRIER INDEX SY-INDEX INTO CARRID.
          WRITE CARRID.
        ENDIF.
    ENDDO.
    SKIP.
    WRITE 'Airlines flying from Frankfurt or San Francisco:'.
    DO 32 TIMES.
      GET BIT SY-INDEX OF UNION INTO BIT.
        IF BIT = 1.
          READ TABLE CARRIER INDEX SY-INDEX INTO CARRID.
          WRITE CARRID.
        ENDIF.
    ENDDO.
    This produces the following output list:
    AA   NEWYORK
    AA   SANFRANSISCO
    AZ    ROME
    AZ    ROME
    AZ    TOKYO
    AZ    ROME
    DL    NEWYORK
    DL    SANFRANSISCO
    The program uses four hexadecimal fields with length 4 - FRANKFURT, FRISCO, INTERSECT, and UNION. Each of these fields can represent a set of up to 32 elements. The basic set is the set of all airlines from database table SCARR. Each bit of the corresponding bit sequences representes one airline. To provide an index, the external index table CARRIER is created and filled with the airline codes from table SCARR. It is then possible to identify an airline using the internal index of table CARRIER.
    In the SELECT loop for database table SPFLI, the corresponding bit for the airline is set either in the FRANKFURT field or the FRISCO field, depending on the departure city. The line number SY-TABIX is determined using a READ statement in which no fields are transported.
    The intersection and union of FRANKFURT and FRISCO are constructed using the bit operations BIT-AND and BIT-OR.
    The bits in INTERSECT and UNION are read one by one and evaluated in two DO loops. For each position in the fields with the value 1, a READ statement retrieves the airline code from the table CARRIER.
    <REMOVED BY MODERATOR>
    Cheers,
    Chandra Sekhar.
    Edited by: Alvaro Tejada Galindo on Mar 4, 2008 2:50 PM

  • XPATH sum(node-set) function using PLSQL

    Hi,
    I'm using the XMLDOM and XSLPROCESSOR PLSQL packages to parse my XML and need to sum a Node element. I was wondering how can I achieve the following XSL command within PLSQL ??
    <xsl:value-of select="sum(<some nodeset>)"/>
    Can I use the XSLPROCESSOR.valueOf function to get the sum ?? Or is there another way ??
    Regards,
    Mark

    Can you try this?

  • Display Job ID and Department ID using set operators

    I am trying to produce a list with the following output from table employees. This query will produce a list of jobs for departments 20, 60, and 25 in that order.
    JOB_ID DEPARTMENT_ID
    ASST 20
    CLERK 60
    MAN 60
    MAN_B 25
    So far I have the query to give the output but I can't figure out the order by part...please help.
    SELECT job_id, department_id FROM employees
    INTERSECT
    SELECT job_id, department_id FROM employees WHERE department_id IN (20,60,25)
    ORDER BY ???
    ;

    The SQL Developer forum is meant for discussions about the tool with the same name.
    What you want is help on the SQL And PL/SQL forum...
    K.
    PS: Hint: ORDER BY Decode(...)
    Message was edited by: K.

  • How to set an Application Item from PL/SQL

    I am attempting to set an Application Item
    After login to my app, I want to retrieve a row from my SETTINGS table and populate some Application Items with the settings information so that I can
    display some of that settings information on every page.
    Just to start, I created one Application Item named F106_YEAR
    I then created a Shared Components Application Process which executes on New Session: After Authentication
    I created this process as an Anynomous PL/SQL block.
    declare
    aucyr varchar(4);
    begin
    select year into auctyr
    from settings;
    :F106_YEAR := aucyr;
    end;
    I've tried a couple of other Syntax tricks attempting to reference the Application Item F106_YEAR from within PL/SQL (like V('F106_YEAR') but nothing seems to be working.
    I'm sure that I am missing something simple. Can someone tell me how to set an Application Item from PL/SQL?
    Thanks in advance.

    I'm still doing something wrong because this is not working for me.
    I've tried both of the following versions as an Application Process set to run on New Session after Authentication:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    :F106_AUCTION_YEAR:=auction_year;
    end;
    and I also tried:
    declare
    auction_year varchar(4);
    begin
    select year into auction_year
    from PBUUC.SETTINGS where rownum < 2;
    APEX_UTIL.SET_SESSION_STATE (p_name, p_value);
    end;
    F106_YEAR is a global Item (shared components).
    The select statement works just fine in SQL*PLUS so I know that it is correct.
    If I run the debugger and log into the application, here is the output. Shouldn't I see my Application Process get called if it is set to run on New Session after Validation?
    My Application process is named RETRIEVE_AUCTION_SETTINGS
    0.01: A C C E P T: Request="P101_PASSWORD"
    0.01: Metadata: Fetch application definition and shortcuts
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Fetch session state from database
    0.02: ...Check session 695371898690095 owner
    0.02: ...Check for session expiration:
    0.02: ...Metadata: Fetch Page, Computation, Process, and Branch
    0.02: Session: Fetch session header information
    0.02: ...Metadata: Fetch page attributes for application 106, page 101
    0.03: ...Validate item page affinity.
    0.03: ...Validate hidden_protected items.
    0.03: ...Check authorization security schemes
    0.03: Session State: Save form items and p_arg_values
    0.03: ...Session State: Save "P101_USERNAME" - saving same value: "jps"
    0.03: Processing point: ON_SUBMIT_BEFORE_COMPUTATION
    0.03: Branch point: BEFORE_COMPUTATION
    0.03: Computation point: AFTER_SUBMIT
    0.03: Tabs: Perform Branching for Tab Requests
    0.03: Branch point: BEFORE_VALIDATION
    0.03: Perform validations:
    0.03: Branch point: BEFORE_PROCESSING
    0.03: Processing point: AFTER_SUBMIT
    0.03: ...Process "Set Username Cookie": PLSQL (AFTER_SUBMIT) begin owa_util.mime_header('text/html', FALSE); owa_cookie.send( name=>'LOGIN_USERNAME_COOKIE', value=>lower(:P101_USERNAME)); exception when others then null; end;
    0.04: ...Process "Login": PLSQL (AFTER_SUBMIT) wwv_flow_custom_auth_std.login( P_UNAME => :P101_USERNAME, P_PASSWORD => :P101_PASSWORD, P_SESSION_ID => v('APP_SESSION'), P_FLOW_PAGE => :APP_ID||':1' );
    0.06: ...Process "Clear Page(s) Cache": CLEAR_CACHE_FOR_PAGES (AFTER_SUBMIT) 101
    0.06: Nulling cache for application "106" page: 101
    0.00:
    0.00: S H O W: application="106" page="1" workspace="" request="" session="695371898690095"
    0.01: alter session set nls_language="AMERICAN"
    0.01: alter session set nls_territory="AMERICA"
    0.01: ...NLS: Set Decimal separator="."
    0.01: ...NLS: Set NLS Group separator=","
    0.01: ...NLS: Set date format="DD-MON-RR"
    0.01: ...Setting session time_zone to -04:00
    0.01: NLS: wwv_flow.g_flow_language_derived_from=0: wwv_flow.g_browser_language=en-us
    0.01: Application 106, Authentication: CUSTOM2, Page Template: 2904114531488186
    0.01: ...Session ID 695371898690095 can be used
    0.01: ...Application session: 695371898690095, user=JPS
    0.01: ...Determine if user "JPS" workspace "1040027630222986" can develop application "106" in workspace "1040027630222986"
    0.01: ...Check for session expiration:
    0.01: Session: Fetch session header information
    0.01: ...Metadata: Fetch page attributes for application 106, page 1
    0.01: Fetch session state from database
    0.02: Branch point: BEFORE_HEADER
    0.02: Fetch application meta data
    0.02: Computation point: BEFORE_HEADER
    0.02: Processing point: BEFORE_HEADER
    0.03: Show page template header
    0.03: Computation point: AFTER_HEADER
    0.03: Processing point: AFTER_HEADER     
    0.04: Computation point: BEFORE_BOX_BODY
    0.04: Processing point: BEFORE_BOX_BODY
    0.04: Region: Auction_Title F106_AUCTION_YEAR

  • Compilation error when used SET or MULTISET operator on nested tables

    Dear All,
    I am getting Compilation error when used SET or MULTISET operator on nested tables inside a procedure.
    This is working fine in other DB installations of 10g but does not work in another 10g DB.
    it says "wrong number of parameter or datatype used in SET"
    Can any one suggest what went wrong here?
    Thanks in advance.

    Hi,
    Thanks for ur reply...
    Since MULTISET and SET operators are the new additions in base 10g release for manipulation of nested tables data, I am surprised that same is working in similar 5 DBs installations with 10.2.0.1.0 version, but does not work in the sixth.
    SET and MULTISET operators are used inside the PL/SQL procedure which is getting compiled in the above mentioned 5 DBs but not in sixth DB.
    it gives
    On line: 3112
    PLS-00306: wrong number or types of arguments in call to 'SET'
    Hope this clarifies the issue...

  • Urgent! I get value when executing query of VO in page, but null in plsql.

    Hi, gentlemen,
    Please help me with this issue.
    1,My VO query sql is like this:
    SELECT acra.receipt_number as receipt_number,
    al_a.meaning as receipt_type, acra.currency_code as currency_code,
    acrha_a.amount as receipt_amount,
    acra.receipt_date as receipt_date,
    acrha_b.gl_date as gl_date,
    arm.NAME as payment_method,
    acra.doc_sequence_value as doc_sequence_value,
    al_b.meaning as status,
    acrha_a.acctd_amount as acctd_amount,
    rcta.trx_number as trx_number,
    rc.customer_name as customer_name,
    rc.customer_number as customer_number,
    rc.jgzz_fiscal_code as taxpayer_id,
    rsu.location as customer_site,
    acra.customer_receipt_reference as customer_ref,
    acra.comments as comments,
    acra.cash_receipt_id as cash_receipt_id
    FROM ar_receivable_applications_all araa,
    ar_cash_receipts_all acra,
    ar_lookups al_a,
    ar_cash_receipt_history_all acrha_a,
    ar_cash_receipt_history_all acrha_b,
    ar_receipt_methods arm,
    ar_lookups al_b,
    ra_customer_trx_all rcta,
    (SELECT hca.cust_account_id customer_id,
    hca.org_id org_id,
    hp.party_name customer_name,
    hca.account_number customer_number,
    hp.jgzz_fiscal_code
    FROM hz_cust_accounts_all hca, hz_parties hp
    WHERE hp.party_id = hca.party_id) rc,
    (SELECT site_use_id site_use_id,
    org_id org_id,
    cust_acct_site_id address_id,
    location location
    FROM hz_cust_site_uses_all) rsu
    WHERE araa.receivable_application_id = :1
    and acra.cash_receipt_id = araa.cash_receipt_id
    and al_a.lookup_type(+) = 'PAYMENT_CATEGORY_TYPE'
    AND al_a.lookup_code(+) = acra.TYPE
    AND acrha_a.cash_receipt_id = acra.cash_receipt_id
    AND acrha_a.current_record_flag = nvl('Y', acra.receipt_number)
    AND acrha_a.org_id = acra.org_id
    AND acrha_b.cash_receipt_id = acra.cash_receipt_id
    AND acrha_b.first_posted_record_flag(+) = 'Y'
    AND arm.receipt_method_id = acra.receipt_method_id
    AND al_b.lookup_type(+) = 'RECEIPT_CREATION_STATUS'
    AND al_b.lookup_code(+) = acra.status
    AND rcta.customer_trx_id(+) = acra.receivables_trx_id
    AND rcta.org_id(+) = acra.org_id
    AND rc.customer_id(+) = acra.pay_from_customer
    AND rc.org_id(+) = acra.org_id
    AND rsu.site_use_id(+) = acra.customer_site_use_id
    AND rsu.org_id(+) = acra.org_id
    2, I add the init func in VOImpl which is like this:
    the receiptApplicationId is 136877.
    public void initQuery(Number receiptApplicationId)
    setWhereClauseParams(null); // always reset
    setWhereClauseParam(0, receiptApplicationId);
    executeQuery();
    When executing the page, its value shows to be "現預金".
    And I used String receipt_type = (String)oaRow.getAttribute("ReceiptType"); in AMImpl, its value is "現預金".
    But when I execute above sql in pl/sql developer, its value is null.
    I am really confused with this.
    How could I get the whole running sql statement, and know why my issue is like this? It's very urgent, Thanks!

    This Query is Org Specific.(As this query using Ord_id attribute to fetch out row.)
    you need to set org_id at PLSQL Developer or Toad Level.
    Thanks, Avaneesh

  • Insert Longraw data type

    Hi...!
    I have two tables with longraw data type.
    I want to insert / update first table from the second table.
    My script on trigger after insert is " insert into FIRST[FIRST TABLE] (fieldA [CHAR-3], FieldB [LONGRAW] )
    select fieldA [char-3], fieldB [LONGRAW] from SECOND [2ND TABLE] S WHERE ......
    When I compiled this trigger, the error message was show up
    " 12 PL/SQL: ORA-00932: inconsistent datatype: expected NUMBER got LONG BINARY " ( I am using PL Sql Developer to develop the trigger).
    Can you give me suggestion how to insert the longraw datatype from another table which have contained the longraw datatype ...?
    Thank you,
    Best Regards,

    787104 wrote:
    Yes the column (field type) of both tables is exactly same.
    Do you think my oracle's or my PlSql Developer's version is not supported ..?
    My Oracle database version is Personal Oracle Database 10g Release 10.2.0.3.0 - Production
    and my Pl SQL Developer Version is 7.0.2.1076 (MBCS)
    Thanks,
    Best Regards,
    Edited by: 787104 on Sep 28, 2010 4:26 AMsb90275 pointed out that longs and long raws have been depricated for a long time, kept around for backward compatability.
    If at all possible use a BLOB instead of along raw and your work will be much easier.
    About the only things you can do with LONG and LONG RAW are inserts and selects, and those sometimes with difficulty. If you check the documentation or even do a web search you should find a long list of what you can't do, including but not limited to
    * use the type in WHERE clauses
    * modify the type with any function
    * use the query with set operators (UNION, etc.)
    Use the newer LOB. Your 10g database will allow this.
    Edited by: riedelme on Sep 28, 2010 5:45 AM
    Oops! 10g docs say you can update a LONG [RAW]. Not sure I want to ...

  • Insert LongRaw Data

    Hello,
    I have the table
    create table CUSTOM
    ID NUMBER(10) not null,
    DOMAINKIND NUMBER(2) not null,
    DATAKIND NUMBER(2) not null,
    USERID NUMBER(10),
    GROUPID NUMBER(10),
    DATANAME VARCHAR2(50) not null,
    DATA LONG RAW
    All I want is populate the field Data with data from I local file.The data in local files are exported from another datadase and it's type is LongRaw.
    My question is
    How I Can read this data from a local file and put them into a database field?
    Thanks

    787104 wrote:
    Yes the column (field type) of both tables is exactly same.
    Do you think my oracle's or my PlSql Developer's version is not supported ..?
    My Oracle database version is Personal Oracle Database 10g Release 10.2.0.3.0 - Production
    and my Pl SQL Developer Version is 7.0.2.1076 (MBCS)
    Thanks,
    Best Regards,
    Edited by: 787104 on Sep 28, 2010 4:26 AMsb90275 pointed out that longs and long raws have been depricated for a long time, kept around for backward compatability.
    If at all possible use a BLOB instead of along raw and your work will be much easier.
    About the only things you can do with LONG and LONG RAW are inserts and selects, and those sometimes with difficulty. If you check the documentation or even do a web search you should find a long list of what you can't do, including but not limited to
    * use the type in WHERE clauses
    * modify the type with any function
    * use the query with set operators (UNION, etc.)
    Use the newer LOB. Your 10g database will allow this.
    Edited by: riedelme on Sep 28, 2010 5:45 AM
    Oops! 10g docs say you can update a LONG [RAW]. Not sure I want to ...

Maybe you are looking for