Select statement not working

hi to all,
I am trying to write use inner joining . here is code
DATA:tabname LIKE dd02L-tabname,
     table_disc LIKE dd02t-ddtext.
  SELECT  dd02ltabname dd02tddtext INTO (tabname,table_disc)
    FROM dd02l INNER JOIN dd02t on dd02ltabname = dd02ttabname
          WHERE dd02tddlanguage = 'E' AND dd02ltabclass = 'TRANSP'
                            AND dd02L~tabname = 'ZANKI*'.
    endselect.
      write : tabname.
I also checked in tables dd02t and dd02l for the table zanki* and data available in both table . but here select statement not working .do u have any idea about this. thank you

Hi,
I executed the ur inner join conditin by commenting 'z*' it's working fine.
I think  where condition is not getting satisfied so u r not getting any data.
Please conform in where condition you need * 'AND'* or OR
I change decalration as below.
DATA:tabname    type TABNAME,
      table_disc type AS4TEXT.
SELECT dd02l~tabname
       dd02t~ddtext  INTO (tabname, table_disc)
FROM dd02l  INNER JOIN dd02t on dd02l~tabname = dd02t~tabname
WHERE dd02t~ddlanguage = 'E' AND
      dd02l~tabclass = 'TRANSP'AND
    dd02L~tabname = 'ZANKI*'.
endselect.
write : tabname.
Regards,
Pravin

