Fetch VARCHAR2 from CLOB

Hi,
I have a plsql function which returns CLOB.(xml format)
How do i convert the output CLOB to VARCHAR2 and select the function from a SELECT query.
The returned output CLOB has more than 4000 characters.
Using DBMS_LOB.SUBSTR only first 4000 characters are extracted , if we go for a larger value it gives a error.
SELECT DBMS_LOB.SUBSTR((Getswiftmsgtagsappended_New(10,2,4,'SWIFT','103')),4000,1) FROM dual
How to resolve this.
Thanks.

A-K wrote:
Hi,
Could you please tell as to what 'amount' and 'offset' mean in the following definition of dbms_lob.substr ?
dbms_lob.substr(
lob_loc IN CLOB CHARACTER SET ANY_CS,
amount IN INTEGER := 32767,
offset IN INTEGER := 1)
RETURN VARCHAR2 CHARACTER SET lob_loc%CHARSET;
Thanks.amount=> how much
offset=>from what position
Example
SQL> declare
  2          aclob clob;
  3          avc2 varchar2(32767);
  4  begin
  5          aclob:=lpad('X',32767,'X')||lpad('M',32767,'M');
  6          dbms_output.put_line('clob Len:'||dbms_lob.getlength(aclob));
  7          avc2:=dbms_lob.substr(aclob,4000,32767);
  8          dbms_output.put_line('Vc2 Len:'||length(avc2));
  9          dbms_output.put_line('Vc2 disp:'|| substr(avc2,1,50));
10          avc2:=dbms_lob.substr(aclob,20,32767);
11          dbms_output.put_line('Vc2 Len:'||length(avc2));
12          dbms_output.put_line('Vc2 disp:'|| substr(avc2,1,50));
13  end;
14  /
clob Len:65534
Vc2 Len:4000
Vc2 disp:XMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
Vc2 Len:20
Vc2 disp:XMMMMMMMMMMMMMMMMMMM
PL/SQL procedure successfully completed.HTH
SS

