To bind the Variable as being of a literal string value

Oracle Database 10g Enterprise Edition Release 10.2.0.5.0 - Prod

PL/SQL Release 10.2.0.5.0 - Production

CORE Production 10.2.0.5.0

AMT for Linux: Version 10.2.0.5.0 - Production

NLSRTL Version 10.2.0.5.0 - Production

Hi there, thank in advance. I have a problem when you create a dynamic statement. The problem is in the binding variable': OLD. CUST_NAME'... my question is is there an escape character to treat the affair as a literal string variable?

{code}

v_str2: = "' client_name =" ' |' | ' || ': OLD. CUST_NAME';

EXECUTE IMMEDIATE 'create or replace trigger trg_.

|| SUBSTR (rec_cur.table_name, 1, 26)

|| "before insert or update or delete on.

|| rec_cur. Owner

|| '.'

|| rec_cur.table_name

|| '

declare

Start

If the UPDATE can

FIFAPPS.ibug.log_errors('||)

v_str2 | »

);

end if;

end;';

{code}

I want the output in a trigger something like this:

{code}

If the UPDATE can

FIFAPPS.ibug.log_errors (' client_name ='|: O LD.) CUST_NAME

);

{code}

Hello

What is the need of business that you are trying to address?  Before writing any kind or trigger and especially before you dynamically create a lot of triggers, see if Oracle provides a better way to meet your needs, for example, audit.

If triggers are really justified, and you are looking for just an easy way to crank out a large number of almost identical triggers right now (not something that end users will do all the time), so I suggest SQL * Plus and the substitution variables.  It will be easier to debug writing and debugging, because you won't have to you not so much worried about quotes and concatenation.  For example, if all the triggers are identical except for the diagram, the table name and column name, you can write a simple script that can be used to create an unlimited number of triggers, like this:

-Trigger_Factory.sql - create trigger standard

DEFINE schema_name = & 1
DEFINE table_name = & 2
DEFINE column_name = & 3

CREATE OR REPLACE TRIGGER trg_ & table_name
BEFORE ON INSERT or UPDATE or DELETE &... schema_name table_name
-' SEO NEW OLD NEW old' is the default, so do not say

-REFERENCING NEW AS NEW OLD O
-In this way, you don't have to worry about the bad OLD spelling.
FOR EACH LINE
BEGIN
IF THE UPDATE CAN
fifapps. IBUG.log_errors (: OLD & column_name);
...

Once you have this course of debugging, you can write another script that calls the script above:

@trigger_factory fifapps t t_column_key

@trigger_factory fifapps u colonne_1

@trigger_factory foo bar column_xyz

Alternatively, instead of manually create a script like the one above, write a query to do it for you:

SELECT '@trigger_factory'

owner

table_name

column_name

From all_tab_columns

WHERE THE...

Tags: Database