Similar Messages

  • Selection statement not working as expected

    The hotter and cooler methods are the ones in question. It just prints "Cannot go below the minimum temperature" ,no matter what value I set increment, min, or max to. It also does not change the value of temperature.
    I've already tried adding parentheses like this : if ((temperature - incremen)t <= min)
    public class Heater
        //the current temperature
        private int temperature;
        //the minimum temperature
        private int min;
        //the maximum temperature
        private int max;
        private int increment;
        public Heater(int minimum, int maximum)
            min = minimum;
            max = maximum;
            increment = 5;
            temperature = 15;
        //decreases the temperature by 5
        public void cooler()
            if (temperature - increment <= min)
            temperature = temperature - increment;
            else
            System.out.println("Cannot go below the minimum temperature");
        //increases the temperature by 5
        public void hotter()
            if (temperature + increment >= max)
            temperature = temperature + increment;
            else
                System.out.println("Cannot go above the maximum temperature");
       //sets the amount to increment the heat by
        public void setIncrement(int incrementAmount)
            if (incrementAmount > 0)
            increment = incrementAmount;
            else
            System.out.println("Please enter a positive amount");
        //returns the current temperature
        public int getTemperature()
            return temperature;
    }

    Hi,
    you mixed the conditions. you want to stay above minimum and below maximum:
    if (temperature - increment >= min)
    if (temperature + increment <= max)

  • Cascading Select Lists - Not Working for me

    I am trying to implement Denes Kubicek's Ajax Cascading Select List solution.
    http://apex.oracle.com/pls/otn/f?p=31517:119
    But it is not working for me.
    I'm a newbie to APEX and checked the forum for advice on cascading select lists. I saw the thread for
    "Cascading Select Lists - Not Working" posted by sue and the replies by Varad Acharya, but I'm still
    having issues of not seeing the alerts, not able to run the pl/sql process in SQL Workshop, and not
    getting the expected results.
    I have a list of countries (US - USA, CA - CANADA, etc.) and a list of states for each country. When a
    user selects a country I would like to show the list of states within that country.
    This is what I've done so far:
    Defined an application process:
    Process Point: On Demand: Run ... by a page process.
    Name: CASCADING_SELECT_LIST1
    Process Text:
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<select>');
    HTP.prn ('<option value="' || 99 || '">' || '- All States -'
    || '</option>'
    FOR c IN (SELECT state_code || ' - ' || state_desc d, state_code r
    FROM tbk_state
    WHERE country_code = :cascading_selectlist_item_1)
    LOOP
    HTP.prn ('<option value="' || c.r || '">' || c.d || '</option>');
    END LOOP;
    HTP.prn ('</select>');
    END;
    defined and application item:
    Name: CASCADING_SELECTLIST_ITEM_1
    Build Option: - No Build Option -
    Created a 'Form on a table with report' as follows:
    Page 5: Report on TBK_HARDWARE_LOCATION
    Page 6: Form on TBK_HARDWARE_LOCATION
    in HTML Header of the page attributes for 'Form on TBK_HARDWARE_LOCATION' I have:
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='"DELETE_CONFIRM_MSG"';
    //-->
    </script>
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    alert ('Dept no=' + pThis.value);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SELECT_LIST1',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    // gReturn = get.get();
    alert('Enames=' + gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue)
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    On Page 6: 'Form on TBK_HARDWARE_LOCATION' I have the following items (plus some others):
    Name: P6_COUNTRY_CODE
    Display as: Select List
    HTML Form Element Attributes: onchange="get_select_list_xml1(this,'P6_STATE_CODE');"
    Source Used: Only when current value in session state is null
    Source Type: Database Column
    maintain session state: Per session
    Source value or expression: COUNTRY_CODE
    Named LOV: LIST OF COUNTRIES
    Name: P6_STATE_CODE
    Display as: Select List
    Source Used: Only when current value in session state is null
    Source Type: Database Column
    maintain session state: Per session
    Source value or expression: STATE_CODE
    Named LOV: - Select named LOV -
    List of Values definition:
         select state_code || ' - ' || state_desc d, state_code r
         from tbk_state
         where country_code = :P6_COUNTRY_CODE
         order by 1
    LIST OF COUNTRIES is defined as:
    select country_code || ' - ' || country_desc d, country_code r
    from tbk_country
    order by 1
    Now to the problem:
    I run page 5 (the report) to see the list of locations and then I try to edit a record (page 6). When I
    try to select a different country I get the following error (on IE):
    "Problems with this web page might prevent it from being displayed properly or functioning properly.
    In the future, you can display this message by double-clicking the warning icon displayed in the status
    bar.
    Line: 17
    Char: 5
    Error: Object expected
    Code: 0
    URL: http//cmrac4.cm.timeinc.com:7777/pls/htmldb/f?
    p=114:6:1413254636072443110::::P6_HARDWARE_LOCATION_ID:2
    I don't see any of the alert messages.
    I also tried to run the application process code in the SQL - Command Processor (I replaced
    :cascading_selectlist_item_1 with 'CA' or 'US') and got the following:
    The XML page cannot be displayed
    Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh
    button, or try again later.
    Only one top level element is allowed in an XML document. Error processing resource
    'http://cmrac4.cm.timeinc.com:7777/pls/...
    <select><option value="99">- All States -</option><option value="X1">X1 - X1</option><optio...
    Can someone help me please?

    Varad,
    First, thank you for taking the time to try to help me with this problem.
    When I view the page's source code (here are the first few lines):
    <html lang="en-us">
    <head>
    <script src="/i/javascript/core.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/i/css/core.css" type="text/css" />
    <script language="JavaScript" type="text/javascript">
    <!--
    htmldb_delete_message='Would you like to perform this delete action?';
    //-->
    </script>
    <script>
    function get_select_list_xml1(pThis,pSelect){
    var l_Return = null;
    var l_Select = html_GetElement(pSelect);
    //alert ('Dept no=' + pThis.value);
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=CASCADING_SELECT_LIST1',0);
    get.add('CASCADING_SELECTLIST_ITEM_1',pThis.value);
    gReturn = get.get('XML');
    // gReturn = get.get();
    //alert('Enames=' + gReturn);
    if(gReturn && l_Select){
    var l_Count = gReturn.getElementsByTagName("option").length;
    l_Select.length = 0;
    for(var i=0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("option");
    appendToSelect(l_Select, l_Opt_Xml.getAttribute('value'),
    l_Opt_Xml.firstChild.nodeValue);
    get = null;
    function appendToSelect(pSelect, pValue, pContent) {
    var l_Opt = document.createElement("option");
    l_Opt.value = pValue;
    if(document.all){
    pSelect.options.add(l_Opt);
    l_Opt.innerText = pContent;
    }else{
    l_Opt.appendChild(document.createTextNode(pContent));
    pSelect.appendChild(l_Opt);
    </script>
    It looks like line 17 is:
    var l_Select = html_GetElement(pSelect);
    I'm still not sure why I'm getting this error and why it's not working?
    Thanks,
    Eti

  • SELECT * CONNECTION not work

    Hi,
    It is found that SELECT * does not work with CONNECTION. For example, I use the following statement to retrieve data from another system and an error states that SQL error 207 when accessing table 'MARA'. 'Invalid column name  'ANIMAL_ORIGIN''. If columns are specified, data can then be retrieved. The SAP BASIS version is 7.31.
    SELECT SINGLE *
          INTO CORRESPONDING FIELDS OF ls_mara
        FROM MARA
                   CLIENT SPECIFIED
                   CONNECTION ('G01')
    WHERE MANDT = '100'.

    Hi TS,
    You gave the answer already, but look at the HELP:
    To allow the Open SQL command to be run for the secondary database connection, the table definitions in the connection must be the same as those in the standard database.
    Cheers,
    Custodio

  • Data Services- The job server you selected is not working

    Long Text:
    After logging in to the Data Services designer,when try to run a job it shows error -The job server you selected is not working
    Latest Software version -BODS 4.0 SP2
    Reproduce Steps:
    1. Double click on the Project from repository, it will display the project in Project area.
    2. After that it will display all the jobs under the project.
    3.Right click on the job and try to execute, then it will display the "Execution Properties" windows.
    Here the we can the default Job Server has been selected.
    4. Try to click ok to execute the job and then we get the error-"The job server you selected is not working"

    Hi
    Please contact your Data services administrator to check on the server why the job server is not working.
    There might be several issues like connectivity with the repository, access details , mapping in the management console etc.
    And let us know the exact issue.
    Regards
    Puneet

  • XMLP 5.6.2 - Parameters -  Both Multi-Select and All-Select  Do Not Work

    Both Multi-Select and All-Select Do Not Work.
    What's up with this behavior?
    And when might it be fixed?
    BG...

    The Multi-Select is now working, not sure what I did wrong earlier. However the "Can select all" option when building the parameter does not work as advertised, though I was able to get around that as well.
    Create a Data Model
    select LAST_NAME, FIRST_NAME from SOME_TABLE where SOME_COLUMN =:SOME_VALUE
    OR
    select LAST_NAME, FIRST_NAME from SOME_TABLE where SOME_COLUMN in (:SOME_VALUE)
    Create a LOV
    Name = LOV_SOME_COLUMN
    Type = SQL Query
    select distinct SOME_TABLE.SOME_COLUMN as SOME_COLUMN from SCHEMA.TABLE
    Create a Parameter
    Identifier = PARM_SOME_COLUMN
    Data Type = String
    Default Value = NULL
    Parameter Type = Menu
    Display Label = LOV_SOME_COLUMN
    List Of Value = LOV_SOME_COLUMN
    Option
    Multiple Selection - Checked
    Can select all - Checked
    Refresh other parameters on change - Checked
    Then test your report. Select "All" from the LOV and click view. Result - No Rows Returned.
    Selecting a "Single" or "Multiple Values" values from the LOV does work.
    The way I am getting around the problem is to uncheck the "Can select all" and then manually select all the values in the LOV in order to get the "All".
    BG...

  • I have F.F 3.6 and windows 7.: 1) When i want to buy a airplane ticket and want to select 2 adults or 2 children, the draw down select, does not work in any websides,? WHY?. 2) Have FF any problems with SKYPE

    I have F.F 3.6 and windows 7.: 1) When i want to buy a airplane ticket and want to select 2 adults or 2 children, the draw down select, does not work in any websides,? WHY?. 2) Have FF any problems with SKYPE
    == This happened ==
    Not sure how often
    == After innstalling windows 7

    As a suggestion I'd put the Text_io segments into their own begin - exception - end sub-blocks within the main code. This way if Text_io does raise an exception you can catch it earlier as it may be able to recover - That is if it is a text_io exception.
    Other than that you;ll have to step through in Debug.

  • SELECT INTO ( variable ) STATEMENTS NOT WORKING FOR SYBASE TABLE AS VIEW

    Dear Experts,
    We have connected our 9i db with Sybase db using Hs connectivity.
    and then we have create the view in oracle db for SYBASE_TABLE as SYBASE_TABLE_VIEW.
    ALL THE INSERT, UPDATE AND DELETE COMMANDS ARE WORKING BUT THE
    select Into (variable) is not working.
    Please help to resolve the select into statment which is in BOLD in the below routine
    PLEASE NOTE! FORM WAS COMPILED SUCCESSFULLY AND FORM IS RUNNING BUT SELECT INTO COMMAND IS NOT WORKING.
    Thanks & Regards
    Eidy
    PROCEDURE SRBL_INSERT IS
    CURSOR SRBL IS
         SELECT impno,impcod,impnam
         from oracle_table1 a, oracle_table2 b
         WHERE a.impcod=b.empcod
         v_srpcod varchar2(5);
    BEGIN     
    FOR rec in SRBL loop     
         begin
    select "im_code" into v_impcod                    
         from SYBASE_TABLE_VIEW
         where "im_code"=rec.impcod;
    exception when no_data_found then
         v_srpcod:=null;
    end;
    END LOOP;
    END;
    Edited by: Eidy on Aug 16, 2010 11:28 AM

    hellow
    try this.
    select "im_code" into v_impcod
    from SYBASE_TABLE_VIEW
    where "im_code"=rec.impcod;
    v_srpcod := v_impcod ;
    ........

  • Case when statement not working

    hi there, I am trying to work out how to get my case statement to work.
    I have got the following code. 
    select pthproto.pthdbo.cnarole.tpkcnarole, pthproto.pthdbo.cnaidta.formataddr as formataddr, cnaidta.dateeffect as maxdate, isnull(cast (pthproto.pthdbo.cnaaddr.prefix1key as varchar (50)),'') + ' ' + isnull(cast (pthproto.pthdbo.cnaaddr.prefix2key
    as varchar (50)),'')+ ' ' + isnull(cast (pthproto.pthdbo.cnaaddr.prefix3key as varchar (50)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.houseidkey as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component1
    as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component2 as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component3 as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component4
    as varchar (100)),'') + ' ' + isnull (cast (pthproto.pthdbo.cnaaddr.component5 as varchar (100)),'') as mailaddress, row_number() over(partition by pthproto.pthdbo.cnarole.tpkcnarole order by cnaidta.dateeffect desc) as rn into #address from pthproto.pthdbo.cnarole
    inner join pthproto.pthdbo.cnaidty on cnarole.tfkcnaidty =cnaidty.tpkcnaidty inner join pthproto.pthdbo.cnaidta on cnaidty.tpkcnaidty = cnaidta.tfkcnaidty inner join pthproto.pthdbo.cnaaddr on cnaidta.tfkcnaaddr = cnaaddr.tpkcnaaddr order by cnaidta.dateeffect
    select *, case when mailaddress is not null then mailaddress else formataddr end as test from #address where tpkcnarole = '18306695'
    The case when statement is struggling with how i have created the column mailaddress.  As it does seem to understand when it is null.  In the example I have got there is no value in any of the columns to create
    the mailaddress.  Hence why I am referencing it from elsewhere.  Due to having a way on the system where it picks up data from 2 different places.    The mailaddress is always correct if there is one, hence why
    trying to reference that one first.  So how do i change this case when statement to work ?            

    It's ok I have fixed my own problem
    when
    (mailaddress
    is
    null 
    or mailaddress

    then formataddr
    else mailaddress
    end
    as test
    case

  • IDVD 08 - problem with scene selection tabs not working after "burn"

    I have a movie that is about an hour long (made in iMovie08 using mostly still photos). I wanted to have "chapters" -- but with that option gone, I used the Scene Selection option in iDVD08. This created menus with 15 scene selection buttons (I chose every 4 minutes). The menus were automatically created by iDVD and I did nothing to change them, except to type in scene info (two-three words).
    The buttons all worked fine on the computer, and I burned a DVD. The DVD worked great in my VCR player. I'd select Play Movie and it would go. I'd select Scene Selection and I'd get the menus for that. But when I'd highlight one of the scene selections and "enter" (select) -- it wouldn't go to that scene. I could go back and forth between menus, and could move around and highlight the scene buttons, but selecting would not start the scene to play. The movie played fine from start to finish, and the other remote features worked (stop, pause, menu, etc.).
    I went back to iDVD and chose a different theme (thinking maybe I'd inadvertently done something to mess things up. The only thing I did differently in addition to the new theme, was to add two small movie clips - and I rearranged the buttons on the menu (dragging) to get them positioned where I wanted them. So my first menu says "Play Movie". The second menu has: Play Movie, Scene Selections, Little Movie 1, Little Movie 2. Everything worked greated in iDVD. Then I created a disk image to view using DVD Player (rather than waste another DVD). Same problem -- only worse. This time I couldn't even highlight Scene Selection to get to the scenes' menus.
    Any thoughts on why I'm not able to get the "Scene Selection" buttons to work after a burn? Am I missing a step somewhere in iDVD?
    Thanks.

    I am not sure, but does your post concerning the problem, that all Remote Control function will work properly within iDVD'08 but after burning the DVD absolutely not with the RC of your set top DVD player connected to your TV?
    If this is it:
    Meanwhile I could figure out - after many nights of not been very productive and only working out on all the iDVD'08 problems - that **ALL** of the *7.0 Themes* have a major problem in generally.
    The following points are concerning iDVD'08 using any of the 7.0 Themes:
    - Complete deep freeze of your Mac under Leopard when rendering/coding/burning a movie which has chapters and you use movies instead of still images in drop zones. (LeopardiDVD087.0Themes)
    - Functions on remote control of your set top DVD player are not working correctly when making a movie with chapters. This is generally on Tiger and Leopard the same problem using iDVD08 with any of the 7.0 Themes.
    Quick and dirty workaround:
    You may avoid this if you simply use a 6.0 Theme or lower version of the Themes.
    But this is of course not the clue...
    It is VERY DISAPPOINTING, having software at such a low quality level deliverd by Apple. And somehow it looks like they DO NOTHING against it. No statement, no excuse, they really remain silent.
    This may also be a thread you could be interested in:
    http://discussions.apple.com/thread.jspa?threadID=1203323
    Cheers,
    Roland

  • Hide statement not working

    Hi experts,
    i am using hide statement but it is not working..The problem with it is that after line selection the variable on which i have used hide is carrying the last value of internal table always..<< Removed >>
    Regards,
    Raman
    Edited by: Rob Burbank on Jun 30, 2009 10:41 AM

    I am sending a test program with same problem...iin this after line selection the field variable emp-name is displayin only last entry of internal table...
    *& Report  ZBASICX12
    REPORT  ZBASICX12.
    INITIALIZATION.
      DATA: BEGIN OF ITAB OCCURS 0,
            EMPID  TYPE ZTEMP-EMPID,
            EMPNAME TYPE ZTEMP-EMPNAME,
            END OF ITAB.
    START-OF-SELECTION.
      SELECT EMPID EMPNAME FROM ZTEMP INTO TABLE ITAB.
      SORT ITAB BY EMPID.
      LOOP AT ITAB.
        WRITE: / ITAB-EMPID HOTSPOT.
        HIDE ITAB-EMPID.
      ENDLOOP.
    END-OF-SELECTION.
    AT LINE-SELECTION.
      CASE SY-LSIND.
        WHEN 1.
          WRITE: ITAB-EMPNAME.
      ENDCASE.

  • Select statment not working with variables

    Hi experts,
    Iam trying to select some data using the follwoing code
    with radio buttons r6 & r7.
    If r6 selected,it takes from parameter and
    if r7 selected it takes from select options...
    data: l_datbi type a005-datbi,l_datab type a005-datab.
        if r6 = 'X'.
          l_datbi = pvalid.
          l_datab = pvalid.
        elseif r7 = 'X'.
          l_datab = svalid-low.
          l_datbi = svalid-high.
        endif.
    select vtweg matnr knumh datbi datab                      into corresponding fields of i_itab
                          from A004
                          where kappl eq 'V'
                          and kschl eq pkschl
                          and vkorg eq pvkorg
                          and vtweg in svtweg
                          and matnr in smatnr
                          and datab le l_datab    ####### 
                          and datbi ge l_databi.  #######
    This select statement is not working.
    It is taking only one value at a time.(r6 value or r7value)
    What might be the reason...?
    reward gurarenteed
    maggy

    Hi,
    You are trying to equate your low value with end date and high value with start date..
    The correct logic will be,
    data: l_datbi type a005-datbi,l_datab type a005-datab.
    if r6 = 'X'.
    l_datbi = pvalid.  "Start Date
    l_datab = pvalid.  "End Date
    elseif r7 = 'X'.
    <b>*l_datab = svalid-low. "Wrong</b>
    <b>l_datab = svalid-high. "Right</b>
    <b>*l_datbi = svalid-high.  "Wrong</b>
    <b>l_datbi = svalid-low.  "Right</b>
    endif.
    select vtweg matnr knumh datbi datab into corresponding fields of i_itab
    from A004
    where kappl eq 'V'
    and kschl eq pkschl
    and vkorg eq pvkorg
    and vtweg in svtweg
    and matnr in smatnr
    and datab le l_datab #######   "This also doesnt look
    and datbi ge l_databi. ####### "right to me, please check
    Hope this helps..
    Sri

  • SQL Statement not works using functions or subqueries-MAXDB

    Hello All,
    I created an ABAP program to select information about country(table: T005) with the country names (Table: T005T). I tried to create a sql query with a sql subquery to select everything but for some reason that I don't know it doesn't work. Please find the query below.
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, `
               &&       `(SELECT landx `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ), `
               &&       `(SELECT natio `
               &&         `FROM SAPNSP.T005T `
               &&         `WHERE mandt = '` && sy-mandt && `' `
               &&           `AND spras = 'EN' `
               &&           `AND land1 = ? ) `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Well, the query above works but the fields LANDX and NATIO are in blank in ALL THE CASES, even with information registred in table T005T.
    So, exploring the SDN forum and after read some documents regarding ADBC, I create a function to handle this sql select and get the correctly the missing informations, but, still don't work. Please find the function below:
    CREATE FUNCTION select_landx (land1 CHAR(3)) RETURNS CHAR(15)
    AS
      VAR landx CHAR(15);
      DECLARE functionresult CURSOR FOR
      SELECT spras, land1, landx
         FROM SAPNSP.t005t
         WHERE spras = 'EN'
             AND land1 = :land1;
         IF $count IS NULL THEN <- | $count is always 0, my SELECT
           BEGIN                                 it's not work but I don't know why
             CLOSE functionresult;
             RETURN NULL;
           END
         ELSE
           SET $rc = 0;
           WHILE $rc = 0 DO
           BEGIN
             FETCH functionresult INTO :landx;
           END;
         CLOSE functionresult;
         RETURN landx;
    Calling the function in a SQL statement:
    DATA:
    resu        TYPE REF TO cl_sql_result_set ,
    stmt         TYPE REF TO cl_sql_statement ,
    qury        TYPE string .
               qury  = `SELECT land1, spras, select_landx(?) landx `
               &&        `FROM SAPNSP.T005 `
               &&        `WHERE mandt = '` && sy-mandt && `' `
               &&          `AND land1 = ? `
               &&        `GROUP BY land1, spras` .
    resu = stmt->execute_query( qury ) .
    Any comments ?
    Best regards,
    Arthur Silva

    Hello,
    Thank's a lot, it works. It's funny because the given solution works using only abap codes.
    It may be happens because the abap interpretor send the sql statement to the db interface that handle the code in the another way.
    Thanks again, it was driving me crazy.
    Best regards,
    Arthur Silva

  • Merge statement not working over db link

    I have a merge statement that works fine when it's run against a local table, but when I try to run it against a table over a database link, I get the following error.
    ERROR at line 1:
    ORA-01008: not all variables bound
    ORA-02063: preceding line from REPOS
    ORA-06512: at "DBADMIN.PING_DB", line 6
    ORA-06512: at line 1
    Here is the code:
    create or replace procedure ping_db
    as
    begin
    merge into availability@repos A
    using (select trunc(sysdate) from dual)
    on (trunc(A.day) = trunc(sysdate))
    when matched then update set A.uptime = A.uptime + 1
    when not matched then insert (hostname,dbname,day,uptime) values
    (utl_inaddr.get_host_name,sys.database_name,trunc(sysdate),1);
    commit;
    end;
    /Code compiles fine, but gets the error when it's executed. Any help would be appreciated.

    9.2.0.x is the version (9.2.0.4,.5 and .6)

  • Select count(*) not working in Apex

    Hello,
    The following sql works in both SQL*Plus and Toad but not in apex.  The variable seems always to be 0 no matter what data I have on the table.
    Basically I try to flip the status from "Inactive" to "Active" only when there is no "Inactive" status left on the table.  Say there are 2 inactive statuses.
    If I delete one inactive status, the overall status should still be "Inactive".  However, with this code, it flips to "Active" status regardless. 
    I tried manually assign the variable to 1 and the status was not flipped.  Therefore, it sounds to me that the count(*) is not working in APEX.
    Does anyone experience this before? 
    Thanks in advance,
    Ning
    ===================================
    DECLARE
    v_status_count NUMBER;
    BEGIN
    UPDATE LGR_APP_STATUSES
    SET DELETED = 'Y'
    WHERE LGR_APP_STATUS_ID = :P42_LGR_APP_STATUS_ID;
    commit;
    select count(LGR_STATUS_ID) into v_status_count from LGR_APP_STATUSES
    where DELETED = 'N'
    and LGR_APPLICATION_ID = :p42_application_id
    and LGR_STATUS_ID in (3,8);
    IF (v_status_count = 0) THEN
    update lgr_applications
      set lgr_application_status = 'ACTIVE'
      where LGR_APPLICATION_ID = :P42_LGR_APPLICATION_ID;
    commit;
    END IF;
    END;

    Hi,
    In query you have used p42_application_id.
    Other statements use P42_LGR_APP_STATUS_ID
    Do you have that item? What is session state for that?
    Regards,
    Jari

Maybe you are looking for

  • Budgetary Ledger without PBET and due date

    Hello, My customer have following requirement: 1. Budgetary Ledger to be used. 2. Commitment items created from for example funds reservation should reserved budget base on due date from payment budget. I use update profile 000100 (payment budget, pa

  • How to create a page break in application designer

    Hi Folks, I need to create a simple page break in a PeopleSoft online page for the purpose controlling how the page prints. To achieve this, I'm using an HTML area in app designer with the following page break code: <p style="page-break-after:always;

  • Can I use a gift card to upgrade to OS X Lion?

    I recently got a gift card and I was wondering if it could be used in the app store to download the newest OS X... Is it possible to do it this way? Thanks for your feedback

  • Rotating Multiple Images

    Greetings, I just purchased Aperture and am currently working through the Apple Pro Training Series book 'Aperture 2'. In one of the lessons they walk you through how to manipulate (rotate) multiple images. No matter what I try I can't seem to rotate

  • Permission to assert Identity in weblogicDEFAULT realm

    Hi, Which users have the permission to assert identity in weblogic default realm? Is it only the "system" user? The user gets authenticated using the username token at ws-security runtime and the currentsubject has only the authenticated user as the