Comma Separated Values in Bind Variable
HelloI'm on Oracle9i Enterprise Edition Release 9.2.0.6.0 - Production.I use in query
select * from employees where first_name in ('Ajay','Ajay5')
It gives me two rows as it should. Now, I want to pass these values as a bind variable.select * from employees where first_name in :1
Now when I run the query and make its contribution as a ('Ajay', 'Ajay5'). It gives me no line.Is their any way to do this. Let me know if you have any questions
Thank you
AJ
Check out this link: the Blog of Tom Kyte: varying in lists...
Tags: Database
Similar Questions
-
The research of a column with comma separated values with ora-text
I use the Oracle 11 g 2 XE and Oracle Text to a web search engine.
I've now created and text indexed a CLOB keywords column that contains words separated by spaces. This allowed me to expand the search, as Oracle Text returns the rows that have one or more keywords that are stored in this column. The contents of the column are visible to the user and serves to 'expand' the search. This does not work as expected.
But now I need support several words or even sentences. With the current configuration, Oracle Text will only search for each keyword. How should I store the phrases and configure Oracle text so that it will search entire sentences (exact match is better, but the partial match is fine too)?
Example of content column of two lines (values separated semicolon):
"Hello, Hello; y at - it anyone out there? Nope; »
"the just; basic facts; »
I found a similar question: looking for a column with values separated by commas, except that I need a solution for Oracle 11 g with it's freetext search.
Possible solutions:
1st solution: I thought to redraw the DB as follows. I would like to make a new array of keywords (pkID NUMBER, nonUniqueID NUMBER, singlePhrase VARCHAR2 (100 BYTE)). And I want to change the column previous keyword to KeywordNonUniqueID, holding the ID (instead of a list of values). At the time of the research I had INNER JOIN with the new keyword table. The problem with this solution is that I will get several lines containing the same data except for the sentence. I guess this will destroy the ranking?
2nd solution: is it possible to store sentences as an XML in the column key of origin and somehow say Oracle text to search for in the XML?
3rd solution: separate individual phrases with spaces, but replace the spaces in sentences with the underscore or something (making a single word). If a phrase "why Hello there, Johnny!" is saved as "Why_hello_there, _Johnny!
4th solution?:
Note that, generally, there is a lot of sentences (less than 100), nor that they will be long (one sentence will be up to 5 words).
Also note that I am currently using CONTAINS, and needs some of its operators, to my full-text searches.When you talk about "phrase", do you mean "a list of words separated by a comma other sentences?
Isn't that the definition of "sentence" used by Oracle Text, where it simply means "a list of words in the order defined."
If I understand your requirement, you want to have data such as:
"aa bb cc dd".
"aa ee dd ff.and give priority to the first on the second if someone looking for "dd".
First, to conduct research in the comma separated list, you should look for in a section. You can either explicitly define sections of field such as
AA bb cc dd
Or you can use the PHRASE special section and set the sentence delimiters correctly. This is done with the attribute BASIC_LEXER punctuationThen you have the number you want to find only words where they are the only words in the section. That's the same problem, I address in the last post of this forum entry:
Contains: match exactlyOur solution will be substantially the same, some surrounding text with special markers, and then prioritize a phrase search with these special markers each side of the word.
We need to do a treatment some additional, although, as we need to surround each "sentence" (in your terminology) with special markers. I did it by surrounding the text with "XX1"... Condition2"then by replacing every comma with"Condition2, XX1"as part of a MULTI_COLUMN_DATASTORE:drop table names; create table names (id number primary key, text varchar2(50)); insert into names values( 1, 'just and kind, kind and loving' ); insert into names values( 2, 'just, kind' ); exec ctx_ddl.drop_preference ( 'mylex' ) exec ctx_ddl.create_preference( 'mylex', 'BASIC_LEXER' ) exec ctx_ddl.set_attribute ( 'mylex', 'PUNCTUATIONS', ',' ) exec ctx_ddl.drop_preference ( 'mcds' ) exec ctx_ddl.create_preference( 'mcds', 'MULTI_COLUMN_DATASTORE' ) exec ctx_ddl.set_attribute ( 'mcds', 'COLUMNS', '''XX1 ''||replace(text, '','',''XX2, XX1'')||'' XX2''' ) exec ctx_ddl.drop_preference ( 'mywl' ) exec ctx_ddl.create_preference( 'mywl', 'BASIC_WORDLIST' ) exec ctx_ddl.set_attribute ( 'mywl', 'SUBSTRING_INDEX', 'YES' ) create index namesindex on names(text) indextype is ctxsys.context parameters( 'datastore mcds wordlist mywl' ) / select score(1),id,text from names where contains( text, '
XX1 kind XX2 kind Output of this is:
SCORE(1) ID TEXT ---------- ---------- -------------------------------------------------- 52 2 just, kind 2 1 just and kind, kind and loving
-
MB of Pass value to bind variable Groove
Hello world. my version is 11.1.2.2
I have a bean managed on the basis that contains two components of input (ex: name of user, pswd)
I'm moving the input value to a query of VO that have variables bind with Groove. as adf.context.current...
If it is possible, what is the expression to access the value of the bean components managed?
THXJust follow this
(1) for the vo, generate the VOImpl and when you create, select the variable bind method also
(2) has the VOimpl who take a parameter, set the varialbe bind using the method and run the query method
(3) expose this method as a customer interface
(4) in the pagedefinition file, create an action method and select this method and have a binding method
(5) of the managed bean, use the following code to execute the methodOperationBinding operation = bindings.getOperationBinding("operation_name"); operation.getParamsMap().put("parameter_name", parameterValue); /// this will be u r bind variable parameter operation.execute(); if (operation.getResult() != null) { Boolean result = (Boolean) operation.getResult(); // cast to the expected result type }
-
creation of selection using comma-separated values list
Hi all
I have the column in the database containing values separated by commas
for ex: Pune, Mumbai, Bangalore...
I want to create the selection list using higher values.
for ex: Pune
Mumbai
Bangalore
Please help me on this issue.
Thanks in advance,
JitendraHello
Try the following
select regexp_substr(YOUR_FIELD_NAME,'[^,]+', 1, level) display_value, regexp_substr(YOUR_FIELD_NAME,'[^,]+', 1, level) return_value from YOUR_TABLE connect by regexp_substr(YOUR_FIELD_NAME, '[^,]+', 1, level) is not null
Concerning
Graham
Published by: gpc on February 1, 2012 11:27
-
Hello
We stock values separated by commas into a table.
IIL_CUSTOMER_TICKETS_TYPE_IDS
-------------------------------------------------------
1,2,3,4,5,6
5,7,10,56,48
12,45,56,
I want to query this table through values separated by commas...
Query as this select * from t1 where IIL_CUSTOMER_TICKETS_TYPE_IDS in (1,2,3)
Help, please...Try this
with mytable as
(
Select 'a' pass, ' 1,2,3,4,5,6"txt of all double union
Select 'b', '5,7,10,56,48' of any double union
Select 'c', "12,45,56" of the double
)
Select
MyTable.col,
txt
Of
MyTable,
(
Select
level n
Of
(
Select
Max (length (txt) - length (replace (txt, ','))) as max_commas
Of
MyTable
)
connect by level<= 1="" +="">=>
) ctr
where
CTR.n<= 1="" +="" length="" (txt)="" -="" length="" (replace="" (txt,="">=>
and regexp_substr (mytable.txt, "[^,] +', 1, n") in (1,5,7)
order by
MyTable.col,
CTR.nhttp://nimishgarg.blogspot.com/2010/06/Oracle-comma-seprated-string-to-rows_16.html
Alexander gelin
http://nimishgarg.blogspot.com -
Using 'text field contains comma-separated values' on a parameter of %
Hello
I use a parameter that has more than one value to be entered, separated by commas. I checked the box 'text field contains values separated by commas' for the parameter and set the sql code by using the operator 'in' so that the column will look in the multiple input values (e.g. family name in (: surname_par)). However, as passing multiple values parameter must also be able to manage %'s. As the sql uses the 'in' operator, BI Publisher brings back an error because % is supposed to bring all family names and not people with a last name of %. Is there a way to get around this?
Thank youIf you try to pass multiple values separated by commas and in addition also takes the query to return the data when the user types just in '%', then you could write something like this in your query:
Select * from table_name
where ((1 = DECODE (: surname_par, '%', 1, 0)) OR family name in (: surname_par))I hope this helps. Please award points if helpful/correct.
-
Order with comma separated values?
I have the following table
create table ord as
(select col1 '4,7,10'
Union
"4,7,8'."
Union
'5,6,11'
Union
'4,7,10'
Union
'4,7,6'
Union
'4,7,7'
the double)
I mean select * from DSB order by col1 and the by should look at every number in the column ordering him to string vs...
Currently 4,7,10 comes first (as it is a string comparison), but I want to come 4,7,6 first.It could by urgent for you, but it is not, we have our own work to do.
In any case...
It will focus on any number of numbers in the list up to 10 digits long each...
SQL> ed Wrote file afiedt.buf 1 with ord as 2 (select '4,7,10' col1 from dual union 3 select '4,7,8' from dual union 4 select '5,6,11' from dual union 5 select '4,7,10' from dual union 6 select '4,7,99,4' from dual union 7 select '4,7,6' from dual union 8 select '4,7,7' from dual) 9 -- End of test data 10 select col1 11 from ord 12* order by regexp_replace(regexp_replace(col1,'(^|,)([^,]+)','\1000000000\2'),'(^|,)[^,]*([0-9]{10})(,|$)','\1\2\3') SQL> / COL1 -------- 4,7,6 4,7,7 4,7,8 4,7,10 4,7,99,4 5,6,11 6 rows selected. SQL>
If you need to more digits cos you're numbers are bigger, so you need to change the regular expression to pad with more than 0 (inbetween the \2 \1) and cut to the required length or replace the {noformat} {10} {noformat} with the number of digits required.
-
How do I see the bind variable values in the output of statspack
Hi all.
Oracle9i Enterprise Edition Release 9.2.0.4.0 - 64 bit Production
PL/SQL Release 9.2.0.4.0 - Production
CORE Production 9.2.0.3.0
AMT for Solaris: release 9.2.0.4.0 - Production
NLSRTL Version 9.2.0.4.0 - Production
Run sprepsql.sql to get full sql and explain the plan of the hash value.
SQL returns with bind variable: 1: 2: 3, etc.
How can I know what are the values for bind variables in order to connect and run them in test db?
Thanks for your help.You can't get the values to bind to StatsPack (AFAIK).
You have to draw a session that is running this / these SQLs (s) to capture the lie.
Or query V$ SQL_BIND_CAPTURE for the SQL when it runs.Hemant K Collette
-
Since plsql automatically converts the variables in the where clause and the clause values in bind variable. So what is the difference between the two statements below?
create table t (number);
1)
declare
x number: = 109;
Start
Insert values into t (x); - plsql will make this variable as a variable binding, and provide the value of x in run mode.
exception when others then
dbms_output.put_line (SQLERRM);
end;
2)
declare
x number: = 109;
Start
immediately execute "insert into values t (: B1)" using x. -the user has explicitly used bind variable.
dbms_output.put_line (SQLERRM);
end;[EDIT: after further testing, I redesigned my original explanation because Rahul referenced below.]
Rahul K wrote:
1)
declare
x number: = 109;
Start
Insert values into t (x); - plsql will make this variable as a variable binding, and provide the value of x in run mode.
exception when others then
dbms_output.put_line (SQLERRM);
end;2)
declare
x number: = 109;
Start
immediately execute "insert into values t (: B1)" using x. -the user has explicitly used bind variable.
dbms_output.put_line (SQLERRM);
end;((1) SQL static, 2) is the dynamic SQL code. Static SQL is parsed to less than dynamic SQL statements.
As you make these calls in PL/SQL anonymous blocks and not in the stored procedures, there will be some analysis every time. Analysis of the static SQL will do less work than the analysis of the dynamic SQL, but both will avoid "hard" analysis which adds the execution plan to the shared pool.
Published by: Ashton stew on January 6, 2013 10:16
-
Hi guys,.
When a SQL using bind variables histograms afftect the excution plan how?
For example
There is a table 'TEST' a column a number, varchar2 (100) b, c. tank (100).
100000 rows in this table and the 90000 column rows a value is 1, the other value is 2-10 by 100rows.
Now this column a histogram and a btree index only has on a;
Here is sample code
number of a_v var;
exec: a_v: = 10;
Select * from test where a =: a_v.
The plan of the excution is full table scan.
If I don't use of variable binding. It will scan the index.
I remember that a document mentioned that "do not use histograms using bind variables.
But why?
I disabled same bind variable peeking?
Thank you guys. Looking forward to your response.Longfei Wei says:
Thanks Centinul this article is useful for me, but it is not explained why histograms do not work well with bind variables.Thanks again.
Longfei,
Jonathan Lewis article is very good - another look at this article. Histograms peuvent work with bind variable, but the end result is usually not the desired result. Bind variables are used to reduce the number of different execution plans. The histograms are used to find what is supposed to be the best execution plan for the predicates provided and in the case of the bind variables, those are peeked from the bind variable values. Thus, if you have a histogram on a column and for hard analysis of a SQL statement and the most common value in this column is presented in the binding variable - this execution plan is considered by the optimizer to be the 'best' execution plan for the bind variable values provided. Suppose now that instead the less popular value in the column is specified - the optimizer peut produce a very different for the same SQL statement execution plan, which is optimized for the less popular value (this can be a scan of the index systematic range, rather than a full table scan). Now suppose the execution plan may not change when change of variable values bind - if you have a single popular value and many unpopular values, if the analysis lasts is performed with the popular single value, you might find that all subsequent runs of this SQL statement to perform full table scans, even if only a few rows in the table are selected.
Here's a quick test on the Oracle 11.2.0.2 database to demonstrate:
CREATE TABLE T1 ( C1 NUMBER, C2 NUMBER, C3 VARCHAR2(300)); INSERT INTO T1 SELECT * FROM (SELECT ROWNUM C1, DECODE(MOD(ROWNUM,100),99,99,1) C2, RPAD('A',300,'A') C3 FROM DUAL CONNECT BY LEVEL <= 1000000) ORDER BY C2; CREATE INDEX IND_T1_C2 ON T1(C2); EXEC DBMS_STATS.GATHER_TABLE_STATS(OWNNAME=>USER,TABNAME=>'T1',CASCADE=>TRUE,METHOD_OPT=>'FOR ALL INDEXED COLUMNS SIZE 254')
The foregoing has created a table with 1 000 000 lines where 99% of the lines have a value of 1 in C2 and 1% have a value of 99, and lines are inserted with a perfect setting in cluster factor because of the ORDER BY clause. A histogram has been created on the indexed column.
Let's try a test, we'll search a unpopular value 2 for the connection variable:
VARIABLE N1 NUMBER EXEC :N1:=2 SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; no rows selected SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 0 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 ------------------------------------------------------------------------------------------------------------ | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | Reads | ------------------------------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | | 0 |00:00:00.01 | 3 | 1 | | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 0 |00:00:00.01 | 3 | 1 | |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 0 |00:00:00.01 | 3 | 1 | ------------------------------------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
Thus, there is no selected row, the optimizer predicts that 5 957 lines would be returned and a path to the index has been selected. Path of this index would also be appropriate for the value of the bind variable 1? We will continue the trial, this time by choosing the 99 for the binding variable value:
EXEC :N1:=99 SET TIMING ON SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; ... 10000 rows selected. Elapsed: 00:00:05.35 SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 0 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 --------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 10000 |00:00:00.02 | 1783 | | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 10000 |00:00:00.02 | 1783 | |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 10000 |00:00:00.01 | 690 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
Once more, the optimizer predicts 5 957 lines could be found even if 10,000 rows have been retrieved. Note also that the number of children is always 0. We will continue the trial, this time with the bind variable value of 1:
EXEC :N1:=1 SET AUTOTRACE TRACEONLY STATISTICS SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; 990000 rows selected. Elapsed: 00:00:18.78 Statistics --------------------------------------------------- 1 recursive calls 1 db block gets 108571 consistent gets 0 physical reads 96 redo size 21958348 bytes sent via SQL*Net to client 726508 bytes received via SQL*Net from client 66001 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 990000 rows processed SET AUTOTRACE OFF
Because I used AUTOTRACE to prevent 990 000 lines scrolling on the screen, I have to specify the SQL_ID and CHILD_NUMBER to retrieve the execution plan:
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',0,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 0 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 --------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 10000 |00:00:00.02 | 1783 | | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 10000 |00:00:00.02 | 1783 | |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 10000 |00:00:00.01 | 690 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
Who can be the execution plan that was used because it shows that 10,000 rows have been retrieved. We will try again, this time with CHILD_NUMBER 1:
SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',1,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 1 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 3617692013 ------------------------------------------------------------------------------------ | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | ------------------------------------------------------------------------------------ | 0 | SELECT STATEMENT | | 1 | | 990K|00:00:00.83 | 108K| |* 1 | TABLE ACCESS FULL| T1 | 1 | 988K| 990K|00:00:00.83 | 108K| ------------------------------------------------------------------------------------ Predicate Information (identified by operation id): --------------------------------------------------- 1 - filter("C2"=:N1)
The foregoing shows the actual plan that has been used. Sharing the adjustment slider (first available with Oracle Database 11.1) is reached and forced to re-evaluate the execution plan to avoid a very slow recovery through the index - which won't happen before 11.1 database Oracle.
Just to illustrate:
ALTER SESSION SET OPTIMIZER_FEATURES_ENABLE='10.2.0.4'; VARIABLE N1 NUMBER EXEC :N1:=2 SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; no rows selected Elapsed: 00:00:00.00 SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 2 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 --------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 0 |00:00:00.01 | 3 | | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 0 |00:00:00.01 | 3 | |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 0 |00:00:00.01 | 3 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
Note in the above that the CHILD_NUMBER is now 2.
Continues:
EXEC :N1:=99 SET TIMING ON SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; 10000 rows selected. Elapsed: 00:00:05.31 SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR(NULL,NULL,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 2 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 --------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 10000 |00:00:00.02 | 1783 | | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 10000 |00:00:00.02 | 1783 | |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 10000 |00:00:00.01 | 690 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
The CHILD_NUMBER is always 2.
Continues:
EXEC :N1:=1 SET AUTOTRACE TRACEONLY STATISTICS SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1; 990000 rows selected. Elapsed: 00:00:16.91 Statistics --------------------------------------------------- 0 recursive calls 0 db block gets 175927 consistent gets 0 physical reads 0 redo size 21958348 bytes sent via SQL*Net to client 726508 bytes received via SQL*Net from client 66001 SQL*Net roundtrips to/from client 0 sorts (memory) 0 sorts (disk) 990000 rows processed SET AUTOTRACE OFF SELECT * FROM TABLE(DBMS_XPLAN.DISPLAY_CURSOR('c7su63uw7nch6',2,'ALLSTATS LAST')); SQL_ID c7su63uw7nch6, child number 2 ------------------------------------- SELECT /*+ GATHER_PLAN_STATISTICS */ C1, C2 FROM T1 WHERE C2 = :N1 Plan hash value: 236868917 --------------------------------------------------------------------------------------------------- | Id | Operation | Name | Starts | E-Rows | A-Rows | A-Time | Buffers | --------------------------------------------------------------------------------------------------- | 0 | SELECT STATEMENT | | 1 | | 990K|00:00:01.63 | 175K| | 1 | TABLE ACCESS BY INDEX ROWID| T1 | 1 | 5957 | 990K|00:00:01.63 | 175K| |* 2 | INDEX RANGE SCAN | IND_T1_C2 | 1 | 5957 | 990K|00:00:00.68 | 67932 | --------------------------------------------------------------------------------------------------- Predicate Information (identified by operation id): --------------------------------------------------- 2 - access("C2"=:N1)
The foregoing is the execution plan for CHILD_NUMBER 2 - notice that this time he reports 990 000 recovered lines, it's the execution that was used - adaptive cursor sharing plan do not have take effect and force the re-evaluation of the implementation plan - implementation plan has NOT been changed for a full table scan. That's the risk you take if you allow histograms on columns that have an uneven distribution of values and bind variables are used in the WHERE clause that refers to the column.
Charles Hooper
Co-author of "Expert Oracle practices: Oracle Database Administration of the Oak Table.
http://hoopercharles.WordPress.com/
IT Manager/Oracle DBA
K & M-making Machine, Inc. -
read the value of the variable binding
Hello
I was debugging a java application and in the process, I wanted to know what values the request as a bind variable. So, I checked v$ sql_bind_capture and activated the trace on the session. Unfortunately the data type is TIMESTAMP, so the view did not show a value and I got the trace was a memory dump that is not helpful for me:
Is there a function/method to convert a timestamp or at least vice versa?Bind#1 oacdty=180 mxl=11(11) mxlc=00 mal=00 scl=00 pre=00 oacflg=03 fl2=1000000 frm=01 csi=873 siz=0 off=24 kxsbbbfp=fffffd7ffdb6fbd0 bln=11 avl=07 flg=01 value= Dump of memory from 0xFFFFFD7FFDB6FBD0 to 0xFFFFFD7FFDB6FBD7 FFFFFD7FFDB6FBD0 0D0B6C78 00010101 [xl......]
Just run this little test:
SQL> CREATE TABLE t (c1 TIMESTAMP); Table created. SQL> INSERT INTO t VALUES (TRUNC(SYSTIMESTAMP)); 1 row created. SQL> COMMIT; Commit complete. SQL> SELECT TO_CHAR(c1) FROM t 2 UNION 3 SELECT DUMP(c1) FROM t; TO_CHAR(C1) -------------------------------------------------------------------------------- 13-NOV-08 00.00.00.000000 Typ=180 Len=7: 120,108,11,13,1,1,1
Convert decimal to hex you gives 78, 6 C, 0, 0 D, 01, 01, 01 what byte order accountant reverse is the same as your memory dump. So I think the bind value is 00:00:00:000000 November 13, 2008.
Not very well how to recover of the hexagon directly at the time, but I do not know someone knows!
In fact, Google has been very helpful... take 100 on the first two decimal values: 120-100 = 20; 108-100 = 08, to give you the year: 2008. Then 11 and 13 are the month and day. The rest is hour + 1 minute + 1, the second + 1. So just convert your hex decimal and you should be able to discern the value!
Published by: Mike Pargeter 13 November 2008 16:54
-
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
-
default values for VO bind variable
Hi all
I have a VO with bind variable year and month
These variables have values as:
year:
cannot import
DF = new SimpleDateFormat("yyyy")
DF.format (ADF. CurrentDate)
month:
cannot import
DF = new SimpleDateFormat ("MM")
DF.format (ADF. CurrentDate)
I have a table in my application this VO-based. I added these two variables as a counter entry number and a command button (ExecuteWithParams)
The table is delivered with these variables dafult (2014 & 2). That's ok. Problem is that default values are not in the number of counters during the loading of the page.
When I enter the new values (2014 & 1) and click the button, the new values to come and there is no problem...
JDev version is 11.1.2.4
Thank you...
I find the solution as:
In the pageDefinition file > binaries > ExecuteWithParams1_p_year > DefaultValue value as value: #{MyBean.year}
-
How to set the value of the variable bind in VO on page load?
Hello, I use JDeveloper 11.1.2.3.0.
I created a VO in my application that uses a variable binding in the where clause. I want to put the value of this variable on the loading of the page automatically.
I read that I can do this through setNamedWhereClauseParam()... but I can't find out where and how to use it.
Can anyone help please?
You can put in different places:
AppModuleImpl,
ViewObjectImpl,
ViewRowImpl
Just him export the customer interface and use whenever you want
-
Get the value of the bind variable in backing bean class VO Impl
Hello
I have a VO that includes a bind "pOrgId" variable, the VO has a java VO Impl class that includes:
/**
* Returns the value of the variable to pOrgId.
value of the variable * @return for pOrgId
*/
public {getpOrgId() number
return (Number) ensureVariableManager () .getVariableValue ("pOrgId");
}
So it is possible to obtain the value is concluded by the binding variable using this class in a backing bean? (I tried to import the VOImpl class in the bean to support, but getpOrgId is not available?).
(JDEV 11.1.2.3.0)
Concerning
CarlHello
When you create a ViewObjectImpl class, none of these options is to generate the getter/setter for bind variable. Create a client class interface and expose the get method for the variable binding. Now, you can reference the method since a binding method in the ADF, which you then access a managed bean by calling
BindingContext bctx = BindingContext.getCurrent(); BindingContainer bindings = bctx.getCurrentBindingsEntry(); OperationBinding oper = (OperationBinding) bindings.get("name of the method binding"); Object returnVal = oper.execute();
Frank
Maybe you are looking for
-
HP Pavilion p6 200ukm: Windows 7 update takes forever or stuck?
I recently installed a new HDD with Hp OEM dics and I tried to use windows update, but it seems to take forever to find updates. I don't know if its stuck or if it theres something wrong, but I can't find the updates. Any advice or help on how to sol
-
Timed loop continues to turn after stop
Only, I have seen this time, but thought I should ask about it. After pressing the stop button, I was surprised that the diagnostic LED on the front panel of the main vi kept flashing. With the performance highlighting ONE values showed that the ti
-
Hello I want to count the number of times that that an event occurs, and using this indictment I've reproduced the data I need. In other words, the counter is used a variable 'intermediate '. How to add and initialize a variable without having to add
-
Where can I find specifications for Acer laptops to upgrade? I have an Acer Aspire one
Hello Where can I find specifications for Acer laptops to upgrade? I have an Acer Aspire One, which is still under Windows XP. I looked on the website and check the manual with no techinical inside info. I'm not find respect for this netbook. Can s
-
Yo USO windows 7, y none oficina PUEDO Instalar 365
Tengo yo window 7 y Descarge el Programa Office 365, than not hay menciona an error y no run Se you can