Substitution string inside PL/SQL generated content (single column source)

Hi! I have a contents table that contains the HTML source (using the HTML Editor Standard item) stored on a single varchar2 column like this.
-- some other HTML source here ---
href="f?p=&APP_ID.:17:&APP_SESSION."
-- other HTML source here --
(Sorry, this forum is parsing my HTML source but it's just as simple as that)
I'm using a PL/SQL Dynamic Content region to select and display my contents using the htp.p procedure. But the problem is the built-in substitution strings in the URL of my content is just displayed as it is. I know that this maybe because htp.p will treat the parameters just like a regular string and the Application Express Engine don't have a chance to parse it. But can somebody show me an alternative solution for this?
Right now, I'm just using a static HTML region as a temporary solution. But I really am curious on how can this be done using PL/SQL dynamic content region. Or what design is best on content management-like application.
Thanks!
Mertz

Mertz,
I'm not sure I understand but say your database table's column contains 'Hello the session id is &APP_ID. ...'. Using a PL/SQL region you could emit that column thus:for c1 in (select content_col from content_tab) loop
  htp.p(replace(c1.content_col, '&' || 'APP_ID.', :APP_ID));
end loop;Splitting up the substitution item name into concatenated strings avoids problems with the Builder doing substitutions when you don't want it to.
Scott

Similar Messages

  • Substitution strings in chart sql query

    Hi Guys,
    I am creating line charts and bar charts based on a query in HTML DB 1.5. I am using substitution strings in the query. Though I can use substitution strings in the line chart, I cannot do it in the bar chart. I am using almost the same sql query in both line and bar charts.
    The sql query in line chart is
    SELECT null, TO_CHAR(t1.extract_date, 'W-MON-YYYY') extractdate,
    MIN_OF_AVERAGES(AVG(&P40_METRICS.),:P40_REGION_LIST,:P40_SUBREGION_LIST,NULL,:P40_METRICS,'ind') orgid
    FROM ind t1,geography t2
    WHERE t1.country_id = t2.country_id(+)
    AND t2.region_name like
    DECODE(:P40_REGION_LIST,'ALL REGIONS','%',:P40_REGION_LIST)
    AND t2.subregion_name like
    NVL(:P40_SUBREGION_LIST,'%')
    GROUP BY TO_CHAR(extract_date, 'W-MON-YYYY')
    order by to_date(extractdate,'DD-MON-YY')
    The sql query in bar chart is
    SELECT null, TO_CHAR(t1.extract_date, 'W-MON-YYYY') extractdate,AVG(&P40_METRICS.) orgid
    FROM ind t1,geography t2
    WHERE t1.country_id = t2.country_id(+)
    AND t2.region_name like
    DECODE(:P40_REGION_LIST,'ALL REGIONS','%',:P40_REGION_LIST)
    AND t2.subregion_name like
    NVL(:P40_SUBREGION_LIST,'%')
    GROUP BY TO_CHAR(extract_date, 'W-MON-YYYY')
    order by to_date(extractdate,'DD-MON-YY')
    The min_of_averages function in the line chart query is some function I am calling. Even if I cut-paste the line chart query in the bar chart I get the error.
    The substitution string which is giving the problem is "&P40_METRICS."
    The error I am getting is
    Query cannot be parsed, please check the syntax of your query. (ORA-00909: invalid number of arguments)
    The only difference I see is that line chart query is inside a series and bar chart is not, does this make a difference??? Or is it because I am using the substitution string in choosing the column??? Please help!!!!
    Thanks,
    Swaroop

    Swaroop,
    You might be using an HTML bar chart and an SVG line chart, I can't tell, but their implementations differ. You won't be able to use a substitution string to replace a column name in the query in the situation you found, you'd have to figure out a way to construct the query string before it gets executed and I'm not sure the chart pages will let you do that.
    Scott

  • Convert Oracle SQL query to single column output

    Hello All,
    I need to build the query to have multiple columns in a single column with multiple rows.
    select a.customer_trx_id,a.previous_customer_trx_id
    from ra_customer_trx_all a
    where a.customer_trx_id = :customer_trx_id
    here, a.customer_trx_id and a.previous_customer_trx_id are in two columns. I need to bring them into a single column.
    Say: the above output is
    a.customer_trx_id a.previous_customer_trx_id
    123456 87654
    Need to have single column
    As
    123456
    87654
    Please do the needful.
    Thanks,
    Abdul

    Hi,
    Post your question in [SQL and PL/SQL|http://forums.oracle.com/forums/forum.jspa?forumID=75] forum, you would probably get a better/faster response.
    Regards,
    Hussein

  • Parse String inside PL/SQL

    What is the easiest way to parse a variable length string, containing x occurrences of data base fields (each occurrance separated
    by a delimeter) inside of a PL/SQL program.
    For example the string is: |x,y,z|x,y,z|
    Thank
    null

    The trick here is to count the number of items in the list(s). Use this code to determine the number of elements in a list:
    length('|x,y,z|x,y,z|') -
    length(replace('|x,y,z|x,y,z|','|')) - 1
    yields 2
    length('x,y,z') -
    length(replace('x,y,z',',')) + 1
    yields 3
    Note the +/- depends on the use of either a "fat" or "normal" list (i.e. delimiters at the front and back of list vs. just between elements).
    Once you know the number of elements, use substr to get the pieces. This works in plsql and sql so be creative; use a table with numbers in it if you want a solution that is sql only (my preference) as in:
    create table intgr (intgr number);
    insert into intgr values (1);
    insert into intgr values (2);
    insert into intgr values (999999...);
    select substr(...,instr(...,'|'),1,intgr.intgr ...
    from intgr
    where intgr =
    length(....)-length(....)+...
    think it through, I use this alot.
    a date table with dates from the last 300 and next 300 years works for lots of stuff too, be creative.
    create table somedates (adate date);
    Good luck.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Olga:
    What is the easiest way to parse a variable length string, containing x occurrences of data base fields (each occurrance separated
    by a delimeter) inside of a PL/SQL program.
    For example the string is: |x,y,z|x,y,z|
    Thank
    <HR></BLOCKQUOTE>
    null

  • How to reference template substitution string in PL/SQL condition

    hi -- I need to conditionally display an item based on the value of #TITLE#. I'm currently trying a pl/sql expression function body returning boolean
    DECLARE
    page_type VARCHAR2(1000);
    BEGIN
    page_type := lower(substr(:TITLE,instr(:TITLE,'Query')));
    if (page_type = 'query') then
    return TRUE;
    else
    return FALSE;
    end if;
    END;
    There are no errors, but the condition is not being met when it should be.
    I tried setting some app items to the value of #TITLE# and I'm obviously not referencing it correctly; they're all null:
    :TEST_VALUE := &TITLE.;
    :TEST_VALUE2 := :TITLE;
    :TEST_VALUE3 := V('TITLE');
    Help?
    Thanks,
    Carol

    Hi,
    You can use javascript on page HTML header
    <script>
    function getDocTitle(pItem){
      $x_Value(pItem, document.title);
    </script>And page body
    onload=" getDocTitle('Px_YOUR_ITEM');"Br, Jari

  • Multiple column heading for sql that returns single column

    Hi All,
    I have just started using APEX and my apex version is 3.2.0.00.27.
    We have a report that displays the output from a query similar to the below one. We are using borderless template and removed the "before each row" and "after each row" values to allow the output displayed in table format.
    Now we wanted to include heading for each column displayed in table. We wanted to include headings from a derived value, Example for column1 , heading need to display the sysdate and column2 heading should be sysdate-1 and so on.  But the column attribute tab is having only one column My_rep. Not sure how to se pl/sql type column heading in this case. Could someone please help me to achieve this?
    Please let me know if I have missed to provide any other details. Thanks in advance.
    select '<tr>
        <td>' || column1    || '</td>' ||
        <td>' || column2    || '</td>' ||
        <td>' || column3    || '</td>' ||
        <td>' || column4    || '</td>' ||
        || '</tr>' My_rep
    from mytable

    22335813-cfb0-46c4-9bef-b61a46f0de67 wrote:
    Please update your forum profile with a real handle instead of "22335813-cfb0-46c4-9bef-b61a46f0de67"
    I have just started using APEX and my apex version is 3.2.0.00.27.
    Upgrading from this unsupported version to the current 4.2 release is recommended.
    When you post a question, always include the following information in addition to the full APEX version number:
    Full database version, edition and host OS
    Web server architecture (EPG, OHS or APEX listener), server platform, and host OS
    Browser(s)/version(s) used
    UI/Theme
    Templates
    Region type (making particular distinction as to whether a "report" is a standard report, an interactive report, or in fact an "updateable report" (i.e. a tabular form)
    With APEX we're also fortunate to have a great resource in apex.oracle.com where we can reproduce and share problems. Reproducing things there is the best way to troubleshoot most issues, especially those relating to layout and visual formatting. To get a detailed answer then it's appropriate for the questioner to take on a significant part of the effort by reproducing the problem on apex.oracle.com before asking for assistance with specific issues, which can then be seen at first hand in a real APEX environment.
    we wanted to get a report in Apex with the below format. and we wanted to change background color of each cell depends on the combination of code||status
    Heading        sysdate             sysdate-1              sysdate-2                              ...(sysdate-30
    ======        ======          ========               =======
    name         code||status                                   code||status
    name                                  code||status
    we are using the below query to get this table format. But heading is the issue we are facing now
    select '<tr>
        <td>' || name    || '</td>' ||
        '<td style=background-color:' || case when sysdate0='0C' then 'Green' when sysdate0='0I' then 'Red'     when (substr(sysdate0,1,1)!='0' and substr(sysdate0,1,1)='I') then 'Orange'  else 'Yellow' end || '>  &nbsp'  || sysdate0 || '  &nbsp</td>'  ||
        || '</tr>' repcolumn
    from
      (select
            a.name,
            max(decode(trunc(a.ardate),trunc(sysdate), a.code||a.STATUS , '' ))   sysdate0,
            max(decode(trunc(a.ardate),trunc(sysdate-30), a.code||a.STATUS , '' )) sysdate30
    from
            mytab a
    where
            a.ardate>=sysdate-30
    group by a.name)
    See Re: Matrix report for a custom report template-based solution to a similar problem, with dynamically generated column headings.

  • Footer navigation using pl/sql - substitution strings

    Hi
    I want to make a footer navigation (a BLAF like footer with the same captions and links that appear in the Tabs and the Navigation Bar) using a PL/SQL region. The code I want to use should work for any HTML DB application.
    The procedure could be defined like this:
    PROCEDURE prb_footer_navigation( p_application_id VARCHAR2
    , p_page_id VARCHAR2
    , p_session_id VARCHAR2);
    p_application_id will be used to get the caption and links of the specific application and p_page_id will be used to know which tab is selected.
    I'm using this query in the procedure:
    SELECT t.tab_text caption
    , t.tab_target link
    , t.tab_sequence num
    FROM flows_010600.wwv_flow_toplevel_tabs t
    WHERE t.flow_id = p_application_id
    ORDER BY t.tab_sequence
    (the user has been granted select from flows_010600.wwv_flow_toplevel_tabs)
    The problem is:
    tab_target has substitution strings like '&XXX.' or '&PX_XXX.', so how can I get the real link with resolved substitution strings using pl/sql?
    Something like function_resolve_string(p_string, p_session_id) would be appreciated...
    Thanks in advance!

    A.U.,
    Have you considered looking at how the navigation bar gets onto your page by examining the page template? You'll find something like this in the body section: 
      <table width="100%" cellpadding="0" cellspacing="0" border="0" summary="">
        <tr>
          <td valign="top" class="t1Logo">#LOGO#</td>
          <td align="right" valign="top">#NAVIGATION_BAR#</td>
        </tr>
      </table>Just copy and paste that onto the end of the body section, or into the footer section of the template, although the footer might not support all the same substitution patterns.
    If that's the kind of result you have in mind, do the same thing for the (html) tables that contain #PARENT_TAB_CELLS# and #TAB_CELLS#. I don't guarantee this will work, but it's worth experimenting with.
    Scott

  • How to execute an SQL query present in a string inside an ABAP program?

    hello,
    How to execute an SQL query present in a string inside an ABAP program

    Raut,
    You can execute Native SQl statements.
    Ex: To use a Native SQL statement, you must precede it with the EXEC SQL statement, and follow it with the ENDEXEC statement as follows:
    EXEC SQL [PERFORMING <form>].
      <Native SQL statement>
    ENDEXEC.
    There is no period after Native SQL statements. Furthermore, using inverted commas (") or an asterisk (*) at the beginning of a line in a native SQL statement does not introduce a comment as it would in normal ABAP syntax. You need to know whether table and field names are case-sensitive in your chosen database.
    In Native SQL statements, the data is transported between the database table and the ABAP program using host variables. These are declared in the ABAP program, and preceded in the Native SQL statement by a colon (:). You can use elementary structures as host variables. Exceptionally, structures in an INTO clause are treated as though all of their fields were listed individually.
    If the selection in a Native SQL SELECT statement is a table, you can pass it to ABAP line by line using the PERFORMING addition. The program calls a subroutine <form> for each line read. You can process the data further within the subroutine.
    As in Open SQL, after the ENDEXEC statement, SY-DBCNT contains the number of lines processed. In nearly all cases, SY-SUBRC contains the value 0 after the ENDEXEC statement. Cursor operations form an exception: After FETCH, SY-SUBRC is 4 if no more records could be read. This also applies when you read a result set using EXEC SQL PERFORMING.
    EXEC SQL PERFORMING loop_output.
      SELECT connid, cityfrom, cityto
      INTO   :wa
      FROM   spfli
      WHERE  carrid = :c1
    ENDEXEC.
    Pls. Mark If useful

  • Embed HTML tag inside XSLT to generate email content

    I want to Embed HTML tag inside XSLT to generate email content .
    XSLT is not working in Jdeveloper , when i use the syntax <xsl:output method="html" indent="yes" version="1.0"/> in transformation activity .
    Can anyone help to resolve the issue .

    in the <xsl:template match=""/> element you can just start with creating your html document
    so for example
         <xsl:template match="/">
              <html>
    the graphical mapper itself won't i think but when you test the xsl it will still procedure a html document, we use it too to generate the email body contents

  • How to reference the Instance name using Substitution string or SQL

    All:
    We have an Application that will be replicated in multiple Apex instances and would like to display the current Oracle Apex Instance name ( Similar to the &APP_USER. on the Welcome portion of the page ) .
    Is there a substitution string for this ?
    We plan on using a Show/Hide region on the splash page titled [About], that when clicked displays an HTML region with the subsitution strings.
    If no substitution strings, can someone help with an SQL that returns the Instance name ?
    Thanks for all the help.
    Aubrey Fernandes

    Aubrey Fernandes wrote:
    I currently have 3 URLs to get to my Development, QA and Production servers & will have many more production servers with different Application Ids.
    Development = http://canqa101:7777/pls/ngcrmd01/apex
    QA = http://canqa101:7777/pls/ngcrmq01/f?p=100:1
    Production = http://cancs105:7777/pls/ngcrmp01/f?p=100:1
    What I need are the portions before the final forward slash ( canqa101:7777/pls/ngcrmd01 ) which I assumed is the Oracle Apex instance.That information is determined by the web server configuration (e.g. the DADs when using OHS) rather than through APEX itself. There are no built-in substitution strings for this. Create an application item and an On New Instance (new session) computation to set the value using the function<tt>owa_util.get_cgi_env</tt> function to get the CGI environment variables <tt> HTTP_HOST</tt> and <tt>SCRIPT_NAME</tt>. You can then reference the value in the region using substitution string syntax.

  • Any way to generate a single quote (') with XSLT?

    Hi:
    I guess this is really an XSLT question. I'm using the Transform() method of an XMLType variable to apply a style sheet. The XML in the variable is just something simple like
    <TBL>
    <LAST_NAME>LIKE|JONES</LAST_NAME>
    <FIRST_NAME>=|MARY</FIRST_NAME>
    <AGE>=|50</AGE>
    </TBL>
    I am trying to get a stylesheet to transform something like the above into SQL such as
    Select * from foo where LAST_NAME like 'JONES'
    and FIRST_NAME ='MARY'
    and AGE = 50But to do this, I need to generate the single quotes around the search terms and I can't get anything but LAST_NAME LIKE &apos;JONES&apos;. Is there a way to do this? For now I am generating a ~ and replacing ~ for ' throughout the generated SQL text but that's a pretty sorry solution.
    I thought that something like <xsl:text disable-output-escaping="yes">&amp;</xsl:text> was going to work but then found out it has been deprecated. I was thinking character-map might work but that's an XSLT 2.0 thing and apparently 10g is on XSLT 1.0? In any case, it had no idea what I was trying to do with a character map.
    So, am I overlooking an obvious way to get my stylesheet to insert apostrophes?
    Thanks.

    It's 10.2.0.4.
    Here's the procedure that accepts the XML/XSL clobs and tries to produce a SQL statement.
    PROCEDURE GetSQLQueryFromXML(XMLClob in CLOB, XSLStylesheet in CLOB,
                SQLQuery out CLOB, status out integer) IS
        -- Define the local variables
      xmldata               XMLType;  -- The XMLType format of the XML to transform
      xsldata               XMLType;  -- The XMLType format of the stylesheet to apply
      sqlQuery_XMLType      XMLType;  -- The XMLType format of the SQL query.
      v_SQLQuery            Clob;     -- Holds XML Clob before translating ~ to '
    BEGIN
    status := -1;  -- Initially unsuccessful
      -- Get the XML document using the getXML() function defined in the database.
      -- Since XMLType.transform() method takes XML data as XMLType instance,
      -- use the XMLType.createXML method to convert the XML content received
      -- as CLOB into an XMLType instance.
      xmldata := XMLType.createXML(XMLClob);
      -- Get the XSL Stylesheet using the getXSL() function defined in the database.
      -- Since XMLType.transform() method takes an XSL stylesheet as XMLType instance,
      -- use the XMLType.createXML method to convert the XSL content received as CLOB
      -- into an XMLType instance.
      xsldata := XMLType.createXML(XSLStylesheet);
      -- Use the XMLtype.transform() function to get the transformed XML instance.
      -- This function applies the stylesheet to the XML document and returns a transformed
      -- XML instance.
      sqlQuery_XMLType := xmldata.transform(xsldata);
      -- Return the transformed XML instance as a CLOB value.   
      v_SQLQuery := sqlQuery_XMLType.getClobVal();
      -- Change tildas to apostrophes.  Currently unable to get an XSLT transformation
      -- to insert single quotes, so we're inserting ~ instead.  Now we need to
      -- translate all ~s to 's in our query.
      SQLQuery := translate(to_char(v_SQLQuery),'~','''');
      status := 1; -- Everything went fine to get here
    EXCEPTION
      WHEN OTHERS THEN         
        raise_application_error
        (-20102, 'Exception occurred in GetSQLQueryFromXML :'||SQLERRM);
    END GetSQLQueryFromXML;The XML it works off of is
        someXML CLOB :=
        to_clob('<?xml version="1.0" encoding="windows-1252" ?>
    <variable table_name="SOME_PERSON_TABLE" query_type="PERSON">
      <item>
        <fieldName><![CDATA[PERSON_KEY]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[Integer]]></fieldType>
        <value><![CDATA[123456789]]></value>
      </item>
      <item>
        <fieldName><![CDATA[LAST_NAME]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value><![CDATA[DOE]]></value>
      </item>
      <item>
        <fieldName><![CDATA[FIRST_NAME]]></fieldName>
        <criteria><![CDATA[=]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value><![CDATA[JOHN]]></value>
      </item>
      <item>
        <fieldName><![CDATA[MIDDLE_NAME]]></fieldName>
        <criteria><![CDATA[-]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value />
      </item>
      <item>
        <fieldName><![CDATA[SUFFIX]]></fieldName>
        <criteria><![CDATA[-]]></criteria>
        <fieldType><![CDATA[String]]></fieldType>
        <value />
      </item>
    </variable>');And the corresponding XSLT that should translate it is:
      myStylesheet  CLOB :=
      to_clob('<?xml version="1.0" encoding="ISO-8859-1"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
    <!-- <xsl:preserve-space elements="list-of-element-names"/> -->
      <!-- We just want the SQL text output.  No XML declaration etc. -->
      <xsl:output method="text" omit-xml-declaration="yes" indent="no"/>
    <!-- Apostrophes will be made tildas and the PL/SQL will translate those to -->
    <!-- apostrophes for the final SQL string. -->
    <xsl:variable name="apos">~</xsl:variable>
      <xsl:template match="/">
        select * from
        <xsl:value-of select="variable/@table_name"/>
        where 1=1
        <xsl:for-each select="variable/child::node()">
          <xsl:choose>
            <!-- if the value node is not null... -->
            <xsl:when test="./value/text()[normalize-space(.)]">
            <!-- There is another predicate.  Add the AND term and the predicate -->
              AND <xsl:value-of select="./fieldName"/>
              <xsl:text> </xsl:text>
              <xsl:value-of select="./criteria"/>
              <xsl:text> </xsl:text>       
              <xsl:choose>
                <xsl:when test="string(./fieldType)=''String''">
                  <xsl:copy-of select="$apos" />
                  <xsl:value-of select="./value"/>
                  <xsl:copy-of select="$apos" />
                </xsl:when>         
                <xsl:when test="string(./fieldType)=''Clob''">
                  <xsl:copy-of select="$apos" />
                  <xsl:value-of select="./value"/>
                  <xsl:copy-of select="$apos" />
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="./value"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:when>
          </xsl:choose>
        </xsl:for-each>
      </xsl:template>
    </xsl:stylesheet>');Basically if the VALUE element has a value then the fieldType is checked. If fieldType is String or Clob then we'll need the apostrophes. For now I'm putting in tildas and changing them later.

  • Modifying a Application Substitution String in Run-time

    Hello all,
    I have a substitution string defined in an application (under application definition) that needs to be different based on whether the application is on a development server or a test server. Is there a way that I can alter the value of that subsitution string on my test run-time instance after I've brought the application in from development? Perhaps an API call? APEX_INSTANCE_ADMIN doesn't appear to have anything for this.
    Or do I have to either do a test in code and set an application item when the application starts up, or pull it from a database table or constant?
    Thanks!
    John

    Shane,
    SubVersion works with files, so everything you do has to be a file, including all of your PL/SQL procs / functions / packages. If you have "cowboy coders" editing packages in the database with SQL Developer or TOAD, that's the first thing that needs to change. I regularly export my APEX apps and check them in. I also make a DDL-only backup of any schemas I'm working on at major mile-stones or before upgrades.
    There's a server and client component. The sever houses the repository and everyone checks projects out from and commits projects to the server. On the client-side, the TortoiseSVN client is by far the most popular Windows client. It perfectly integrates with Windows so you can right-click a file and lock, update, commit it.
    To work on a project, you:
    - check it out from the repository. you typically only do this once as you keep a working copy on your client pc.
    - get a lock on a file you want to edit. This is optional, but it's my preferred method. Now you are the only one that can commit the file back to the repository.
    - make your changes to the file, once you are happy, simply right-click and select commit. you can then enter comments on the file.
    - now, anyone else who wants to edit that file will see your changes when they request a lock or issue the "update" command.
    You can review every version of the file, diff versions, "Tag" a version of your code, and the list goes on.
    After a few hours you'll be comfortable with the client process. I think the server component of it deters most people as you have a number of choices to make and it can be slightly complicated to install. For this reason, I STRONGLY recommend trying one of the hosting providers as then all you have to worry about is the client-side. Additionally, your code is now backed-up off-site.
    I don't have any personal experience with these services, but here are a few reasonably priced ones. The first one has a free option which is where I would start with a test project just to get a feel for it.:
    - https://www.projectlocker.com
    - http://svnrepository.com/
    For what it's worth, the APEX team uses SubVersion, as do many dev teams inside Oracle (not the DB dev team though). Also, the new https://samplecode.oracle.com uses Subversion as part of an offering from CollabNet. My 1st project hosted there is called logger . You can brows the logger subversion repository here: https://logger.samplecode.oracle.com/source/browse/logger/
    Links:
    - [TortoiseSVN Client|http://tortoisesvn.tigris.org/]
    - [SubVersion Server|http://subversion.tigris.org/]
    Tyler Muth
    http://tylermuth.wordpress.com
    [Applied Oracle Security: Developing Secure Database and Middleware Environments|http://sn.im/aos.book]
    Edited by: Tyler on Nov 17, 2009 2:57 PM

  • Can substitution strings be used for table name references?

    Hi,
    I was wondering if it's possible to use substituion strings for table names in SQL queries. This would allow for me to edit all references to a table at one location. For instance, if a table name or dblink changed, I could edit the substitution string or application item to ensure all the queries reference the new table.
    For example:
    select * from &table1.
    table1 would be the substitution string for the actual table name
    I know this is possible if I used a pl/sql function returning a query, but I would much rather use a substition string in a SQL query.
    Thanks in advance.
    Brian

    i think not
    because how create the fields of * in this case
    in the other because all is dynamic, i think that you obtain only an error

  • Selecting a single column in SQL

    Hi all,
    I am doign a Java application at the moment and I need to select only a single column in a row of a table.
    I know that I can do something like
    SELECT column_name FROM table
    but the fact is, I am not supposed to know the name of the column, but only its content. The row can be determined by a CUSTOMER_ID and in the row resulting from the SELECT, one of the column has "2" as content.
    I would then like to know how I can build my query to only select this column, because I will then be able to retrieve the column name using the getColumnName() from the ResultSetMetadata.
    I hope it was clearly said, thanks.
    D.

    OMG, that table isn't even in first normal form. Whoever designed the model for that application needs to get some training. If it were properly normalized, the problem would be simple, as it is you're in a mess (as I'm sure lots of code that tries to use that table is). If it were normalized, the query would look something like this ...
    select status
    from customer_transaction
    where transaction_code = 2;Or even better, transaction code would be more meaningful and have a code table of it's own where you could refer to it with something less obscure than the number 2.
    You could create a view that makes that table appear denormalized using 100 union alls but it wouldn't perform worth a damn. All I can think of is that you'll need to generate a query that looks something like this ...
    select case when tan_1 = 2 then 'STATUS_TAN_1'
    when tan_2 = 2 then 'STATUS_TAN_2'
    when tan_3 = 2 then 'STATUS_TAN_3'
    end
    from tan ...Then you can build your dynamic update using that returned column name.

  • Possible bug in 3.1.1 with APP_ALIAS substitution string?

    Hello team,
    this morning we carried out the migration to 3.1.1 however i noticed that the only translated application i have doesn't correctly handle the APP_ALIAS substitution string any more.
    I had to manually replace all the occurrences of APP_ALIAS in the application to get it back to work when using a translated version.
    The primary language app works ok and correctly substitutes the application alias, but the mapped application throws errors saying it cannot locate the page alias being referenced.
    If i look at the resulting links of a mapped application i see that the application alias is not the expected string but a system generated string beginning with letter A followed by several digits.
    I seeded and published the application several times with no improvements.
    Does this sound as a known problem?
    Bye,
    Flavio
    http://www.oraclequirks.com

    Ok,
    i can now provide some more details on the problem:
    see the problem by connecting to:
    http://www.yocoya.com/pls/apex/f?p=601
    if you navigate the application without changing language, everything works fine.
    Now switch to english by clicking on the button on the upper right side of the page, then
    click on any link, you will get a message like:
    Error      ERR-1412 Unable to resolve page alias (NEWS)
    If you hover with the pointer on the links, you can see that the application alias is a string like "A2549821011244062".
    In the primary language application is instead YOCOYA601.
    Until version 3.0.1 the application alias of a translated application was equal to the alias of the primary application.
    I hope is now clear what i meant with my first message.
    Bye,
    Flavio
    http://www.oraclequirks.com

Maybe you are looking for

  • What is better: Apple TV ethernet or WiFi to an Airport repeater?

    Hi - I have a Time Capsule as main WiFi router (ethernet to Cable modem), and an Airport Extreme as repeater/booster in the other side of the house. There, I can connect the AppleTV (2nd generation) either by WiFi to the Airport Extreme repeater or w

  • Ipod nano 2nd gen screen is scrambled

    I have a 2nd gen Ipod nano and the screen is either blank or scrambled.  I tried to reboot it by holding down the menu and center button simultaneously and that had worked in the past but not this time.  Before I would get the Apple logo on the scree

  • Absolutely livid with the non-service, when did th...

    I purhased a broadband package with BT which included BT sport and a £40 gift voucher for Sainsbury's. I was advised my expected install date was 13th August 2013. on Sunday 11th August 2013 I received an email to advise me that a phone line engineer

  • Time Machine deleted all the back up files on my TimeCapsule

    My computer required an erase and install. I was using 10.5.8. I reinstalled the OS but I did not do a restore from my Time Machine when I first booted it up. However, I wanted to continue to use my time machine back up (basically continue to add fil

  • VERY slow internal HD transfer performance

    My MacBook Pro 17 (early 2011) came with Snow Leopard. Via some common-themed recommendations I found online, I repartitioned my drive, splitting the original single partition into two partitions, and 'freshly' installed a Lion on the 2nd partition.