Can we create prompts in Derived Table sql query

Hi,
I am trying to define derived table sql query as below. Though the syntax parsing is going through but when I am generating the report it is throwing and invalid prompt definition error.
" select * from table_a where call_direction = @Prompt('Enter Call Direction','A','"derivedtable_a".SHORT_STRING',mono,free,not_persistent,) and
where call_type = @Prompt('Enter Call Direction','A','"derivedtable_b".SHORT_STRING',mono,free,not_persistent,) "
Can somebody please share your thoughts if this can be achieved in universe or not ?
Appreciate immediate responses as it is a show stopper for my deliverable.
Thanks in advance.
Thanks and Regards,
Shireen.

Hi Shireen
We can use prompt in the derived table. There is issue with the SQL that you have used while creating the Derived Table.
Instead of using the "derivedtable_a".SHORT_STRING' field use the object from the class on which you are creating the derived table.
For example: If you are creating a derived table in the sample universe efashion on Agg_yr_qt_rn_st_ln_ca_sr table then use the following query:
SELECT *
FROM Agg_yr_qt_rn_st_ln_ca_sr
WHERE Agg_yr_qt_rn_st_ln_ca_sr.Yr = @Prompt ('Enter Value','C','Time Period\Year',mono,constrained)
Hope this helps!
Thanks