Similar Messages

  • Chnage colum from CLOB to Varchar2 and find the length of CLOB

    Hi,
    I have got tables contain CLOB fields. I want to converter them to varchar2? Is the a way to do it? how can I find the max of length the data in CLOB fields.
    Thanks in advance!!
    Michael

    Hi All,
    Thanks you for your useful information. What I need is to change the colum data type (definaition itself)from CLOB to Varchar2, not just to display the values in CLOB field into varchar2. I have tried to change the date type from COLB to varchar2 in TOAD and got ORA_22859: invaliad modification of columns.
    Any suggestions?
    Many Thanks
    Michael

  • Error reading data from CLOB column into VARCHAR2 variable

    Hi all,
    Am hitting an issue retrieving data > 8K (minus 1) stored in a CLOB column into a VARCHAR2 variable in PL/SQL...
    The "problem to be solved" here is storing DDL, in this case a "CREATE VIEW" statement, that is longer than 8K for later retrieval (and execution) using dynamic SQL. Given that the EXECUTE IMMEDIATE statement can take a VARCHAR2 variable (up to 32K(-1)), this should suffice for our needs, however, it seems that somewhere in the process of converting this VARCHAR2 text to a CLOB for storage, and then retrieving the CLOB and attempting to put it back into a VARCHAR2 variable, it is throwing a standard ORA-06502 exception ("PL/SQL: numeric or value error"). Consider the following code:
    set serveroutput on
    drop table test1;
    create table test1(col1 CLOB);
    declare
    cursor c1 is select col1 from test1;
    myvar VARCHAR2(32000);
    begin
    myvar := '';
    for i in 1..8192 loop
    myvar := myvar || 'a';
    end loop;
    INSERT INTO test1 (col1) VALUES (myvar);
    for arec in c1 loop
    begin
    myvar := arec.col1;
    dbms_output.put_line('Read data of length ' || length(myvar));
    exception when others then
    dbms_output.put_line('Error reading data: ' || sqlerrm);
    end;
    end loop;
    end;
    If you change the loop upper bound to 8191, all works fine. I'm guessing this might have something to do with the database character set -- we've recently converted our databases over to UTF-8, for Internationalizion support, and that seems to have changed underlying assumptions regarding character processing...?
    As far as the dynamic SQL issue goes, we can probably use the DBMS_SQL interface instead, with it's EXECUTE procedure that takes a PL/SQL array of varchar2(32K) - the only issue there is reading the data from the CLOB column, and then breaking that data into an array but that doesn't seem insurmountable. But this same basic issue (when a 9K text block, let's say, turns into a >32K block after being CLOBberred) seems to comes up in other text-processing situations also, so any ideas for how to resolve would be much appreciated.
    Thanks for any tips/hints/ideas...
    Jim

    For those curious about this, here's the word from Oracle support (courtesy of Metalinks):
    RESEARCH
    ========
    Test the issue for different DB version and different characterset.
    --Testing the following PL/SQL blocks by using direct assignment method(myvar := arec.col1;) on
    different database version and different characterset.
    SQL>create table test1(col1 CLOB);
    --Inserting four CLOB data into test1.
    declare
    myvar VARCHAR2(32767);
    begin
    myvar := RPAD('a',4000);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('a',8191);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('b',8192);
    INSERT INTO test1 (col1) VALUES (myvar);
    myvar := RPAD('c',32767);
    INSERT INTO test1 (col1) VALUES (myvar);
    commit;
    end;
    --Testing the direct assignment method.
    declare
    cursor c1 is select col1, length(col1) len1 from test1;
    myvar VARCHAR2(32767);
    begin
    for arec in c1 loop
    myvar := arec.col1;
    --DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar);
    dbms_output.put_line('Read data of length: ' || length(myvar));
    end loop;
    end;
    The following are the summary of the test results:
    ===================================
    1. If the database characterset is WE8ISO8859P1, then the above direct assignment
    method(myvar := arec.col1;) works for database version 9i/10g/11g without any
    errors.
    2. If the database characterset is UTF8 or AL32UTF8, then the above direct assignment method(myvar := arec.col1;) will generate the "ORA-06502:
    PL/SQL: numeric or value error" when the length of the CLOB data is greater
    than 8191(=8K-1). The same error can be reproduced across all database versions
    9i/10g/11g.
    3. Using DBMS_LOB.READ(arec.col1, arec.len1, 1, myvar) method to read CLOB data into a VARCHAR2 variable works for both WE8ISO8859P1 and UTF8
    characterset and for all database versions.
    So - it seems as I'd surmised, UTF8 changes the way VARCHAR2 and CLOB data is handled. Not too surprising, I suppose - may you all be lucky enough to be able to stay away from this sort of issue. But - the DBMS_LOB.READ workaround is certainly sufficient for the text processing situations we find ourselves in currently.
    Cheers,
    Jim C.

  • Fetching international characters from Clob

    Hi,
    I am trying to fetch hungarian characters from Clob data. I tried reading the Character Stream returned by Clob.getCharacterStream() in linux and it returns junk characters for those but the same works well with windows. I guess its picking up the platform depended default charset. Is there any way i can get the characters without changing the default charset of the OS ? any other way would be highly appreciated!
    Thanks in advance.

    Hi,
    I am trying to fetch hungarian characters from Clob
    data. I tried reading the Character Stream returned
    by Clob.getCharacterStream() in linux and it returns
    junk characters for those but the same works well
    with windows. Are you printing it to the console window on the OS to determine this?
    Then you are doing it incorrectly. That process of outputing a string requires mapping characters to the console character set.
    The only correct way to do this is to print the numeric representation of each character and see if that is correct. If it is correct then it is not a JDBC/driver problem. If it is not correct then it is a JDBC/driver problem.

  • Change Parameter from VarChar2 to CLOB

    Hi,
    I have a function csvToArray which takes a csv string and converts it to an array.
    PROCEDURE csvToArray(p_csvString IN VarChar2,
    p_count OUT PLS_INTEGER,
    p_array OUT ARRAY_T) IS...
    Unfortunately the size of the csvString being passed in exceeds 32K, so I was thinking about changing the type of the csvString from Varchar2 to CLOB,i.e
    PROCEDURE csvToArray(p_csvString IN CLOB,
    p_count OUT PLS_INTEGER,
    p_array OUT ARRAY_T) IS...
    The procedure only uses the string functions instr and substr to find the elements of the csv string to place in an array.
    I've tested the change and it works, but is there anything I should consider with the change to the data type, or will the above always work fine? The extreme max size of p_csvString would be around 150K.
    Database version is 10.2.0.4.0
    Thanks

    Hi,
    This test maybe helpful
    Passed Length 65K test
    create or replace procedure my_pro ( pclob clob)
    is
    begin
      dbms_output.put_line('clob passed LEN:' ||
       dbms_lob.getlength(pclob) );
    end;
    Procedure created.
    SQL> exec my_pro( to_clob(lpad('x',32767,'c')||lpad('x',32767,'c')||'x'));
    clob passed LEN:65535
    PL/SQL procedure successfully completed.SS

  • How to retreive soap xml data from clob column in a table

    Hi,
    I am trying to retrieve the XML tag value from clob column.
    Table name = xyz and column= abc (clob datatype)
    data stored in abc column is as below
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:head="http://www.abc.com/gcgi/shared/system/header" xmlns:v6="http://www.abc.com/gcgi/services/v6_0_0_0" xmlns:sys="http://www.abc.com/gcgi/shared/system/systemtypes">
    <soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
    <RqHeader soapenv:mustUnderstand="0" xmlns="http://www.abc.com/gcgi/shared/system/header">
    <DateAndTimeStamp>2011-12-20T16:02:36.677+08:00</DateAndTimeStamp>
    <UUID>1000002932</UUID>
    <Version>6_0_0_0</Version>
    <ClientDetails>
    <Org>ABC</Org>
    <OrgUnit>ABC</OrgUnit>
    <ChannelID>HBK</ChannelID>
    <TerminalID>0000</TerminalID>
    <SrcCountryCode>SG</SrcCountryCode>
    <DestCountryCode>SG</DestCountryCode>
    <UserGroup>HBK</UserGroup>
    </ClientDetails>
    </RqHeader>
    <wsa:Action>/SvcImpl/bank/
    SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq</wsa:Action></soapenv:Header>
    <soapenv:Body>
    <v6:AlertDeleteInqRq>
    <v6:Base>
    <v6:VID>20071209013112</v6:VID>
    <!--Optional:-->
    <v6:Ref>CTAA00000002644</v6:Ref>
    </v6:Base>
    </v6:AlertDeleteInqRq>
    </soapenv:Body>
    </soapenv:Envelope>
    And i want to retrieve the values of tag
    <ChannelID> and <v6:VID>
    can somebody help, i have tried with extractvalue but not able to get the values

    I have used the below two queries but not able to get the expected results. Both queries result into no values.
    select xmltype(MED_REQ_PAYLOAD).extract('//ClientDetails/Org','xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" || xmlns="http://www.abc.com/gcgi/shared/system/header"').getStringValue() from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/alerts/v6_0_0_0/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    select EXTRACTVALUE(xmltype(MED_REQ_PAYLOAD),'/RqHeader/) from ESB_OUTPUT_TEMP where SOAPACTION = '/SvcImpl/bank/SOAPEndpoint/AlertsService.serviceagent/OpEndpointHTTP/AlertDeleteInq'
    Well, for starters, both queries are syntactically wrong :
    - non terminated string
    - incorrect namespace mapping declaration
    - unknown XMLType method "getStringValue()"
    Secondly, all those functions are deprecated now.
    Here's an up-to-date example using XMLTable. It will retrieve the two tag values you mentioned :
    SQL> select x.*
      2  from esb_output_temp t
      3     , xmltable(
      4         xmlnamespaces(
      5           'http://schemas.xmlsoap.org/soap/envelope/' as "soap"
      6         , 'http://www.abc.com/gcgi/shared/system/header' as "head"
      7         , 'http://www.abc.com/gcgi/services/v6_0_0_0' as "v6"
      8         )
      9       , '/soap:Envelope'
    10         passing xmlparse(document t.med_req_payload)
    11         columns ChannelID  varchar2(10) path 'soap:Header/head:RqHeader/head:ClientDetails/head:ChannelID'
    12               , VID        varchar2(30) path 'soap:Body/v6:AlertDeleteInqRq/v6:Base/v6:VID'
    13       ) x
    14  ;
    CHANNELID  VID
    HBK        20071209013112
    You may also want to store XML in XMLType columns for both performance and storage optimizations.

  • Eliminate duplicate while fetching data from source

    Hi All,
    CUSTOMER TRANSACTION
    CUST_LOC     CUT_ID          TRANSACTION_DATE     TRANSACTION_TYPE
    100          12345          01-jan-2009          CREDIT
    100          23456          15-jan-2000          CREDIT
    100          12345          01-jan-2010          DEBIT
    100          12345          01-jan-2000          DEBITNow as per my requirement, i need to fetch data from CISTOMER_TRANSACTION table for those customer which has transaction in last 10 years. In my above data, customer 12345 has transaction in last 10 years, whereas for customer 23456, does not have transaction in last 10 years so will eliminate it.
    Now, CUSTOMER_TRANSACTION table has approximately 100 million records. So, we are fectching data in batches. Batching is divided into months. Total 120 months. Below is my query.
    select *
    FROM CUSTOMER_TRANSACTION CT left outer join
    (select distinct CUST_LOC, CUT_ID FROM CUSTOMER_TRANSACTION WHERE TRANSACTION_DATE >= ADD_MONTHS(SYSDATE, -120) and TRANSACTION_DATE < ADD_MONTHS(SYSDATE, -119) CUST
    on CT.CUST_LOC = CUST.CUST_LOC and CT.CUT_ID = CUST.CUT_IDThru shell script, months number will change. -120:-119, -119:-118 ....., -1:-0.
    Now the problem is duplication of records.
    while fetching data for jan-2009, it will get cust_id 12345 and will fetch all 3 records and load it into target.
    while fetching data for jan-2010, it will get cust_id 12345 and will fetch all 3 records and load in into target.
    So instead of having only 3 records, for customer 12345 it will be having 6 records. Can someone help me on how can i eliminate duplicate records from getting in.
    As of now i have 2 ways in mind.
    1. Fetch all records at once. Which is impossible as it will give space issue.
    2. After each batch, run a procedure which will delete duplicate records based on cust_loc, cut_id and transaction_date. But again it will have performance problem.
    I want to eliminate it while fetching data from source.
    Edited by: ace_friends22 on Apr 6, 2011 10:16 AM

    You can do it this way....
    SELECT DISTINCT cust_doc,
                    cut_id
      FROM customer_transaction
    WHERE transaction_date >= ADD_MONTHS(SYSDATE, -120)
       AND transaction_date < ADD_MONTHS(SYSDATE, -119)However please note that - if want to get the transaction in a month like what you said earlier jan-2009 and jan-2010 and so on... you might need to use TRUNC...
    Your date comparison could be like this... In this example I am checking if the transaction date is in the month of jan-2009
    AND transaction_date BETWEEN ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27)  AND LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27)) Your modified SQL...
    SELECT *
      FROM customer_transaction 
    WHERE transaction_date BETWEEN ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27)  AND LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27))Testing..
    --Sample Data
    CREATE TABLE customer_transaction (
    cust_loc number,
    cut_id number,
    transaction_date date,
    transaction_type varchar2(20)
    INSERT INTO customer_transaction VALUES (100,12345,TO_DATE('01-JAN-2009','dd-MON-yyyy'),'CREDIT');
    INSERT INTO customer_transaction VALUES (100,23456,TO_DATE('15-JAN-2000','dd-MON-yyyy'),'CREDIT');
    INSERT INTO customer_transaction VALUES (100,12345,TO_DATE('01-JAN-2010','dd-MON-yyyy'),'DEBIT');
    INSERT INTO customer_transaction VALUES (100,12345,TO_DATE('01-JAN-2000','dd-MON-yyyy'),'DEBIT');
    --To have three records in the month of jan-2009
    UPDATE customer_transaction
       SET transaction_date = TO_DATE('02-JAN-2009','dd-MON-yyyy')
    WHERE cut_id = 12345
       AND transaction_date = TO_DATE('01-JAN-2010','dd-MON-yyyy');
    UPDATE customer_transaction
       SET transaction_date = TO_DATE('03-JAN-2009','dd-MON-yyyy')
    WHERE cut_id = 12345
       AND transaction_date = TO_DATE('01-JAN-2000','dd-MON-yyyy');
    commit;
    --End of sample data
    SELECT *
      FROM customer_transaction 
    WHERE transaction_date BETWEEN ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27)  AND LAST_DAY(ADD_MONTHS(TRUNC(SYSDATE,'MONTH'), -27));Results....
    CUST_LOC     CUT_ID TRANSACTI TRANSACTION_TYPE
          100      12345 01-JAN-09 CREDIT
          100      12345 02-JAN-09 DEBIT
          100      12345 03-JAN-09 DEBITAs you can see, there are only 3 records for 12345
    Regards,
    Rakesh
    Edited by: Rakesh on Apr 6, 2011 11:48 AM

  • Convert XMLTYPE to VARCHAR2 or CLOB?

    Does anyone know how to convert an XMLTYPE variable to VARCHAR2 or CLOB? I am using the XMLELEMENT function to select XML into an XMLTYPE variable (VARCHAR2 and CLOB will not accept xml from this function). But I would like to convert the xml in the XMLTYPE variable to VARCHAR2 or CLOB. Can anyone please tell me how to do this? The reason is that I would like to call this procedure from MS ADO.
    Anthony Sneed
    email: [email protected]

    Hi,
    But I would like to convert the xml in the XMLTYPE variable to VARCHAR2 or CLOB.You can select XMLType data using PL/SQL or Java. You can also use the getClobVal(), getStringVal(), or getNumberVal() functions to retrieve XML as a CLOB, VARCHAR, or NUMBER, respectively.
    Example 4-18 Selecting XMLType Columns using getClobVal()
    This example shows how to select an XMLType column using SQL*Plus:
    SET long 2000
    SELECT e.poDoc.getClobval() AS poXML
    FROM po_xml_tab e;
    POXML
    <?xml version="1.0"?>
    <PO pono="2">
    <PNAME>Po_2</PNAME>
    <CUSTNAME>Nance</CUSTNAME>
    <SHIPADDR>
    <STREET>2 Avocet Drive</STREET>
    <CITY>Redwood Shores</CITY>
    <STATE>CA</STATE>
    </SHIPADDR>
    </PO>
    Look into the documentation: Oracle9i XML Database Developer's Guide - Oracle XML DB for more details.
    Hope that helps.
    OTN team@IDC

  • Wanted to fetch data from ref cursor to nested pl/sql table getting an erro

    create or replace type "DEPT12" as object(dno number(2),dname varchar2(30),loc varchar2(50));
    create or replace type dept_tab as table of "DEPT12"
    create or replace type "LOC12" as object(locno number,loc_name varchar2(100))
    create or replace type loc_tab as table of "LOC12"
    create or replace type dept_loc_rec1 as object (dept_dt dept_tab,eno number,loc_dt loc_tab);
    create type dept_loc_tb as table of dept_loc_rec1
    create table dept_loc_tb_bk1(dept_dt dept_tab,eno number,loc_dt loc_tab)
    NESTED TABLE dept_dt
    STORE AS dept_tab12,
    NESTED TABLE loc_dt
    STORE AS loc_tab12
    insert into dept_loc_tb_bk1 values(dept_tab(dept12(3,'ABD','LOC')
    ,dept12(4,'ABD','LOC')
    ,dept12(5,'ABD','LOC')),3,loc_tab(loc12(21,'AAB'),
    loc12(22,'AAB'),
    loc12(23,'AAB')));
    when I am trying to fetch data from ref cursor to pl/sql table which i am getting an error ora-06504: pl/sql : Return types of result set variables or query do not match.
    I have created a nested table of same as the nested pl/sql object table dept_loc_tb and i have declared the lv_dept_loc_tb of same dept_loc_tb but getting an above error when trying to fetch into that variable.
    Please any one who can solve my problem.
    declare
    type cr is ref cursor;
    cr_obj cr;
    lv_dept_loc_tb dept_loc_tb;
    begin
    open cr_obj for select dept_dt,eno,loc_dt from dept_loc_tb_bk1;
    fetch cr_obj bulk collect into lv_dept_loc_tb;
    close cr_obj;
    end;

    Your query selects 3 separate columns therefore requires 3 collections of corresponding types. You want to treat those 3 columns as an object of DEPT_LOC_REC1 type:
    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4 
      5  lv_dept_loc_tb dept_loc_tb;
      6 
      7  begin
      8  open cr_obj for select dept_dt,eno,loc_dt from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
    10  close cr_obj;
    11  end;
    12  /
    declare
    ERROR at line 1:
    ORA-06504: PL/SQL: Return types of Result Set variables or query do not match
    ORA-06512: at line 9
    SQL> declare
      2  type cr is ref cursor;
      3  cr_obj cr;
      4 
      5  lv_dept_loc_tb dept_loc_tb;
      6 
      7  begin
      8  open cr_obj for select DEPT_LOC_REC1(dept_dt,eno,loc_dt) from dept_loc_tb_bk1;
      9  fetch cr_obj bulk collect into lv_dept_loc_tb;
    10  close cr_obj;
    11  end;
    12  /
    PL/SQL procedure successfully completed.
    SQL> SY.
    P.S. Discover sys_refcursor.

  • Reading from CLOB..Clolumn from table

    Hi,
    I would like to know the reading data from CLOB Column can any one help in this regard,
    I had written some code but I would like to loop it..
    Please see the code given below :-
    DECLARE
    lobloc CLOB;
    buffer VARCHAR2(32000);
    amount NUMBER := 200;
    amount_in_buffer NUMBER;
    offset NUMBER := 1;
    BEGIN
    --Initialize buffer with data to be inserted
    SELECT f_large_value
    into lobloc
    FROM T_PRODUCT_BRAND_PARAMS
    WHERE F_BRAND_ID='PPNET' AND F_PRODUCT_ID ='CASINO'
         AND F_KEY LIKE '%TAB_CONFIG%';
    dbms_lob.read(lobloc,amount,offset,buffer);
    --using length built-in function to find the length of the buffer
    amount_in_buffer := length(buffer);
    dbms_output.put_line(buffer);
    -- dbms_output.put_line(to_char(amount_in_buffer));
    END;
    where f_large_value is clob column,
    when I executed its given oly first 5 lines of the data..
    I would like to loop it can any one suggest me... in this regard
    Thanks
    Pavan Kumar N

    Hi,
    I am using BO Data Integrator as ETL tool, can you specify how will I 'split the data loads' or 'read the data in mutliple passes' ? Is it by using multiple Query Transform with different Where clause as filters? eg. 'by period' and  'by year'?
    Query_1 filter:
    year = 2006
    Query_2 filters:
    year = 2007
    Merge:
    Query_1 and Query_2
    Thanks again!
    Randy

  • RFC fetching data from table which is not commited

    Hi Experts,
                   I have a query regarding commit work.Below is the RFC that i have written
    FUNCTION ZBAPI_CREATE.
    *"*"Local Interface:
    *"  TABLES
    *"      IT_ZABAP_RFC STRUCTURE  ZBAPI_RFC_STR OPTIONAL
    *"      RETURN STRUCTURE  BAPIRET2 OPTIONAL
    CALL FUNCTION 'ZBO_BAPI_CREATE'
    TABLES
       IT_ZABAP_RFC       = IT_ZABAP_RFC
       RETURN             = return
    Break-point.
    DATA lt TYPE TABLE OF ZBAPI_RFC_STR_MAIN.
    CALL FUNCTION 'ZBAPI_SEARCH_RANGE'
    * EXPORTING
    *   IS_STR        =
    TABLES
       ET_TAB        = lt
    *   RETURN        =
    ENDFUNCTION.
    here in first RFC call i am creating a record in ZTABLE , and then at break-point
    i check the ZTABLE where it does not create any record because data is not commited into ZTABLE upto this point, but just after it i have written code for fetching data from ZTABLE but i am able to get this new record in lt.
    Can anybody please explain that from where this serach RFC is providing data because inside serach i am simply selecting data from ZTABLE.
    Regards,
    Abhishek Bajpai
    Edited by: ABHISHEK BAJPAI on Jan 28, 2009 1:12 PM

    Hi Thomas,
                     Thanks for reply , i checked in ZTABLE ,before search RFC call data is not there but if i commit explicitly only then it is showing data in ZTABLE. Actually my requirement is different -
    I have two RFCs 1. Create 2. Search , Now  from web dynpro user will call first Create RFCs but at this point it should not insert record in ZTABLE and just after it user will call another search RFC and in this search he should be able to get these newly created records.
    I want to have the functionality which a user gets when working with normal database front end like SQLPLus for Oracle. In these scenarios we see that whenever user does any insert or update the data sits in the table but still it is not committed. So there he fires Select query he sees the inserted data. But if he logs off from SQL PLUS and then logs in again, and fires Select query he does not see the data as it was not committed. I want a similiar functionalty in which if user inserts the data through Create RFC and fires the Select query through Search RFC then he can see the newly Created data also even though this data is not committed.
    Although if i call create RFC in update task it will not update ZTABLE but in this situation , if user will call search RFC he will not be able to get newly created records.
    So my requirement is that i should be able to get those records which are not commited in ZTABLE .If you have still any doubt regarding my question then please let me know.
    Regards,
    Abhishek

  • How to find the number of fetched lines from select statement

    Hi Experts,
    Can you tell me how to find the number of fetched lines from select statements..
    and one more thing is can you tell me how to check the written select statement or written statement is correct or not????
    Thanks in advance
    santosh

    Hi,
    Look for the system field SY_TABIX. That will contain the number of records which have been put into an internal table through a select statement.
    For ex:
    data: itab type mara occurs 0 with header line.
    Select * from mara into table itab.
    Write: Sy-tabix.
    This will give you the number of entries that has been selected.
    I am not sure what you mean by the second question. If you can let me know what you need then we might have a solution.
    Hope this helps,
    Sudhi
    Message was edited by:
            Sudhindra Chandrashekar

  • Fetching data from internal table in smartform

    Hi,
    I'm able to fetch data from one internal table, but in the table the fields are not coming perfectly, can anybody help me in this?
    Thanks in advance.

    Hi
    You have to to specify the text node that you have created for the table that it belong to which cell in the table. Also you styles to format the text(eg: left aligned, center alinged etc)
    If you have further query please post.
    If this resolves your query close the thread and reward points
    Cheers
    Shafiq

  • Multiple select queries used in Excel BI report ,fetching data from Sharepoint DB(SP2010_Prod_ProjectServer) causing blockage on DB ,when more than one workbook(same copy of Excel BI Report) refreshed using Refresh All option.

    I am using mutiple select queries to fetch data from Project Server 2010 DB(its sharepoint DB) and these queries fetch data in Excel BI report by establishing connection with DB using instance name and all. I have enhance all these select queries and data
    is being fetched in secs. but when more than one copy of same Excel BI report is refreshed using 'Refresh All' option, then these select queries cause blockage on DB.
    Please let me know mitigation for this blockage issue.
    Should I use begin transaction and commit transaction statements/ shared lock statements.
    please reply

    Hi,
    run same query at the same time?

  • How to fetch data from a SAP BW Cube via Perl/PHP on a Linux machine?

    Hi all,
    here's the scenario:
    I need to fetch data from a cube of a remote SAP NetWeaver 7.  The data will later be used in a web application based on  Linux and  Perl/PHP. (I'd prefer using perl for the backend and doing the business logic of the web application.)
    I have:
    A Linux system with all its on-board tools and scripting languages.
    A user for the SAP BW which allows me to logon (very,very limited user rights, no se37,no se80,no rsaX and so on)
    Access to http://<SAP BW Server>:<Port>/sap/bw/xml/soap/xmla with the above mentioned user.
    My questions:
    - Could you please push me into the right direction how I can realize this? E.g. by pointing to tutorials / HowTos / sample code / CPAN modules etc..  (Most information I found so far referred to software based on a different operating system and on remote function calls using custom functions.)
    - I'm aware of the  SAPNW::RFC CPAN module, but do I necessarily have to perform a remote function call? ( If so, is there a "standard" function I could call for accessing a cube?)
    Thanks a lot in advance!

    You can take through the RFCS .check for some system function modules...but why do you need to route it through XI?How huge z the files?

Maybe you are looking for

  • Youtube videos are not displaying as a whole

    My videos are not showing completely on youtube. You just see a portion of the video

  • Trouble hooking my Mac up to my Kodak printer dock... help!!!

    Oh boy, do I ever need help! I'm not even sure where else to turn or what to do next, so any and all suggestions are MORE than welcome!!!!! I guess the best way to do this would be to copy and paste the email I sent to both Kodak and Apple. Then you

  • Needs help in developing project in java

    hello sir, i'm the fianl year student.i have got a computing related fields project. our project Director told told us make any type of project that has a worth in market.so i'm confusing to take decision please suggest me better it's question of my

  • I tunes wont download on to my laptop

    hi there i have been trying to download the new i tunes to my laptop but as i get near the end a msg box comes up saying windows installer is not working contact support or vendor is this a problem with i tunes or windows any help will be greatly app

  • Academic licensing for 2012 Essentials

    Hi, I have seen an academic license option advertised by resellers for Windows Server2012 Essentials. Are there any functional differences between this academic license version and the regular version?