How to reference Report level program unit in report query?

I have created a report level function FREF13 which returns a VARCHAR2 variable. I am trying to reference this function in report SQL statement like:
select * from wtr where file_ref = FREF13(:fref)
I am getting error 'ORA-00904: Invalid column name' error. This is because it is unable to recognize FREF13 as local function.
Is it possible to reference local program units in report query?
Rgds,
Manish

No, it's not possible. The only things you can reference in a SQL query are columns and functions accessable in the database (since this is where the query is executed). You should create the function in the database.
Regards,
Danny

Similar Messages

  • Created below function (program units) in report builder

    hi all,
    I created below function (program units) in report builder and added two insert statements to know how much time it is taking to execute.Report is executing successfully but no rows inserted into tale testtime.
    Is there any other way to know the execution time of this function.
    Please help me
    function CF_TYPEFormula return Char is
    begin
         insert into testtime values(sysdate,1,'CF_TYPEFormula');
      IF(:CATG0=1)
           THEN RETURN ('MOVING STOCK');
           insert into testtime values(sysdate,1,'CF_TYPEFormula');
      ELSE RETURN('NON-MOVING STOCK');
      END IF;
      insert into testtime values(sysdate,1,'CF_TYPEFormula');
      commit;
    end;Edited by: maddy on 26 Dec, 2011 8:46 PM
    Edited by: maddy on 29 Dec, 2011 9:25 PM

    Shashank,
    Try,
    function CF_TYPEFormula return Char is
    Str_Ret_Val VARCHAR2(100);
    BEGIN
       INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       IF(:CATG0=1) THEN
          Str_Ret_Val := 'MOVING STOCK';
          INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       ELSE
          Str_Ret_Val := 'NON-MOVING STOCK';
       END IF;
       INSERT INTO TESTTIME VALUES(SYSDATE, 1, 'CF_TYPEFormula');
       COMMIT;
       RETURN Str_Ret_Val;
    END;Regards,
    Manu.

  • How to do register-level programming for NI6025E when I want to acquire single scan incuding multiple input channels?

    How to do register-level programming for NI6025E when I want to acquire single scan incuding multiple input channels?

    Thanks, Alan, I think I indeed need to combine aiex1.cpp and aiex2.cpp. I made a change to Configure_Board of aiex1.cpp  as follows:
    //Call this function to configure board options.
    void Configure_Board(tSTC *theSTC,tESeries *board)
     //Clear configuration memory
     theSTC->Write_Strobe_0.writeRegister(0x0001);
     //Clear ADC FIFO
     theSTC->Write_Strobe_1.writeRegister(0x0001);
     //Writing to Config_Memory_High_Register for channel 1 settings
     board->ConfigFifoHigh.setChannel(0);
     board->ConfigFifoHigh.setBank(0);
     board->ConfigFifoHigh.setChannelType(board->ConfigFifoHigh.kChannelTypeRSE);
     board->ConfigFifoHigh.flush();
     //Writing to Config_Memory_Low_Register for following channel 1 settings
     board->ConfigFifoLow.setLastChannel(0);
     board->ConfigFifoLow.setGeneralTrigger(0);
     board->ConfigFifoLow.setGain(board->ConfigFifoLow.kGain001_0);
     board->ConfigFifoLow.setPolarity(board->ConfigFifoLow.kPolarityBipolar);
     board->ConfigFifoLow.setDither(0);
     board->ConfigFifoLow.flush();
     //Writing to Config_Memory_High_Register for following channel 0 settings
     board->ConfigFifoHigh.setChannel(1);
     board->ConfigFifoHigh.setBank(0);
     board->ConfigFifoHigh.setChannelType(board->ConfigFifoHigh.kChannelTypeRSE);//RSE mode
     board->ConfigFifoHigh.flush();
     //Writing to Config_Memory_Low_Register for following channel 0 settings
     board->ConfigFifoLow.setLastChannel(1);
     board->ConfigFifoLow.setGeneralTrigger(0);
     board->ConfigFifoLow.setGain(board->ConfigFifoLow.kGain001_0);
     board->ConfigFifoLow.setPolarity(board->ConfigFifoLow.kPolarityBipolar);//BIPOLAR
     board->ConfigFifoLow.setDither(0);
     board->ConfigFifoLow.flush(); 
     return;
     and a change to test(iBus *bus):
    do
      uStatus = theSTC->AI_Status_1.readRegister();
      if (!((uStatus & 0x1000) == 0x1000))
        uValue[i] = board->AIFifoData.readRegister();
       i++;
     } while(i<1);
     printf("Value %d is %6.2f\n",0,FindADDouble(uValue[0]));
     printf("Value %d is %6.2f\n",1,FindADDouble(uValue[1]));
    but it doesn't work, why?
    How shoud I do?

  • How to reference the selected row on a report by click a radiobox

    I created a report with a column displayed as a radiobox.The report source is like "select htmldb_item.radiogroup(1,.....),rec_id,....from .... where ....",after click one radiobox,i want to get other column's value in the selected row in the after submit process ,can anyone help me?????? how to reference "rec_id" of the selected row?

    Hello,
    First, please tell us your first name, and update your forum handle. It’s make it easier to track your threads, and help you.
    >> apex_application.g_f01(1)" only return the first record's rec_id,if i click radiobox in other rows,it returns the same result as click radiobox in the first row?
    The ‘G_F01’ is an array of values, so apex_application.g_f01(1) will always bring you the first element of this array. If you want to retrieve other values from this array, which will include the values of the radiogroup value of the other lines, you need to use a loop. Something like that should work:
    for i in 1.. apex_application.g_f01.count loop
    … apex_application.g_f01(i) …
    end loop;
    >> after click one radiobox,i want to get other column's value in the selected row in the after submit process
    That means that the value of your radiogroup item should include some indication to the line you are on. If, like in Andy’s example, you can retrieve your record from a table, based on a PK, your radiogroup can return this kind of information. However, if the data on the other columns of the select raw, were just entered/updated by the user (like in a tabular form), the radiogroup item should include information about the row you are in, in order for you to be able to access the corresponding array elements – other G-Fxx arrays – of the other columns in the row. In this case, I believe using checkboxes is preferable.
    Regards,
    Arie.

  • Lexical Parameter in Reports 6i Program Unit

    A report I'm writing requires me to use the lexical parameter in a program unit rather than a query in the data model. Lexical parameters in a query have always worked with the example "WHERE &my_parameter". But using "WHERE :my_parameter" or "WHERE &my_parameter" in a program unit gave me the error "expression is of wrong type" so the code wouldn't compile in the editor.
    The parameter returns "segment1 = '8675309' AND segment2 = 'Jenny'I was able to resolve it by using the first column of the expression and the replace function on the parameter so the program unit editor thinks it's a valid expression and the resulting line is a valid predicate that gets the correct data. Here's my example:
    WHERE segment1 = replace(:my_parameter, 'segment1 = ')The replace function strips off the "segment1 = " from the lexical parameter so the resulting line that gets passed to the server is:
    WHERE segment1 = '8675309' AND segment2 = 'Jenny'This solution will not work where the parameter could return something other than "segment1 = " at the beginning of the parameter string like "segment1 BETWEEN " or a different column name to compare other than segment1. Anyway, this is working but if there are better ways to do it I'd like to try them. Using Reports 6i with EBS 11.5.10.2.

    Hello,
    You'll find explanations and examples here :
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/dmobj/sq_a_lexical_references.htm
    This documentation is for Reports 10.1.2 but is valid for Reports 6i too ...
    Regards

  • How to send patch level program changes from concert level instruments?

    Heya,
    Here's the gist of my setup:
    I have two concert level external instrument channel strips (Nord Electro 3 and Prophet 8 module). I am attempting to change the bank on the Electro 3 on a per patch basis. It seems as if the concert level nature of the channel strip is overriding my ability to change on a per patch basis. I am sending out a program change on a certain patch, and it is being reflected in all of the other patches across the concert (this is expected behaviour from reading the manual).
    I've been looking for a way to manually send the program changes on a per patch basis (for these concert level strips), using some sort variation of the override parent setting, but I've been unsuccessful at finding a method for doing this. Is it even possible?
    The behaviour I'm looking to replicate is easily accomplished by manually creating the external instrument channel strip in each of the patches, and then sending out the appropriate program change message. This isn't a problem to do. It is, however, a tad bit cumbersome and sort of defeates the purpose (in my opinion) of having concert level channel strips.
    Any wisdom would be appreciated.
    Cheers,
    Nick

    As far as I know the only way to send program changes is to create channel strips in every patch. I don't use concert level channel strips for that reason.
    One of the advancements is that you can level your external instrument on patch level.
    Tip: create one patch with the channel strips you need and duplicate that one (CMD-D) to create new patches. Works faster for me.

  • How to save pl/sql program unit in a file

    Could anyone please let me know how to save a pl/sql program in a program file. As per my knowledge Edit command is used to invoke the editor and save the program. But i am unable to use this command properly. I am using Oracle 10g on Linux

    One can edit SQL scripts and the command buffer (the last command entered) with the EDIT (or ED) command. However, sometimes one needs to select an editor before using this command. Examples:
    Use the Unix/Linux vi-editor:
    DEFINE _EDITOR=vi
    Use the Notepad on Windows:
    DEFINE _EDITOR=notepad
    PS: Add this command in your login.sql or glogin.sql scripts so it executes every time you start sqlplus.
    Does that answers your question?

  • How to reference a user parameter in program unit

    I tried to define a user parameter in Oracle Report 6i and I could reference it (&p_where_clause) in the main query but I failed to reference it in one of the program units. Here is the logic:
    function CF_OTHER_COURSESFormula return Char is
    cnt           number;
    priority     number;
    class_code     varchar2(8);
    oc           varchar2(100) := null;
    cursor oc_cur is
    select class_code, branch_priority
    from nominations n, employments e
    where n.hkic_no = e.hkic_no
    and e.staff_status_code = 'EMP'
    and &p_where_clause --> contain "n.course_code in ('A','B','C')"
    and n.hkic_no = :hkic_no
    and n.class_code != :class_code;
    begin
    cnt := 1;
    open oc_cur;
    loop
    fetch oc_cur into class_code, priority;
    if oc_cur%notfound then
         exit;
    end if;
    if cnt = 1 then
    oc := oc||class_code||'('||priority||')';
    else
    oc := oc||', '||class_code||'('||priority||')';
    end if;
    cnt := cnt + 1;
    end loop;
    close oc_cur;
    return oc;
    exception
    when no_data_found then      
    return '';
    end;
    Does anyone tell me how to reference it in program unit? Does Oracle Reports 6i support this operation?

    There hasn't been any changes to the way lexicals and bind variables work in Reports between 2.5 and 6i. There are different versions of PL/SQL and you might be hitting some problem here.
    In your case, you shouldn't be using the query lexical "&p_where_clause" just the PL/SQL bind variable syntax ":p_where_clause". Since you're creating a PL/SQL cursor, you should probably use dynamic sql creation with a concatenation of the where clause to build up the SQL for the cursor. Check out the PL/SQL documentation for this.

  • Help with using Program unit.

    How do I use a program unit. I am creating a procedure trying to understand how to use it.
    I added 2 parameters to the layout. :P1_TEST and :P2_TEST
    I created a simple program unit to place information into them
    procedure test is
    begin
    :P1_TEST := 'YES';
    :P2_TEST := 'NO';
    end;.
    When I run it nothing happens.
    Howard

    Hello,
    The procedure must be callled in order to initialize the parameters.
    In your case, you can call the procedure test in a Reports Trigger : the Before Report for example
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwwhthow/whatare/prgmobj/tr_1a_types.htm
    Regards

  • Dunning report driver program

    Hi,
       I see a dunning sap script z_asia_dunning assigned in Dunning procedure.  I am interested in knowing the driver program for this dunning script. 
      I searched in SDN and failed to get this information.  Please let me know how to get a driver program for dunning report.
    Thanks in advance
    Sudhaker

    ok it IS possible
    and well the table where those connections of driver programs and form are stored is (i hope you learned that by now from the earlier posts) TNAPR.
    you are a developer, so it´s not really neccesary for you to have a transaction to chance some record in a database table.
    I would propose the TA SE16N with the fcode &sap_edit.
    then just fill in your new (copied) driver program and save

  • Reporting Level - Can someone please explain this attribute?

    All - I am a relative newbie to Siebel on Demand but creating reports with other tools for years. I recently came across some reports that I have inherited that are constantly giving us trouble. They are basic reports that look at the count of calls, meetings, etc. for a given user. What we are finding is that we have used this reporting level attribute to filter but depending on the level of manager logging in it is causing problems. Some people can't see the data and some get a massive amount of duplicated data.
    When it is all said and done we are looking for a simple manager-to-rep list of the counts of these activities. After looking at the reporitng level value it would look like an indicator of relative position from the lowest level in the reports-to heirarchy. We will generally filter for a level = 0 (or maybe 1) in most reports but what I want is a way to control that based on the user. My requirement is to have the level they can see and the detail at one level lower but I dont' fully understand how that gets created or how I can use system variables to find the user's level to control it.
    Anyone that has any background info on this or how I can control a basic anaylytic report in a more maintainable fashion to show my stuff and subtotals at one level lower that would be greatly appreciated.

    Not sure if I can help with the specific report, but I will try to shed some more light on Reporting Level.
    In any report where the Owned By User dimension is exposed, you can find the Reporting Level field. Each user is part of a reporting hierarchy, derived from the "Reports To" value in their user profile.
    The best way to see this is to create a simple report with the User Email, Reporting Level, and Manager Email. This will show you the manager at each level. You can use this to expose and filter on the full management hierarchy.
    Level 0 = the user. All users have a value of themselves as Manager at Level 0.
    Level 1 = Reports To - who the user directly reports to.
    Level 2+ = Up the chain...
    You may want to take a look at some of the pre-built reports to see how this can be used to achieve Team based reports, such as "Team Pipeline Analysis", "Team Sales Effectiveness Analysis", and "Team Activity Analysis". You can open any of the pre-buiilt reports to use as starting points as well.

  • Plant level P&L/BS reporting

    I am looking for some advice on how to achieve Plant level P&L/BS reporting without having to configure the org structure using one company code per plant.
    We would like to group multiple plants under one company code and still be able to generate a P&L/BS reporting at the plant level.  The only way I have seen to do this is to set up business areas per plant.  My questions are...
    1.  Can this be achieved through Business Area?
    2.  Are there other ways to do this?
    Any guidance would be greatly appreciated.
    Thanks.

    hi
    i would always suggest using profit center wise balance sheets & P&L.
    Also segment wise reporitng is prefered if you are planning to report either geographically or as per product segments.
    segment wise reporting , as you are aware, is a mandate for IFRS, will be useful.
    if you are on new gl, segment reporting will give lot of in depth analysis for Managerial accounting.
    thanks
    eashwar

  • How can i incorpurate multiple operating unit feature in rdf(Custome AP Report)

    Hi, Team,
    i have a requirment is..will select 1 Operating unit need to get data for only that OU, if will provide Null value need to get data for ALL OU's.
    i am trying below script using in Report level 'AfterPForm'
    if :P_ORG_ID IS NULL THEN MO_GLOBAL.SET_POLICY_CONTEXT('M',null);
      ELSE MO_GLOBAL.SET_POLICY_CONTEXT('S',:P_ORG_ID);
      END IF;
    getting below error.
    Forcing NLS_NUMERIC_CHARACTERS to: '.,' for XDO processing APPLLCSP Environment Variable set to : Current NLS_LANG and NLS_NUMERIC_CHARACTERS Environment Variables are : AMERICAN_AMERICA.AL32UTF8 '.,' Enter Password: MSG-00000: And so it begins ... MSG-00001: After SRWINIT REP-1419: 'beforereport': PL/SQL program aborted. REP-0069: Internal error REP-57054: In-process job terminated:Terminated with error: REP-1419: MSG-00000: And so it begins ... MSG-00001: After SRWINIT REP-1419: 'beforereport': PL/SQL program aborted.
    but this report running fine for Single OU, that is the parameter value is provided.
    appriciate your assistence on this. need to clos this ASAP, please do the needfull.
    Thanks,
    Venkat.

    Hi,
    Just simple ...
    You can take the Operating Unit (OU as you said) in the where condition of you query...
    e.g.,
    where
    (p_parm_ou = :ou or :ou is null )

  • Generate txt output using a program unit in web report (OAS 10g)

    Hi Everyone.
    I have a c/s report (6i) which generates a txt file in a program unit using TEXT_IO package. I need to move this report to web (Reports 10g) and publishing it in OAS 10g. I've done that (without the text file generation), I can see the report on the browser in PDF Format and works fine... but, I still have a problem... when I use Text_io package, the c/s version of the report in 10g runs an generates the output.txt file but when I move it to web I got an error in the before report trigger (in which I invoke the program unit sp_generate_txt)
    I looked around for a solution and I just find the usage of webutil package, but as you know, webutil package is only usable in Forms.
    Any Ideas on how can I solve this problem?

    Hello,
    TEXT_IO can be used in Reports deployed on the web.
    The difference with Client /Server is the fact that the file create by TEXT_IO will be created on the "Middle Tier Server" and not on the Client.
    Regards

  • How to improve the query performance in to report level and designer level

    How to improve the query performance in to report level and designer level......?
    Plz let me know the detail view......

    first its all based on the design of the database, universe and the report.
    at the universe Level, you have to check your Contexts very well to get the optimal performance of the universe and also your joins, keep your joins with key fields, will give you the best performance.
    at the report level, try to make the reports dynamic as much as you can, (Parameters) and so on.
    and when you create a paremeter try to get it match with the key fields in the database.
    good luck
    Amr

Maybe you are looking for