Report query: I need to use a variable as domain name

Hello everyone,
Perhaps my question is very basic, sorry in advance if this is the case.

My report query contains something like:
«... and 'field_name' = 1...»
'field_name' is not fixed but depends on a variable that is defined by a search form, let's say: field_name_search
I don't know which I should use to include syntax: field_name_search in the above report query.

Thank you.

Eugenio

Hello

You need not actually double quotes for the names of simple objects.

No matter what REPLACEMENT function you used would work on the content of the channel and would be regarded as a normal SQL - so the effect would be the same if you use it (unless, by chance, there was a quote in the string itself), in other words, you would still end up with a string not a fieldname.

Andy

Tags: Database

Similar Questions

  • I need to use a variable in place of the name of the instance

    I have a MC with sub of instance name that has a MC with instance name 9 in.

    I'm using AS3

    var itemNo: String;

    Sub.Item9.addEventListener (MouseEvent.ROLL_OVER, handleRollOver9);

    function handleRollOver9(e:MouseEvent):void {}
    itemNo = e.target.name;
    trace (itemNo);


    void. itemNo.removeEventListener (MouseEvent.ROLL_OVER, handleRollOver9);
    void. itemNo.gotoAndPlay ("s2");
    void. itemNo.addEventListener (MouseEvent.ROLL_OUT, handleRollOut9);
    }

    When I trace itemNo it returns 9 is what I want to spend in the last 3 lines.

    in the last 3 lines if I replace itemNo by 9, it works.

    This is what I get in the output window:

    9
    TypeError: Error #1010: a term is undefined and has no properties.
    at test1_fla::MainTimeline/handleRollOver9() [test1_fla. MainTimeline::frame1:25]

    also I tried to use e.currentTarget.name which did not help.

    Use the scoreboard operator to force the flash to fix ropes to objects.  but in your case, use:

    Sub.Item9.addEventListener (MouseEvent.ROLL_OVER, handleRollOver9);

    function handleRollOver9(e:MouseEvent):void {}
            itemNo = e.target.name;
            trace (itemNo);

    e.currentTarget.removeEventListener (MouseEvent.ROLL_OVER, handleRollOver9);
    e.currentTarget.gotoAndPlay ("s2");
    e.currentTarget.addEventListener (MouseEvent.ROLL_OUT, handleRollOut9);
    }

  • Using a variable db link for interactive report

    I have a requirement where users select an instance a LOV apex (link db) and data in an interactive report query based on the selected db link.

    I use a db link in a report query interactive but only if I provide the exact name of the binding. If I'm doing something link select * from foo@:P12_DBLINK it does not work.

    It seems that my only option is to use something like apex_collection.create_collection_from_query and then I can build my dynamic SQL query and use a variable for the name of dblink. Then I create just a from IRR of my collection.

    This sound correct approach like that or am I missing something?

    Any suggestions are most appreciated,

    John

    Hi John,.

    Why not create a classic report based on a function of PL/SQL returns a query.

    André

  • Use the variable based on Chncalculate to tiara

    I need to use a variable in the ChnCalculate function but only takes the text then how to incorporate the varaible in text inside this function. It keeps on undefined variable beep where, as I have already defined at the beginning of the program and also value.

    Hi coolguru,

    The syntax error is in your first line, it should be instead:

    GlobaDim "a".

    Brad Turpin
    Support Engineer product DIAdme
    National Instruments

  • How to use a variable as a column name in a select statement

    Hello, I am using

    Oracle Database 11 g Enterprise Edition Release 11.2.0.3.0 - 64 bit Production

    PL/SQL Release 11.2.0.3.0 - Production

    I have a procedure looking for groups that have not been updated for the current month. The columns are month_01, month_02, month_03 etc. I'm becoming if I can automate every month, but I need to be able to use a variable as the name of the column for the month. Can someone help me with this?

    Example of Table

    CREATE TABLE TEST_TABLE
    (
      IDENTITY_CODE      NUMBER(10),
      YEAR_S             NUMBER(5),
      MONTH_01           NUMBER(18,2),
      MONTH_02           NUMBER(18,2),
      MONTH_03           NUMBER(18,2),
      MONTH_04           NUMBER(18,2),
      MONTH_05           NUMBER(18,2),
      MONTH_06           NUMBER(18,2),
      MONTH_07           NUMBER(18,2),
      MONTH_08           NUMBER(18,2),
      MONTH_09           NUMBER(18,2),
      MONTH_10           NUMBER(18,2),
      MONTH_11           NUMBER(18,2),
      MONTH_12           NUMBER(18,2) 
    );
    INSERT ALL
    INTO TEST_TABLE VALUES(640,2015,124,123,125,126,127,128,547,888,987,567,145,685)
    INTO TEST_TABLE VALUES(098,2015,587,874,0,587,652,222,444,777,885,999,657,547)
    INTO TEST_TABLE VALUES(608,2015,587,874,687,587,652,222,444,787,885,999,657,547)
    select 1 from dual;
     

    Here's my current procedure

    CREATE OR REPLACE PROCEDURE RRM_EMAIL_NOTIFICATION IS
    
    v_output VARCHAR2(10000);
    v_message VARCHAR2(1000);
    v_date date;
    cursor v_check is 
    SELECT *
      FROM (SELECT '640' AS ds FROM DUAL
            UNION ALL
            SELECT '098' AS ds FROM DUAL
            UNION ALL
            SELECT '608' AS ds FROM DUAL
            UNION ALL
            SELECT '618' AS ds FROM DUAL
            UNION ALL
            SELECT '617' AS ds FROM DUAL
            UNION ALL
            SELECT '614' AS ds FROM DUAL
            UNION ALL
            SELECT '610' AS ds FROM DUAL
            UNION ALL
            SELECT '616' AS ds FROM DUAL
            UNION ALL
            SELECT '643' AS ds FROM DUAL)
    WHERE LPAD (ds, 3, '0') NOT IN
              (SELECT DISTINCT (SUBSTR (IDENTITY_CODE, 2, 3)) AS Blah_Blah_Blah
                 FROM TEST_TABLE
                WHERE     month_03 <> 0
                      AND year_s = 2015
                      AND (   SUBSTR (IDENTITY_CODE, 2, 3) = '640'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '098'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '608'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '618'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '617'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '614'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '610'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '616'
                           OR SUBSTR (IDENTITY_CODE, 2, 3) = '643'));
    
    BEGIN
    v_date := SYSDATE;
    open v_check;
    loop 
    fetch v_check into v_output;
    exit when v_check%NOTFOUND;
    v_message := v_message || chr(13) || v_output;
    END LOOP;
    close v_check;
       
    send_mail('The RRM one-time initiatives that have not been processed for '||v_date|| ' are ' || chr(13) ||v_message,'[email protected]','RRM ONETIMES NOT PROCESSED FOR ' || v_date);
       
    END RRM_EMAIL_NOTIFICATION;
     

    I need to be able to substitute the name e.g. MONTH_01 with a variable column so that it will be MONTH_ | "" some months "

    A variable can be created as v_month: = 'month_ | TO_CHAR (T_DATE, 'MM')

    If I'm not mistaken that should come out as month_03 for March

    The output should be in an email as follows:

    Capture.JPG

    Something like:

    CREATE OR REPLACE PROCEDURE RRM_EMAIL_NOTIFICATION IS

    v_output VARCHAR2 (10000);

    v_message VARCHAR2 (1000);

    date of T_DATE;

    v_check SYS_REFCURSOR;

    BEGIN

    T_DATE: = SYSDATE;

    Open the v_check FOR

    Q' {}

    SELECT *.

    FROM (SELECT '640' DS DUAL FROM

    UNION ALL

    SELECT '098' LIKE ds FROM DUAL

    UNION ALL

    SELECT '608' LIKE ds FROM DUAL

    UNION ALL

    SELECT '618' LIKE ds FROM DUAL

    UNION ALL

    SELECT '617' LIKE ds FROM DUAL

    UNION ALL

    SELECT '614' LIKE ds FROM DUAL

    UNION ALL

    SELECT '610' LIKE ds FROM DUAL

    UNION ALL

    SELECT '616' LIKE ds FROM DUAL

    UNION ALL

    SELECT '643' DS DUAL FROM)

    WHERE LPAD (ds, 3, '0') NOT IN

    (SELECT DISTINCT (SUBSTR (IDENTITY_CODE, 2, 3)) AS Blah_Blah_Blah

    FROM TEST_TABLE

    {WHERE month_}' | TO_CHAR (T_DATE, 'MM') | Q'{ <> 0

    AND year_s = 2015

    AND SUBSTR (IDENTITY_CODE, 2, 3))

    '640'

    '098'

    , ' 608 "

    '618'

    '617'

    '614'

    '610'

    '616'

    '643')

    )

    }';

    loop

    extract the v_check in v_output;

    When the output v_check % NOTFOUND;

    v_message: = v_message | Chr (13) | v_output;

    END LOOP;

    close v_check;

    send_mail ("one-time initiatives the RRM that haven't been treated for ' |") T_DATE | «are» | Chr (13) | v_message,' [email protected]',' ONETIMES UNPROCESSED for RRM ' | T_DATE);

    END RRM_EMAIL_NOTIFICATION;

  • USE OF THE DOMAIN NAME

    I'll uninstall and reinstall my windows server. Can I use reuse my old DOMAIN name in my new installation.

    WindowsServer installed 2012, domain name is registered with the ISP.

    no change of IP ADDRESS, AND OTHER THINGS.

    Hello Mohan,

    I suggest you send Windows Server related issues at Windows TechNet forum to get help. Consult the following link:

    http://social.technet.Microsoft.com/forums/en-us/winserver8gen/threads

    Hope the helps of information.

  • Can I use a godaddy domain name once I built my site with muse cc?

    I'll use the Muse CC to build my site, can use a dad bought domain name go to my site, wether I host by adobe or not? (what is the best option for this?)

    See you soon

    Hello

    Yes, you can, you can either host your website with Godaddy or Adobe Business catalyst. in both cases, you will be able to use your domain name that you purchased at Godaddy.

    Let us know if you have any other questions.

  • When we need to use a query variable and how to use it?

    Hello

    When we create a line of dashboard, we set the variable, there are two types: variable presentation and application.
    I'm confuse when we need to use a query variable and how to use it?

    Thank you
    Anne

    Hello
    The variable 'demand' can be used if you want to use session related information specific to you.

    See below a:
    http://gerardnico.com/wiki/dat/OBIEE/logical_sql/obiee_set_request_variable_dashboard_prompt

    FYI... example of
    for the example query variable (a good post Nico)

    http://gerardnico.com/wiki/dat/OBIEE/set_variable

    for the variable of presentation with example

    http://gerardnico.com/wiki/dat/OBIEE/presentation_variable

    Thank you

    Deva

  • Report using Bind Variables

    Hey everybody,

    I have a little trouble to create a report. I need the FROM part of the code in order to use bind variables. I came up with this piece of code below, but im getting the following error:

    Failed to parse the SQL query:
    ORA-06550: line 1, column 8:
    PLS-00103: encountered the symbol "" when expecting one of the following values:

    begin function package pragma procedure subtype type use
    form
    current cursor
    The symbol "" was ignored.
    ORA-06550: line 2, column 24:

    PLS-00103: encountered the symbol "" when expecting one of the following values:

    begin function package pragma procedure subtype type use
    form
    course

    Where can I see im wrong?

    Thanks in advance,
    -N.S.N.O.

    Code
    DECLARE
    x VARCHAR2 (4000);
    BEGIN
    x : = x || "select *";
    x : = x || "from";
    x : = x || : p13_schema;
    x : = x || '.ddl_log @';
    x : = x || : p13_db_name;
    x : = x || ' _DBAAPEX. TNTEWW. COM';
    RETURN (x);
    END;

    AHA, but when you have changed the source, have you also changed the Type (from "SQL query" to "SQL Query-PL/SQL function return SQL Query")?
    And clicked on "use generic names (analysis of query runtime only) column" option below the source code?

  • How many times can I use a variable binding in a query of the VO?

    Is it possible that I can use a variable binding in a query of VO just once?

    I test a query that keeps throwing the Houston-27122 error by pressing the application module tester. I tried to limit the problem to the simplest possible case, and it seems that the error is caused by the fact that I use the same variable bind two or more times.

    When the query looks like this:

    query1.png

    I have run, enter 'x' and it returns me the result.

    When I change to:

    query2.png

    I have run, enter the value

    param.png

    and immediately get the error

    error.png

    The same thing in sqlplus runs without problem:

    sqlplus.png

    My version of JDev is build JDEVADF_11.1.1.9.0_GENERIC_150314.0718.6673

    Please, advise.

    P. S. where can I find documentation queries are supported in your? In particular, I'm interested if I can use WITH the clause. There seems to be some confusion on this matter (see, for example, Oracle SQL WITH clause support - JDeveloper and ADF)

    Thank you.

    It depends on:

    Open your VO in JDev and go the the query page.

    In the lower part, there is a drop down 'link type', it is usually set to "JDBC-positional. In this case, you will need to provide the bind value for each occurrence of the variable binding separately.

    You could change that to "named" (don't remember the exact name). But beware, this will also affect all relatioships master retail to others your. I think that this is not a good idea to change the style of binding to a single VO.

    Good bye

    DPT

  • How to avoid the report query needs a unique key to identify each line

    Hello

    How to avoid the error below

    The report query needs a unique key to identify each row. The supplied key cannot be used for this query. Please change the report attributes to define a unique key column.

    I have master-detail tables but without constraints, when I created a query as dept, emp table he gave me above the error.

    Select d.deptno, e.ename

    by d, e emp dept

    where e.deptno = d.deptno

    Thank you and best regards,

    Ashish

    Hi mickael,.

    Work on interactive report?

    You must set the column link (in the attributes report) to something other than "link to display single line." You can set it to 'Exclude the column link' or 'target link to Custom.

  • How can I pass a value to a variable binding in a report query?

    I did a query of report to print a PDF report, with a dinamyc source query that has a connection variable, like this:

    SELECT EMPNO, EMPNAME, EMPDEPT

    FROM EMP

    WHERE EMPNO =: PARAMETER;

    I want to call the report print directly from a page, by using the url print showed by apex:

    f? p = & APP_ID.:0 : & SESSION. : PRINT_REPORT = MYREPORT

    How can I pass the value of the variable binding: PARAMETER using this URL?

    I don't think you can use the url parameter passes in a report query.

    the binding variable: PARAMETER must be a page element or an element of the application.

    use the "include session information and application" in the defination of report query to bind the value when the report is run

  • Can I use session variables in data model BI publisher SQL query?

    Hi Experts,

    We apply security at the level of the BI Publisher 11g data.

    In OBIEE we do so using session variables, so I wanted to just ask if we can use the same session variables in BI Publisher as well
    That is, we can include a where clause in the SQL for the sample data as

    Where ORG_ID = @{biServer.variables ['NQ_SESSION.]} {[INV_ORG']}

    I would like to know your opinion on this.

    PS: We implement security EBS r12 in BI Publisher.

    Thank you

    Read this-> OBIEE 11 g: error: "[nQSError: 23006] the session variable, NQ_SESSION.» LAN_INT, has no definition of value. "When you create a SQL query using the session NQ_SESSION variable. LAN_INT in BI Publisher [ID 1511676.1]

    Follow the ER - BUG: 13607750 -NEED TO be able TO SET up a SESSION IN OBIEE VARIABLE AND use it IN BI PUBLISHER

    HTH,
    SVS

  • the variable name of database query to SQL Server using the Oracle database link

    Hi all

    I have an ApEx 4.1 application running on x 64 (11.2.0.1) 11g on Windows Server 2008 x 64, and I have a few points of data integration with SQL (2005 and 2008) server that I need to create. I have configured the database with dg4odbc link and it works perfectly... I can run queries on the SQL Server database without any problem using the database link.

    However, there is a scenario where the SQL Server database name is dynamic, and I need to generate on the fly in a PL/SQL block and then use it in a query dynamic SQL (all this in the ApEx). It of wherever I meet problems... when I asked the default database that is based on the ODBC connection and I don't have to specify the name of the database, no problem. But when I need access to one of the several other databases by default, I received the error "invalid table.

    It works well:* (note that 'fv' is the name of my database link)

    v_query1: = "select 'Release Date' from dbo." Schedules@FV where dbo. Annexes. "" SchedID "=: calendar";
    EXECUTE IMMEDIATE v_query1 in rel_date using the grid.




    I then take this rel_date variable, convert a varchar2 (rel_date_char), then use it as the name of the database in the following query...


    _ It returns an error(error ORA-00903: invalid table name)

    v_query2: = "select"PARTNO": rel_date_char.dbo.ProdDetails@fv where 'SchedID' =: calendar and"UnitID"=: unit"
    and 'MasterKey' =: master and "ParentKey" =: parent';

    EXECUTE IMMEDIATE v_query2 in part_number using planning, master, parent unit;



    I also tried using all of the following conditions without result:

    "select"PARTNO"of" | : rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"of" | rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"of" | @rel_date_char | '.dbo. ProdDetails@fv where 'SchedID '...
    "select"PARTNO"in @rel_date_char.dbo.ProdDetails @fv where 'SchedID'..."


    Is it possible to do it in PL/SQL?

    Thanks for any help!
    -Ian C.

    Published by: 946532 on July 15, 2012 19:45

    Just did a test using passthrough:

    SQL > set serveroutput on
    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5. start
    c: 6 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, "select count (*) from EMP");
    8 LOOP
    9 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    10 output when nr = 0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    12 dbms_output.put_line (val);
    13 end of loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    15 end;
    16.
    24576

    PL/SQL procedure successfully completed.

    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5. start
    c: 6 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    7 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, ' select count (*) from dbo.) EMP');
    8 LOOP
    9 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    10 output when nr = 0;
    11 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    12 dbms_output.put_line (val);
    13 end of loop;
    14 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    15 end;
    16.
    24576

    PL/SQL procedure successfully completed.

    So all 3 ways work for me.

    Published by: kgronau on July 23, 2012 10:08

    Now, using the variables to make the selection:

    SQL > declare
    2 val varchar2 (100);
    3 c whole;
    4 whole nr;
    5 tabname varchar2 (20): = 'EMP ';
    6 ownr varchar2 (20): = "dbo."
    7 dbname varchar2 (20): = "door";
    Start 8
    c: 9 = dbms_hs_passthrough.open_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3;
    10 dbms_hs_passthrough.parse@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, ' SELECT count (*) FROM ': dbname: '.) ' || ownr | '.'|| tabname | ") ;
    11 LOOP
    12 nr: = DBMS_Hs_Passthrough.fetch_row@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    13 when the exit nr = 0;
    14 dbms_hs_passthrough.get_value@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c, 1, val);
    15 dbms_output.put_line (val);
    16 end loop;
    17 dbms_hs_passthrough.close_cursor@FREETDS_DG4ODBC_EMGTW_11_2_0_3 (c);
    18 end;
    19.
    24576

    PL/SQL procedure successfully completed.

    => instead of executing the statement using the "execute Immediate" we use the PASTHROUGH package to pass the statement to SQL Server.

    Published by: kgronau on July 23, 2012 10:10

  • Problem using bind variables in shared components report queries

    Greetings,

    I use APEX 4.0.1.00.03 and BI Publisher 10.1.3.4.1.

    In the APEX, I try to create a report query that uses bind variables in the where clause. I have a page that contains a button and a text element (P1_ID). The button is used to call the report. I went the shared components and created a new report query. Here is the text of the code.
    select violation_date
    , violation_type
    , nvl(:P1_ID,'zzz')
    from edd_procard_violations
    where upper(card_holder_id) = upper(:P1_ID)
    I also have Session State to enabled and have added the P1_ID in the area of 'State of Session' under the query.

    When I change the query, and click on the 'Set Bind Variables' button, I get a field where I can enter a value for: P1_ID I enter a value that should return lines, but when I click on the button "Test query", I get no rows returned. If I comment on where clause and test the query, even once, I get all rows in the table. You'll notice in my query I have included nvl(:P1_ID,'zzz'). When I run the query, without where clause, the returned value is always "zzz" indicating that: P1_ID is null.

    No idea what I am doing wrong?

    Thank you very much.
    Larry

    Hello Larry,.

    Looks like the wizard to create a report query in the shared components has a bug related to bind variables. I was able to reproduce your problem. Just create the query using the link variable, check the box to include session state, add the item and create the query. When you use the report query to download the report, where the your clause will work fine.

    Thank you
    Machaan

