Problem to create a link with parameters using a PL/SQL function body

Hi everybody,
I need some help to create a link on a SELECT statement.
I have a region report with type "PL/SQL function body return SQL query".
I would like to use a link using HTML tag <a href>.
I know how to do the link, but I don't know to pass a parameters in <a href> statement.
Always I tried it doesn't work well.
My PL/SQL anonimous block is, (just with link) :
DECLARE
q vARCHAR2(4000);
BEGIN
q:='select     "INDICADOR"."NRINDICADOR" as "NRINDICADOR",';
q:=q||'     "INDICADOR"."DSINDICADOR" as "DSINDICADOR",';
q:=q||'''<span style="font-weight:bold;">';
q:=q||'''||TO_CHAR("TOTAL_INDICADOR"."VL_INDICADOR", ''999G999G999G990D00'')||''</span>''';
q:=q||' as "VL_INDICADOR",';
q:=q||'     "TOTAL_INDICADOR"."VL_META" as "VL_META" ';
q:=q||' from     "TOTAL_INDICADOR" "TOTAL_INDICADOR",';
q:=q||'     "INDICADOR" "INDICADOR" ';
q:=q||' where "INDICADOR"."NRINDICADOR"="TOTAL_INDICADOR"."NR_INDICADOR"';
RETURN q;
END;
Thanks for any help,
Alessandra

Your code is in a default value for an item, right?
You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
Message was edited by:
Bill Carlisle

Similar Messages

  • Problem in creating Maintenance Order with multiple operations

    Hello all,
    I am facing problem while creating Maintenance Order with multiple operations and sub-operations. I am using BAPI : BAPI_ALM_ORDER_MAINTAIN.
    For single operation it is working fine,but i am unable to create MO with multiple operations and sub-operations.
    Please, provide me the inputs required,
    I have used methods :
    ORDER        CREATE,
    OPERATION CREATE
    and SAVE.
    Regards,
    Siddhartha

    Hi,
    The FM you are using is a perfect one. This FM is bit tricky to use. You need to perfectly pass the Reference number field. which links various input table parameters of this FM.
    Thanks & Regards,
    Navneeth K.

  • Problem in creating DB Link - Please help

    Hi ,
    I created a DB Link with name "CTM_DBLINK".
    i want to create DB Link with different name but using same server and connection also same.
    When i am trying this its shows error :
    "ORA-00933:SQL Command not properly ended."
    My Query :
    create public database link "CTM_BANK"
    connect to ABC
    identified by <pwd>
    using 'database';
    i am getting error on line 3 : identified by <pwd>
    Please help , its urgent.
    Surender

    Try enclosing the password in quotes.
    Same problem occurs if you try to create a user using the password you have given.
    SQL> create user abc identified by abc!;
    create user abc identified by abc!
    ERROR at line 1:
    ORA-00922: missing or invalid option
    SQL> create user abc identified by "abc!" ;
    User created.
    To create the database link, try this:
    SQL> CREATE PUBLIC DATABASE LINK "CTM_BANK" CONNECT TO "ABC"
    2 IDENTIFIED BY "abc!"
    3 USING 'database' ;
    Database link created.
    Hope that helps!
    Regards.
    RK

  • Problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2

    Hi experts,
    I'm getting problems in creating and storing new documents using BAPI_DOCUMENT_CREATE2.
    I have a scenario where is defined the document type ZC1, document part 200, authorization group 0002 and for all of these  documents the storage category "Cofre DMS1". And the status which demands the storage category is 'FR'.
    I've been fullfiling the BAPI_DOCUMENT_CREATE2 in this way:
    "Tables
    data: it_doc like bapi_doc_draw2,
          it_return like bapiret2,
          it_files like bapi_doc_files2 occurs 0 with header line,
          it_objs like bapi_doc_drad occurs 0 with header line.
    "Variables
    data: wl_doctype like bapi_doc_draw2-documenttype,
          wl_docnumber like bapi_doc_draw2-documentnumber,
          wl_docpart like bapi_doc_draw2-documentpart,
          wl_docversion like bapi_doc_draw2-documentversion.
    it_doc-documenttype = 'ZC1'.
    it_doc-documentpart = '200'.
    it_doc-documentversion = '00'.
    it_doc-description = 'Test of documents creation via BAPI'.
    it_doc-username = sy-uname.
    it_doc-statusextern = 'FR'.
    it_doc-authoritygroup = '0002'.
    refresh it_files[].
    clear it_files.
    it_files-originaltype = '1'.
    it_files-storagecategory = 'Cofre DMS1'.
    it_files-wsapplication = 'PDF'.
    it_files-docfile = 'c:\110307.pdf'.
    it_files-description = 'Test file'.
    append it_files.
    refresh it_objs[].
    clear it_objs.
    it_objs-objecttype = 'EKPO'.
    it_objs-objectkey = '47000497600010'.
    append it_objs.
    CALL FUNCTION 'BAPI_DOCUMENT_CREATE2'
      EXPORTING
        documentdata = it_doc
      IMPORTING
        documenttype = wl_doctype
        documentnumber = wl_docnumber
        documentpart = wl_docpart
        documentversion = wl_docversion
        return = it_return
      TABLES
        objectlinks = it_objs
        documentfiles = it_files.
    After execute the BAPI process I got the following error:
    E26 087 - Data carrier COFRE DMS1 not defined
    Does anybody have a sugestion to help me, please?
    Thks
    David
    Edited by: David Tsutsui on Mar 18, 2010 10:52 AM

    Please refer to this thread, it tells why you need a data carrier you can also configure the same in DC20.
    Data Carriers for Storage the Originals of DMS

  • Download link with parameters.

    I've created a generic download function that takes a couple of parameters. The function works but now I'm trying to find out how to provide a download link that has the parameters filled in based on some page items.
    Page items:
    P38_export_type: The user can select what kind of data to download
    P38_filename: The user can provide a filename
    What I've tried is to create a button: Redirect to URL
    #OWNER#.download_my_file?p_application_id=&APP_ID.&p_filenaam=&P38_FILENAME.&p_functie=Statistiek&p_parameter1=&P38_EXPORT_TYPE.
    Although this creates a link, the parameters are filled on page load. This is to early, I need the values at the time the button is pressed.
    Any ideas how to do this?

    Hi thanks,
    In the meantime I figured out something similar.
    function my_redirect ()
      redirect(html_GetElement('P38_OWNER').value+".download_my_file?p_application_id="+html_GetElement('pFlowId').value+"&p_filenaam="+html_GetElement('P38_BESTAND').value+"&p_functie=Statistiek&p_parameter1="+html_GetElement('P38_SOORT_EXPORT').value);
    } I struggled a bit with the owner value before I decided to put it in a hidden field. Passing it as a variable is a better idea.
    It seems that accessing the item values can be done in several ways.
    redirect or location.href=URL ? any preference?

  • How to create a view with parameters; read the documentation but nothing!

    Hello!
    I'm new to the Oracle world but together with my coworkers we need to very quickly study Oracle to figure out whether we'll add Oracle to our list of supported databases or not.
    Question: How do I create a view with parameters?
    I've read the documentation but I could not find this! I found the sql syntax to create a view but no parameters whatsoever...
    I have found on the web some very complicated way of doing this, but doesn't Oracle support Views with parameters?
    The goal here is to return a recordset, don't forget, so,please don't speak about stored procedures unless you are going to tell me how to get a recordset out of a stored procedure! ;)
    Thanks for all your help and attention!
    Jorge C.

    You can set up a parameterized view via context as follows:
    1. Set up a procedure to set your context values:
    create or replace procedure p_set_context (p_context IN VARCHAR2,p_param_name IN VARCHAR2,p_value IN VARCHAR2)
    as
    BEGIN
    sys.dbms_session.set_context(p_context,p_param_name,p_value);
    END;
    2. Create your context using the procedure you just created
    create or replace context my_ctx using p_set_context
    3. This is the test table I'll use
    create table my_table(col1 number)
    and populate it:
    begin
    for v_index in 1..10
    loop
    insert into my_table values(v_index);
    end loop;
    end;
    and the view that will be parameterised
    create or replace view v_my_table as select col1 from my_table where col1 between sys_context('my_ctx','start_range') and sys_context('my_ctx','end_range')
    4. Now set the parameters using the procedure above.
    begin
    p_set_context('my_ctx','start_range','1');
    p_set_context('my_ctx','end_range','5');
    end;
    5. Selecting from my_table will give you 1 to 10 (no surprise there :-) )
    selectng from v_my_table will give you 1 to 5
    You can use the context to set formats etc using the same principle. A common gotcha to watch for is trying to set the context directly using DBMS_SESSION.SET_CONTEXT instead of creating a procedure. This belongs to SYS and SYS won't have the privileges to set your context so you get an insufficient privileges result leading to much headscratching and unnecessary grants (at least that's my understanding of it).
    Sorry Jorge, as you're new to Oracle I should also have pointed out for completeness sake, that you can change the parameters at any time through recalling the p_set_context, for example, following on from above, after your "select * from v_my_table" and seeing 1 to 5, you could then do
    begin
    p_set_context('my_ctx','start_range','3');
    end;
    and when you requery 'Select * from v_my_table' you will now see rows 3 to 5.
    Bit of a simplistic example, but you can see how easy it is. :-)
    Message was edited by:
    ian512

  • Problem while creating XDO Report with PL/SQL

    hi,
    i am trying to create
    1.created XDO Report with the help of PL/SQL which takes two parameters and code for writing XML tags to output file
    2.created concurrent program that will call the PL/SQL pkg
    here i am trying to create the xml out put bu t i am stuck with some errors below is the code
    create or replace
    PACKAGE AgentTimeReport_XDO_pkg AS
    TYPE srdaterange_rec is RECORD (
    fromsrdate varchar2(20 byte),
    tosrdate varchar2(20 byte)
    Type agent_table IS TABLE OF srdaterange_rec INDEX BY BINARY_INTEGER;
    procedure GetAgentTimeList(o_errbuf  OUT VARCHAR2
                   ,o_retcode             OUT VARCHAR2,p_fromsrdate IN varchar2,p_tosrdate IN varchar2);
    END AgentTimeReport_XDO_pkg;
    create or replace
    PACKAGE BODY AGENTTIMEREPORT_XDO_PKG AS
      procedure GetAgentTimeList(o_errbuf  OUT VARCHAR2
                   ,o_retcode             OUT VARCHAR2,p_fromsrdate IN
    VARCHAR2,p_tosrdate IN VARCHAR2 )
    IS
    cursor cs_agenttime(p_fromdate IN VARCHAR2,p_todate IN VARCHAR2)
    is
    SELECT  
      incident.Incident_Number as ServiceRequestNumber,
      TO_CHAR (incident.incident_date,'DD-MON-YYYY') as ServiceRequestDate,
      incident.Summary as Summary,
      agenttime.agentname as AgentName,
      to_char(agenttime.agentstarttime,'DD-MM-YYYY HH24:MI') as StartTime,
      to_char(to_date('00:00:00','HH24:MI:SS') +
      (agenttime.endtime-agenttime.agentstarttime), 'HH24:MI') as TimeSpent 
    FROM cs_incidents_all_b incident,cs_agenttime_agv agenttime
    WHERE agenttime.incident_id=incident.incident_id
    AND incident.incident_date between to_date(p_fromsrdate,'DD-MON-YYYY')
    AND to_date(p_tosrdate,'DD-MON-YYYY');
      BEGIN
        /*First line of XML data should be ‘<?xml version="1.0" encoding='utf-8'?>’*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<?xml version="1.0" encoding="utf-8"?>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<AGENTTIME>');
    FOR cs_agent IN cs_agenttime(p_fromsrdate,p_tosrdate)
    LOOP
    /*For each record create a group tag <G_AGENT_TIME> at the start*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<G_AGENT_TIME>');
    /*Embed data between XML tags for ex:- <EMP_NAME>Abeesh</EMP_NAME>*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_NUMBER>' ||
    cs_agent.ServiceRequestNumber 
                                    || '</SERVICEREQUEST_NUMBER>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<SERVICEREQUEST_DATE>' ||
    cs_agent.ServiceRequestDate ||
                                       '</SERVICEREQUEST_DATE>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<START_TIME>' || cs_agent.StartTime
                                     ||'</START_TIME>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'<TIME_SPENT>' || cs_agent.TimeSpent
                                     ||'</TIME_SPENT>');
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</G_AGENT_TIME>');
    END LOOP;
    /*Finally Close the starting Report tag*/
    FND_FILE.PUT_LINE(FND_FILE.OUTPUT,'</AGENTTIME>');
      END GetAgentTimeList;
    END AGENTTIMEREPORT_XDO_PKG;any one help me
    the log file
    Service: Version : 12.0.0
    Copyright (c) 1979, 1999, Oracle Corporation. All rights reserved.
    DEMOXDO module: DemoAgentXDO Report
    Current system time is 28-JUL-2009 05:16:46
    **Starts**28-JUL-2009 05:16:46
    ORACLE error 1861 in FDPSTP
    Cause: FDPSTP failed due to ORA-01861: literal does not match format string
    ORA-06512: at "APPS.AGENTTIMEREPORT_XDO_PKG", line 9
    ORA-06512: at "APPS.AGENTTIMEREPORT_XDO_PKG", line 25
    ORA-06512: at line 1
    The SQL statement b
    Start of log messages from FND_FILE
    End of log messages from FND_FILE
    Executing request completion options...
    Finished executing request completion options.
    Concurrent request completed
    Current system time is 28-JUL-2009 05:16:46
    ---------------------------------------------------------------------------

    Hi,
    Please see if these documents help.
    Note: 367607.1 - FDPSTP Failed Due to ORA-01861: Literal Does Not Match Format String
    Note: 370272.1 - not able to run the report set having unsupported date format of fnd-date4
    Note: 376034.1 - How to Handle New Date Formats in SQL*Plus and PL/SQL Procedures?
    Regards,
    Hussein

  • Error while creating sales order with ref using SD_SALESDOCUMENT_CREATE

    Hi
    I am creating sales order with reference using function module SD_SALESDOCUMENT_CREATE , while creating i am getting error
    Document doesn't have document category even thougth i am passing document category in header as well as item lavel.
    In VBUK table there is no value for VGTYP.
    Can you please help me how to resolve it.
    Thanks & regards
    kiran

    Problem resolved by passing   REFDOC_CAT in the FM along with  SD_DOC_CAT.
    Thanks

  • How to create a link with an anchor outside of the edge animation ?

    Hello
    I want to know if it's possible to create a link with an anchor that is placed outside of the edge animation , on the same page ?
    Tanks

    Is it... very likely..., javascript is javascript...Has anyone yet? Maybe i haven't looked.
    You only need 3 files... not including "Edge Includes" and "External Art Assets"
    NAME_edge.js
    NAME_edgeActions.js
    NAME_edgePreload.js
    The advantage of Edge being that u have the "power" to do whatever you like, but as with new things it takes awhile to figure it all out.

  • I am creating a slideshow with elements using photos and videos but the video sound doesnt play?

    I am creating a slideshow with elements using photos and videos but the video sound doesnt play?

     Hello jive
         I am playing it back in the slideshow editor/setting up part of
    programme where you determine photos/video to be included gaps between
    slides, music to play etc This goes through each phot and when comes
    to a video the background sound doesnt play, I am using windows 7 and
    elements 10.
         regards gins51

  • Create a line with arcs using new SdoApi (not liniear)

    Hi
    How we create a line with arcs using sdoapi (not liniear line)?
    Philipp

    Philipp,
    You have to use the default constructor for JGeometry
    to build lines with arcs:
    public JGeometry(int gtype,
    int srid, double x, double y, double z,
    int[] elemInfo, double[] ordinates)
    Currently, this is the only way to create lines with arcs.
    siva

  • I need to create a link with confirmation..

    Please I need a help o this :
    I need to create a link with confirmation, it means that after clicking the link it does not redirects to the next page, but first it displays a question like "Are you sure you want to go to page XYZ" ? Yes / No  .If you click "No"  then message just dissapears, if you click "Yes" it goes to the next page...
    Any dea ? thanks in advance...

    <a href="XYZ.php" onclick="return confirm('Are you sure you want to go to page XYZ?')">XYZ.php</a>

  • Problem with PL/SQL Function Body

    Hi,
    I'm getting the following error, when i run the report.
    I'm trying to fetch a year value from a table based on a parameter value ":P33_YEAR"
    ORA-01403: no data found
    Error ERR-1904 Unable to compute item default: type = Function Body computation_type= DECLARE FY VARCHAR2(6); BEGIN SELECT DISTINCT YEAR1 INTO FY FROM REP WHERE YEAR = TRIM(:P33_YEAR);
    RETURN FY; END;.
    I have written this code in a PL/SQL Function Body for a Hidden item.
    Please let me know whats wrong with this code?
    Thanks
    CK
    Message was edited by:
    user536304

    Your code is in a default value for an item, right?
    You need to make sure :P33_YEAR is not null and handle the error in the PL/SQL if it is.
    How is P33_YEAR populated? do you pass it in? check to see if it is making it there..
    Message was edited by:
    Bill Carlisle

  • How to use a select list value in a PL/SQL function body returning SQLquery

    Hi Friends,
    I have a select list P6_TEST with values 'nav' anf 'jyo'. I am trying to create a report using "SQL Query (PL/SQL
    function body returning SQL query)". In my report query can i check if P6_TEST='nav' and do something like the
    code shown below.How can i do that.
    DECLARE
    v_sql VARCHAR2(3000);
    BEGIN
    IF :P6_TEST = 'nav' THEN
    v_sql :=
    'SELECT
    * from department';
    ........................Thanks,
    Nav

    Nav:
    What you have should work. Give it a go. Post back if you run into issues.
    Varad

  • Using Package to produce pl/sql function body returning sql query Report

    I have existing code that we want to use in building reports in APEX. We are needing to modify it slightly to handle some new requirements, but would like to use them in reports based upon SQL query (pl/sql function body returning sql query) functionality.
    Any suggestions as how to call these in an APEX report region?
    Thank you,
    Tony Miller
    UTMB/EHN

    Hi Tony-
    I am also v new to Apex and you may have answered a question I was in search of. I, however, now have a couple more. First a bit of background-- Like in your situation, my college has a lot of existing code (400 +) that we need to get into Apex. The majority of this canned code contains one/both: 1) many lines, sometimes containing multiple select statements 2) imbedded create table & view statements (temp user owned). Up until reading your post, I was unable to figure out an easy way of getting this existing code into the product. Thanks. Now the questions, do you know how I would go about dealing with the create tables/views. I've read some posts on this forum which suggest temporary tables being unstable in this environment. Also, do you know if there's a size limitation when passing sql code via a function?
    As you may/may not be able to tell, I'm a bit lost right now... so any info you can provide would be appreciated. Thanks.
    Don

Maybe you are looking for

  • Workbooks only able to 'save as' while system is not open

    Hi Gurus, My client has been working with it's BW system fully opened for the last three years. Users could then access a workbook through BEx Analyzer (wether it was in the role or favorites area) make any neccessary changes and then save it. Now th

  • Can't change child's account settings

    Hi! I am the admin of my computer and I set up a "limited" account for my daughter. I am trying to change her settings to give her more access, but I get in accounts preferences, I get a greyed out user with an orange check mark next to her account.

  • Signing in and out

    I have just set up Skype with my microsoft hotmail address and password but I want to change the primary email address on my account.  When I do this, it asks me to confirm my password but when I put in my hotmail password, it says it is incorrect. 

  • FLEX data table serialization

    I currently use this PHP code to take table data serialized by the prototype ajax framework into an array to be inserted into a database. How can I do this in FLEX?

  • Las aplicaciones se cierran al iniciarlas en mi iPad mini Retina

    Al iniciar los juegos corren sólo un poco hasta que llega un momento en que se cierran