Return all the values into cursor

I want to return collection of varray using sys_refcursor. but it is returning only last record. I am wondering how I can return all the four records into result sys_refcursor.
The following is not returning all the four records under SP.
resultData OUT sys_refcursor
for i in 1..4
loop
OPEN result FOR
Select sdo_util.to_wkbgeometry
(sdo_geometry(2002, 2958, Null,
Mdsys.Sdo_Elem_Info_Array(1,2,1),
arr_result123(i)
)) as geometry
FROM dual c;
end loop;
Thanks
Al

I have removed the for loop but no luck. I am posting my whole procedure.
Can you please let me know what i am missing!..........urgent please.
PROCEDURE SP_Lines
mlatlon IN Varchar2,
resultData OUT sys_refcursor
) As
plat Varchar2(256);
plon Varchar2(256);
lPosition number;
lcounter number;
newlat number;
newlon number;
-- to draw lines
geometry1 mdsys.sdo_geometry;
geometry2 mdsys.sdo_geometry;
begin
Begin
arr_result123 := arr_result(
mdsys.sdo_ordinate_array(-79.7198833241796,43.7437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.618833241796,43.5437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.4198833241796,43.3437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.1198833241796,43.1437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.0198833241796,43.0437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.7198833241796,43.007243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.7198833241796,43.7437243394591,-79.7170360355377,43.7503404513126),
mdsys.sdo_ordinate_array(-79.7198833241796,43.7437243394591,-79.7170360355377,43.7503404513126) );
lPosition := Instr(mlatlon, '_');
plat := Substr(mlatlon, 1, lPosition-1);
plon := Substr(mlatlon, lPosition+1, length(mlatlon) );
lcounter :=1;
--get 4 nearest points
for rec in (
Select sdo_cs.transform(c.geometry,4326) as geometry
FROM Ac c
where SDO_NN(c.GEOMETRY,
(sdo_geometry(2001, 4326, sdo_point_type(plon, plat, null), null, null) )
, 'sdo_batch_size =5')='TRUE'
AND ROWNUM <= 4
loop
newlat := get_ordinate(rec.geometry, 2);
newlon := get_ordinate(rec.geometry, 1);
-- ~~ building geometries ~~
geometry1 := sdo_geometry(2002, 4326, sdo_point_type(newlon, newlat, null), null, null);
geometry2 := sdo_geometry(2002, 4326, sdo_point_type(plon, plat, null), null, null);
arr_result123(lcounter) := GET_LINE_ORDINATE(geometry1, geometry2);
lcounter:=lcounter+1;
end loop;
end if;
lcounter:=1;
OPEN resultData FOR
Select sdo_util.to_wkbgeometry
(sdo_geometry(2002, 2958, Null,
Mdsys.Sdo_Elem_Info_Array(1,2,1),
arr_result123(lcounter)
)) as geometry
FROM dual c, (select level lcounter from dual connect by level <=2);
END;
end SP_Lines;

Similar Messages

  • Get-NetworkStatistics returns all the values set to zero despite having internet traffic

    Hi
    I'm running Windows Server 2012 R2 and I have a problem with the Get-NetworkStatistics cmdlet: it returns all the parameters with a value of zero eventhough the wireless network adapter is up and running, including having internet access. Furthermore, if
    I double-click on the wireless network adapter, it displays the correct values for bytes sent / received.
    So it seems like the Get-NetworkStatistics cmdlet is unable to read the statistics for the wireless adapter. Any help would be appreciated.
    Thanks

    Hi,
    Is this what you're referring to?
    https://gallery.technet.microsoft.com/scriptcenter/Get-NetworkStatistics-66057d71
    If so, the best way to contact the author is by posting on the QandA tab of the gallery item.
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Return all the value in table

    Hi Team
    I want one query plz help
    I have a table emp in that we have empno,ename,sal,comm
    like
    select empno,ename,comm from emp
    where comm=300
    it will execute the 300 records
    if i did not give any number for comm like null
    then i want to execute the all date
    i user nvl
    like
    select empno,ename,comm from emp
    where comm=nvl(&comm,comm);
    output: wrong.

    Yes this is the query i am also using and this is returning the all the rows
    SQL> select * from emp where nvl(to_char(comm),'0')=nvl(to_char(&comm),nvl(comm,'0'));
    Enter value for comm: ''
    old 1: select * from emp where nvl(to_char(comm),'0')=nvl(to_char(&comm),nvl(comm,'0'))
    new 1: select * from emp where nvl(to_char(comm),'0')=nvl(to_char(''),nvl(comm,'0'))
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7369 SMITH CLERK 7902 17-DEC-80 800 20
    7499 ALLEN SALESMAN 7698 20-FEB-81 1600 300 30
    7521 WARD SALESMAN 7698 22-FEB-81 1250 500 30
    7566 JONES MANAGER 7839 02-APR-81 2975 20
    7654 MARTIN SALESMAN 7698 28-SEP-81 1250 1400 30
    7698 BLAKE MANAGER 7839 01-MAY-81 2850 30
    7782 CLARK MANAGER 7839 09-JUN-81 2450 10
    7788 SCOTT ANALYST 7566 19-APR-87 3000 20
    7839 KING PRESIDENT 17-NOV-81 5000 10
    7844 TURNER SALESMAN 7698 08-SEP-81 1500 0 30
    7876 ADAMS CLERK 7788 23-MAY-87 1100 20
    EMPNO ENAME JOB MGR HIREDATE SAL COMM DEPTNO
    7900 JAMES CLERK 7698 03-DEC-81 950 30
    7902 FORD ANALYST 7566 03-DEC-81 3000 20
    7934 MILLER CLERK 7782 23-JAN-82 1300 10
    14 rows selected.
    Regards,
    Navneet

  • Return all the column values using the F4IF_INT_TABLE_VALUE_REQUEST

    Hi,
    How to return all the column values using the F4IF_INT_TABLE_VALUE_REQUEST?
    For example : if the row has 3 columns then after selecting the particular row, the RETURN_TAB internal table should contain all the three column values.
    Regards,
    Raghu

    Hi,
       Try the following...
    DATA : it_fields like help_value occurs 1 with header line.
    data: begin of w_vbap,
            vbeln      like vbap-vbeln,    
            posnr      like vbap-posnr,   
            werks      like vbap-werks,  
          end of w_vbap.
    data: i_vbap   like w_vbap   occurs 0 with header line,
             w_fields type help_value,
          i_dfies type table of dfies,
          i_return_tab type table of ddshretval with header line,
          i_field  type dfies.
      select vbeln posnr werks
          from vbap into table i_vbap up to 5 rows.
    if sy-subrc = 0.
       sort i_vbap by vbeln.
    endif.
      clear it_fields[] , it_fields.
      it_fields-tabname = c_vbap.
      it_fields-fieldname = 'VBELN'.
      it_fields-selectflag = c_on.
      append it_fields.
      it_fields-tabname = c_vbap.
      it_fields-fieldname = 'POSNR'.
      it_fields-selectflag = space.
      append it_fields.
      it_fields-tabname = c_vbap.
      it_fields-fieldname = 'WERKS'.
      it_fields-selectflag = space.
      append it_fields.
      loop at it_fields into w_fields.
        i_field-tabname   = w_fields-tabname.
        i_field-fieldname = w_fields-fieldname.
        i_field-keyflag   = w_fields-selectflag.
        append i_field to i_dfies.
      endloop.
      call function 'F4IF_INT_TABLE_VALUE_REQUEST'
        exporting
          retfield               = 'VBELN'
         window_title           = 'Select'
        tables
          value_tab              = i_vbap
          field_tab                = i_dfies
          return_tab             = i_return_tab
       exceptions
         parameter_error        = 1
         no_values_found        = 2
         others                 = 3
      read table i_return_tab into w_return_tab index 1.
      if sy-subrc = 0.
      endif.
    Regards,
    Srini.

  • When the combobox is rendered all the values displayed look like [object Object].

    I wasn't sure where to post this so please forgive me.
    I am trying to populate a combobox with a series of values
    returned from a Coldfusion method that retrives a resault froma
    database. Basically all the data from a table of staff.
    <cffunction name="getUsers" access="remote"
    returntype="array">
    <cfquery name="q" datasource="#datasource#">
    SELECT *
    FROM STAFF_CHARTS_STAFF_TEMP
    </cfquery>
    <cfset aRecordset= querytoarray(q)>
    <cfset flash.result=aRecordset>
    <cfreturn flash.result>
    </cffunction>
    <cffunction name="querytoarray" returntype="array"
    output="No">
    <cfargument name="q" required="Yes" type="query">
    <cfset var aTmp = arraynew(1)>
    <cfif q.recordcount>
    <cfloop query="q">
    <cfset stTmp = structNew()>
    <cfloop list="#lcase(q.columnlist)#" index="col">
    <cfset stTmp[col] = q[col][currentRow]>
    </cfloop>
    <cfset arrayAppend(aTmp,stTmp)>
    </cfloop>
    <cfelse>
    <cfset stTmp = structNew()>
    <cfloop list="#lcase(q.columnlist)#" index="col">
    <cfset stTmp[col] = "">
    </cfloop>
    <cfset arrayAppend(aTmp,stTmp)>
    </cfif>
    <cfreturn aTmp>
    </cffunction>
    The result from a call of CF method getUsers is set as the
    data provider to ComboBox with id = "cb"
    <mx:RemoteObject
    id="myService"
    destination="ColdFusion"
    source="staff_ratings.staff_Ratings-debug.staff"
    showBusyCursor="true">
    <mx:method name="getUsers" result="handleResult(event)"
    fault="Alert.show(event.fault.message)"/>
    </mx:RemoteObject>
    <mx:Script>
    <![CDATA[
    import mx.rpc.events.ResultEvent;
    import mx.controls.Alert;
    [Bindable]
    public var sResult:Array;
    public function handleResult(event:ResultEvent):void{
    sResult=event.result as Array;
    cb.dataProvider=sResult;
    ]]>
    </mx:Script>
    However when the combobox is rendered all the values
    displayed look like [object Object].
    I think the problem is that the result is a array of arrays
    so I need to find away to ectract a particular colun of data into
    the combobox
    How do I fix this?

    This is what I did for a single field.
    If you were wanting the to have muliple fields in the
    dropdown, I would concatenate them in the query.
    something like
    select fname + ' ' + lname + ' ' + anotherfield as tech from
    dbo.table
    <cffunction name="getTech" output="no" access="remote"
    returntype="query">
    <cfset var qTech="">
    <cfquery name="qTech" datasource="datasource">
    select tech
    from dbo.table
    group by tech
    order by tech
    </cfquery>
    <cfreturn qTech>
    </cffunction>
    <mx:RemoteObject
    id="dataManager"
    showBusyCursor="true"
    destination="ColdFusion"
    source="cust.components.cfgenerated.Records">
    <mx:method name="getMasterQuery"
    result="getMasterQuery_result(event)" fault="server_fault(event)"
    />
    <mx:method name="deleteItem"
    result="deleteItem_result(event)" fault="server_fault(event)" />
    </mx:RemoteObject>
    <mx:ComboBox id="TECH"
    dataProvider="{dataManager.getTech.lastResult}" labelField="tech"
    />

  • Contains return all the records when the query string matches the columns

    I used the multi_column_datastore preference and created an index on three columns (item_name, description,owner_part_number). Now if I do a search:
    select * from items where contains(description, 'description') > 0;It returns all the rows in items table, but not all the rows have "description" as a word. I guess Oracle text assumes the query intends to get all the rows as the query string matches one of the column names. My question is whether Oracle Text has any preference settings to alter this behavior?
    execute ctx_ddl.create_preference('item_multi_preference', 'MULTI_COLUMN_DATASTORE');
    execute ctx_ddl.set_attribute('item_multi_preference', 'columns', 'item_name, description,owner_part_number');
    create index item_text_index on items(description) indextype is ctxsys.context filter by owner parameters('LEXER ENG_LEXER WORDLIST ENG_WORDLIST STOPLIST CTXSYS.EMPTY_STOPLIST datastore item_multi_preference MEMORY 1024M');Thanks.
    Jun Gao

    It looks like a basic_section_group fixes the problem as well, as demonstrated below and I believe a basic_section_group may be more efficient than auto_section_group.
    SCOTT@orcl_11gR2> -- recreation of problem:
    SCOTT@orcl_11gR2> drop table items
      2  /
    Table dropped.
    SCOTT@orcl_11gR2> create table items (
      2       "ITEM_NAME"             varchar2(100 byte),
      3        "ITEM_NUMBER"              varchar2(100 byte),
      4        "DESCRIPTION"              varchar2(4000 byte),
      5        "OWNER" number
      6  )
      7  /
    Table created.
    SCOTT@orcl_11gR2> begin
      2    FOR Lcntr IN 1..100
      3    loop
      4         insert into items (item_name, item_number, description, owner)
      5         values (dbms_random.string('A', 10),
      6              dbms_random.string('A', 10),
      7              dbms_random.string('L', 8) || ' '
      8              || dbms_random.string('A', 4)
      9              || dbms_random.string('A', 5)  || ' '
    10              || dbms_random.string('A', 10),
    11              dbms_random.value(1,10) );
    12    end loop;
    13  end;
    14  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    FOR Lcntr IN 1..100
      3    loop
      4         insert into items (item_name, item_number, description, owner)
      5         values (dbms_random.string('A', 10),
      6              dbms_random.string('A', 10),
      7              dbms_random.string('L', 8) || ' '
      8              || dbms_random.string('A', 4) || '111'
      9              || dbms_random.string('A', 5)  || ' '
    10              || dbms_random.string('A', 10), 1234 );
    11    end loop;
    12  end;
    13  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> exec ctx_ddl.drop_preference('ENG_WORDLIST');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference('ENG_WORDLIST', 'BASIC_WORDLIST');
      3    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_INDEX','TRUE');
      4    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_MIN_LENGTH',1);
      5    ctx_ddl.set_attribute('ENG_WORDLIST','PREFIX_MAX_LENGTH',10);
      6    ctx_ddl.set_attribute('ENG_WORDLIST','SUBSTRING_INDEX','TRUE');
      7    ctx_ddl.set_attribute('ENG_WORDLIST','WILDCARD_MAXTERMS', 0);
      8  end;
      9  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> execute ctx_ddl.drop_preference('ENG_LEXER');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    CTX_DDL.CREATE_PREFERENCE ('ENG_LEXER', 'BASIC_LEXER');
      3    CTX_DDL.SET_ATTRIBUTE ('ENG_LEXER', 'PRINTJOINS', '@-_');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> execute ctx_ddl.drop_preference('items_multi_preference');
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_preference('items_multi_preference', 'MULTI_COLUMN_DATASTORE');
      3    ctx_ddl.set_attribute('items_multi_preference', 'columns', 'item_name, description,item_number');
      4  end;
      5  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> create index items_text_index
      2  on items(description)
      3  indextype is ctxsys.context
      4  parameters
      5    ('LEXER         ENG_LEXER
      6        WORDLIST   ENG_WORDLIST
      7        STOPLIST   CTXSYS.EMPTY_STOPLIST
      8        datastore  items_multi_preference
      9        MEMORY     1024M')
    10  /
    Index created.
    SCOTT@orcl_11gR2> create index owner_idx on items (owner)
      2  /
    Index created.
    SCOTT@orcl_11gR2> exec dbms_stats.gather_table_stats (user, 'ITEMS')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> select count(*)
      2  from   items
      3  where  contains (description, 'description') > 0
      4  /
      COUNT(*)
           200
    1 row selected.
    SCOTT@orcl_11gR2> -- correction of problem:
    SCOTT@orcl_11gR2> exec ctx_ddl.drop_section_group ('items_sec')
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> begin
      2    ctx_ddl.create_section_group ('items_sec', 'basic_section_group');
      3    ctx_ddl.add_field_section ('items_sec', 'item_name', 'item_name', true);
      4    ctx_ddl.add_field_section ('items_sec', 'description', 'description', true);
      5  end;
      6  /
    PL/SQL procedure successfully completed.
    SCOTT@orcl_11gR2> drop index items_text_index
      2  /
    Index dropped.
    SCOTT@orcl_11gR2> create index items_text_index
      2  on items(description)
      3  indextype is ctxsys.context
      4  parameters
      5    ('LEXER         ENG_LEXER
      6        WORDLIST   ENG_WORDLIST
      7        STOPLIST   CTXSYS.EMPTY_STOPLIST
      8        datastore  items_multi_preference
      9        MEMORY     1024M
    10        section group items_sec')
    11  /
    Index created.
    SCOTT@orcl_11gR2> select count(*)
      2  from   items
      3  where  contains (description, 'description') > 0
      4  /
      COUNT(*)
             0
    1 row selected.

  • Getting all the values from a JList

    Hi,
    I want to get all the values from a JList and store it into an array. Any method is available to perform this task? Pls help me out with this task.

    Use getModel() on the list to get the ListModel and then call getSize() and getElementAt(int) to loop over the elements
    HTH
    Mike

  • Any function module to read all the values in Tcode-PPQD?

    Hi all
    Is there any function module to read all the values in Tcode-PPQD (Display Qualifiaction Catalog).
    and any idea what tables are involved to get these values like parent and child relationship?
    Thanks in advance.
    Murali.

    Murali,
    you can use the following..
    data: w_sobid type sobid, "Qualification ID
          w_objid type objid. "Qualification Catalog
    select objid  into w_objid
                  up to 1 rows
                  from HRP1001
                 where otype = 'QK'
                   and plvar = '01'
                   and istat = 1
                   and risgn = 'B'
                   and relat = '030'
                   and endda ge sy-datum
                   and begda le sy-datum
                   and sclas = 'Q'
                   and sobid = w_sobid.
    endselect.
    if sy-subrc eq 0.
    write: / w_objid,w_sobid.
    endif.
    Regards,
    Suresh Datti

  • Formula to Copy all the values based on condition

    Hi All,
          I have Text Column called "PASS" in Pivot table holding values like and NA and 0.0133333333333333 .
          So I want to create the calculate column "CALS "and copy all the values which are not holding NA into this column and set value 0 if found NA.Can any one help me how can I solve this.
    Thanks,
    Sid

    Hello Sid,
    For this you can use a calculate column a simple condition with the IF function like
    =IF(MyTable[MixedValueColumn] = "NA", 0, CURRENCY(MyTable[MixedValueColumn]))
    Olaf Helper
    [ Blog] [ Xing] [ MVP]

  • RowSetIterator not returning all the rows

    Hi,
    We have a use-case where we need to create a new row iterator to insert rows(values) in it. Immediately after insertRow(), we are reading the values by creating a secondary row set iterator (createRowSetIterator) but it is not returning all the inserted rows. Here is the code snippet:
    Code to insert rows:
    public void insertTerrLineOfBusiness(CreateOperation operation, TerritoryVORowImpl newTerritoryRow, TerritoryVORowImpl selectedRow){     
    if((operation.equals(CreateOperation.CREATE))
    || operation.equals(CreateOperation.COPY)
    || operation.equals(CreateOperation.ADD_EXISTING)){
    RowIterator selTerritoryLineOfBusinessIter = selectedRow.getTerritoryLineOfBusiness();
    //RowIterator newTerrLineOfBusinessIter = newTerritoryRow.getTerritoryLineOfBusiness();
    ViewRowSetImpl newTerrLineOfBusinessIter = (ViewRowSetImpl) newTerritoryRow.getTerritoryLineOfBusiness();
    newTerrLineOfBusinessIter.setAssociationConsistent(true);
    while(selTerritoryLineOfBusinessIter.hasNext()){
    TerritoryLineOfBusinessVORowImpl selTerrLineOfBusinessRow =
    (TerritoryLineOfBusinessVORowImpl)selTerritoryLineOfBusinessIter.next();
    TerritoryLineOfBusinessVORowImpl newTerrLineOfBusinessRow =
    (TerritoryLineOfBusinessVORowImpl)newTerrLineOfBusinessIter.createRow();
    newTerrLineOfBusinessRow.setTerritoryVersionId(newTerritoryRow.getTerritoryVersionId());
    newTerrLineOfBusinessRow.setLobCode(selTerrLineOfBusinessRow.getLobCode());
    newTerrLineOfBusinessIter.insertRow(newTerrLineOfBusinessRow);
    Code to read:
    public List getTerritoryLobsValues() {
    List <String> lobsValues = new ArrayList<String>();
    if (this.getTerritory().getCurrentRow() != null) {
    TerritoryVORowImpl territoryVORowImpl =
    (TerritoryVORowImpl)this.getTerritory().getCurrentRow();
    if(territoryVORowImpl.getTerritoryLineOfBusiness() != null){
    ViewRowSetImpl territoryLob =
    (ViewRowSetImpl)territoryVORowImpl.getTerritoryLineOfBusiness();
    RowSetIterator itr = territoryLob.createRowSetIterator(null);
    if(itr!=null){
    while(itr.hasNext()) {
    Row r = itr.next();
    String lobCode = (String)r.getAttribute("LobCode");
    lobsValues.add(lobCode);
    itr.closeRowSetIterator();
    return lobsValues;
    Can anybody suggest what could be the issue? How to fix it?
    Thanks,
    Akhila

    Thanks for your response.
    Jdev version:
    Primary == FUSIONAPPS_PT.V1REL6INT_LINUX.X64_120719.0800 (Primary Product for the view)
    Primary depends on FMWTOOLS == FMWTOOLS_11.1.1.6.0_GENERIC_120112.0037.2
    FMWTOOLS depends on label == JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192.1
    The above label originated from base label == JDEVADF_11.1.1.6.0_GENERIC_111205.1733.6192
    Use case: We have a tree table, each record may or may not have Line of Business(LOB) associated with it. On creating a child node in the tree table, the child node copies all the attributes of parent. These attributes are not committed explicitly, if user wants to save the child node only then the attributes are committed.
    Giving secondary rowSetIterator a name did not help in resolving this issue.
    If I am calling postChanges() before reading from secondary row iterator then its returning all the inserted values. But this.getTransaction().postChanges() is a JAudit violation, so cannot use it:
    RuleId: apps-jbo-category.File.AdfModel.54
    Rule: insertTerrLineOfBusiness - Review DBTransaction.postChanges call to ensure passivation-safety
    Any pointers on this?

  • How to avoid report running for all the values in roll up of guided naviga

    Hi
    Thanks in Advance
    I have 3 reports on three different pages of a dashboard. (Implemented guided navigation on one column of each report).When I click on value of guided navigation column it guides me to report 2 for that particular value (is prompted), same way for 3 report also till here it works fine.
    However when I return from report 3 to report 2 and 2 to 1, the reports are running for all the values instead for the value which was passed by guided navigation of previous report earlier (Value on which I clicked to pass to the next report).
    Edited by: 808623 on Nov 9, 2010 2:10 AM

    Yes
    Example : If i click on values 'X' in report 1
    Report 2 shows results for 'X' only. And if i click on Value say 'Y' in 2 then report 3 shows for only 'Y'. But when i rollup from 3 to 2, Report 2 is showing for all values rather than showing 'x'.
    I'm using Link or Image Dashboard Object > Destination>Request or Dashboard (path of previous report)
    Edited by: 808623 on Nov 9, 2010 2:37 AM

  • Sum of all the values in a field

    I have a report which needs to sum all the values of KONV-KBETR where KONV-kinak NE 'A'.
    How do i write the code.
    Can anyone help me in wrting the code..
    This value i have to finally display in my internal table as one value.

    data: sumf type i.
    select sum( kbetr ) from  konv into sumf where kinak <> 'A' group by konv.
    write: sumf.
    Message was edited by:
            Ramu

  • Is it possible inscribe all the packages into a single package ??

    Hi,
    In Oracle 10g , Is it possible inscribe all the packages into a single package ??
    Because, my PM Is asking me to inscribe all the Packages into Single Package and give same reference to the .Net developers.
    I have tried a lot, but i am not finding out the right solution for this ., and even i am bit confused whether is this possible or not.
    Can any one please suggest me how to achieve this it it's possible in Oracle.

    You mean something like...
    -- First package with functions in it...
    SQL> create package mypack1 as
      2    function myfunc1 return number;
      3  end;
      4  /
    Package created.
    -- assume a package body is created for this as well
    -- Second package with functions in it...
    SQL> create package mypack2 as
      2    function myfunc2 return number;
      3  end;
      4  /
    Package created.
    -- assume a package body is created for this as well
    -- One package encompassing other packages...
    SQL> create package allpacks as
      2    function myfunc1 return number;
      3    function myfunc2 return number;
      4  end;
      5  /
    Package created.
    SQL> create package body allpacks as
      2    function myfunc1 return number is
      3    begin
      4      return mypack1.myfunc1;
      5    end;
      6
      7    function myfunc2 return number is
      8    begin
      9      return mypack2.myfunc2;
    10    end;
    11  end;
    12  /
    Package body created.
    SQL>;)

  • How i can pass the value into 1 line

    Hi expert,
    how do i pass all the value for sales document flow item in one line?
    i'm using this function
    CALL FUNCTION 'RV_ORDER_FLOW_INFORMATION'
        EXPORTING
          aufbereitung  = '2'
          belegtyp      = i_del-vbtyp
          comwa         = l_comwa
          nachfolger    = ' '
          vorgaenger    = 'X'
          v_stufen      = '50'
        TABLES
          vbfa_tab      = lt_vbfa
        EXCEPTIONS
          no_vbfa       = 1
          no_vbuk_found = 2
          OTHERS        = 3.
    so now lt_vbfa already got data line by line....
    line 1 : contract : 00010 : 1000000 : 19,000.00
    line 2 : order     : 00010 : 2000000 : 10000.00
    line 3 : delivery : 00010 : 3000000 : 10000.00
    how i can pass the value into 1 line?
    for example :
    contract  | line     | amount     | Order     | line     | amount    | delivery   | line     | amount     |
    1000000 | 00010| 19,000.00 | 2000000 |00010 | 10000.00 | 3000000 | 00010 | 10000.00 |
    Edited by: anuar jusoh on Aug 17, 2009 4:02 AM

    Hi,
    What is requirement for passing the data in a single line ? Do you finally need to append the same in the internal table and pass it in the module ?
    You can create an internal table of type 1000 character and can loop the existing internal table. Then you can append the Work area in a single line and can finally append it to the table.
    DATA : ITAB type standard table of char1000.
    Loop at <existing table>.
    concatenate table work area wa_char100 into Itab_char_1000.
    endloop.
    APPEND itab_char_1000 into itab.
    Hope this helps.
    Thanks,
    Samantak.

  • I want to spit cell the value into two separate columns like f_name & l_nam

    Hi Guys,
    I have excel data in one cell with ',' separated data.
    sample data:
    empno ename
    121 ravi,kann
    232 ram,raman
    here ename value in one provided in one cell.
    Now i want to spit cell the value into two separate columns like first_name and last_name?
    Thanks in advance
    -LK

    with sample_data as
      select 121 empno, 'ravi,kann' ename from dual union all
      select 232 empno, 'ram,raman' from dual
    select empno,
           substr(ename,1,instr(ename,',')-1) first_name,
           substr(ename,instr(ename,',')+1) last_name
    from sample_data;       or with regular expressions:
    with sample_data as
      select 121 empno, 'ravi,kann' ename from dual union all
      select 232 empno, 'ram,raman' from dual
    select empno,
           regexp_substr(ename,'^[^,]*') first_name,
           regexp_substr(ename,'[^,]*$') last_name
    from sample_data; Edited by: hm on 04.07.2012 06:22

Maybe you are looking for