Using stored function in the Report Trigger

I have faced this problem in Reports6.0.
When a stored function is called in the after form trigger as
below
val := func1(abc,def);
the report is hanging
If I write like this i.e.,
select func1(abc,def) into val
from dual;
it is working fine . Is this a bug ? Or Is there any reason
behind it . Please Clarify !
ThanX in Advance !
Rajesh Mudiganti
null

Hi,
You can define your own PF-STATUS and in that assign the function code for BACK button anything except 'BACK'.
The code would somewhat look like this:
SET PF-STATUS 'TEST'.
write : itab-col1,
           itab-col2.
in the PF-STATUS 'TEST', assign the function code to BACK button as 'BCK'.
Now in your program you can use the event AT USER-COMMAND.
In this you can handle the functionality of BACK button.
Hope this helps.
Regards,
Himanshu

Similar Messages

  • How to use oracle functions in Crystal Reports XI using Oracle Server

    Hi all,
    Is it possible  to use oracle functions in Crystal Reports XI using Oracle Server as Data Source.
    If i try to use a procedure,i am getting error with message "Invalid Arguement Provided".
    Functions are not visible objects like tables,views and stored procedures.
    The  jdbs driver i m using is oracle.jdbc.driver.OracleDriver.

    I think it is not possible to add functions in crystal directly for any database. You need to use those functions in a stored procedure and add that storedprocedure as a datasource.
    [https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333233353335333833323333%7D.do]
    regards,
    Raghavendra

  • Using Match function in FR Reports

    Hi,
    Can anyone pls. let me know how i can use Match function in FR ? I've a Report where i'm using 2 Grids. In one Grid1 i'm using Entity under page and ICP dimension as Column. In Grid2, i'm using ICP under page and would like to use Match function where the condition is, if i select ICP member from Page, it should show the corresponding Entities in Grid1
    Thanks,
    PVR

    I don't think what your trying to do is available "out of the box", we have used a workaround to do what you want:
    - include idescendants for the member but apply suppression on the member names that ended in rollup.
    (we were lucky in that the parent members were standardized to contain rollup as the description name).
    Cheers, Iain

  • How to use db2 function in the HQL

    hello
    i am newbie to hibernate, now i am choosing a solution for my project, in this project, it use db2 function in the sql clause as follow:
    insert into idstool.access(userid,node,password) values('userid','nodename',encrypt('password','nodename'));
    i wonder if i can implement such function by using hibernate, that is if hibrenate can use the db2 function, or user-defined sql functions? if yes, how?
    thanks for any helps

    I think you'll find that you can do this through HQL. You also have the option of invoking a stored procedure or invoking native SQL in tandem with the normal Hibernate options.

  • DBMS_XMLQuery behavior when using stored function within cursor select

    Consider the following SQL Statement
    select t1.id
    , t1.name
    , cursor ( select t2.id
    from tab t2
    where t2.t1_id
    = t1.id
    and validate(t2.xyz,:bd1)
    = 1
    from tab t1
    where t1.id = :bd2
    DBMS_XMLQuery is used to create a context and to bind the appropriate values. In this case 'validate' is a stored function. I get the following error message upon execution:
    ORA-29532: Java call terminated by uncaught Java exception:
    java.sql.SQLException: Missing IN or OUT parameter at index:: 1
    Issuing a similar statement in SQL*Plus works fine. I was wondering whether this is a known issue when using a stored function in the cursor select statement in the context of DBMS_XMLQuery or whether I'm doing something wrong.

    Hi Jan,
    This problem has been identified and fixed. The fix should be available in the next release. Thank you for bringing this up to our attention.
    visar

  • The Problem is about Standard Back Button Function in the Report Program.

    The Problem is about Standard Back Button Function in the Report Program.
    In the Report,First call screen Then Using "write" output some information,That is ok. but In the GUI When I press back button that is standard button,it exit screen to program.
    My question is how can i do When i press back button,the screen can be back forward first screen instand of exit screen to program. Thanks .

    Hi,
    You can define your own PF-STATUS and in that assign the function code for BACK button anything except 'BACK'.
    The code would somewhat look like this:
    SET PF-STATUS 'TEST'.
    write : itab-col1,
               itab-col2.
    in the PF-STATUS 'TEST', assign the function code to BACK button as 'BCK'.
    Now in your program you can use the event AT USER-COMMAND.
    In this you can handle the functionality of BACK button.
    Hope this helps.
    Regards,
    Himanshu

  • Using substring function in the dashboard prompt

    Hi,
    I want to use a function in the dashboard prompt.
    Example: Subject Area:Paint --> Products --> Color
    I want to take second letter of color, describe a label for it and use this label in prompt. The formula is below;
    CASE WHEN (SUBSTRING(Products.Color FROM 2 FOR 1) = 'a') THEN 'AAA' ELSE 'BBB' END
    Dashboard prompt should list 3 choices; All choices, AAA, BBB.
    When selecting AAA in the prompt, these colors should be listed in the request; Carriage House Red, Dante, Manchester Red.
    I created a dashboard prompt (add a function) and a request. When selecting AAA in the prompt, it sends "AAA" as prompt, not sends "a". So I couldn't reach the result.
    Is it possible? Could anyone help me ASAP?
    Thanks & Best Regards,

    Create a column in the logical layer using the same formula that you described. Then use the new column in the prompt. Then add the new column to the report as 'is prompted'.

  • Adding a stored Procedure to the Report

    Hi,
    I am developing a report using crystal plugin in eclipse.I have problems in adding a stored procedure to the report .I write the following command in SQL SCRAPBOOK dbo.StoredProcedure @Param1="param1",@Param2="param2",@Param3="None" and run it. It runs successfully ,but when i try to add it to report nothing is being added to it.
    I am using a Sybase database and driver(com.sybase.jdbc3.jdbc.SybXADataSource)
    Any suggestions regarding this would be of great help.
    Thanks in advance
    Siva
    Edited by: Siva_velicheti on Jun 1, 2010 12:10 PM

    Hmm, not sure about stored procedures, but you can get SQL queries to work like below....
    @method to get ResultSet from SQL query with user, pwd, and dbConnectionInfo
    @param query, scrollType, user, password, dbName, db
    @throws SQLException 
    @throws ClassNotFoundException
             private static ResultSet getResultSetQueryDBInfo(String query, int scrollType, String user, String password, String dbName, String db)
             throws SQLException, ClassNotFoundException
                  String DBUSERNAME =  user;
                  final String DBPASSWORD = password;
                  final String CONNECTION_URL = "jdbc:oracle:thin:@" + dbName + ":1521:" + db;
                  Connection connection = DriverManager.getConnection(CONNECTION_URL, DBUSERNAME, DBPASSWORD);
                  DatabaseMetaData meta = connection.getMetaData();
                  System.out.println("getResultSetQueryDBInfo - Connected to URL : " + meta.getURL());
                  System.out.printf("getResultSetQueryDBInfo - as user: %s\n", meta.getUserName() );
                  Statement statement = connection.createStatement(scrollType, ResultSet.CONCUR_READ_ONLY);
                  System.out.println("getResultSetQueryDBInfo method - executing query: \n");
                  return statement.executeQuery(query);

  • How to use SQL functions in the queries

    hey guys i wanna know how to use SQL functions in the queries is it possible or not .

    Hi,
    Wat exactly that set values are?
    those from sql query?
    How to use count():
    The COUNT() function returns the number of rows that matches a specified criteria.
    SQL COUNT(column_name) Syntax
    The COUNT(column_name) function returns the number of values (NULL values will not be counted) of the specified column:
    SELECT COUNT(column_name) FROM table_name
    SQL COUNT(*) Syntax
    The COUNT(*) function returns the number of records in a table:
    SELECT COUNT(*) FROM table_name
    SQL COUNT(DISTINCT column_name) Syntax
    The COUNT(DISTINCT column_name) function returns the number of distinct values of the specified column:
    SELECT COUNT(DISTINCT column_name) FROM table_name
    The IN function helps reduce the need to use multiple OR conditions.
    The syntax for the IN function is:
    SELECT columns
    FROM tables
    WHERE column1 in (value1, value2, .... value_n);

  • Can you use information obtained in the report to use as output?

    I am wondering if in XI R2 or 2008 you can use infomation obtained in the report generation to use in output parameters?   For example, if my results come back with email addresses, can I then use them to email to?

    There are several export options.  But how about this solution:
    Insert a text object on the detail line with the text "E-mail: ".  Then drag the data field of the company/person's name and drop it in the text at the end.
    Then, right-click the text, and select "Format Text...".  Then click the Hyperlink tab and select "An EMail Address".  Below, for the e-mail address, it says "mailto:" but you don't want a static address.  So click on the formula button on the right.  For the formula, enter "mailto:" +
    When you run the report, you'll see "E-Mail: John Doe" but when you click on it, it'll open a mail message window with the address as the recipient.  (The names of the victims in this example have been changed, to protect the innocent   )
    I'm sure there are several other ways to accomplish your goal, but without more info on your situation, I can only guess that this is the best one.

  • How can i insert character data in a table using the report trigger

    well here is my query
    do_sql ('insert into report_trigger_details values(po report,before parameter)');
    i need to to insert data from within the report using the before parameter form trigger.Error is as follows:
    error: rep-1425,cant parse the statement,missing comma
    This error got removed by removing the space in ''po report" and before parameter"
    Now the error that i get is :ora-00984:column not allowed here
    Also i need to keep the spaces between the values while inserting data
    Please help!!!
    Thanks
    Edited by: 924271 on Mar 29, 2012 7:02 AM
    Edited by: 924271 on Mar 29, 2012 7:07 AM
    Edited by: 924271 on Mar 29, 2012 7:08 AM

    I know this isnt a great way of using query but its part of the assignment ,so any help will be greatly appreciated.
    Here it is again......
    function BeforePForm return boolean is
    segment2 varchar2(10);
    begin
         srw.message(001,'I just got executed first');
    srw.do_sql('select segment1 into :segment2 from xxmssl_po_headers_all');
    srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'')');
    srw.do_sql('commit');
    return (TRUE);
    end;
    the that i was getting earlier was resolved by using two single quotes....Now the error is....
    Error: error putting value in column....
    column 'segment2' may not be referenced by parameter triggers..
    The insert ran fine until I changed the above function as follows:
    function BeforePForm return boolean is
    segment2 varchar2(10);
    type_code varchar2(10);
    org_no number(4);
    begin
         srw.message(001,'I just got executed first');
    srw.do_sql('select segment1,type_lookup_code,org_id into :segment2,:type_code,:org_no from xxmssl_po_headers_all');
    srw.do_sql('insert into report_trigger_details values(seq2.nextval,:segment2,''po report'',''before parameter form'',''po number is'':segment2 '',type_code is'':type_code '',org_no is'':org_no )');
    srw.do_sql('commit');
    return (TRUE);
    end;
    When i ran it ,it started giving the above mentioned error.I reverted the changes back and recompiled my report but still getting the same error....
    Thanks in advance
    Edited by: 924271 on Mar 29, 2012 11:59 PM
    Edited by: 924271 on Mar 30, 2012 12:11 AM

  • Using a function in a report query

    Why can't I call a function (basically a query) in a report query like I can from from SQL?
    Consider the following:
    Select MyFunctionName(arg) from dual;
    From SQL, it works great! No problem:
    In a report query, [Application/Shared Components/Report Queries] It doesn't work. I get an XML error:
    XML Parsing Error: not well formed
    <MyFunctionName('arg')>&lt;?xml version="1.0"?&gt;
    ----------------------^
    Why?
    Looks like APEX is not even executing the function...
    See I have a table with a CLOB field that contains properly formatted HTML. I cannot simply query for that content, since Oracle escapes the tags in the conversion to XML. I have to (somehow) tell Oracle to keep it's grubby mitts off my CLOB content. As far as I can tell, using DBMS_XMLGEN.setConvertSpecialChars is the only way to keep Oracle from escaping the html stored in the table--in fact, the DBMS_XMLGEN documentation states that it why this functionality exists in the first place!
    This is why I am trying to use a function. Simply queries don't work. The function I wrote works beautifully in SQL, but not in a report query...
    Edited by: Vorlon on Aug 5, 2010 1:20 PM

    Note from the first post:
    "In a report query, [Application/Shared Components/Report Queries]" Let me clarify: This report query is used in a BI Publisher report. Getting the information to the screen isn't the problem. I have that working. :-) It's just when I try to get the report to print that I see APEX has escaped the output before reaching BI Publisher--so BI Publisher is not the issue. I have a xsl template that will process the embedded HTML, but APEX is escaping my data before I can act on it. In other words:
    It seems Apex is not creating the XML properly, since it escapes everything. Even when the function passes back data correctly.
    Has anyone else seen this? Ideas for a workaround?
    Thanks!

  • Using stored procedures within Crystal Reports

    Hello all,
    Background Information:
    I am trying to teach myself how to execute a stored procedure within Crystal Reports.  This is an aspect of Crystal that my work group has not utilized before and we're trying to gather information on the subject.  We use Oracle to create and execute functions and procedures all the time, but I've never tried this within Crystal.
    I use the "Add Command" functionality within Crystal on most of my reports so that I can taylor the sql to the report.  I find this easier to do versus using the ODBC connection to the tables and writing the code through the Crystal Reports wizard.  I also frequently use functions within these sql statements that are inserted in the Add Command.
    What I'm trying to achieve:
    I have a report that needs to run as a "trial", and then later as a committed "run".  This is for a monthly billing system.  Essentially, the user will run the report as the "trial", preview the data, make any necessay corrections, and then later, run the actual billing run.  Within my application, the bills are not actually marked as "billed" until they are actually "billed', if that makes sense.  As a result, the "trial" report will need to mark the bills as "billed", generate the report, and then rollback the data (so that the bills are not "billed".  Once the actual billing reports are ran, the same report will run, but with a "commit" at the end of the report so that the bills are now "billed".
    I'm trying simple tests and failing (i.e. taking baby steps to learn what capabilities Crystal has):
    I created as simple of a procedure as I can envision.  This procedure inserts the word "test" in one of my fields for a provided account number.  When I try to run this procedure via Crystal (via New Report ->History->My ODBC Database link->Stored Procedures), Crystal asks for the account number parameter, as it should.  But I then receive the error message:
    Database Connector Error: '42000:[Microsoft][ODBC driver for Oracle]Syntax error or access violation'
    The existing ODBC connection has work great for years and years to retrieve data from tables, but this is the first time I've tried to utilize procedures.  Can anybody help?  And can anybody explain what the Stored Procedures link is supposed to do?  Am I going down the right path?
    thanks,
    Noel

    Hello,
    Make sure the Oracle client install path is in the PATH statement. And also make sure you are using an IN/OUT cursor. CR only reads the last SELECT statement. Search the Documents area on how to create a Stored Procedure.
    Also, if you are using CR XI ( 11.0 ) then upgrade to CR XI R2 and apply all service packs ( SP 6 ). Go to this link: http://www.sdn.sap.com/irj/boc and download the trial version of CR XI R2 and use your XI keycode, then apply the patches which you can get to by clicking on the BusinessObjects tab above, then Downloads.
    Direct link to the Trial version: http://www.sap.com/solutions/sapbusinessobjects/sme/freetrials/index.epx
    It may fix your issue also.
    Thanks again
    Don

  • Trouble using a function in the where clause

    Hello,
    I am using a function found at ask.tom.oracle.com which converts a long data type to a character. The function is returning an error when it is placed in the where clause. The sql statement , error message and the function from ask tom are shown below. Does anyone know how to fix this?
    <pre>
    SELECT A.FLDPHYSICAL,
    A.FLDEXPOSURE,
    A.FLDDATEDUE,
    A.FLDDATELAST,
    A.FLDEMPLOYEE,
    B.FLDBDATE,
    B.FLDMAILSTOP,
    B.FLDREC_NUM,
    B.FLDLNAME,
    B.FLDMI,
    B.FLDFNAME,
    B.FLDBDATE,
    B.FLDDEPT,
    B.FLDSTATUS,
    B.FLDSSN,
    B.FLDHOMEPHON,
    B.FLDWORKPHON,
    B.FLDID,
    B.FLDDIVISION
    FROM REQEXAM A,
    EMPLOYEE B,
    EMPLOYEE_MEMO C
    WHERE A.FLDEMPLOYEE = B.FLDREC_NUM
    AND b.flduserstr = c.fldrec_num
    AND OHM_PKG.GET_LONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'
    AND A.FLDDATEDUE > '01/01/1900'
    AND A.FLDPHYSICAL ='CDP'
    ORDER BY B.FLDDIVISION,
    B.FLDLNAME,
    B.FLDFNAME,
    B.FLDMI,
    A.FLDDATEDUE
    The error message
    Error at Command Line:26 Column:4
    Error report:
    SQL Error: ORA-00904: "OHM_PKG"."GET_LONG": invalid identifier
    00904. 00000 - "%s: invalid identifier"
    create or replace
    PACKAGE OHM_PKG AS
    /* TODO enter package declarations (types, exceptions, methods etc) here */
    function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2;
    END OHM_PKG;
    create or replace
    PACKAGE BODY OHM_PKG AS
    function getlong( p_tname in varchar2,p_cname in varchar2,p_rowid in rowid ) return varchar2 as
    l_cursor integer default dbms_sql.open_cursor;
    l_n number;
    l_long_val varchar2(4000);
    l_long_len number;
    l_buflen number := 4000;
    l_curpos number := 0;
    begin
    dbms_sql.parse( l_cursor,
    'select ' || p_cname || ' from ' || p_tname ||
    ' where rowid = :x',
    dbms_sql.native );
    dbms_sql.bind_variable( l_cursor, ':x', p_rowid );
    dbms_sql.define_column_long(l_cursor, 1);
    l_n := dbms_sql.execute(l_cursor);
    if (dbms_sql.fetch_rows(l_cursor)>0)
    then
    dbms_sql.column_value_long(l_cursor, 1, l_buflen, l_curpos ,
    l_long_val, l_long_len );
    end if;
    dbms_sql.close_cursor(l_cursor);
    return l_long_val;
    end getlong;
    END OHM_PKG;
    </prev>

    Remove the '_' from the function's name as below:
    AND OHM_PKG.GETLONG('EMPLOYEE_MEMO', 'FLDDATA', C.ROWID) LIKE '%CDL YES%'

  • How to use stored procedure in crystal report for eclipse

    Hi;
    I am working on crystal report for eclipse 2.0 and  trying to use stored procedure in report .It is created from Oracle but it is not showing any dependencies
    CREATE OR REPLACE procedure ACT_DB.getCostTransferDetails
            p_In_Contract_ID         varchar2 DEFAULT  '*',
            p_In_Status_ID           varchar2 DEFAULT  '*',
            p_In_COST_TRAN_DATE      varchar2 DEFAULT  '*',
            p_In_DEPT_ID             varchar2 DEFAULT  '*',
            p_In_PROJECT_ID          varchar2 DEFAULT  '*',
            p_In_EMPLOYEE_ID         varchar2 DEFAULT  '*',
            p_Out_CostTransfer_Cusor OUT COST_TRANSFER_PACKAGE.COST_TRANSFER_TYPE
    AS
    BEGIN    
            OPEN p_Out_CostTransfer_Cusor FOR
            SELECT
                header.cost_tran_id,
                header.cost_tran_date,
                header.total_credit_amount,
                header.total_debit_amount,
                header.transfer_status,
                header.updated_by,
                header.added_by,
                header.trf_over_ninety_days,
                header.business_unit_id,
                header.equip_approval,
                header.batch_desc,
                details.opr_unit_id,
                status.status_id,
                details.fund_code_id,
                details.prgm_code_id,
                details.class_id,
                details.activity_id,
                details.product_id,
                details.status_id,
                details.transaction_amount,
                details.jrnl_date,
                details.adjust_prcnt,
                details.adjust_amnt,
                details.details_equip_approval,
                details.detail_desc,
                details.account_id,
                details.project_id,
                details.dept_id,
                details.contract_id,
                details.reason_code_id,
                details.jrnl_id,
                employee.f_name,
                employee.l_name,
                employee.employee_id,
                project.project_id,
                project.project_status,
                --header.transfer_status,
                contracts.contract_desc 
              FROM header, details, status, employee, department, project, contracts
             WHERE     (header.cost_tran_id = details.cost_tran_id)
                    AND (header.cost_tran_date = details.cost_tran_date)
                    AND (header.transfer_status = status.status_id)
                    AND (department.dept_id = details.dept_id)
                    AND (department.dept_id = employee.dept_id)
                    AND (project.project_id = details.project_id)
                    AND (contracts.contract_id = details.contract_id)
                    AND (details.Contract_ID = p_In_Contract_ID OR p_In_Contract_ID ='*' )
                    AND (header.TRANSFER_STATUS = p_In_Status_ID OR p_In_Status_ID ='*' )
                    AND (TO_CHAR(details.COST_TRAN_DATE, 'MM/DD/YYYY') = p_In_COST_TRAN_DATE OR p_In_COST_TRAN_DATE ='*' )
                    AND (details.DEPT_ID  = p_In_DEPT_ID  OR p_In_DEPT_ID  ='*' )
                    AND (details.PROJECT_ID  = p_In_PROJECT_ID  OR p_In_PROJECT_ID  ='*' )
                    AND (header.ADDED_BY  = p_In_EMPLOYEE_ID  OR '*'=p_In_EMPLOYEE_ID  )
    Can any another way to make procedure
    Thanx
    Regards ,
    Amol

    Hi Amol,
    Are you able to execute your stored procedure from oracle?.
    - If "Yes" then use  the Crystal Report XIR2 Designer to create the report.
    - Import this report in the Crystal Report For Eclipse Workbench.
    - The latest version for Crystal Report For Eclipse is SP1.
    Please let me know the results.
    Thanks,
    Neeraj

Maybe you are looking for