Error in FROM clause of query

I've looked this over TONS of times and compared my query to the query in the tutorial and cannot figure out the error. Here's my SQL query:
select extractValue(value(t),'/*/id') "ID",
extractValue(value(t),'/*/key') "Key",
extractValue(value(t),'/*/featurelevel') "Feature Level",
extractValue(value(t),'/*/title') "Title"
extractValue(value(t),'/*/description') "Description",
extractValue(value(t),'/*/plaindesc') "Plain Description",
extractValue(value(t),'/*/location/city') "City",
extractValue(value(t),'/*/location/state') "State",
extractValue(value(t),'/*/location/zip') "Zip Code",
extractValue(value(t),'/*/location/country') "Country",
extractValue(value(t),'/*/company/name') "Company",
extractValue(value(t),'/*/detail-url') "URL",
extractValue(value(t),'/*/post-date') "Post Date"
from apex_collections c,
table(xmlsequence(extract(xmltype.createxml(c.clob001),'/job-list/job'))) t
where c.collection_name = 'JOB_RESPONSE'
Here's the resulting error message:
1 error has occurred
•     Query cannot be parsed, please check the syntax of your query. (ORA-00923: FROM keyword not found where expected)
And here's the query in the tutorial which works fine:
select extractValue(value(t),'/*/title') "Title",
extractValue(value(t),'/*/description') "Description",
extractValue(value(t),'/*/pubDate') "Date",
extractValue(value(t),'/*/author') "Author"
from apex_collections c,
table(xmlsequence(extract(xmltype.createxml(c.clob001),'/rss/channel/item'))) t
where c.collection_name = 'RSS_RESPONSE'
What am I missing? Any thoughts? Thanks in advance!

The line
extractValue(value(t),'/*/title') "Title"doesn't have a comma after the alias "Title"
HTH
Regards Nigel