Maybe you are looking for

  • I bought a Macbook used, and now I can't update iMovie, iPhoto and iTunes without apple ID of the older owner how can I work around this?

    Hey everybody, This is my first post. A couple of years, I bought a used Macbook. I never did update (it is so long and then I decide to Watch youtube videos... it is not used for work or school). So now, I've updated the Yosemite and I want to get e

  • REGZA WL66: HDMI input has stopped working

    Hello the HDMI to my Regza WL abruptly arrested two weeks after having worked well for several years of work. Previously, the different types of devices have been recognized without any problem: DVD player, receiver, laptop, Media Player. Now, no dev

  • Pavilion 14-v060Br: Remove audio beats without loss of sound quality

    As many customers know, audio beats produced distortions and can be very annoying. After a lot of research here, I could remove from Beats Audio and install generic drivers, but then I lost the quality of the sound and equalization that I would have

  • low Harmonic frequencies in the signal strength

    Hi all I try to know what are the causes of noise in my signal, whether it's a faulty hardware or my lack of knowledge. The system that I'm actually consist of two engines not to not (parker HV232) that provide the uprising due to frost harmonic + pi

  • T530 The bad memory

    My T530 (i7-3720QM, 2.6 GHz, 4 GB) is 18 months old. Lately, some programs acted weird (region of a window will be unclear). Lenovo Solutions HW audit found nothing wrong. I decided to run Memtest86 + (v5.01) to check the memory and it has detected a