Similar Questions

  • Bind the Variable in a dynamic query

    The procedure below uses a variable binding for the deptno and run it with a ref cursor The expected result is to display the ename from EMP for the deptno passed for the p_deptno parameter, but the procedure fails with an exception.

    CREATE OR REPLACE PROCEDURE dynamic_query(p_deptno NUMBER)
    AS
        lv_deptno number(4);
    --    l_lookup_type    VARCHAR2(30):='PBAMERICAS_CO';
        lv_query VARCHAR2(15000) :=' SELECT  ename,''Year'' from emp where deptno='|| p_deptno;
        lv_cursor  SYS_REFCURSOR;
        lv_lookup VARCHAR2(20);
        lv_emp_rec emp%rowtype;
        lv_ename VARCHAR2(10);
        lv_year   VARCHAR2(10);
    BEGIN
        dbms_output.put_line(lv_query);
        OPEN lv_cursor FOR lv_query USING p_deptno ;
        Loop
            FETCH lv_cursor INTO lv_ename,lv_year;
            dbms_output.put_line(lv_ename || ',' ||lv_year);
          EXIT WHEN lv_cursor%NOTFOUND;
         END LOOP;
        CLOSE lv_cursor;
    END dynamic_query;       
    
    
    

    
    
    SQL> exec dynamic_query(10);
    SELECT  ename,'Year' from emp where deptno=10
    BEGIN dynamic_query(10); END;
    
    
    *
    ERROR at line 1:
    ORA-01006: bind variable does not exist
    ORA-06512: at "APPS.DYNAMIC_QUERY", line 13
    ORA-06512: at line 1
    
    
    
    
    
    
    

    I can change the code slightly and change the where clause to work but wanted to know what am I did wrong which makes the procedure fails with the above code.

    CREATE OR REPLACE PROCEDURE APPS.dynamic_query(p_deptno NUMBER)
    AS
        lv_deptno number(4);
       lv_query VARCHAR2(15000) :=' SELECT  ename,''Year'' from emp ' ;
        lv_cursor  SYS_REFCURSOR;
        lv_lookup VARCHAR2(20);
        lv_emp_rec emp%rowtype;
        lv_ename VARCHAR2(10);
        lv_year   VARCHAR2(10);
    BEGIN
    
    
        IF p_deptno IS NOT NULL THEN
            lv_query := lv_query || ' Where deptno =' || TO_CHAR(p_deptno);
         END IF;
             dbms_output.put_line(lv_query);
        OPEN lv_cursor FOR lv_query  ;
        Loop
            FETCH lv_cursor INTO lv_ename,lv_year;
            dbms_output.put_line(lv_ename || ',' ||lv_year);
          EXIT WHEN lv_cursor%NOTFOUND;
         END LOOP;
        CLOSE lv_cursor;
    END dynamic_query;
    /
    
    

    PS: I use the table EMP for this example includes so not CREATE TABLE and INSERT.

    The procedure below uses a variable binding

    No, it isn't.

    You're just concatenation of the value of p_deptno in the query, such as a literal.

    It's using a variable binding:

    lv_query VARCHAR2 (15000): = ' 'year', SELECT ename from emp where deptno =: 1';

    Then, the variable may be correctly bound (by post) via the USING clause.

  • to BIND the variable SUBSTITUTION

    I have a code where I find dates START and end range for the past 3 years, the beginning Date must start on a Sunday and the end Date is at the end on Saturday using the weird system they have here:-)

    the end usable VARIABLE must be in YYYYMMDD format as number, because that's how they set up Date here... can anything about...

    So I thought to all the Dates, performing a combination of Variables of SUBSTITUTION AND LINKING, why I do like that it is because

    I received an error when I used just the variables SUBSTITUTION (maximum 240 characters used on the START DATE of the year2, in)

    switching to this, the error has disappeared), well that's what I thought he'll fix it.

    But now, when I try to use and VARIABLE in SQL, I get an error that it cannot use BIND variables, so try to pass values to a SUBSTITUTION

    afin_que this error disappears) - unless there is a better way?

    If there is a better way to stay maybe everything inside SUBSTITUTION and don't imply any LINK, maybe it would be better, if you guys know a way around the 240 character error...

    :-)

    My variables are:

    -find YEAR 1

    SET LY_END_DATE_NUM = "TO_NUMBER (TO_CHAR (NEXT_DAY ((SYSDATE-7), 'SATURDAY'), 'YYYYMMDD'));

    variable BIND_LY_END_DATE_N number;

    run: BIND_LY_END_DATE_N: = & LY_END_DATE_NUM;

    PRINT BIND_LY_END_DATE_N;

    SET LY_START_DATE = ' TO_DATE (: BIND_LY_END_DATE_N, 'yyyy-mm-dd')-363;

    SET LY_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& LY_START_DATE, 'YYYYMMDD'));

    variable BIND_LY_START_DATE_N number;

    run: BIND_LY_START_DATE_N: = & LY_START_DATE_NUM;

    PRINT BIND_LY_START_DATE_N;

    -find YEAR 2

    SET YRS2_END_DATE = ' TO_DATE (: BIND_LY_START_DATE_N, 'yyyy-mm-dd')-1;

    SET YRS2_END_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS2_END_DATE, 'YYYYMMDD'));

    variable BIND_YRS2_END_DATE_N number;

    run: BIND_YRS2_END_DATE_N: = & YRS2_END_DATE_NUM;

    PRINT BIND_YRS2_END_DATE_N;

    SET YRS2_START_DATE = ' TO_DATE (: BIND_YRS2_END_DATE_N, 'yyyy-mm-dd')-363;

    SET YRS2_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS2_START_DATE, 'YYYYMMDD'));

    variable BIND_YRS2_START_DATE_N number;

    run: BIND_YRS2_START_DATE_N: = & YRS2_START_DATE_NUM;

    PRINT BIND_YRS2_START_DATE_N;

    -find YEAR 3

    SET YRS3_END_DATE = ' TO_DATE (: BIND_YRS2_START_DATE_N, 'yyyy-mm-dd')-1;

    SET YRS3_END_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS3_END_DATE, 'YYYYMMDD'));

    variable BIND_YRS3_END_DATE_N number;

    run: BIND_YRS3_END_DATE_N: = & YRS3_END_DATE_NUM;

    PRINT BIND_YRS3_END_DATE_N;

    SET YRS3_START_DATE = ' TO_DATE (: BIND_YRS3_END_DATE_N, 'yyyy-mm-dd')-363;

    SET YRS3_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS3_START_DATE, 'YYYYMMDD'));

    variable BIND_YRS3_START_DATE_N number;

    run: BIND_YRS3_START_DATE_N: = & YRS3_START_DATE_NUM;

    PRINT BIND_YRS3_START_DATE_N;

    Hello

    Kodiak_Seattle wrote:

    I have a code where I find dates START and end range for the past 3 years, the beginning Date must start on a Sunday and the end Date is at the end on Saturday using the weird system they have here:-)

    the end usable VARIABLE must be in YYYYMMDD format as number, because that's how they set up Date here... can anything about...

    So I thought to all the Dates, performing a combination of Variables of SUBSTITUTION AND LINKING, why I do like that it is because

    I received an error when I used just the variables SUBSTITUTION (maximum 240 characters used on the START DATE of the year2, in)

    switching to this, the error has disappeared), well that's what I thought he'll fix it.

    But now, when I try to use & VARIABLE in SQL, I get an error that it cannot use BIND variables, so try to pass values to a SUBSTITUTION

    afin_que this error disappears) - unless there is a better way?

    If there is a better way to stay maybe everything inside SUBSTITUTION and don't imply any LINK, maybe it would be better, if you guys know a way around the 240 character error...

    :-)

    My variables are:

    -find YEAR 1

    SET LY_END_DATE_NUM = "TO_NUMBER (TO_CHAR (NEXT_DAY ((SYSDATE-7), 'SATURDAY'), 'YYYYMMDD'));

    variable BIND_LY_END_DATE_N number;

    run: BIND_LY_END_DATE_N: = & LY_END_DATE_NUM;

    PRINT BIND_LY_END_DATE_N;

    SET LY_START_DATE = ' TO_DATE (: BIND_LY_END_DATE_N, 'yyyy-mm-dd')-363;

    SET LY_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& LY_START_DATE, 'YYYYMMDD'));

    variable BIND_LY_START_DATE_N number;

    run: BIND_LY_START_DATE_N: = & LY_START_DATE_NUM;

    PRINT BIND_LY_START_DATE_N;

    -find YEAR 2

    SET YRS2_END_DATE = ' TO_DATE (: BIND_LY_START_DATE_N, 'yyyy-mm-dd')-1;

    SET YRS2_END_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS2_END_DATE, 'YYYYMMDD'));

    variable BIND_YRS2_END_DATE_N number;

    run: BIND_YRS2_END_DATE_N: = & YRS2_END_DATE_NUM;

    PRINT BIND_YRS2_END_DATE_N;

    SET YRS2_START_DATE = ' TO_DATE (: BIND_YRS2_END_DATE_N, 'yyyy-mm-dd')-363;

    SET YRS2_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS2_START_DATE, 'YYYYMMDD'));

    variable BIND_YRS2_START_DATE_N number;

    run: BIND_YRS2_START_DATE_N: = & YRS2_START_DATE_NUM;

    PRINT BIND_YRS2_START_DATE_N;

    -find YEAR 3

    SET YRS3_END_DATE = ' TO_DATE (: BIND_YRS2_START_DATE_N, 'yyyy-mm-dd')-1;

    SET YRS3_END_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS3_END_DATE, 'YYYYMMDD'));

    variable BIND_YRS3_END_DATE_N number;

    run: BIND_YRS3_END_DATE_N: = & YRS3_END_DATE_NUM;

    PRINT BIND_YRS3_END_DATE_N;

    SET YRS3_START_DATE = ' TO_DATE (: BIND_YRS3_END_DATE_N, 'yyyy-mm-dd')-363;

    SET YRS3_START_DATE_NUM = "TO_NUMBER (TO_CHAR (& YRS3_START_DATE, 'YYYYMMDD'));

    variable BIND_YRS3_START_DATE_N number;

    run: BIND_YRS3_START_DATE_N: = & YRS3_START_DATE_NUM;

    PRINT BIND_YRS3_START_DATE_N;

    Let me make sure I understand the problem.

    One year, in this problem, is exactly 364 days.

    You want the year that ended on the most recent Saturday (otherwise said, the year ending Saturday between 6 days ago and today) and two years ago.

    You want the first date in each of those years and the last date each year, in the format YYYYMMDD.

    Is this fair?

    Here's a way to define variables of substitution (with names like year_1_start):

    COLUMN y1_start new_value by year_1_start

    COLUMN y1_end new_value by year_1_end

    COLUMN y2_start new_value by year_2_start

    COLUMN y2_end new_value by year_2_end

    COLUMN y3_start new_value by year_3_start

    COLUMN y3_end new_value by year_3_end

    WITH got_y1e AS

    (

    SELECT NEXT_DAY (SYSDATE - 7 'SATURDAY') AS y1e

    OF the double

    )

    SELECT TO_CHAR (y1e + 1 - (364 * 3), 'YYYYMMDD') AS y3_start

    , TO_CHAR (y1e - (364 * 2), 'YYYYMMDD') AS y3_end

    , TO_CHAR (y1e + 1 - (364 * 2), 'YYYYMMDD') AS y2_start

    , TO_CHAR (y1e - 364, 'YYYYMMDD') AS y2_end

    , TO_CHAR (y1e + 1-364, 'YYYYMMDD') AS y1_start

    , TO_CHAR (y1e, 'YYYYMMDD') AS y1_end

    OF got_y1e

    ;

    If you prefer that bind variable, write an anonymous PL/SQL block and use the same logic to 6 variables.

  • Bind the Variable Table name in the query of VO

    I have a VO that must have its clause defined dynamically at run time.  I have a string bind variable defined with a default value that is referenced in the query of the VO.  However, JDeveloper allow me to leave the definition of the query of the view object when the from clause is a variable binding, even if the binding variable has the default value.

    For example.

    Select

    « X »

    Of

    : TABLE

    where

    1 = 1

    The variable binding TABLE is defined as a string with a default value of the 'double '.  Did I miss something in the definition of the VO?

    Thank you

    Hello

    I suggest you to dynamically set the query of the view object.  This does not meet your requirements.

    xxVo.setQuery ();

  • bind the variable column of v$ sqlarea

    BANNER
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
    PL/SQL Release 10.2.0.4.0 - Production
    CORE     10.2.0.4.0     Production
    TNS for HPUX: Version 10.2.0.4.0 - Production
    NLSRTL Version 10.2.0.4.0 - Production
    select to_char(sql_fulltext), bind_data from v$sqlarea where sql_id = '5fwm73ndv5pjp';
    TO_CHAR(SQL_FULLTEXT)                    BIND_DATA
    select vgal.GAFS_DISPLAY_LINE_CD
    from view_gafs_account_line vgal
     where vgal.ACCOUNT_ID =  :p1 and
     vgal.ACCOUNT_LINE_SEQ_CD =  :p2 and 
    vgal.ACCOUNT_TYPE_ID =  :p3 and 
    vgal.PROGRAM_SUMMARY_ID =  :p4     
    I'm not horribly v$ sqlarea. but there were some questions about the application executes a query and get
    no row is returned.

    I find the query in v$ sqlarea but I would like to know what are bind variables, but this column is null.

    This means that the query has been run with null for all bind variables?
    or bind variables not seized for any reason are any?

    v$ sql_bind_capture I bind the value of the variable

    SELECT
       a.sql_text,
       b.name,
       b.position,
       b.datatype_string,
       b.value_string
    FROM
    
      v$sql_bind_capture b,
    
      v$sqlarea          a
    
    WHERE
    
       b.sql_id = 'dpf3w96us2797'
    
    AND
       b.sql_id = a.sql_id;
    
  • BIND THE VARIABLE INSIDE A LOOP

    Hello
    I have question about the sort of the values using Plsql... My requirement is to get values of N with the user and sorting in ascending or descending order. I tried the following query

    DECLARE
    Is of type TABLE numsort
    NUMBER
    INDEX OF DIRECTORY;
    v_num numsort;
    number of v_total;
    number of v_no;
    BEGIN
    -get the number of values to sort
    v_total: =: TotalNum;
    dbms_output.put_line (v_total);
    because me in 1.v_total
    LOOP
    v_no: =: none; -Read the values
    v_num (i): = v_no;
    dbms_output.put_line (v_num (i): 10;)
    END LOOP;
    END;

    its code is not complete... sound to read the value in the table... Read itself does not

    The problem is that the connection variable is not reset with each iteration. I am using Toad and he asked me to pass all the variable binding both... But I want to read the values in the table with each iteration. Is it possible in PLSQL... or is there another way to do this...

    hope you are clear with the requirement... If any infomartion extra need please come bk...

    Waiting for your replay

    Thanks and greetings
    Rognard

    Maybe like this?

    SQL> create or replace procedure test_proc (p_input varchar2, p_separator varchar2) is
      2  v_input varchar2(32767):= p_input||p_separator;
      3  begin
      4  if p_input is not null then
      5  while instr(v_input,p_separator) > 0 loop
      6      dbms_output.put_line(substr(v_input,1,instr(v_input,p_separator)-1));
      7      v_input:=substr(v_input,instr(v_input,p_separator)+1);
      8  end loop;
      9  end if;
     10  end;
     11  /
    
    Procedure created.
    
    SQL> exec test_proc('10, 4, 6, 3',',')
    10
    4
    6
    3
    
    PL/SQL procedure successfully completed.
    
    SQL> exec test_proc('',',')
    
    PL/SQL procedure successfully completed.
    
    SQL>
    

    Nicolas.

  • Bind the Variable problem

    Hi all

    CREATE OR REPLACE PROCEDURE PRMADM_BATCH. UPDATE_PROC_LOG (p_SRC_SYS_ID VARCHAR,
    p_APPL_MOD_NM VARCHAR, p_INPT_OBJ_NM VARCHAR, VARCHAR, p_OUTPT_OBJ_NM p_ERR_ID
    VARCHAR, p_ERR_DESC VARCHAR)
    AS
    number of p_OUTPT_ROW_CNT;
    number of p_INPT_ROW_CNT;
    p_OUTPT_SQL VARCHAR2 (4000);
    p_INPT_SQL VARCHAR2 (4000);
    number of p_ERR_ID_CHK;
    BEGIN
    IF p_ERR_ID = 0 THEN - success
    p_OUTPT_ROW_CNT: = 0;
    p_INPT_ROW_CNT: = 0;
    p_OUTPT_SQL: = NULL;
    p_INPT_SQL: = NULL;
    p_ERR_ID_CHK: = 0;
    DBMS_OUTPUT. PUT_LINE ('SRC_SYS_ID =' | p_SRC_SYS_ID);
    p_OUTPT_SQL: = 'SELECT COUNT (*) FROM "| p_OUTPT_OBJ_NM | ' WHERE
    SRC_SYS_ID =: a ';
    p_INPT_SQL: = 'SELECT COUNT (*) FROM "| p_INPT_OBJ_NM | ' WHERE
    SRC_SYS_ID =: b';
    DBMS_OUTPUT. Put_line (p_OUTPT_SQL);
    DBMS_OUTPUT. Put_line (p_INPT_SQL);
    EXECUTE IMMEDIATE p_OUTPT_SQL IN p_OUTPT_ROW_CNT IN USING p_SRC_SYS_ID;
    EXECUTE IMMEDIATE p_INPT_SQL IN p_INPT_ROW_CNT IN USING p_SRC_SYS_ID;
    Else - failure
    p_OUTPT_ROW_CNT: = - 1;
    p_INPT_ROW_CNT: = - 1;
    p_OUTPT_SQL: = NULL;
    p_INPT_SQL: = NULL;
    p_ERR_ID_CHK: = - 1;
    SELECT COUNT (*) IN the p_ERR_ID_CHK OF PRMADM. ERR WHERE ERR_ID =
    p_ERR_ID;
    IF p_ERR_ID_CHK = 0 THEN
    INSERT INTO PRMADM. ERR (ERR_ID, ERR_DESC) VALUES (p_ERR_ID,
    p_ERR_DESC);
    COMMIT;
    END IF;
    END IF;
    UPDATE PRMADM. PROC_LOG
    SET PROC_END_DY_DT = SYSDATE,
    INPT_ROW_CNT = p_INPT_ROW_CNT,
    OUTPT_ROW_CNT = p_OUTPT_ROW_CNT,
    ERR_ID = p_ERR_ID
    WHERE APPL_MOD_NM = p_APPL_MOD_NM
    AND PROC_END_DY_DT IS NULL
    AND OUTPT_OBJ_NM = p_OUTPT_OBJ_NM
    AND INPT_OBJ_NM = p_INPT_OBJ_NM
    AND SRC_SYS_ID = p_SRC_SYS_ID;
    COMMIT;
    END UPDATE_PROC_LOG;
    /

    The proc above is running well and gives the result below

    SRC_SYS_ID = 1030
    SELECT COUNT (*) IN THE PRMADM. PGM WHERE
    SRC_SYS_ID =: a
    SELECT COUNT (*) IN THE PRMADM. INPT_PGM WHERE
    SRC_SYS_ID =: b


    My question is where can I enter the value for the variable bind a and b...

    I want to put two to 1030

    Thanks in advance

    Ndiaye (ndiaye) wrote:
    p_SRC_SYS_ID (input in my proc parameter) takes the value of 1030 and I want that the connection variable: an and: b take the same value...

    But they take this value...

    EXECUTE IMMEDIATE p_OUTPT_SQL IN p_OUTPT_ROW_CNT IN USING p_SRC_SYS_ID;
    EXECUTE IMMEDIATE p_INPT_SQL IN p_INPT_ROW_CNT IN USING p_SRC_SYS_ID;

    The 'USE' of the declaration part links the value to bind variables in the SQL statement.

    Where is the problem?

  • Access to bind the variables of class EntityImpl

    Hello

    I use jdeveloper 11.1.1.7.0

    I have an Obj to the entity and a view Obj, in the a view Obj I defined some variables bind to the WhereClause,

    EntityImpl of EO class, I need to access these variable bind, how can I do for this case?

    Habib

    Concerning

    There are several options:

    1. download VO in your EOImpl class (as I have already suggested). It is the best way to recover your var bind, but will present a dependence between OT and VO (and usually EO should not depend on a VO, but of course it depends on concrete use cases). So, if you know that there is only one THAT VO editable based on this OS, I'd go with this approach.

    2. put your var to link to the http session and then access this variable with: ADFContext.getCurrent () .getSessionScope ().  It is not difficult to implement, but this isn't a very good approach because it would break the MVC pattern (you should not reference something layer in the layer of view model).

    3. place your var bind to structure UserData. It's probably "appropriately", but it is also the most difficult to implement correctly, see for example Andrejus Baranovskis Blog: Solution for sharing the global user data in British Colombia ADF

    Dario

  • bind the variable question

    Hello

    I wonder what trivial mistake, am I doing here? Qsure uite that the syntax is correct and it has worked before in the developer doesn't have it?

    variable bind_variable number
    execute :bind_variable := 1;
    print bind_variable
    
    
    PL/SQL procedure successfully completed.
    
    
    
    
    BIND_VARIABLE
    ------
    
    
    


    I found regarding reports bug, but for versions a lot older.

    Win 7

    Version 4.1.0.19

    Java 1.8.0_31

    Looks like a bug in 4.1 based on the thread below and the comments in the blog below:

    Printing in SQL Developer 4.1 output

    http://www.thatjeffsmith.com/archive/2015/05/SQL-Developer-version-4-1-feature-recap/

    Works very well in 4.0.3.16

    See you soon

    AJ

  • Bind the Variable for: 'No. Inline Validation errors displayed' existing?

    Hello

    Is there a variable corresponding to 'No Inline Validation errors displayed' APEX?
    I would test this variable combined with others for complex validation scenarios.

    Kind regards

    Christian

    Christian:

    You can use 'wwv_flow.g_inline_validation_error_cnt' to determine the number of online validation errors

    CITY

  • How to pass the number object type to bind the variable in a select statement

    Hello

    I have a scenario like,

    UI, we store the values in the type of object, and this object type must be spent in a select query to retrieve the data accordingly.

    Is it possible to do so.

    If this isn't the case, please let me know how to take the values of object type and pass to the select query.

    Kind regards

    I found it,

    Object_name ('parameters1', 'parameter2');

  • How to assign to the variable of type XML with function extract values?

    Hello

    I have variable XMLTYPE LeXml have under folder

    <? XML version = "1.0" encoding = "utf-8"? >
    < soap envelope: xmlns: xsi = "http://www.w3.org/2001/XMLSchema-instance" container = "http://www.w3.org/2001/XMLSchema" xmlns:soap = "http://schemas.xmlsoap.org/soap/envelope/" >
    < soap: Body >
    < AddListing xmlns = "http://www.christielites.com/" >
    string of < sComCode > < / sComCode >
    string of < sLocCode > < / sLocCode >
    dateTime < dStart > < / dStart >
    dateTime < made > < / made >
    < sEcode > string < / sEcode >
    < iAvail > int < / iAvail >
    < iOwned > int < / iOwned >
    string of < sPostTrans > < / sPostTrans >
    < / AddListing >
    < / soap: Body >
    < / envelope soap: >

    I want to get the sEcode value chain in a varialbe using the extract function or another?

    can someone give me the syntax FRO it?

    I tried with Mstring:=LeXml.extract('AddListing/scomcode/text()').getStringval(); but iam in error
    ERROR on line 1:
    ORA-31011: XML parsing failed
    ORA-19202: an error has occurred in the processing of XML
    LPX-00601: token not valid in: "soap:Envelope/text().
    ORA-06512: at "SYS." XMLTYPE", line 111
    ORA-06512: at the 'BLUEWATER '. CREATELERESPONSELOG', line 12
    ORA-06512: at line 1

    Please guide me.
    Mstring:=LeXml.extract('AddListing/scomcode/text()').getStringval(); 
    

    should be

    Mstring:=LeXml.extract('/soap:Envelope/soap:Body/AddListing/sComCode/text()', 'xmlns="http://www.christielites.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"').getStringval(); 
    

    I used to request verification is

    select xmltype('
    
    
    
    string
    string
    dateTime
    dateTime
    string
    int
    int
    string
    
    
    ').extract('/soap:Envelope/soap:Body/AddListing/sComCode/text()', 'xmlns="http://www.christielites.com/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"') from dual
    

    Ravi Kumar

  • Please help on the binding of variables

    Hello

    I need to bind the variable into the next function.
    If the only deptno is passed to the function, the function will return correct result. However, if all of the deptno is passed, the function cannot give correct result.

    Could someone help me please in this topic...

    Thanks in advance!



    Scott@ORA111 > create or replace function my_test (p_deptno_list varchar2)
    2 return sys_refcursor
    3 as
    4 rec sys_refcursor;
    VARCHAR2 (1000) v_sql 5.
    6
    7. start
    8 v_sql: = ' select * from emp where deptno in (: 1)';
    9. open rec for v_sql using p_deptno_list;
    10 return rec.
    11
    12 end;
    13.

    The function is created.

    Elapsed time: 00:00:00.04
    Scott@ORA111 > var my_rec refcursor
    Scott@ORA111 > run: my_rec: = my_test('10');

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.00
    Scott@ORA111 > print: my_rec

    EMPNO, ENAME, JOB HIREDATE DEPTNO COMM SAL MGR
    ---------- ---------- --------- ---------- --------- ---------- ---------- ----------
    7782 CLARK MANAGER 7839 2450 JUNE 9 81 10
    PRESIDENT OF 7839 17 NOVEMBER KING 81 5000 10
    7934 MILLER COMMITTED JANUARY 7782 1300 23 82 10
    SELLER OF TEMP 9999 7782 6000 27 APRIL 09 10

    Elapsed time: 00:00:00.01

    Scott@ORA111 > var my_rec refcursor
    Scott@ORA111 > run: my_rec: = my_test (10, 20');

    PL/SQL procedure successfully completed.

    Elapsed time: 00:00:00.01
    Scott@ORA111 > print: my_rec
    ERROR:
    ORA-12801: error reported in the parallel query P000 Server
    ORA-01722: invalid number

    no selected line
    Elapsed time: 00:00:00.01

    You can also do this by changing the where clause with INSTR function

    SELECT * FROM EMP WHERE INSTR(:P_DEPTNO,DEPTNO) > 0
    
  • not possible to bind a variable shared via Ethernet network

    Hello!

    I have computer A and B with windows xp, sp3 and labview 8.6, professional edition. The two computers are in the ethernet network. I'd like to Exchange data between two applications of LV using shared variables. I create a shared variable (published network) on both computers.
    The problem is in the properties of shared variables not possible to bind the variable of the remote computer to the local computer. In the first step, there is even no possible to see any computer on the network. After the registration of the computer (Tools-> shared-> computer registry variable)
    I see the computer remote, but without any variable sharing.

    Do you have any idea how to solve this problem?

    Thank you for the answers.

    Hi ,

    Visit this link, maybe it can help you.

  • bind the parameter to dynamic sql

    Dear user

    I want to bind the variable at run time

    the problem is as follows:-

    I have a table like this: -.

    type_id, rule_dtls, rule_id, using_paramter

    rule_id and type_id is an idea just to the rule and object

    using_paramter:-is parameters used to bind the variable to the rule, it may be different

    as examples of data the spouse;

    using_paramter can be different parameter as AREA, BOARD_NO or face_no,

    rule_id, board_type, rule_dtls using_paramter
    17CASE WHEN: BOARD_NO < 1000 then 10 when: BOARD_NO > 1000 then CEIL (: BOARD_NO/5000) * 5 endBOARD_NO,BOARD_NO,BOARD_NO
    25
    WHEN BOX: AREA < 3 then 15 when : AREA > 3 then (: SPACE - 3 * 2) + 15 end
    BOX, BOX, BOX

    and I have the function of database 10g as follows:-

    CREATE OR REPLACE FUNCTION    get_bord_price(area number,face_no number,BOARD_NO number,BOARD_TYPE_v varchar2) RETURN number  IS
    amt number:=0;
    sql_v varchar2(500);
    BOARD_RULE varchar2(500);
    using_clom varchar2(500);
    price number;
    ERR varchar2(500);
    ERR_CODE NUMBER;
    BEGIN
    price:=0;
    select rule_dtls ,using_paramter into BOARD_RULE,using_clom from BOARD_RULE where BOARD_TYPE=BOARD_TYPE_v;
    sql_v:='select '||BOARD_RULE  ||' from dual';
    execute immediate sql_v 
    INTO price
    using using_clom;
    RETURN price;
    exception when others THEN
    ERR:=SQLERRM;
    return 0;
    END;
    
    
    

    the error is in

    using using_clom;

    How can I bind varable this:

    or is there another solution

    Hello

    Bind variables cannot be a variable.

    Identify the parts to be replaced (e.g.,: BOARD_NO,: AREA) and write statements to REPLACE to replace those.

    Manu.

Maybe you are looking for