Similar Messages

  • Stupid question: whats wrong here? -- Syntax Error in FROM clause

    i keep getting the error: Syntax Error in FROM clause.
    here is the code:
    <%@ page import="java.sql.*" %>
    <HTML>
    <HEAD>
         <TITLE>User Application Area</TITLE>
    </HEAD>
    <BODY BGCOLOR="#FFFFFF" TEXT="#000000">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:fypproject","","");
    Statement st = con.createStatement();
    String email = (String)session.getAttribute("email");
    String levelStatus = (String)session.getAttribute("levelStatus");
    String details = "SELECT PD.Forename, PD.Surname, L.Level_Name FROM PD Personal_Details AND LD Login_Details AND L Level WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    ResultSet rsDet = st.executeQuery(details);
    if(rsDet.next()) {
    String forename = rsDet.getString("Forename");
    String surname = rsDet.getString("Surname");
    String level_name = rsDet.getString("Level_Name");
    %>
    <DIV ALIGN="center"><H1>User Application Arena</H1></DIV>
    <BR>
    <H4>Welcome back <% out.println(forename + " " + surname); %> </H4>
    <BR>
    <%
    out.println(level_name);
    else {
    out.println("NOT FOUND ANYTHING");
    st.close();
    con.close();
    %>
    </BODY>
    </HTML>
    the strange thing is when i write a query that doesn't involve the 'Level' table it works fine.
    for example if i just want to display the forename and surname from 'Personal_Details' where the Email_Address = email it works fine...as soon as i involve the 'Level' table i get this error.
    i basically have 'Level_ID' in the 'Login_Details' table which is found out in the preceding jsp and passed through to this page and i can print out the Level_ID
    but....what i want to do is use this Level_ID and find the respective Level_Name in the Level table.
    my Level table looks like this:
    Level_ID Level_Name
    0 Pending
    1 Interview
    2 Rejection
    Thanks :o)

    Perhaps this is your issue ...
    The column Level_ID is in both the Login_Details and Level tables. Therefore, in your WHERE clause, you must specify a table alias for each reference to Level_ID
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND Level_ID = '" + levelStatus + "'";
    should be
    WHERE PD.Email_Address = LD.Email_Address AND LD.Level_ID = L.Level_ID AND L.Level_ID = '" + levelStatus + "'"; //ADDED "L." before Level_ID
    Level_ID would have been unique until you added the Level table.
    Good luck.
    -Mark

  • Syntax error in From clause from Access

    I am trying to migrate a database from Access 2000, and all of the tables except one migrate correctly. The one problem table gives me the following error message:
    Unable to migrate table data: NWQ_TANC.PARAMETERS; [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    Does anyone know how to fix this? I have found the error in the help Appendix, but it just lists it as a QUERY type error, #3131, and gives no explanation or clues on how to fix it.
    Thanks, Jessica

    Hi Jessica
    Just wondering if you ever managed to find a solution to this problem, as I am getting a very similar error - only I don't just get it for one table, I get it for every single table in the database!
    Would be very interested to hear if you managed to sort it or not
    Cheers
    Ed

  • Exception: DBD, [Microsoft][ODBC Excel Driver] Syntax error in FROM clause.

    Dear experts,
    I'm trying to create an universe linked to an Excel File.
    I've created the ODBc connection and the DNS Data Source and inserted the table (table name RAC$) in the Universe. however, when I try to map each table field in the universe's Objects I'm getting this error message:
    "Exception: DBD, [ODBC Excel Driver] Syntax error in FROM clause.State:37000".
    I've tried to rename the table, inserting square brackects and also add new parameters to the universe («Transactional Available = "Yes"» and «Delimited Identifier = "Yes"») but still no solution to my problem.
    Any advice, tip or trick?
    Thank you. My best regards.
    Inês Santos

    Hi Ines,
    Thanks for sharing how you resolved this! I will bookmark this so that I can find it when I will likely need it!
    Bill
    Sorry I don't know how to make the accent circumflex! Or is that what you call it? On top of the e?
    Edited by: wavery on Jun 11, 2010 12:07 AM
    Edited by: wavery on Jun 11, 2010 12:09 AM

  • Error in FROM clause

    hi,
    ok i have a piece of code which looks like
    ResultSet rs = stmt.executeQuery("SELECT OrderDate, ProdNumber, Quantity, Price, OrderNumber FROM Order WHERE EmailAddress='" + email + "'");
    when i execute it... i get following error
    java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in FROM clause.
    i don't think there is any problem with syntax...
    thanx in advance

    Hey the escape character in java is \ you need to use that to escape the property of " for eg you will write like this ResultSet rs = stmt.executeQuery("SELECT OrderDate, ProdNumber, Quantity, Price, OrderNumber FROM Order WHERE EmailAddress= "\""+ email + "\"");
    try this and let me know if it works

  • Error in FROM clause (MS Access)

    I'm getting an 'error executing a database query.' The query
    is a simple
    <cfquery name="myquery" datasource="#application.dsn#">
    SELECT *
    FROM #url.table#
    </cfquery>
    The debugging info i get is as follows:
    SELECT * FROM Order
    VENDORERRORCODE -3506
    SQLSTATE 42000
    It also states the error is in the FROM clause and only
    happens when url.table is Order, not the other table names. I know
    the order table exists because i get a nonexistent table name error
    when url table is a bogus table name. This implies that
    it knows the order table exists but says there's an error in
    the FROM clause. The query is successful on all the other tables in
    my db (MS access, i'm using the access driver without unicode). Any
    ideas?

    order is a reserved word...you'll need to escape it using
    brackets
    FROM [order]
    HTH
    Tim Carley
    www.recfusion.com
    [email protected]

  • How to use From clause as a block datasources

    Hi,
    I want to know how to use from clause as a block datasource.
    Could anyone give me an example to do that? I couldn't find it
    in the help file.
    I sincerely ask someone help me.
    Many thanks
    Diana

    Diana,
    I presume you are getting a "FRM-40505: error unable to perform
    query" when you try to execute query. I suggest you select the
    "Display Error" item from the "Help" menu to see the query that
    Oracle is generating. If the query that Oracle generates as a
    result of your "Query data source name" is not formed correctly,
    you will get the FRM-40505 error.
    Copy and paste the query that is displayed into SQLPLUS and test
    to see what happens when you try to execute the query from
    SQLPLUS. That will give you a better idea of what the cause of
    the problem is.
    From your example, a query that works should look like "select
    c_no from (select c_no from books)".
    Keep in mind that for blocks based on FROM clause, the query that
    produces the data is of the form :
    SELECT <all columns in the block>
    FROM <select statement entered in the "Query Data Source Name"
    blockproperty>
    The data source for the block is the select statement embedded in
    the from clause.
    Hope this helps.

  • Nested query in FROM clause causes 'SQL Command not properly ended' error

    SELECT sj.job_id AS job_id, 'STATUS_AWAITING_PREPARATION' AS job_status, sjr.email_sys_attach_filename AS attach_filename, sje.emailaddr as emailaddr_lastsentto
                        FROM arsnd_jobs sj, (SELECT emailaddr from ARSND_JOB_EMAILS where job_id=sj.job_id AND ROW_NUM=1) as SJE, ARSND_JOB_QUEUE sjq,ARSND_JOB_RECIPIENTS sjr
                        WHERE sj.job_id=sjq.job_id and sj.job_id=sjr.job_id
                        AND sjq.PROCESSING_STATE=0
                        ORDER BY sj.created
    I don't see anything wrong with the above query, it fails with 'SQL Command not properly ended'.
    If I remove the usage of the nested query in the FROM clause, then it doesn't give that error. Please advice what I'm doing wrong.

    Pls try
    SELECT sj.job_id AS job_id, 'STATUS_AWAITING_PREPARATION' AS job_status, sjr.email_sys_attach_filename AS attach_filename, sje.emailaddr as emailaddr_lastsentto
    FROM arsnd_jobs sj, (SELECT emailaddr from ARSND_JOB_EMAILS where job_id=sj.job_id AND ROW_NUM=1) SJE, ARSND_JOB_QUEUE sjq,ARSND_JOB_RECIPIENTS sjr
    WHERE sj.job_id=sjq.job_id and sj.job_id=sjr.job_id
    AND sjq.PROCESSING_STATE=0
    ORDER BY sj.created
    I have removed the 'as' clause you used for alias of the subquery. It should work fine now.....

  • Query data source type = procedure or from clause

    1)I have a form where a block is based on a from clause. In the source name I entered a simple sql statement.
    Isn't the items suppose to show without any other action or
    WHAT ELSE DO I NEED TO DO IN ORDER TO SEE THE BLOCK ITEMS EQUIVALENT TO THE COLUMNS IN THE QUERY?
    2) I have a form where a block is based on a procedure.
    First I created a package in a program unit with the procedures query_procedure, insert_procedure, update_procedure, delete_procedure and lock_procedure.
    Then I set the query data source name to the package query_procedure. The columns and arguments were automatically filled by Forms - they are fine as well.
    Forms automatically created the block triggers insert-procedure,delete-procedure, update-procedure and lock-procedure.
    Everything seems to be fine but when I run the form and execute the query I get frm 40505 - unable to perform query.
    What am i doing wrong?
    This is the package:
    PACKAGE pkgdeptemp IS
    type dept_emp is record (
    empno number(4),
    ename varchar2(10),
    job varchar2(9),
    hiredate date,
    sal number(7,2),
    deptno number(2),
    dname varchar2(14));
    success constant number :=0;
    type dept_emp_ref is ref cursor return dept_emp;
    type dept_emp_tab is table of dept_emp index by binary_integer;
    procedure query_procedure (resultset in out dept_emp_ref, p_empno in number);
    procedure lock_procedure (dmlset in out dept_emp_tab);
    procedure insert_procedure (dmlset in out dept_emp_tab);
    procedure update_procedure (dmlset in out dept_emp_tab);
    procedure delete_procedure (dmlset in out dept_emp_tab);
    END;
    PACKAGE BODY pkgdeptemp IS
    function get_success return number is
         begin
              return(success);
         end;
    procedure query_procedure (resultset in out dept_emp_ref, p_empno in number) is
    begin
         open resultset for
              select e.empno, e.ename, e.job, e.hiredate, e.sal, e.deptno, d.dname
              from emp e, dept d
              where e.deptno = d.deptno
              and e.empno = nvl(p_empno, e.empno);
    end query_procedure;
    procedure lock_procedure(dmlset in out dept_emp_tab) is
         tempout number(4);
    begin
         for i in 1..dmlset.count loop
              select empno
              into tempout
              from emp
              where empno = dmlset(i).empno
              for update;
         end loop;
    end lock_procedure;
    procedure insert_procedure (dmlset in out dept_emp_tab) is
         cursor c_dept (i binary_integer) is
         select deptno
         from dept
         where deptno = dmlset(i).deptno;
         tempout number(4);
    begin
         for i in 1..dmlset.count loop
              open c_dept(i);
              fetch c_dept into tempout;
              if c_dept%notfound then
                   insert into dept(deptno,dname)
                   values(dmlset(i).deptno, dmlset(i).dname);
              end if;
              close c_dept;
              insert into emp (empno,ename,job,hiredate,sal,deptno)
              values (dmlset(i).empno, dmlset(i).ename, dmlset(i).job, dmlset(i).hiredate, dmlset(i).sal, dmlset(i).deptno);
         end loop;
    end insert_procedure;
    procedure update_procedure (dmlset in out dept_emp_tab) is
         cursor c_dept (i binary_integer) is
         select deptno
         from dept
         where deptno = dmlset(i).deptno;
         tempout number(4);
    begin
         for i in 1..dmlset.count loop
              open c_dept(i);
              fetch c_dept into tempout;
              if c_dept%notfound then
                   insert into dept(deptno,dname)
                   values(dmlset(i).deptno, dmlset(i).dname);
              else
              update dept
              set deptno=dmlset(i).deptno,
              dname=dmlset(i).dname;
              end if;
              close c_dept;
         update emp
              set empno=dmlset(i).empno,
              ename=dmlset(i).ename,
              job=dmlset(i).job,
              hiredate=dmlset(i).hiredate,
              sal=dmlset(i).sal,
              deptno=dmlset(i).deptno;
         end loop;
    end update_procedure;
    procedure delete_procedure (dmlset in out dept_emp_tab) is
    begin
         for i in 1..dmlset.count loop
              delete from emp where empno = dmlset(i).empno;
         end loop;
    end delete_procedure;
    END;

    for ur q1:
    create the text items manually in the layout editor or in the obj navigator then specify there properties manually in the the pallette.
    database item = yes
    column name = field name in ur select statement
    for q2:
    try running the form again and press F8 then if an error occur press F1 or shift F1 to show the error in ur code.
    i suspect u forgot to specify a value for the in parameter the reason why u get an error that is specify the actual parameter for ur in argument then press F8.
    enjoy!

  • From Clause query with form variables

    forms 9.0.4 rdbms 9.2
    Is it possible to create a From Clause query with form variables generated from another block (but in the same form)? I am not having any success.
    I searched Metalink. It appears that according to DOC ID # 69884.1, in Forms 6i, this is not possible. Metalink suggest in DOC ID 104771.1 implementating a dynamic From Clause, but when I duplicate the example on my system, I receive an Oracle error. Further investigation from the web form (DISPLAY ERROR) indicates that the system does not see the dynamic value.
    Has anyone else run into this error? Has this been fixed in forms 9.0.4 and I am just missing something? Does a dynamic from clause query work? Can anyone point me to an example or post an example or offer any advise.
    thanks in advance

    As far as I know it is not possible to use block items in a from clause query in forms 9.0.4. Here is my solution for a From-Clause-Query via the 'Query-Data-Source-Name-Property':
    To use the values of the block items in my from clause query I implemented a database package with getter and setter routines for the block item values I needed for the query.
    In the Key-Exeqry-Trigger of the From-Clause-Query-Block I set the global package variables with values of the block-items I am interested in. In the From-Clause-Query I used the values in the where-clause via package functions which return the global package variables.
    Hope my solution will work for your problem.

  • SET_BLOCK_PROPERTY('QUERY_DATA_SOURCE_NAME') with FROM clause query data block

    Two block :
    - Block A based on table
    - Block B based on FROM clause query
    In WHEN-NEW-RECORD-INSTANCE of block A, I perform a SET_BLOCK_PROPERTY('BLOCK_B','QUERY_DATA_SOURCE_NAME','(...)'); and then query block B (... depends on value taken by 'code' column in block A).
    At runtime it works till 'code' does not change (query_data_source_name does not change) but when I navigate to a record having a different 'code', it got the folowing message :
    41380 - Cannot set the blocks query data source.
    Any idea or suggestion ?

    Hello all i m trying dynamically change query_data_source_name but its not working.
    i did the followings
    Forms(10g2) block level:Query_data_source_type
    Query_data_source_name:SELECT 1,2,3,4,5 FROM dual;
    in control Block:
    when_button_press my code is
    GO_BLOCK('blk_query');
    Clear_Block(No_Validate);
    set_block_property('blk_query',query_data_source_name,
    'SELECT col1,col2,col3,col4,col5 FROM mytable');
    execute_query;
    same result:unable to query error.
    any one can help me regarding this issue.

  • FROM CLAUSE QUERY, how to construct?

    Have always used the data block wizard so am probably missing something quiet simple. I have created a new form and am manually creating a simple test block. What i've done so far:
    Block Properties
    Database Data block: No
    Enforce Primary Key: Yes
    Query allowed: Yes
    Query data source type: FROM clause query
    Query data source name: select department_id, department_name from departments
    Query data source columns: department_id (number), department_name (varchar2)
    Created a canvas with and put two items, department_id (set as Primary key) and department_name on it.
    When i run the form i get... FRM-41003 This function cannot be performed here.
    What am i doing wrong and what steps should i be taking?
    Gus
    Oracle 10g

    first of all you should set the DATABASE DATA BLOCK property to YES, not NO.
    it is a database block though not based on a TABLE, rather on a FROM CLAUSE QUERY, but it is a database block.
    another thing, when you run the form, what function you are trying to perform when you get the error: "FRM-41003 This function cannot be performed here."
    i guess you are trying to query the data. if its same, then that should be resolved once you set the DATABASE DATA BLOCK to YES.

  • FROM Clause Query and Invisible records :(

    HI:
    My form has a block based on a FROM clause query (QUERY DATA SOURCE TYPE).
    This works fine with no errors. Count hits suggests that it is retrieving records but my Item is not displaying the records. I have nine records in total but all fields are blank even though I can 'scroll' through the nine (invisible) records.
    Strange, any ideas people ?
    thanks.
    N.

    Thanks you for the reply but its not the cause of the 'probem'. My items are in a multi record block ( I have tried single item bock / No Items displayed 1 etc..) but to no avail.
    The strange thing about it is that I can Message(:blk.item) and the value displays on the Message bar but there are no values displayed in the Canvas Item at runtime ????? Very strange or does someone know something I dont.
    I can even scroll to the end of the record set ( 9 recs).
    I have never caome across this before has anyone else ?
    Thanks
    N.

  • From clause query works ok in form designer,  gets an ORA-01422 ran on web

    I am using forms 6i patch 9 with 10g database.
    I have two ‘FROM clause queries’ fired via a block/key-exeqry trigger in a if/elsif.
    The first/top SET BLOCK PROPERTY works perfect and populates the block.
    But the bottom/second SET BLOCK PROPERTY select (after the elsif)
    Is also based on a user entered field value and generates a ora-01422 error.
    The problem is that both top and bottom set block properties
    work fine when ran in forms designer,
    But when I compile it on the app_server and run the web version
    1. the top all ‘FROM clause query’ works fine
    2. the bottom ‘FROM clause query’ works fine if only one record to return.
    3. the bottom ‘FROM clause query’: gets the ora-01422 if > 1 record to return.
    FRM-40735: KEY–EXEQRY trigger raised unhandled exception ORA-01422
    The ORA-01422: ‘Exact fetch returned more than the exact number of rows’.
    Both set block property selects ‘share’ a block property/where clause of FAC_ID = :FACILITIES.ID
    The entered value in the entry field should populate 1 to many associated records
    in the bottom (elsif) set block property (and does so correctly when ran in forms designer)
    The block’s key-exeqry code:
    –-query all records associated with fac_id only
    if (:emission_stacks.stack_id_num is null) then
         SET_BLOCK_PROPERTY('EMISSION_STACKS',QUERY_DATA_SOURCE_NAME,
         '(SELECT C.ID, A.ID EP_ID,A.FAC_ID,A.NUM,A.DESCRIPTION,C.PARENT_MODE_ID,
    C.STACK_ID, C.CAPTURE_PERCENT, C.CAPTURE_METHOD, C.DATE_TESTED
    FROM EMISSION_POINTS A,
    EP_MODES B,
    CAPTURING_DEVICES C
    WHERE A.ID = B.EP_ID AND
    B.ID = C.PARENT_MODE_ID AND
    C.CD_ID IS NULL AND
    C.PARENT_MODE_ID IS NOT NULL AND
    C.STACK_ID IS NOT NULL)');
    EXECUTE_QUERY;
    elsif
    (:emission_stacks.stack_id_num is not null) then
    –-(query all records associated with fac_id and the entry field value)
    SET_BLOCK_PROPERTY('EMISSION_STACKS',QUERY_DATA_SOURCE_NAME,
         '(SELECT C.ID, A.ID EP_ID, A.FAC_ID, A.NUM, A.DESCRIPTION, C.PARENT_MODE_ID,
    C.STACK_ID, C.CAPTURE_PERCENT, C.CAPTURE_METHOD, C.DATE_TESTED
    FROM EMISSION_POINTS A,
    EP_MODES B,
    CAPTURING_DEVICES C,
    STACKS S
    WHERE A.ID = B.EP_ID AND
    B.ID = C.PARENT_MODE_ID AND
    C.STACK_ID = S.ID AND
    C.CD_ID IS NULL AND
    C.PARENT_MODE_ID IS NOT NULL AND
    C.STACK_ID IS NOT NULL AND
    S.NUM = '''||:emission_stacks.stack_id_num||''')');
    EXECUTE_QUERY;
    ** I have multiple database items in the block.
    Data block properties:
    Database/
    Data Base Block = Yes
    Query Allowed= Yes
    Is there a way to overcome the ora-01422?
    And populate the block with multiple rows(records)?
    Any suggestions appreciated.

    Sorry, false alarm, I made a mistake
    the form is working fine the way it should,
    without error. (No ora-01422 errror is occurring now.)
    I just got a new version of humming bird,
    which I used to compile the form with
    and did not have the binary switch on:
    --long story short, a new fmx was not created
    and I was not seeing the current version of screen
    at runtime.
    Thank you.

  • Block based on "From clause query" and substitution variable

    Hi Folks,
    I have a "From clause query" block type, which is based on query that uses a substitution variable (:BLOCK.COLUMN) from previous block. When I run a query, then I obtain an error: ORA-01008: not all variables bound.
    My query looks like:
    select seq_no, prod_code, descr, curr_code,
           max(decode(sched_type_code,'ROLLOVER',amt,0)) OUTSTD_DRAW,
           max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) OUTSTD_INTEREST_FEE
    from
        select r.fac_no, r.prod_code, f.descr, r.prod_seq_no seq_no, r.curr_code, r.sched_type_code,sum(nvl(rep_amt,0)) amt
          from repay_scheds r,
               fac_prods f
         where r.fac_no = f.fac_no
           and r.prod_code = f.prd_code
           and r.prod_seq_no = f.seq_no
           and r.fac_no = :B2.FAC_NO
           and r.trans_ref_from is not null
           and r.status         <> 'P'
        group by r.fac_no, r.prod_code, f.descr, r.prod_seq_no, r.curr_code, r.sched_type_code 
    group by seq_no, prod_code, descr, curr_code
    having max(decode(sched_type_code,'ROLLOVER',amt,0)) >0 or max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) > 0Once I replace that substitution variable in query condition with some exact test number then it works fine.
    select seq_no, prod_code, descr, curr_code,
           max(decode(sched_type_code,'ROLLOVER',amt,0)) OUTSTD_DRAW,
           max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) OUTSTD_INTEREST_FEE
    from
        select r.fac_no, r.prod_code, f.descr, r.prod_seq_no seq_no, r.curr_code, r.sched_type_code,sum(nvl(rep_amt,0)) amt
          from repay_scheds r,
               fac_prods f
         where r.fac_no = f.fac_no
           and r.prod_code = f.prd_code
           and r.prod_seq_no = f.seq_no
           and r.fac_no = 2012500
           and r.trans_ref_from is not null
           and r.status         <> 'P'
        group by r.fac_no, r.prod_code, f.descr, r.prod_seq_no, r.curr_code, r.sched_type_code 
    group by seq_no, prod_code, descr, curr_code
    having max(decode(sched_type_code,'ROLLOVER',amt,0)) >0 or max(decode(sched_type_code,'INTCHG',amt,decode(sched_type_code,'FEEREC',amt,0))) > 0How can I use substitution variable within query for "From clause query" block type? Or any other way how to get the same result?
    Thanks for your reply.
    Tomas

    I have a solution:
    Before entering block I'm calling function, that populates my block:
    PROCEDURE POP_<<MY_BLOCK>>_BLOCK IS
      query_txt varchar2(2000);
    BEGIN
       query_txt := '(select seq_no, prod_code, descr, curr_code,
                            max(decode(sched_type_code,''ROLLOVER'',amt,0)) OUTSTD_DRAW,
                            max(decode(sched_type_code,''INTCHG'',amt,decode(sched_type_code,''FEEREC'',amt,0))) OUTSTD_INTEREST_FEE
                                                  from
                                                     select r.fac_no, r.prod_code, f.descr, r.prod_seq_no seq_no, r.curr_code, r.sched_type_code,sum(nvl(rep_amt,0)) amt
                                                       from repay_scheds r,
                                                            fac_prods f
                                                      where r.fac_no = f.fac_no
                                                        and r.prod_code = f.prd_code
                                                        and r.prod_seq_no = f.seq_no
                                                        and r.fac_no = '||:B2.FAC_NO||'
                                                        and r.trans_ref_from is not null
                                                        and r.status         <> ''P''
                                                     group by r.fac_no, r.prod_code, f.descr, r.prod_seq_no, r.curr_code, r.sched_type_code 
                                                 group by seq_no, prod_code, descr, curr_code
                                                 having max(decode(sched_type_code,''ROLLOVER'',amt,0)) >0 or max(decode(sched_type_code,''INTCHG'',amt,decode(sched_type_code,''FEEREC'',amt,0))) > 0)';
       Go_Block('<<MY_BLOCK>>' );
       Clear_Block ;
       Set_Block_Property( '<<MY_BLOCK>>', QUERY_DATA_SOURCE_NAME, query_txt) ;
       -- populate my  block --
       Execute_Query ;
    END;Thanks,
    Tomas

