Creating a dynamic sql statement

hi,
I am having a query
select w.id, w.cr_dt, w.cc_cor_addr_id, w.cc_cee_addr_id,
w.ttl_pkgs, w.chrg_wt, wf.wb_bkg_chgd_amt + wf.wb_bkg_chgd_amt_st
from ops_waybl_fin wf, ops_waybl w
where wf.id = w.id
and cre_bill_batch_dtls_id in (select get_bill_batch(1) from dual);
the bold part is a function returns a select query.
if the sql statement is run then we get data based on which the parent query returns data.
how we should use a function that returns select query.
Please advice..

*** not tested *** Sven probably had in mind something like
with
v_count_cust_no as
(select count(orr.param_val) the_count
   from ops_report_req orr
  where orr.id = :p_req_id
    and orr.param_nm = 'CUST_ID'
v_count_cust_cntr as
(select count(orr.param_val) the_count
   from ops_report_req orr
  where orr.id = :p_req_id
    and orr.param_nm = 'CUST_CNTR_ID'
variant as
(select case when (select the_count from v_count_cust_no) > 0
             then case when (select the_count from v_count_cust_cntr) > 0
                       then 1
                       else 2
                  end
             else case when (select the_count from v_count_cust_cntr) > 0
                       then 3
                       else 4
                  end
        end the_type
   from dual
select w.id,w.cr_dt,w.cc_cor_addr_id,w.cc_cee_addr_id,w.ttl_pkgs,w.chrg_wt,wf.wb_bkg_chgd_amt + wf.wb_bkg_chgd_amt_st
  from ops_waybl_fin wf,ops_waybl w
where wf.id = w.id
   and cre_bill_batch_dtls_id in (select to_number(b.id)
                                    from ops_bill_batch_dtls b,ops_cust_cntr cc
                                   where b.cust_cntr_id = cc.id
                                     and b.bill_batch_id = f1(1)
                                     and b.status_lid = 255
                                     and (((select the_type from variant) = 1
                                           and cc.cust_no in (select param_val
                                                                from ops_report_req
                                                               where id = :p_req_id
                                                                 and param_nm = 'CUST_ID'
                                           and cc.ID in (select param_val
                                                           from ops_report_req
                                                          where id = :p_req_id
                                                            and param_nm = 'CUST_CNTR_ID'
                                       or ((select the_type from variant) = 2
                                           and cc.cust_no in (select param_val
                                                                from ops_report_req
                                                               where id = :p_req_id
                                                                 and param_nm = 'CUST_ID'
                                       or ((select the_type from variant) = 3
                                           and cc.ID in (select param_val
                                                           from ops_report_req
                                                          where id = :p_req_id
                                                            and param_nm = 'CUST_CNTR_ID'
                                       or ((select the_type from variant) = 4
                                 ) Regards
Etbin

Similar Messages

  • Creating a Dynamic Update Statement based on Select

    hi,
    i'm trying to create a dynamic update statement based on select statement
    my requirment is to query a joint tables and get the results then based on the results i need to copy all the data and create an update statement for each row
    for ex
    the update statement should look like this
    update iadvyy set SO_SWEEP_CNT = '1' where inst_no = '003' and memb_cust_no = 'aaaaaaaaaaaaaaaa';
    and the select statement like the following
    select substr(key_1,11,9) account_no,sord_mast SO_SWEEP_CNT from
    select acct_no,count(*) sord_mast from
    (select from_acct_no acct_no,update_mast
    from sord where FROM_SYS in ('DEP','INV') and TERM_DATE > 40460
    union all
    select to_acct_no acct_no,update_mast
    from sord where TO_SYS in ('DEP','INV') and TERM_DATE > 40460)
    group by Acct_no)
    right outer join
    invm
    on
    key_1 = '003'||acct_no
    where sord_mast > 0;
    so taking the above two columns from the above select statement and substitue the values as separate update statement.
    is that doable , please share your knowledge with me if poosible
    thanks in advanced

    is that doable , please share your knowledge with me if poosibleyes
    The standard advice when (ab)using EXECUTE IMMEDIATE is to compose the SQL statement in a single VARCHAR2 variable
    Then print the SQL before passing it to EXECUTE IMMEDIATE.
    COPY the statement & PASTE into sqlplus to validate its correctness.

  • How can I open a cursor for dynamic sql statement

    Hi,
    I'm facing issues opening a cursor for dynamic sql statement : PLS-00455: cursor 'RESULT1' cannot be used in dynamic SQL OPEN statement.
    CREATE OR REPLACE FUNCTION DEMO
    (MN_I in VARCHAR)
    return AB_OWNER.ABC_Type.NonCurTyp is
    RESULT1 AB_OWNER.ABC_Type.NonCurTyp;
    sql_stmt VARCHAR2(4000);
    BEGIN
    sql_stmt := 'SELECT * FROM AB_OWNER.DUN WHERE JZ_I in ('||mn_i||') ORDER BY app.ACC_I';
    OPEN RESULT1 FOR sql_stmt;
    END IF;
    return RESULT1;
    END DEMO;
    What changes should I make in the code so that it doesn't fail? I can't change the definition of RESULT1 cursor though.

    Gangadhar Reddy wrote:
    I used SYS REFCURSOR and was able to implement successfully.How many times did you run this successful implementation that does not use bind variables?
    Because this is what will happen when it runs a lot.
    http://download.oracle.com/docs/cd/E11882_01/server.112/e17766/e2100.htm#sthref1874
    http://forums.oracle.com/forums/search.jspa?q=%2BORA-04031%20%2Bbind&objID=c84&dateRange=all&rankBy=10001&start=30
    And you will have to regularly restart the server, or possibly slightly less invasive, flush the shared pool.
    Flushing Shared Pool regularly
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1516005546092
    >
    Ok, this is an easy one to diagnose.
    You are not using bind variables. This is terrible. Flushing the shared pool is a bad
    solution -- you are literally killing the performance on your box by not using them.
    If I was to write a book on how to build “non scalable applications in Oracle”, this
    would be the first and last chapter. This is a major cause of performance issues and a
    major inhibitor of scalability in Oracle. The way the Oracle shared pool (a very
    important shared memory data structure) operates is predicated on developers using bind
    variables. If you want to make Oracle run slowly, even grind to a total halt – just
    refuse to use them.
    >
    But, please feel free to go ahead with this successful implementation.
    I just hope anyone else who reads this doesn't make the same mistake.

  • Help With SUBSTR in dynamic SQL statement

    Following is the dynamic SQL statement.
    EXECUTE IMMEDIATE 'UPDATE table_name pml
    SET pml.'|| con_fields.field ||' = SUBSTR(pml.'||con_fields.field||' ||'' ''||
    (SELECT pml1.'||con_fields.field||'
    FROM table_name pml1
    WHERE pml1.grp_id = '||los_concats.grp_id ||'
    AND pml1.row_id = '||los_concats.row_id||'
    AND pml1.loser_flg = ''Y''),1, '||con_fields.max_length||')
    WHERE pml.grp_id = '||los_concats.grp_id ||'
    AND pml.loser_flg IS NULL ';
    what it does is that it updates a particular field. This field is concatenated by a field of a similar record.
    My problem is with SUBSTR function. Since I am concatenating fields I do not want the field to be updated greater than max_length on that field, the reason why I use SUBSTR. the select query inside SUBSTR works alright with one of the AND condition in a WHERE clause not present. When I add that additional condition it gives me this error.
    ORA-00907: missing right parenthesis.
    Is there any way to get around this problem. Does SQL has other than SUBSTR function which can limit the character length.
    Appreciate it.

    The other alternative I thought about was to do this first
    EXECUTE IMMEDIATE 'SELECT pml.'||con_fields.field||'
    FROM table_name pml
    WHERE pml.grp_id = '||los_concats.grp_id||'
    AND pml.row_id = '||los_concats.row_id||'
    AND pml.loser_flg = ''Y''
    ' INTO v_concat_field;
    write into the variable v_concat_field and then use it into the previous script.
    But on this I get SQL Command not properly terminated, I don't get it Why?
    Donald I tried with your suggested script. It works fine with one of the conditions eliminated. I don't understand what the error trying to say?
    Thanks

  • Preparing Dynamic SQL statement for inserting in Pro*C

    Hi Friends,
    From quite some time i am struggling writing Dynamic SQL statement for dynamic insert and update in Pro*C.
    Can somebody go through my code and suggest me the rigth way of doing.
    Right now it throws an error saying " Error while updating ORA-00904: invalid column name "
    Please help me.
    Girish.
    int main()
    EXEC SQL BEGIN DECLARE SECTION;
    char *uid ="scott/tiger";
    static char sqlstmt[129];
    struct /* DEPT record */
    int dept_num;
    char dept_name[15];
    char location[14];
    } dept_rec;
    EXEC SQL END DECLARE SECTION;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL CONNECT :uid;
    dept_rec.dept_num = 50;
    strcpy(dept_rec.dept_name,"ADMIN");
    strcpy(dept_rec.location,"IN");
    strcpy(sqlstmt,"UPDATE dept set DNAME = dept_rec.dept_name where DEPTNO = dept_rec.dept_num");
    EXEC SQL EXECUTE IMMEDIATE:sqlstmt;
    EXEC SQL COMMIT;
    exit(0);
    void sql_error()
    printf("\nError while updating %s",sqlca.sqlerrm.sqlerrmc);
    EXEC SQL ROLLBACK;
    }

    A bit rusty here but this is how I see it.
    Think of it this way ..
    all Oracle is going to see is:
    UPDATE dept set DNAME = dept_rec.dept_name where DEPTNO = dept_rec.dept_num
    Its NOT going to know what dept_rec.dept_name is or dept_rec.dept_num is ..
    it doesnt go back and fill in those values.
    You need something like
    strcpy(sqlstmt,"UPDATE dept set DNAME = \"");
    strcat(sqlstmt,dept_rec.dept_name);
    strcat(sqlstmt,"\" where DEPTNO = ");
    strcat(sqlstmt,dept_rec.dept_num);
    printf(sqlsmt); # Just to be sure the update statement look right during testing.

  • How can I execute Dynamic SQL statement in Forms?

    Hi All,
    I have to execute dynamic SQL statement from Forms
    Below statement I have to execute
    "EXECUTE IMMEDIATE v_stmt INTO v_return;".
    Googled for the same got results saying, Better use Database function or procedures to execute these Dynamic Statements but We want to execute in forms only.
    Can any one help me..
    Thanks,
    Madhu

    So in short you are trading code obfuscation for maintainability and the ability to share code between tools? If from somewhere else you need a procedure already implemented in database PL/SQL (and now ported to forms) this would mean you'd need to implement it in every other tool. In times where you might want to integrate your forms with $other_technology and putting stuff on the database is the first step to share functionality you just go the opposite way? And all that because someone is afraid that somebody might steal your source code? I am sorry to be blunt, but this is just plain stupid.
    Leaving aside that some things like Analytic Functions, Bulk processing or execute immediate are not even available in forms your software consists of how many LOC? How long does it take to bring a new developer up to speed with your source code? Imagine how long that would take for a developer who doesn't have coleagues who know their way around.
    And just so you know: I work for a ISV selling a closed-source product as well. We have 200+ customers all over the planet. We are well aware that wrapped packages can be reverse engineered. The premise is: stored procedures can be reused in every tool we have, if it makes sense to put stuff on the database by all means do it. If someone would want to reverse engineer our software I'd wish him good luck as some parts are implemented in such a hilarious complicated way I have troubles understanding them (and quite frankly I refuse to understand certain parts, but that's another story). I do work for almost 10 years for that ISV.
    In any case the possible solutions have already been mentioned: you have exec_sql, create_group_from_query and forms_ddl to execute dynamic SQL in forms whereas forms_ddl is a one way street and most certainly not the thing you need or want. Take a look at the documentation for the other 2 things.
    cheers

  • Concatenate problem for Dynamic SQL statements

    Hi Experts ,
    I am building Dynamic SQL statements depending on the values which the user enters into the select option parameters .This dynamic query is passed to cl_sql_connection object for querying from another databasse
    So i wrote dynamic values for one select option spointof for the database field ppointofdelivery.
    loop at spointof.
    CONCATENATE ' pointofdelivery between ''' spointof-low''''
    ' AND ''' spointof-high''''
    INTO where_clause .
    endloop.
    The whereclause has value pointofdelivery between '123' and '124'.(if the user has entered 123 and 124 as values)
    This works fine . But my problem is I have to pass the fieldnames and operator dynamically into where_clause depending on User input.
    when i am writing code like the below
    field_name = ' pointofdelivery '.
    operator = '='.
    CONCATENATE field_name operator '''spointof-low''' INTO where_clause .
    the where_clause contains value
    pointofdelivery = ' spointof-low '
    and not pointofdelivery = ' 123 ' as expected .
    Do you know why this is haapening as it is not taking the value.
    Thanks
    Arshad

    Hi,
    there are lot of function modules..available...to build a where clause based on the select-options..
    check the FM FREE_SELECTIONS_RANGE_2_WHERE
    Thanks
    Naren

  • Dynamic SQL statement in a Procedure

    Hi,
    is it possible to use a variable in place of a column name in a sql statement inside a procedure. Or to create the whole statement as a sql statement and execute it (preferrably with parameters - rather than concatinating the values).
    Thanks for any help or direction
    Elliot

    Turns out you can do the following very nicely (dynamic sql with parameterized values)
    Declare
    id number(10,0);
    sql_stmt varchar2(300);
    fieldName varchar2(30);
    fieldValue varchar2(100);
    id := 30;
    fieldName := 'somecolumn';
    fieldValue := 'some value';
    sql_stmt := 'UPDATE myTable SET ' || fieldName || ' = :1 WHERE id = :2';
    EXECUTE IMMEDIATE sql_stmt USING fieldValue, id;

  • Creating a dynamic SQL query builder class

    I have a jobs table where each row contains information about jobs run on a machine. I have a web view of this database which shows different information and queries for this information are built using the following fields:
    TYPE
    TITLE
    NODE
    STATUS (an array of 4 different possible statuses)
    TIMESTAMP
    GUID (will be used when a view of a specific job (row in the table) is requested, no other search criteria needed when this view is required.)
    All the criteria will be passed from the view layer into a search criteria object which is then passed to the DAO class which passes it to a BuildSQL class to use it to build the SQL.
    There are many different "views" of the data which will result in many different combinations of criteria being passed down to the data access layer. (for example a status of failed and a timestamp resulting in all the jobs run in the last 2 hours)
    As there are a number of different search criteria used in each query I'm having trouble designing the class to dynamically build the query. Are there any standard ways of doing this out there that could guide me?
    At the moment I'm seeing this class as being a large combination of if statements and not really being very dynamic.
    I was thinking maybe checking all the criteria to see if its null, if so ignore it straight away and then running through all the other criteria and appending one by one to the may SELECT which has already been created. Quite how i'd decided whether it would need an AND or OR before it I dont know.
    Are there any standard proven ways to approach this because i've done a search here and on google and not really come back with much, so any advice would be great. I've got to say I'm pretty new to java and don't really have many bright ideas here!

    Well my dear friend... I did something special for a business logic support to an web autocomplete component.
    The criteria building was based on a custom variable into the SQL statement:
    SELECT * FROM TABLE WHERE __MC__ AND (FIXED CRITERIA)
    Where:
    *FIXED CRITERIA: Is a fixed criteria that doesn't variate
    *__MC__: Is a "custom variable" defined for me to make the replacement.
    There are two main clases:
    *SQLBuilder: It has many logic to build SQL Statements
    *Multicriteria: It has the specific logic to insert into a SQL statement multiple criterias
    // The SQLBuilder class
    public class SQLBuilder {
        public static final String MC = "__MC__";
        static String buildMultiCriteria(String sql, Object[] params) throws Exception {
            for(int i=0; i<params.length; i++) {
                if(params[i] instanceof MultiCriteria) {
                    sql = sql.replaceFirst("__MC__",
                            ((MultiCriteria)params).getCriteria());
    params[i] = null;
    return sql;
    // The MultiCriteria class
    public class MultiCriteria {
    public static final int BEGINS = 0;
    public static final int ENDS = 1;
    public static final int CONTAINS = 2;
    private String criteria = null;
    public MultiCriteria(String[] fields, String value, int type) throws Exception {
    String[] tokens = value.split(" ");
    StringBuffer sb = new StringBuffer("(");
    for(int i=0; i<fields.length; i++) {
    for(int j=0; j<tokens.length; j++) {
    if(tokens[j].length()>0) {
         sb.append(fields[i].toUpperCase());
         sb.append(" LIKE '");
         sb.append(toType(tokens[j], type));
         sb.append("'");
         if(j<tokens.length-1) sb.append(" OR ");
    if(i<fields.length-1) sb.append(" OR ");
    sb.append(")");
    criteria = sb.toString();
    public String getCriteria() {
    return criteria;
    private final String toType(String value, int type) throws Exception {
    switch(type) {
         case BEGINS:
         value = value + "%";
         break;
         case ENDS:
         value = "%" + value;      
         break;
         case CONTAINS:
         value = "%" + value + "%";      
         break;
         default:
         throw new Exception("Undefined MutiCriteria type");
    return value;
    // I use the MultiCriteria this way
    // criteria is a string introduced in a html input text
    // The class splits the string by " " and ensemble multiple criterias
    // for the given fields permuting them with the tokens resulting of the
    // split
    MultiCriteria mc = new MultiCriteria(
    new String[] {"FIELD_01", "FIELD_02"},
         criteria,
         MultiCriteria.CONTAINS
    I think this idea could help you.
    Anything else, write me at [email protected]
    Best Regards,

  • Dynamic SQL Statement with table name

    Dear all
    i like to have a SQL statement with a dynamic tablename. Is this possible? If yes, how?
    should be something like "select * from <mytablename>"
    Thank you
    Herbert

    Yes this is possible. use the below reference code for this.
    data: g_tablename type w_tabname,
            gv_dref TYPE REF TO data.
    FIELD-SYMBOLS: <g_itab> TYPE STANDARD TABLE.
    gv_tabname = p_tablename (take table name form selection screen or as per ur requirement)
    CREATE DATA gv_dref TYPE TABLE OF (g_tabname).
    ASSIGN gv_dref->* TO <g_itab>.
    now use the below select query to fetch the data
      SELECT * FROM (gv_tabname) INTO TABLE <g_itab>.
    Hope this will help

  • Dynamic SQL statements

    Hi
    Here is an interesting question for all. My application has to support 5 markets. For that I created a report based on querying a view. That report is based on some search criteria which comes through a form. Right now the report is perfectly working as I have queried it as
    select * from portland.rsu_inventory where ne = :ne_no
    But we have some more markets apart from PORTLAND. For that we want to use the same application. So we have to be able to pass the market name dynamically. I am able to capture the market name in the search croteria form. But how can I send the market name to the Report SQL statement like
    select * from &#0124; &#0124;MarketName&#0124; &#0124;.rsu_inventory where ne = :ne_no
    Here the "MarketName" should be the market name that I would dynamically pass.
    How can I acieve this. Thanks for any kind of suggession.
    venu

    According to the metalink, the new version of OracleAs Portal is no longer support the query statement passing to this wwv_render_report.show procedure but however you can pass the cursor handle to this procedure instead. Here is the sample code to call this procedure:
    declare
    v_qry_stmt varchar2(32767) ;
    v_cur_hdl int;
    begin
    v_cur_hdl := dbms_sql.open_cursor; -- open cursor
    v_qry_stmt := '<your query>';
    --Example query:
    --v_qry_stmt := 'select empno,ename from scott.emp';
    dbms_sql.parse(v_cur_hdl, v_qry_stmt, dbms_sql.native);
    PORTAL30.wwv_render_report.show(p_table_border=>'1',
    p_heading_bgcolor=>'#FFFFF0',
    p_heading_font_face=>'Arial',
    p_heading_font_size=>'13',
    p_table_bgcolor=>'#FFFFFF',
    p_font_face=>'Arial',
    p_font_size=>'10',
    p_query=>to_char(v_cur_hdl),
    p_col_headings=>PORTAL30.wwv_standard_util.string_to_table2('Employee Number:Employee Name')
    end;
    Thanks
    -Krishnamurthy

  • Execute Dynamic SQL statement using procedure builder

    i want to execute a dynamic SQL statment using procedure builder not using forms
    because my statement depending on a variable table name
    i know that i can do that from forms using
    FORMS_DDL('SQL_STAT');
    but i wanna to use the procedure builder
    which function i should use and how?
    please explain in example if you don't mind.
    thanks

    Hi,
    You can very well use DBMS_SQL Package supplied by Oracle for doing this.
    Search for DBMS_SQL in OTN. You will get all info regarding this.
    Regards.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by itslul:
    i want to execute a dynamic SQL statment using procedure builder not using forms
    because my statement depending on a variable table name
    i know that i can do that from forms using
    FORMS_DDL('SQL_STAT');
    but i wanna to use the procedure builder
    which function i should use and how?
    please explain in example if you don't mind.
    thanks<HR></BLOCKQUOTE>
    null

  • Comparintg times  in a dynamic sql statement

    I am working on a coversion procedure from one database to another. I have a move procedure that calls functions and the like .
    I am trying to use dynamic sql and my where clause is giving me errors. What am I missing here ? TIA....
    DEFINE DATECUTOFF ='11-JAN-05' of type date
    DES_DATE is a date column in the 2nd database .... type date
    I am building strings to do a create table from the 2nd database ...
    Testwhere := q'[where to_char("des_date", 'DD-MM-YY') < '01-JAN-05]'; === works but I want to pass in date variable
    Teststring := 'Create table '|| table_name || ' as select * from '|| second_table||'@'Linkname
    execute immediate teststring || ''|| testwhere;
    Testwhere := q'[where to_char("des_date", 'DD-MM_YY') <  to_char(DATECUTOFF, 'DD-MON-YY')]; gives me errors like invalid number, or invalid type depending on where the quotes are or how I define DATECUTOFF
    Any ideas of what I am doing wrong in comparing the two dates ?
    Thanks.

    Sorry if I confused anyone ... we're working a duo effort here and get confused ourselves. Here's a summary of the effort.
    We're on 11G Linux.
    We're writing scripts, procedures and functions that will help us transition from a remote database (Ingres) to oracle. We plan to do this for many dbs, so we are using variables for the table names, links, etc ....
    The Where clase that we are developing is pretty
    complex, so our initial attempts to build it is
    to make it into two sections as a "literal" , join them and do a execute immediate. A date fields seem to be the issue...
    Our main procedure calls a datamove function to do the select from the remote data base....
    DATECUTOFF is date;
    TESTWHERE is varchar2(600);
    TESTSTRING varchar2(600);
    TestString := 'Create table '|| table_name_temp|| as select * from '||remote_table_name||'@'Linkname;
    TestWhere :=q'[ Where ||des_date < 'DATECUTOFF'];
    execute immediate Teststring || '' ||Testwhere;
    Can I do this in dynamic plsql ? the des_date is the column from the remote database. DATACUTOFF comes from the main procedure passed in.
    I do a DBMS_OUTPUT.Put_Line{teststring);
    DBMS_OUPUT.Put_Line(testwhere);
    and get the following on my screen
    Create Table AC_KEY_TEMP as select * from ACK_KEY2@DBLINK2
    where "des_date" = 11-Jan-05
    DECLARE
    Error at line 1;
    ORA-00904 "JAN" invalid identfier
    ORA- 06512 at datamove.datamove, line 146
    ORA-06512 at line 49, which is the line for
    the TestWHERE string.
    so in the procedure, if DBMS_OUTPUT is correct, the execute immediate is operating on the where clause and it
    thinks the JAN field is incorrect. I have put single quotes around it as well ...

  • Creating a dynamic prepared statement

    the problem:
    i have a range of paratmeters coming in from a form and need to be able to create a dynamic query string to go into a prepared statement object.
    the problem i have is there are 2 fields year range and year.
    if year range is none i need to create the query string as such :
    where the value of year can be serached on exactly
    str.append("VOLUME_YEAR = ? ");the probelm is if the year range is 5 or year range is 10 i dont know how to maipulate the query string to be able to set the string such that i can then place the year value in the place holder in preparedStatement.setInt(1, year)
    how can i create the intial query string ie.- what are the possible things that i can do. - i'm thinking of things like putting some type of between or such type query statement - but not at all sure how the syntax would go - ie. how would i use the year value and how would i create this dynamic part of the query string so that the JDBC regonises it?
    thanks for any help.
    public String setVolumeYearQuerySt(String year, String yearRange, StringBuffer str){
              String volumeYearQueryString = null;
              Sring doAction= null;
              if (yearRange.equals("None")){str.append("VOLUME_YEAR = ? ");}
              else if(yearRange.equals("5 Years")){doAction = "Nothing";}
              else if (yearRange.equals("10 Years")){doAction = "Nothing";}
              return volumeYearQueryString;
              }

    Please do not cross-post:
    http://forum.java.sun.com/thread.jspa?threadID=686789&tstart=0
    - Saish

  • Dynamic SQL Statements with an JDBC Adapter

    Hello,
    i have a simple scenario:
    A WebService calls SAP XI and XI has convert this request into an dynamic SQL for a particular DB-Table.
    Two Questions:
    1. Can this done with an JDBC-Receiverchannel or do i have to write a Java Server-Proxy?
    2. How do i bring dynamic SQL Stratement into the JDBC Receiver-Adapter?
    Regard
    Gunnar

    I think you should be able to achieve this using the SQL_QUERY / SQL_DML action in the JDB receiver adapter...
    The SQL string can be dynamically created....
    see the help link on different document types with JDBC receiver adapater....look for statement6...
    http://help.sap.com/saphelp_nw04/helpdata/en/2e/96fd3f2d14e869e10000000a155106/frameset.htm
      <StatementName6>
    <anyName action=” SQL_QUERY” | “SQL_DML”>
    <access>SQL-String with optional placeholder(s)</access>
    <key>
      <placeholder1>value1</placeholder1>
      <placeholder2>value2<placeholder2>    
    </key>
    </anyName > 
      </StatementName6>
    Thanks,
    Renjith

Maybe you are looking for

  • Intel Mac Mini Core Solo - Kernel Panic on Boot

    I was wondering if anyone who has purchased the Intel Mac Mini is having issues with Kernel Panics during the booting sequence? I got a Core Solo from the local Apple store (couldn't wait to play, I'm waiting on the Core Duo I ordered online to come

  • C3 double anchor problem

    When inserting a link to an anchor on a page, users are able to browse to the part of the page they want using a link which already points to the anchor e.g. <a href="anypage.htm#anchor1">First link to anchored text</a>. If they do that the newly cre

  • Advance Table - Add Row button and coloumn issue

    Hi all, I have created Advanced Table wth four coloumns. for two columns item style as messagtextinput and the rest are same as DATE. But when the page is rendering the table columns shows as messagestyletext , which means messagetextinput style item

  • Search based on UnApproved status in HRMS

    Hi All I have search page which shows records based on search that page has one dropdown list which contain many options like Approved,Closed,Rejected,Unapproved,etc when I select Approved status then It shows all records that are approved and when I

  • Help in Query for max date

    Hi, How I can get the max(Gst_date) record of GRD. IF record of GRD has more than one record then I need the one max(GST_date) record of every GRD. Thanks. create table #CRT (CRT numeric, GRD numeric, GST_Date datetime) insert into #CRT values (7 ,19