Similar Messages

  • Can u create cluster and pooled tables in real time

    hi
        can u create cluster and pooled tables in real time.can u send data base tables name of above one.

    Hai Anil
    For creating cluster tables first u have to create table pool ...
    create a table and specify the fields and other tecnical settings and
    then Goto EXTRAS --> Change Table Category and selct the Pooled table and activate it...
    Then Create another table And specify the required fileds and also the settings and then
    Goto EXTRAS --> Change Table Category and selct the Cluaster table and in Delivery and
    Maintainence Properties mention the Pooled table that u created and activate it...
    Regards
    Sreeni

  • How to get second maximum salary from employee table(sql query)

    how to get second maximum salary from employee table(sql query)

    dude there is no matter of structure .........that user already said its from employee table ...............its basic table in sql and there is no need to specify the table structure
    .........i think u got my point I think you are the one who didn't understand Sarma's point.
    Give a man a fish and you feed him once. Teach a man how to fish and you feed him a life long.
    >
    and the query is
    select max(sal) from emp where sal<(select max(sal)
    from emp);
    this will give the 2nd max salary from the emp tableBtw: You solution is bad, because it needs to scan and sort the table emp twice. And a better solution has been given already.
    Message was edited by:
    Sven W. - reordered statements

  • How can i create a Global Temporary Table inside a Stored Procedure....

    Hi...
    I need to create a Global Temporary Table inside a Stored
    Procedure....
    I have no idea how to do that....
    Please....if u can send me a sample, send to me....
    Thanks a lot

    To create a global temporary table inside a stored procedure,
    the minimal syntax would be:
    CREATE OR REPLACE PROCEDURE procedure_name
    AS
    BEGIN
    EXECUTE IMMEDIATE 'CREATE GLOBAL TEMPORARY TABLE table_name'
    || '(column_name NUMBER)';
    END procedure_name;
    As Todd stated, it would probably be better to create the global
    temporary table outside of the procedure:
    SQL> CREATE GLOBAL TEMPORARY TABLE table_name
    2 (column_name NUMBER);
    Table created.
    You can also specify things like ON COMMIT PRESERVE ROWS or ON
    COMMIT DELETE ROWS.
    It may be that there is something else, like a PL/SQL table of
    records or a cursor, that would suit your needs better. It is
    difficult to guess without knowing what you want to do with it.

  • Can we create cursor using the table created dynamically

    Dear all,
    Can we create the cursor using the table which is created dynamically using "Execute immediate" within the same procedure,
    or is there any way to call the table created dynamically ..
    please Do Help me in this
    thanks alot
    Edited by: khaja on Jan 18, 2009 10:57 AM

    Well, I don't think this approach is bad in any possible circumstances. It depends on the requirements we don't know. Yes, usually applications should not be designed in this way. But 'usually' does not mean 'never'. One possible case is described in Oracle's example Referencing Database Objects that Do Not Exist at Compilation. It's possible to assume that tables inv_01_2003, inv_04_2003, etc from the referenced topic What Is Dynamic SQL? are generated automatically by some job using dynamic create table stmt. If the OP has similar requirements tnen this approach is not bad. It may not be the best one but it at least is not so bad as you said.
    I believe that OPs know their requirements much better than me. This is why I always try to answer the exact question. If the approach is really ugly then I don't answer such questions at all.
    Regards,
    Dima
    Message was edited by:
    DimaCit

  • Paragraph styles - can I create one so that tables label: Table 1, Table 2, Table 2A, Table 3...

    I have certain sections where the table headings continue with letters, but not always.  Can I create a paragraph style, or manipulate the numbering easily, so that I can add letters after the table # when it is necessary?
    Table 1
    Table 2
    Table 2A
    Table 3
    Table 3A
    Table 3B
    Table 4
    etc...

    Try Numbered list
    http://blogs.adobe.com/indesigndocs/2009/04/numbered_lists_part_iii_figure.html

  • Can I create a file using pl/sql code in application server ?

    Hi
    I wanted to create a file(any kind of file .txt .csv .exe etc..) using pl/sql code in application server?
    Please help me with an example...in this regard
    Regards
    Sa

    864334 wrote:
    I wanted to create a file(any kind of file .txt .csv .exe etc..) using pl/sql code in application server?And how is this "file" to be delivered?
    Files can be created by PL/SQL code and stored in the Oracle database as CLOBs. This a fairly easy and robust process. It runs entirely in the database. It conforms to transaction processing. The "file" (as a CLOB) resides in the database and can thus be secured via database security, is part of database backups and so on.
    The basic issue is how to deliver the contents of the CLOB to the user. If via FTP, then the database can directly FTP the contents of the CLOB to the FTP server as a file. If via HTTP, the database can deliver the CLOB as a HTTP download directly to the web browser.
    If the client is Java or .Net, then the CLOB contents can be delivered via SQL or DBMS_LOB or a custom PL/SQL interface.
    In such cases, there is no need to step outside the secure and flexible database environment and create a physical o/s file in the wild (outside the controls of database security, data integrity and transaction processing). This is thus recommended and is the preference.

  • BUG??? Can't  create a class deriving from ActionForm using wizard

    Has anyone managed to create an class deriving from ActionForm class using the wizard in JDev 9033?
    When I try to do create a class by right-clicking.."New"..etc nothing happens!!

    Yeah. Same thing happens for me. I went to File->New->Web Tier->Struts->ActionForm. Can't get it to do anything.

  • How many heirachies can be created using one dimensional table

    Hi,
    I have one dimension table and one fact table, how many heirachies can be created, is it only one?
    Thank you.

    Hi,
    One dimension can have only one hierrarchy for sure.But create dimension in a such a way(columns should be included in one dimension,example: Year and FYear in Time Dimension) that we can create two branches on Total level.
    Refer this blog..Will solve your doubt....http://gerardnico.com/wiki/dat/obiee/hierarchy#defining_multiple_hierarchies_for_the_same_dimension_logical_table
    Regards,
    Srikanth
    http://bintelligencegroup.wordpress.com

  • How to create a Folder using a SQL Query?

    Hi
    How can I create a Folder (eg. C:\MyNewFolder) using SQL Query?

    Hi,
    I added some code in order to get the result from the xp_cmdshell command
    This returns null if successfull, if an error occurs returns the error message. May be useful instead of getting an sql error
    Code Snippet
    declare @cmdpath nvarchar(60), @Location nvarchar(100), @message nvarchar(max)
    set @Location = N'C:\Temp\Temp5'
    set @cmdpath = 'MD '+ @Location
    Create table #result
    result nvarchar(255)
    insert into #result (result) exec master.dbo.xp_cmdshell @cmdpath
    select @message = ISNULL(@message + ' - ','') + result from #result where result is not null
    select @message
    drop table #result
    Eralper
    http://www.kodyaz.com

  • Can I declare variables in Reports from SQL Query

    Hi
    I have a Report from SQL Query published as a portlet on a page among other reports. In the query report I am using the fuction WWCTX_API.GET_USER at quite a few places to filter the data returned to the user. Can I assingn the user id to a variable at some level & replace the fuction WWCTX_API.GET_USER with the variable in all the places.
    For eg:
    usr varchar2(25);
    usr:= PORTAL30.WWCTX_API.GET_USER;
    select USER_ID, USER_LVL, BUSINESS_ID, BRANCH_ID from crs_user where user_id=usr;
    can i declare variable and assign the value like the above at any level(Report or Page Level) to the acces the variale in queries.
    Thanks in advance

    I have found that you can't use a * in a dynamic page.
    Try this:
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    You can also add table tags for column formating:
    <table>
    <tr><td>column 1</td></tr><tr><td nowrap>
    <ORACLE>
    DECLARE
    usr varchar2(25):=PORTAL30.WWCTX_API.GET_USER;
    BEGIN
    for c in
    (SELECT <column_name> <alias> FROM PORTALWORK.CRS_USER WHERE USER_ID=usr)
    Loop
    htp.p(c.<alias>);
    END;
    </ORACLE>
    </td></tr></table>
    Martin

  • Can't pass a parameter to an SQL Query

    I've looked for about an hour or more now on the web, java.sun.com, but can't find what I need:
    I have a page called display.jsp, and I call it from the browser
    http://localhost/display.jsp?libnum=1
    In the page I have the following code:
    <sql:query var="profileQuery" dataSource="${profileDS}">
    SELECT * FROM singles.profile where libnum=?
    <sql:param value="${libnum}"/>
    </sql:query>
    However, the database sees the query as
    " SELECT * FROM singles.profile where libnum=null"
    So, my question is how do I make this line work ? :
    " <sql:param value="${libnum}"/> "
    can you help ?
    thanks !
    Dennis

    Dude .....
    Here's my code now -- solved it... phew..
    Just to think of it ... what a difference between "libnum" and "param.libnum". That was like 3-4, if not 5 hour difference for me.
    <sql:query var="profileQuery" dataSource="${profileDS}">
    SELECT * FROM singles.profile where libnum=?
    <sql:param value="${param.libnum}"/>
    </sql:query>
    Dennis

  • Can we change/Modify BI server generated Sql query and run to fetch data

    Hi,
    My client is saying that there is an option to modify bi server generated sql query to fetch data from source.
    question:As a request is made in presentation services, A dynamic sql query is generated and fetches data from source. all this is loggedin Nqlquery log..well can we change/modify the sql query generated and run modified sql query to fetch data from source. ., if so how? if not why?
    Thanks in advance
    Edited by: user10794468 on Jun 16, 2009 6:29 PM
    Edited by: user10794468 on Aug 12, 2009 6:58 PM

    Thank you so much for your reply..
    ..Can we also modify sql query generated by bi server to fetech data. the query's which we see in query log file..

  • Creating JTree with results from SQL Query

    I have the following source in SQLJ:
    String temp=null;
    iter1 it1;
    iter2 it2;
    #sql it1={select id,fdn,level from groups connect by prior fdn=parent_fdn start with fdn='/' };
    while(it1.next())
    System.out.println(it1.id()); // Display Parent
    temp=it1.fdn();
    #sql it2= {select clli from nes where parent_fdn=:temp order by clli };
    while(it2.next())
    System.out.println(it2.clli());//Display Child of above Parent if any
    My problem is to construct a Tree GUI using JTree from the above
    code with the same hierarchy of parent-child relationship.
    I have tried every possible solution using Vectors,Hashtables,String Arrays etc but have not come up with a successful solution so far
    IF ANYONE HAS A SOLUTION PLEASE HELP ME WITH AN EXAMPLE.
    Thank You
    Sharath

    sharathkv,
    Your issue seems to be in figuring out an algorithm to convert row-based SQL resultsets to a hierarchical data structure suitable for display in a tree.
    Run the jython (www.jython.org) app below: it simulates doing just that. jython is indentation-sensitive, so you'll need to exercise care when copying. If copy-paste to a text editor doesn't work, copy-paste to a HTML-aware editor (even Outlook Express, if on Windows), then copy from there and paste in a text editor.
    --A
    This is a jython (www.jython.org) app that illustrates
    converting row-based data (eg. a SQL resultset) to a custom
    hierarchical data structure, and displaying it in a JTree.
    from javax.swing import *
    from javax.swing.tree import *
    import java
    def getSQLRows():
        Simulates a SQL resultset.
        Columns fdn and parent-fdn indicate parent/child relationships.
        rows = [
            # id, fdn, parent-fdn, level
              [1, '/', None, 1]
            , [2, '/fruits', '/', 2]
            , [3, '/colors', '/', 2]
            , [4, '/sports', '/', 2]
            , [5, '/fruits/apples', '/fruits', 3]
            , [6, '/fruits/oranges', '/fruits', 3]
            , [7, '/colors/red', '/colors', 3]
            , [8, '/colors/blue', '/colors', 3]
            , [9, '/sports/petanc', '/sports', 3]
            , [10, '/sports/rugby', '/sports', 3]
        return rows
    def convertRowsToHierarchy(rows):
        Converts row-based results to hierarchical structure.
        Uses known parent/child relations present in rows.
        root = None
        for row in rows:
            fdn, parentfdn = row[1], row[2]
            node = SQLTreeNode(fdn, parentfdn)
            if root:
                root.addEx(node)
            else:
                root = node
        return root
    class SQLTreeNode(java.lang.Object):
        '''Custom tree node; displayed in JTree'''
        def __init__(self, fdn, parentfdn):
            self.fdn = fdn
            self.parentfdn = parentfdn
            self.nodes = []
        def add(self, node):
            '''Adds node as immediate child'''
            self.nodes.append(node)
        def addEx(self, node):
            '''Adds-with-search.  NOTE: naive implementation'''
            if self.fdn == node.parentfdn:
                self.add(node)
            else:
                for child in self.nodes:
                    child.addEx(node)
        def toString(self):
            return self.fdn
        def dump(self):
            '''Debug routine to dump hierarchy'''
            print 'fdn=%s, parentfdn=%s' % (self.fdn, self.parentfdn)
            for node in self.nodes:
                node.dump()
    class SQLTreeModelAdapter(TreeModel):
        '''Tree model adapter: adapts custom data structure to TreeModel'''
        def __init__(self, root):
            self.__root = root
        def getChild(self, parent, index):
            return parent.nodes[index]
        def getChildCount(self, parent) :
            return len(parent.nodes)
        def getIndexOfChild(self, parent, child):
            return parent.nodes.index(child)
        def getRoot(self) :
            return self.__root
        def isLeaf(self, node):
            return len(node.nodes) == 0
        def addTreeModelListener(self, l):
            pass
        def removeTreeModelListener(self, l):
            pass
        def valueForPathChanged(self, path, newValue):
            pass
    class SQLTreeDemo(JFrame):
        Tree demo UI
        Displays a tree displaying [hierarchical] results
        of a BOM-type SQL query
        def __init__(self):
            # Get matrix simulating SQL resultset
            rows = getSQLRows()
            # Convert to custom hierarchical data structure
            root = convertRowsToHierarchy(rows)
            model = SQLTreeModelAdapter(root)
            tree = JTree(model)
            sp = JScrollPane(tree)
            self.contentPane.add(sp)
            self.size = 200, 300
    if __name__ == '__main__':
        s = SQLTreeDemo()
        s.visible = 1

  • Can we create LOV using free hand sql with out hardcoding

    Hi gurus,
    Dear All,
    For some of the reporst we don't have universe, so we use to get the report with the help of free hand sql,
    but here I have to hardcode the list of values by using @prompt, but instead of hardcoding is there any ways to get the list of vaues  by using @prompt, if then can any one help me out.

    Yes and no.
    When we use a LOV in a universe, the SQL is generated from the object definition. With Free Hand SQL (FHS) there is no universe. However...
    If you create a very simple universe to host your LOV, and then reuse the same prompt text in your FHS then you can fake the LOV. This is not a great solution, but to be honest, FHS is never really a solution that I would consider. You might consider using Crystal to replace Deski in these cases.

Maybe you are looking for