Maybe you are looking for

  • What was going on in db at a given time ??

    Hi All, I am on 11.2 on Linux. I want to find out (ideally) which SQLs were running on my database between 21:00 and 21:15 last night? How can I do that? AWR has 1 hour snapshot interval, can it still generate report for 15 minutes interval? What els

  • Merge 3 Unlinked Reports into a single Report

    I have 3 Crystal Reports with  different structures and groupings, I want to view it in single report .Right now I'm using Embedded Crystal Report hence I'm unable to merge it through the code .I require a solution to this. Thanks a lot in advance.

  • Send Image to browser - Firefox issue

    Hi, I have implemented the retrieval of an OrdImage from the DB and sending it to a browser using the OrdHttpJspResponseHandler: OrdImage media = (OrdImage)result.getCustomDatum(1, OrdImage.getFactory()); handler.setPageContext(pageContext); handler.

  • What is X-CorrelationID in the OEG 11g transaction log ? How can I get it ?

    Hi May I have question here: what is X-CorrelationID in the OEG 11g transaction log ? How can I get it through policy path and keep it's value ? Thanks. Cliff

  • Loading large text files into java vectors and outof memmory

    Hi there, need your help for the following: i'm trying to load large ammoubnts of data into a Vector in order to concatenate several text files and treat them, but i'm getting outofmemory error. I even tried using xml structure and saving to database