Using jquery FullCalendar in APEX with dynamic query

Hi,
I am trying to implement jquery FullCalendar in APEX and came across thie following post but I am unable to get the events to work. I would really like to see it working with an Application_Process:
How we can highlight events in Calendar
Currently I created an Application Process that simply calls a DB table and convert it into json format.
DECLARE
v_sql varchar2(400);
BEGIN
v_sql := 'SELECT * FROM CAL_FEED';
apex_util.json_from_sql(v_sql);
END;
But I am unsure how to add the events via an Application_Process.
I have tried the following in numerious ways (events:function, url feed, etc). It does work if I just do an array but would like it as a dynamic query.
$('#calendar').fullCalendar({
events: "http://server:8080/apex/f?p=101:53:4352610578859707:APPLICATION_PROCESS=IAT_TEST_CAL_FEED"
Thank you in advance,
Jimmy

Hi,
I was able to get the events into Fullcalendar with an Application Process but not sure if this would scale well with alot of events.
Would someone be able to tell me if there is a better way?
I am currently using an On Demand Application Process called IAT_TEST_FEED:_
DECLARE
lv_cal_list VARCHAR2(16000);
lv_return_str VARCHAR2(32000);
BEGIN
FOR i IN (SELECT "CAL_FEED"."ID" as ID,
"CAL_FEED"."title" as caltitle,
"CAL_FEED"."start" as calstart,
"CAL_FEED"."end" as calend
FROM "CAL_FEED")
LOOP
lv_cal_list := lv_cal_list || '{"id":' || CHR(39) || i.ID || CHR(39) || ',' ||
' "title":' || CHR(39) || i.caltitle || CHR(39) || ',' ||
' "start":' || CHR(39) || i.calstart || CHR(39) || ',' ||
' "end":' || CHR(39) || i.calend || CHR(39) || '},';
END LOOP;
lv_return_str := '[' || RTRIM(lv_cal_list,',') || ']';
htp.prn(lv_return_str);
EXCEPTION WHEN OTHERS THEN
htp.prn('error');
END;
In a HTML Region on a page within the Region Header:_
<link rel="stylesheet" type="text/css" href="#WORKSPACE_IMAGES#fullcalendar.css" />
<script type="text/javascript" src="#WORKSPACE_IMAGES#ui.core.js"></script>
<script type="text/javascript" src="#WORKSPACE_IMAGES#ui.draggable.js"></script>
<script type="text/javascript" src="#WORKSPACE_IMAGES#ui.resizable.js"></script>
<script type="text/javascript" src="#WORKSPACE_IMAGES#jquery.js"></script>
<script type="text/javascript" src="#WORKSPACE_IMAGES#fullcalendar.js"></script>
<script type="text/javascript" src="#WORKSPACE_IMAGES#fullcalendar.min.js"></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({
events: function(start, end, callback) {
$.ajax({
type: "POST",
url: "wwv_flow.show",
dataType: "json",
data: {
p_flow_id:$('#pFlowId').val(),
p_flow_step_id:$('#pFlowStepId').val(),
p_instance:$('#pInstance').val(),
p_request:"APPLICATION_PROCESS=IAT_TEST_FEED"
success:function(calevents){
$.each(calevents, function(i, calevent){
$('#calendar').fullCalendar('renderEvent', calevent, true);
</script>
The line within the ajax call is basically where my concern would be
$('#calendar').fullCalendar('renderEvent', calevent, true);
Thank you,
Jimmy

Similar Messages

  • Help on performance with dynamic query

    Hi All,
      We are using SQL Server 2008R2. In our one of report we are using Dynamic query and it is taking more time to retrieve the data. to retrieve 32 records it is taking 13-15 secs. In my observation in a table variable, created more than 60 columns. In
    the SP called one more sp with insert statement.
    Please let me know how i can improve performance of the SP.
    I know that i have to provide the SP  for observation but unfortunately I cannot provide the SP. Please guide me how i can achieve this .
    I tried with temp tables by creating indexes on temp tables but i couldn't find improvement in performance. 
    Waiting for valuable replies.

    First of all a "dynamic query" is not "a query" - it is a multitude of them. Some of them may be fast, others may be slow.
    There is of course no way we can give specific suggestions without seeing the code, the table and index definitions etc.
    We can only give the generic suggestions. As for the code, make sure that you are using parameterised SQL and you are not building a complete SQL string with parameters and all. If nothing else, this helps to make the code more readable and maintainable.
    It also protects you against SQL injection. And it also helps to prevent performance issue due to implicit conversion.
    You will need to look at the query plan to see where the bottlenecks may be. You should look at the actual query plan. Note that the thickness of the arrows are more relevant than the percentages you see; the percentages are only estimates, and estimates
    are often off. Next step is to see if you can add indexes to alleviate the situation. You should also analyse if there are problems in the query, for instance indexed columns that are entangled in expression. If you are using views, make sure that you don't
    have views built on top of views etc. This can often result a table appearing multiple times in a query, when one would be enough.
    Erland Sommarskog, SQL Server MVP, [email protected]

  • Apex with dynamic check box....

    hi to all:
    i have report emp.it contain data like eno,ename,sal,record .
    example:eno ename sal record
    100 a 100
    200 b 3000 going on...
    using this column i am making report by using apex and report contain one submit button also.
    1)in this report i am creating dynamic check box depend on eno..see my coding
    declare
    str varchar2(3000);
    begin
    str:='select htmldb_item.CHECKBOX(10,eno,DECODE(record,1,''CHECKED'')) "SELECT" ,eno,ename,sal ,record from emp where 1=1';
    return str;
    end;
    2)in process created after  submit
    iam created pl/code like ..this code for
    declare
    i number;
    str varchar2(2000);
    emp_id number;
    begin
    FOR i in 1..HTMLDB_APPLICATION.G_F10.count
    LOOP
    IF HTMLDB_APPLICATION.G_F10(i) is not null then
    SELECT htmldb_application.G_F10(i) INTO emp_id from dual;
    --insert into my_log values(emp_id);commit;
    update emp set record=1 where eno=emp_id ;
    commit;
    else if HTMLDB_APPLICATION.G_F10(i) is null then
    update emp set record=0 where eno=emp_id ;
    commit;
    else
    null;
    end if;
    end loop;
    end;
    my requirenent:
    a)if check box checked then -update -record column -1
    b)if check box uncked then -update - record column -0
    in process coding--
    eno alway is not null only..
    so i want to do check box with update the record column..like this
    a)if check box checked then -update -record column -1
    b)if check box uncked then -update - record column -0
    pls give solution.
    output i want like this example:
    chebox eno ename sal record
    checked(X) 100 a 300 1
    checked(x) 200 b 300 1
    next time i am trying to make uncheck first row like
    chebox eno ename sal record
    unchecked 100 a 300 0
    checked(x) 200 b 300 1

    Hi VKR,
    Please try this,
    <cfform name="frmTest"  format="Flash" action="test.cfm" method="post"  >
    <cfscript>
        qryCountry = queryNew("Country,CountryID");   
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "India");  
          querySetCell(qryCountry, "CountryID", "1");  
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "England");
           querySetCell(qryCountry, "CountryID", "2");    
          queryAddRow(qryCountry);  
          querySetCell(qryCountry, "Country", "Kenya");
           querySetCell(qryCountry, "CountryID", "3");      
    </cfscript>   
        <cfformgroup type="repeater"  query="qryCountry">                       
            <cfinput type="checkbox" value="{qryCountry.currentItem.CountryID}" name="chk" Label="{qryCountry.currentItem.Country}">                               
        </cfformgroup>
        <cfinput type="submit" name="submit" width="100" value="Submit"  >
    </cfform>
    Hope this will help

  • Using bind variables (in & out) with dynamic sql

    I got a table that holds pl/sql code snippets to do validations on a set of data. what the code basically does is receiving a ID and returning a number of errors found.
    To execute the code I use dynamic sql with two bind variables.
    When the codes consists of a simpel query, it works like a charm, for example with this code:
    BEGIN
       SELECT COUNT (1)
       INTO :1
       FROM articles atl
       WHERE ATL.CSE_ID = :2 AND cgp_id IS NULL;
    END;however when I get to some more complex validations that need to do calculations or execute multiple queries, I'm running into trouble.
    I've boiled the problem down into this:
    DECLARE
       counter   NUMBER;
       my_id     NUMBER := 61;
    BEGIN
       EXECUTE IMMEDIATE ('
          declare
             some_var number;
          begin
          select 1 into some_var from dual
          where :2 = 61;
          :1 := :2;
          end;
          USING OUT counter, IN my_id;
       DBMS_OUTPUT.put_line (counter || '-' || my_id);
    END;this code doesn't really make any sense, but it's just to show you what the problem is. When I execute this code, I get the error
    ORA-6537 OUT bind variable bound to an IN position
    The error doesn't seem to make sense, :2 is the only IN bind variable, and it's only used in a where clause.
    As soon as I remove that where clause , the code will work again (giving me 61-61, in case you liked to know).
    Any idea whats going wrong? Am I just using the bind variables in a way you're not supposed to use them?
    I'm using Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit

    Correction. With execute immediate binding is by position, but binds do not need to be repeated. So my statement above is incorrect..
    You need to bind it once only - but bind by position. And the bind must match how the bind variable is used.
    If the bind variable never assigns a value in the code, bind as IN.
    If the bind variable assigns a value in the code, bind as OUT.
    If the bind variable assigns a value and is used a variable in any other statement in the code, bind as IN OUT.
    E.g.
    SQL> create or replace procedure FooProc is
      2          cnt     number;
      3          id      number := 61;
      4  begin
      5          execute immediate
      6  'declare
      7          n       number;
      8  begin
      9          select
    10                  1 into n
    11          from dual
    12          where :var1 = 61;       --// var1 is used as IN
    13 
    14          :var2 := n * :var1;     --// var2 is used as OUT and var1 as IN
    15          :var2 := -1 * :var2;    --// var2 is used as OUT and IN
    16  end;
    17  '
    18          using
    19                  in out id, in out cnt;  --// must reflect usage above
    20 
    21          DBMS_OUTPUT.put_line ( 'cnt='||cnt || ' id=' || id);
    22  end;
    23  /
    Procedure created.
    SQL>
    SQL> exec FooProc
    cnt=-61 id=61
    PL/SQL procedure successfully completed.
    SQL>

  • Do you use Oracle Application Express (APEX) with EBS?

    I am conducting a short survey to determine how you integrate Oracle Application Express with eBusiness Suite. Please take a few minutes to fill out the survey:
    http://apex.oracle.com/pls/otn/f?p=54654:1:0
    {We will not share information with anyone except with your explicit permission}
    We believe that there are a large number of eBusiness Suite customers that are using Application Express in various ways so we are trying to quantify that and get some further information.
    This is all part of a broader effort we are currently undertaking working closely with various people from the eBusiness Suite Development Team.
    This survey is very important to us so please take the time to complete the survey if you use Application Express with eBusiness Suite - It is only 1 page long.
    Thanks,
    David

    Thanks for your reply.
    I did some more investigation to check what could cause this to happene, whereby the report toatal is not displayed at all for few selected paramters.
    What i could analyse was that the records returned were more than 50 (Standard Setting) , which however could not fit into the page, along with that the pagination scheme was not selected. I had to make 2 changes to the Layout of the report
    Pagination Scheme : Row Ranges X to Y(with Next and Previous Links)
    Number of Rows : 500
    This worked for me as the displayed could not be seen on the next page with Previous and next links on the report output.
    Thanks,
    Dips

  • Problem with dynamic query in Forms Builder

    Hi,
    I need in forms builder cursor in procedure which parameter is a whole query. But i stuck when i wanna give some text in signs '' to procedure.
    I wanna give like test('select ' ||'test' || ' from dual');
    But this is not good beacuse it is missing ''.
    Query which procedure get is select test from dual.
    The right sql would be select 'test' from dual.
    How could i pass signs '' to procedure.
    Any ideas.
    Thanks in advance.

    test('select ''' ||'test' || ''' from dual');Francois

  • Pipelined Function with dynamic query

    Hello All,
    Orcl Ver: 11g R2.
    I am leveraging the Oracle's pipelined table function.
    It's working fine for static SQL.
    create or replace package test13_pkg as
        type r_disc_req is record(disc_line_id number,
                                 req_id number);
        type t_disc_req is table of r_disc_req;
        function F_GetDiscReq return t_disc_req pipelined;
        procedure P_ProcessDiscReq;
    end;
    CREATE OR REPLACE PACKAGE BODY test13_pkg
    AS
       FUNCTION F_GetDiscReq
          RETURN t_disc_req
          PIPELINED
       IS
          lo_disc_req   r_disc_req;
       BEGIN
          FOR r_row IN (SELECT disc_line_id, req_id
                          FROM edms_disc_lines_stg
                         WHERE ROWNUM < 10)
          LOOP
             lo_disc_req.disc_line_id := r_row.disc_line_id;
             lo_disc_req.req_id := r_row.req_id;
             PIPE ROW (lo_disc_req);
          END LOOP;
       END F_GetDiscReq;
       PROCEDURE P_ProcessDiscReq
       AS
          ln_totalRecords   NUMBER;
       BEGIN
          SELECT COUNT (*)
            INTO ln_totalRecords
            FROM edms_disc_lines_stg t1, TABLE (F_GetDiscReq ()) t2
           WHERE t1.disc_line_id = t2.disc_line_id AND t1.req_id = t2.req_id;
       DBMS_OUTPUT.put_line (ln_totalRecords);
       END;
    END;
    begin
        test13_pkg.P_ProcessDiscReq();
    end;
    How do I leverage it for dynamic sql?
    FUNCTION F_GetDiscReq (p_filter1 IN NUMBER, p_filter2 IN NUMBER, p_filter3 IN NUMBER)
       RETURN t_disc_req
       PIPELINED
    IS
       lo_disc_req   r_disc_req;
       l_sql varchar2(4000) := 'SELECT disc_line_id, req_id
                       FROM edms_disc_lines_stg';
       l_where_clause varchar2(4000) := 'WHERE 1 = 1 ';
    BEGIN
       IF p_filter1 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter1;
       END IF;
       IF p_filter2 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter2;
       END IF;
       IF p_filter3 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = '||p_filter3;
       END IF;
       l_sql := l_sql||l_where_clause;
    --I'm stuck here.   
    FOR r_row IN (l_sql)
       LOOP
          lo_disc_req.disc_line_id := r_row.disc_line_id;
          lo_disc_req.req_id := r_row.req_id;
          PIPE ROW (lo_disc_req);
       END LOOP;
    END F_GetDiscReq;
    Could you please guide me here?
    Thx
    Shank.

    Hi,
    It's very doubtful whether you need or want dynamic SQL for this task.
    If you do, however, here's one way to do it:
    FUNCTION F_GetDiscReq
    (  p_filter1  IN  edms_disc_lines_stg.filter1%TYPE
    ,  p_filter2  IN  edms_disc_lines_stg.filter1%TYPE
    ,  p_filter3  IN  edms_disc_lines_stg.filter1%TYPE
       RETURN t_disc_req
       PIPELINED
    IS
       lo_disc_req   r_disc_req;
       l_sql varchar2(4000) := 'SELECT disc_line_id, req_id
                       FROM edms_disc_lines_stg ';
       l_where_clause varchar2(4000) := 'WHERE 1 = 1 ';
       c     SYS_REFCURSOR;
    BEGIN
       IF p_filter1 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter1 = ''' || p_filter1 || '''';
       END IF;
       IF p_filter2 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter2 = ''' || p_filter2 || '''';
       END IF;
       IF p_filter3 IS NOT NULL THEN
        l_where_clause := l_where_clause||'AND filter3 = ''' || p_filter3 || '''';
       END IF;
       l_sql := l_sql||l_where_clause;
    --   dbms_output.put_line (l_sql || ' = l_sql');   -- For debugging
       OPEN  c  FOR l_sql;
       LOOP
          FETCH  c  INTO  lo_disc_req;
          EXIT WHEN  c%NOTFOUND;
          PIPE ROW (lo_disc_req);
       END LOOP;
    END F_GetDiscReq;
    Static SQL will, in general, be more efficient than dynamic SQL.
    Given that you need dynamic SQL, there are lots of ways the function above could be made more efficient.  If that's an issue, make sure you understand what this is doing before trying to improve it.

  • Help! Inaccessible iterator when using dynamic query

    Hi!
    I have a problem retreiving results from a dynamic query into sqlj iterator.
    I consulted the Oracle App Dev Guide and Oracle SQLJ Dev Guide and wrote the following code:
    <PRE>
    package pmServer;
    #sql iterator LocIterator (int id, String name);
    public class pmRISDImpl
    public int GetLocations(...)
    LocIterator locIt;
    String q = "select ID, NAME from PMADM.LOCATIONS";
    #sql
    BEGIN
    open :OUT locIt for :q;
    END;
    </PRE>
    When I try to compile it using tools provided by JDeveloper ver 3.2.2.(Build 915) for JDK 1.2.2 I get error for #sql statement:
    Inaccessible Java type for host item locIt (at position #1): pmServer.LocIterator
    and warning:
    Type pmServer.LocIterator of host item locIt (at position #1) is not permitted in JDBC. This will not be portable.
    Althow the code is identcal to those demonstrated in Oracle document "Oracle8 i
    SQLJ Developers Guide and Reference
    Release 3 (8.1.7)
    July 2000
    Part No. A83723-01" pp 12-67 (PL/SQL in SQLJ for Dynamic SQLDynamicDemo.sqlj). There it looks like
    <PRE>
    private static void dynamicSelectMany(String what_cond)
    throws SQLException {
    System.out.println("dynamic multi-row query on table emp");
    Employees empIter;
    // table/column names cannot be bind args in dynamic PL/SQL, so
    // build up query as Java string
    String query = "select ename, sal from emp " +
    (((what_cond == null) &#0124; &#0124; (what_cond.equals(""))) ? "" :
    (" where " + what_cond)) +
    "order by ename";
    #sql {
    begin
    open :OUT empIter for -- opening ref cursor with dynamic query
    :query;
    -- can have USING clause here if needed
    end;
    while (empIter.next()) {
    System.out.println("Employee " + empIter.ename() +
    " has salary " + empIter.sal() );
    empIter.close();
    </PRE>
    Please guide me what should I do to get it working.
    null

    In the CAST statement the SQLJ runtime must be able to produce an instance of you SQLJ iterator using Java reflection.
    This necessitates that the iterator class must be accessible by public.
    You have two options:
    (1) Declare the iterator public. This requires that you put it in its own file LocIterator.sqlj:
    #sql public iterator LocIterator (int id, String name);
    (2) Declare the iterator as an inner class. In this case you want to make it public static (that is it does not require an instance of the outer class in scope). You might write the following.
    package pmServer;
    public class pmRISDImpl
    #sql public static iterator LocIterator (int id, String name);
    (3) If you are using Oracle 9i you have another option. You can embed dynamic SQL fragments directly in your SQLJ code and do not need to use the CAST:
    public int GetLocations(...)
    LocIterator locIt;
    String q = "PMADM.LOCATIONS";
    #sql locIt = { select ID, NAME from :{q} }; // Note new syntax :{q} for embedding SQL source code
    }

  • Create Portal Page Design with Dynamic content in Moss2007(without using Visual Studio)

    Hi All,
    I am facing a issue while designing a page in MOSS 2007. I can't use custom code as the client doesn't want it to be used.
    The page is with dynamic content coming from sharepoint lists and picture library. I tried using SharePoint Listview after adding zones as per my page design..but was unsuccessful because I am unable to change its design and css styles in its xslt view.
    Plesae help me to find any alternative so that I can easily style my page with the dynamic content. Is there any way using Content editor webparts? Can we get List data in Content editor html as this can be easily styled. I googled and tried it by using javascript
    and jquery but again unsuccessful.
    Please help me with some solution.
    Thanks..!!

    I recommend your repost this in the WebLogic Portal forum.
    WebLogic Portal

  • Error using JQuery

    Hi folks,
    I am trying to use JQuery in my apex application. I downloaded and installed JQuery library via Shared Components > Static files and associated it with my application.
    In my page template, between <head> and </head>, i included the following
    *<script src="#APP_IMAGES#jquery-1.3.2.min.js" type="text/javascript"></script>*
    and saved the changes.
    I created a <div> element on my page and tested using the ff code from Tyler Muths blog
    It should turns any div on the page red when you hover over it, then white when you move your mouse out of it.
    *$(document).ready(function() {*
    *$("div").hover(function() {*
    *$(this).css('background-color','#ff0000');*
    *function() {*
    *$(this).css('background-color','#ffffff');*
    I placed the above code in my page HTML Header section but when i ran the page and moved my mouse over the div, nothing happens. FireBug displays an error *"$ is not defined"*
    Any clues as to what i may be doing wrong?
    Thanks.
    Stephen.

    I remember having a similar problem with some other jquery function. What I did was to copy the deffinition of the function in the page zero. After that the script would work.
    Denes Kubicek
    http://deneskubicek.blogspot.com/
    http://www.opal-consulting.de/training
    http://apex.oracle.com/pls/otn/f?p=31517:1
    -------------------------------------------------------------------

  • How to use three part name with using dynamic query.

    Dear all, (sqlserver 2008 express r2)
    q1)following is showing error, is it possible to accomplish the task with out using dynamic query.
    DECLARE @A VARCHAR(100)
    DECLARE @A1 VARCHAR(100)
    SET @A='DB1'
    SET @A1='DBO'
    SELECT * FROM @[email protected]
    q2) table value function is not accepting dynamic query , is there any way to do this task.
    yours sincerley

    Certain parts in an SQL query like FROM tablename cannot be local variables. In such a case, dynamic SQL can be applied:
    http://www.sqlusa.com/bestpractices/dynamicsql/
    As noted above, more information needed to decide if dynamic SQL the correct solution in this instance.
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Design & Programming
    New Book / Kindle: Exam 70-461 Bootcamp: Querying Microsoft SQL Server 2012

  • Using JQuery with Apex

    Hello, I have a question for those of you who are using JQuery with Apex:
    This is my HTML header:
    <script type="text/javascript" src="&WORKSPACE_IMAGES.jsapi.js"></script>
    <script type="text/javascript">
    google.load("jquery", "1.3.2");
    </script>
    The problem is that JQuery still loads from Google and since the Company Intranet has the cookies blocked the privacy icon appars in IE. I am sure somebody will one day notice this and it's gonna be a "big" problem.
    I suspect that something must be changed below to make the privacy icon dissapear,
    if (!window['google']) {
    window['google'] = {};
    if (!window['google']['loader']) {
    window['google']['loader'] = {};
    google.loader.ServiceBase = 'http://www.google.com/uds';
    google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax';
    google.loader.ApiKey = 'notsupplied';
    google.loader.KeyVerified = true;
    google.loader.LoadFailure = false;
    google.loader.Secure = false;
    google.loader.GoogleLocale = 'www.google.com';
    Any ideas how to change this code and if this is going to work?
    George

    Hi,
    If you do not like use jQuery from Google, discard your code
    <script type="text/javascript" src="&WORKSPACE_IMAGES.jsapi.js"></script>
    <script type="text/javascript">
    google.load("jquery", "1.3.2");
    </script>and use e.g. this guide to integrate jQuery to your Apex apps
    http://www.oracleapplicationexpress.com/tutorials/66-integrating-jquery-into-apex
    Br,Jari

  • How to use a LOV object in apex with the parameter?

    Hi,
    I would like to create a LOV object with a query:
    SELECT ID, NAME
    FROM TABLE
    WHERE
    REF= APEX_FORM_VARIABLE
    This is for an Apex report page and each row provides the Apex form variable.

    What is your question then?
    Just create a dynamic LOV with that as your query. Use the bind variable notation for the apex item.

  • Ref Cursor Using Dynamic Query

    Hi,
    I need to use the ref cursor to fetch result from dynamic query.
    e.g.
    Open ref_test_tbl for Select * from tbl1 where tbl1.field1= :1
    and tbl1.field2 =:2 using i_v1,i_v2;
    The thing is i_v1, i_v2 are dynamic.
    i.e. using clause can include i_v3, i_v4 also.
    How to include dynamic variables in the using clause.
    thanks

    > How to include dynamic variables in the using clause.
    Cannot using a ref cursor.. (and anyone that post code that writes dynamic PL/SQL in order to achieve this, I will call an idiot).
    What you should be using in PL/SQL is a DBMS_SQL cursor. This allows you to create a fully dynamic SQL statement with bind variables. E.g.
    select * from tbl1 where col1 = :1
    select * from tbl1 where col2 = :1 order by 2
    select * from tbl1 where col3 between :0 and :1
    Using this dynamically created SQL statement, you can parse it using DBMS_SQL, determine the number of bind variables, and bind each of these dynamically.
    You can then execute the SQL and again, dynamically, determine just what the projection of the cursor is. How many columns are returned, their names, data types, precision and so on.
    This is what APEX (see http://apex.oracle.com) use extensively in order to run SQLs and render these as reports - all dynamically.
    DBMS_SQL is detailed in the [url http://download.oracle.com/docs/cd/B19306_01/appdev.102/b14258/d_sql.htm#BABEDAHF]Oracle® Database PL/SQL Packages and Types Reference manual.

  • How to build dynamic query strings in the query using DB adapter 'Pure SQL'

    Dear Forum,
    I am building an application which will access DB to fetch some result set. The query involves retrieving data from multiple tables(nearly 10 tables). So I have created a DB adapter using 'execute pure sql' option. With this query works fine, but my inputs parameters will vary. So I need to make my query dynamic to append the query strings at runtime depending on the inputs.
    For example I have 3 input variables - input1,input2 and input3 (in my request xsd) which are used in the pure sql query. Now if I get a 4th input parameter input4 in the request, I need to append this to query string as 'AND input4=[some value]' at runtime. Otherwise my query should have only 3 parameters. Please suggest how this can be achieved.
    Regards,
    Satya.

    This is a strange requirement, depending on the columns you have and what are optional in them, one way is to have separate operations and each opeartion will have different inputs and for each operation , a different DB Adapter is called. But this way, it results in more number of operations for the service as well as more number of references in the composite. Even if you pass the column inputs to the SQL procedure, it will result in a large number of if-else cases..
    Thanks,
    N

Maybe you are looking for

  • Foreign language Invoice

    I am using SAP B1 2007A version and would like to be able to invoice in other languages. I have setup in ADMIN/SYSTEM Initi/Company Details to enable Foreign Languages. So now I can go to a B/P and set is to another language e.g Spanish. It also give

  • Value from JDialog to another class

    Hi: I have a trouble with getting my values from a JDialog box to another class. Here's what I have: This is an ftp application. I have a main frame where if the user selects File->New Connection it pops up a Connect dialog box. The connect dialog bo

  • How to setup a basic VPN

    Hi, I just bought a Linksys BEFSX41 VPN router, I wanted to make a basic VPN.  I tried more than a week, I followed the guide.  But it never work and really made me headache.  I hope any body can help me to make it work. I setup the router as the gui

  • Inserting a Recordset Kills PHP Processing

    In Dreamweaver 11.0 (CS5) on both MAMP and a live server, I am experiencing a puzzling issue. Inserting any Recordset kills PHP processing.  For example, this document works perfectly: <!DOCTYPE HTML> <html> <head> <meta http-equiv="Content-Type" con

  • Lenovo a526 can't move application to SD card

    i just buy lenovo a526.i think this is a great phone.but there is one problem in this phone.. my application can't move to sd card.so my internal memory almost get full. can you solve this problem or any update will be released?? thank you