Using the research of CF &; quot; AS &; quot; Operator SQL
I did search by keyword limited fields selected in MS Access and SQL Server for several years now. My research has always been in this format: "WHERE Title LIKE ' %#sKeyword #%". " They always seem to work. The only downside to this method is that any word that contains the sKeyword is returned because there is a % on both ends.What I discovered today, it was that this form also works: WHERE title LIKE ' %#sKeyword #'; that is, return any word that ends with the keyword. But the other Variant (WHERE title LIKE "#sKeyword #%"), where the % is on the end, will not work.
Anyone has an idea why version will not work with the % on the end?
As a related article, someone has an idea how you would search a long text for the sKeyword field; for example, it would be like doing a WHERE title LIKE "#sKeyword # I know that a search LIKE without any % will not return anything and I already do Verity searches and so I know about this method. I am looking for a simple way to find a whole word within a group of words in a single field.
I have the same case here too and all cases seem to work exactly as I expected to do.
Thanks again.
Tags: ColdFusion
Similar Questions
-
Use the results of ore RQTableEval in a PL/SQL module
Documentation of ore RQTableEval show how to display the results in the form of a query using the syntax "SELECT * FROM TABLE (RQTableEval ( blah, blah ". "))" I use the option 'select' for the third parameter of RQTableEval.
But how can I access this result within a PL/SQL module? This syntax raises a compile error of
- Error (76,32): PL/SQL: ORA-22905: cannot access the rows of a table not nested element
Open the speed for select * from table (rqTableEval ( blah, blah ))
where speed is a weakly typed SYS_REFCURSOR
I'm out of ideas/knowledge to solve this problem.
You might want to try display in space R Oracle here: R Technologies
John
-
How to use the Pivot function for range group in oracle SQL
Hello
Hello!!!
I need to display the data in the format below. There are 2 columns 1 is State and another is rate.
State < 100 100-199, 200-299 300-399 400-499, 500-599 600-699 700-799 800-899 900-999 > = 1000 Total
AK 1 2 0 4 1 4 4 35 35 4 1 25
AL 0 0 2 27 10 17 35 2 2 35 0 103
AR 0 0 1 0 0 2 2 13 13 2 0 6
AZ 0 1 2 14 2 14 13 3 3 13 0 57
CA 0 0 1 6 2 7 3 4 4 3 0 34
Developed the sub query but unable to use the beach on the pivot function. Please help on this.
(select (SELECT short_description
OF CODE_VALUES
WHERE CODE_TYPE_CODE = ad. STATE_TYPE_IND_CODE
AND VALUE = ad. STATE_CODE
) STATE,
Nr.rate
N-NEUTRAL
c contacts,
announcement of addresses,
xref_contacts_addresses xca,
neutral_rates nr
where n.contact_id = c.contact_id
and n.address_id = ad.address_id
and xca.address_id = ad.address_id
and xca.contact_id = c.contact_id
and nr.contact_id = n.contact_id
and nr.rate_frequency = 'HOUR')Like this
with t as ( select 'AL' state, 12 value from dual union all select 'AL' state, 67 value from dual union all select 'AL' state, 23 value from dual union all select 'AL' state, 12 value from dual union all select 'AL' state, 12 value from dual union all select 'AL' state, 78 value from dual union all select 'AL' state, 34 value from dual union all select 'AL' state, 4 value from dual union all select 'AL' state, 12 value from dual union all select 'AL' state, 15 value from dual union all select 'AZ' state, 6 value from dual union all select 'AZ' state, 123 value from dual union all select 'AZ' state, 123 value from dual union all select 'MA' state, 23 value from dual union all select 'MA' state, 120 value from dual union all select 'MA' state, 456 value from dual union all select 'MA' state, 11 value from dual union all select 'MA' state, 24 value from dual union all select 'MA' state, 34 value from dual union all select 'MA' state, 87 value from dual union all select 'MA' state, 23 value from dual union all select 'MA' state, 234 value from dual union all select 'MA' state, 789 value from dual union all select 'MH' state, 54321 value from dual ) -- End of test data select state, nvl(count(decode(value, 0, 0)), 0) "<100", nvl(count(decode(value, 1, 1)), 0) "100-199", nvl(count(decode(value, 2, 2)), 0) "200-299", nvl(count(decode(value, 3, 3)), 0) "300-399", nvl(count(decode(value, 4, 4)), 0) "400-499", nvl(count(decode(value, 5, 5)), 0) "500-599", nvl(count(decode(value, 6, 6)), 0) "600-699", nvl(count(decode(value, 7, 7)), 0) "700-799", nvl(count(decode(value, 8, 8)), 0) "800-899", nvl(count(decode(value, 9, 9)), 0) "900-999", nvl(count(decode(value, 10, 10)), 0) ">=1000" from ( select state, case when value < 100 then 0 when value between 100 and 199 then 1 when value between 200 and 299 then 2 when value between 300 and 399 then 3 when value between 400 and 499 then 4 when value between 500 and 599 then 5 when value between 600 and 699 then 6 when value between 700 and 799 then 7 when value between 800 and 899 then 8 when value between 900 and 999 then 9 when value >= 1000 then 10 end value from t ) group by state
-
Using the Case statement in Where clause with operator
Hi all
I'm doing the following work (this is just a simple version of what I'll eventually need):
Sorry, I forgot how to use the code tags...
and li. MAJOR_ACCT in case
When: prompt = 'Energy' then ('9320906 ', ' 9321471')
end
Problem is that I get a missing closing parenthesis error.
Wouldn't - that evaluate against a value(as below) it works fine:
and li. MAJOR_ACCT in case
When: prompt = 'Energy' then ('9320906')
end
Any thoughts? Is it possible to use a box (or decode) in an In clause with multiple values? I tried to use decode as well and get the same results.
Thank you.
Darren.What:
and ( case when :prompt = 'Energy' and li.MAJOR_ACCT in ('9320906', '9321471') then 1 when :prompt = 'Vehicle' and li.MAJOR_ACCT in ('9812180', '9812320') then 1 when :prompt = 'Meals' and li.MAJOR_ACCT in ('983120', '983452') then 1 end ) = 1
-
How to use the record type as a parameter IN PL/SQL procedure or package
Hi people,
I need help on the record as the OUT parameter type. I am able to get out a single line as a parameter, but not getting do not idea how to get a multi ranks as output parameter.
I have the code that works very well for a single line. Please see CODE1.
But when I try to get several lines, I'm failing to do. Please see the CODE2. I get the error of compilation as
Error report:
ORA-06550: line 11, column 35:
PLS-00487: Invalid reference to the variable "P_NAME.
ORA-06550: line 11, column 1:
PL/SQL: Statement ignored
06550 00000 - "line %s, column % s:\n%s".
* Cause: Usually a PL/SQL compilation error.
Any help or a sample execution of script would be really useful.
Thanks in advance.
YZ
--------------------------CODE1------------------------------------------
-------------------------Package Spec-------------------------------
CREATE OR REPLACE
PACKAGE xx_sample_pkg as
--
Xx_sample_table_rectype RECORD TYPE IS
(p_name varchar2 (40))
number of p_emp_id
);
PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);
END xx_sample_pkg;
------------------------------Package Body------------------------
create or replace
PACKAGE xx_sample_pkg AS BODY
--
PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS
BEGIN
SELECT ename, empno
IN xx_sample_rec1
FROM scott.emp
WHERE ename = 'SMITH ';.
END xx_sample_prc;
END xx_sample_pkg;
-------------------------------------------Execute----------------------
DECLARE
l_rec_type xx_sample_pkg.xx_sample_table_rectype;
BEGIN
dbms_output.put_line ('xx_sample_prc appeal');
xx_sample_pkg.xx_sample_prc (l_rec_type);
dbms_output.put_line ('YZ' | l_rec_type.p_name |') '|| l_rec_type.p_emp_id);
END;
---------------------------------------------------------------
-------------------------CODE2-------------------------------------------
-------------------------Package Spec-------------------------------
CREATE OR REPLACE
PACKAGE xx_sample_pkg as
--
Xx_sample_table_rectype RECORD TYPE IS
(p_name varchar2 (40))
number of p_emp_id
);
PROCEDURE xx_sample_prc (xx_sample_rec1, OUT xx_sample_table_rectype);
END xx_sample_pkg;
------------------------------Package Body------------------------
create or replace
PACKAGE xx_sample_pkg AS BODY
--
PROCEDURE xx_sample_prc (xx_sample_rec1 OUT xx_sample_table_rectype) IS
BEGIN
SELECT ename, empno
IN xx_sample_rec1
FROM scott.emp;
END xx_sample_prc;
END xx_sample_pkg;
-------------------------------------------Execute----------------------
DECLARE
l_rec_type xx_sample_pkg.xx_sample_table_rectype;
BEGIN
dbms_output.put_line ('xx_sample_prc appeal');
xx_sample_pkg.xx_sample_prc (l_rec_type);
for l_rec in 1.l_rec_type.p_name.count
loop
dbms_output.put_line ('YZ' | l_rec_type.p_name (l_rec) |) » '|| l_rec_type.p_emp_id (l_rec));
end loop;
end;
---------------------------------------------------------------
bb8c573a-6ca3-4d7c-90ed-e55c2df67201 wrote:
But now, my question would be why the record type could not be used? My understanding is missing some concept between use of type type array collection record vs. Please specify.
Do not confuse the folder with the collection.
SY.
-
Question of copy/move when using the VMware Machine by more than an operating system
My Mac Pro runs like a machine triple boot with Ubuntu 10.04, OS X 10.6 and Windows 7. I use my virtual machines in OS X (VMware Fusion) and Ubuntu 10.04 (VMware Player).
When you start a virtual machine, that I always wonder if the machine has been copied or moved. An insider tip to avoid this? It is not really a biggie but well anyway.
Thanks a bunch for reading my post.
A.
You just need to insert uuid.action = 'keep' in the vmx file.
See http://kb.vmware.com/kb/1541
André
-
Using the vs do-it-all formula in a sql
As a beginner, I worked on some reports, and very often I need to decide whether to put the code in CF (formulas) vs in the main query.
Using CF, the code is cleaner since the function is dedicated to a task, as do all the tasks in a single big sql will make it harder to read and maintain on the road.
However, I am concerned about the degradation of performance regarding CF.
First he CF is PL/SQL and SQL and PL/SQL execution at the same time involves the change of context.
In addition, according to my colleagues, SEE run in report server, while SQL runs in the DB server. The IO involved between the two servers is also another penalty (or is it a kind of load balancing, which reduces the workload on the DB server)?
Right now I'm trying to add CF as little as possible, as it is difficult to tighten requirements in the main SQL. I have made the right choice?
Thank you very much.Hello
You do think it rigth...
http://download-UK.Oracle.com/docs/CD/B14099_17/bi.1012/b14048/pbr_tune.htm
20.4.3 calculations
In a report (either by summary columns or formulas), to ensure that most of the calculations is performed by the data source. In the case of SQL queries, the calculations are performed on the database rather than the data retrieved by the report. User-defined functions and stored procedures in the database can also be included in the select list of the query to a database Oracle or a JDBC query. It is more efficient to use a local function, since the calculated data is returned as part of the database of results.Concerning
-
declare
i_var varchar2 (30): = '& enter_string';
Vout varchar2 (20);
Start
:=Lower(Reverse(i_var)) Vout;
If lower (i_var) = vout can
dbms_output.put_line ('this is a palindrome');
on the other
dbms_output.put_line ('this is not a palindrome');
end if;
end;
I agree completely
SQL > declare
2 i_var varchar2 (30): = "& enter_string;
3 vout varchar2 (20);
4 start
5 Select lower (reverse (i_var))
6 in vout
7 double;
8 lower (i_var) = vout
9. can
10 dbms_output.put_line (i_var |) 'is a palindrome');
11 other
12 dbms_output.put_line (i_var |) (' ' is not a palindrome ");
13 end if;
14 end;
15.
Enter the value of enter_string: Bolton
2 old: i_var varchar2 (30): = "& enter_string;
2 new: i_var varchar2 (30): = 'Bolton ';
Bolton is not a palindrome
PL/SQL procedure successfully completed.
-
Want to downgrade from Windows 7 to XP using the upgrade disc
I installed windows 7 on my laptop. Many problems. Tried to re - install Windows xp with a upgrade version, but will not recognize windows 7 upgrade to xp. How to re-install xp with a upgrade disk.
* original title - replaced with win7 winxp. have xp updated but will not be installed with win7. How to make xp back on computer
Hi Allen,.
You will not be able to install XP on Win 7 using the upgrade disc. You will require your original operating system disk and you will have to boot from the OS installation disc, once installed you can use the disk to upgrade XP on this operating system. Another way is out to install your system disk and the boot of Winxp.
I hope this helps.
-
Original title: I can't use my question mark (rises like a capital E with accent French and cannot use the quotes)
I'm having a problem from time to time with my ability to use marks quotaion, brands etc. How can I treat it DEFINITIVELY the question.
Thank you
Hi golfnut11,
1. you are using a laptop?
2. you remember to make changes to the computer priro to this question?
Step 1:
If you use a laptop, check if the FN key is enabled. If so, then try to turn it off and check.
Step 2:
You can also try to check the keyboard on the screen and if the problem occurs or not.
Check out the link:
Type without using the keyboard (on-screen keyboard)
http://Windows.Microsoft.com/en-us/Windows7/type-without-using-the-keyboard-on-screen-keyboard
If you use a Microsoft keyboard, you can also consult the following article:
Troubleshoot wired keyboards that do not or only the erroneous characters category
http://support.Microsoft.com/kb/258826Hope this information is useful.
-
What is the equivalent of | operator using the Q-quote mechanism?
Version: 11.2.0.3
I started a thread on similar requirement last week. I didn't want to resurrect. So, I start a new thread.
We have a stored procedure called generate_table_stats that meet the stats for tables with a few additional options.
Usually, this procedure is performed as below
generate_table_stats exec ('EMP_DTL', 'BASIC');
We want to generate the exec above instructions dynamically for all tables.
In the traditional method of quotations, we use the concatenation (|) operator to separate the column names whose values are retrieved dynamically from the table queried.
Similarly, how can I get a column of values printed when you use the Q-quote mechanism?
In my column in table_name attempt below must be retrieved from user_tables. But table_name and pipes that are treated as literal string (which is not surprising).
What is the equivalent of | (concatenation operator) when you use the Q-quote mechanism?
-Expected results
generate_table_stats exec ('EMP_DTL', 'BASIC');
generate_table_stats exec ('CUSTOMER_DTL', 'BASIC');
.
.
.
-My attempt using Q-quote
-Using # as the quote delimiter
SQL > select q'#exec generate_table_stats ('| table_name |', 'BASE'); #' From user_tables;
Q' #EXECGENERATE_TABLE_STATS('||) TABLE_NAME |', 'BASE')
-----------------------------------------------------
generate_table_stats exec ('| table_name |', 'BASE');
generate_table_stats exec ('| table_name |', 'BASE');
generate_table_stats exec ('| table_name |', 'BASE');
generate_table_stats exec ('| table_name |', 'BASE');
.
.
.
.
Hello
The concatenation operator. works the same with any string expression.
x | There
Returns a string that is the same as sting followed immediately the string x y, x is
- a literal string with Q before the first single quote
- a literal string without Q
- a VARCHAR2 column
- a function that returns a string, or
- any string expression.
The string can be everything above, too.
If you concatenate strings of 3 or more, like this
str1. str2. ... || Suro
then each of the STRS can be any kind of expression, independent of others.
If you want to concatenate strings of 3, the 1st and the 3rd being Q-literals and the 2nd being a column, you can do it like this:
Select q' generate_table_stats #exec (#' | table_name)
|| q ' #, ' BASIC'); #'
From user_tables;
Each of literals has its own Q and her own pair of start and end markers (all the ' # s in the example above).
Since the first string literal has no any single-quotation marks incorporated, it is unnecessary to use Q-rating, and it could be misleading; a person who bed the code might think the actaully string contains ' #'s. I prefer wriite the query in the form
Select ' generate_table_stats exec (' | table_name)
|| q ' #, ' BASIC'); #'
From user_tables;
-
By using the quote delimiter with set off.
I have problems with the quote delimiter pick up the colon as a variable binding. For some reason any where there is a colon infront tick it break (ex. 2) but in (Exodus 3) he is behind the colon, it works perfectly.
set define off DECLARE s1 VARCHAR2(20); s2 VARCHAR2(20); s3 VARCHAR2(20); BEGIN s1 := 'Isn''t t:his cool'; --s2 := q'{Isn't th:is cool}'; s3 := q'{Isnt th:is co'ol}'; dbms_output.put_line(s1); dbms_output.put_line(s2); dbms_output.put_line(s3); END; /
In this case simply update your client. From your database in version 10 already, you must also use a client version 10.
9i and 10g client can be installed on a PC without a problem alnongside. It's just that the 10g client is installed with a little more subfolders. Maybe you have already installed and just continue to use the old client (old link?).
On a windows client system 10g would be in a structure like this: file://c:/oracle/product/10.2.0/client_1/bin
whereus 9i client is in: file://c:/oracle/ora92/bin
Published by: Sven w. on July 21, 2011 19:33
Published by: Sven w. on July 21, 2011 19:36
-
for some reason when you use the character ":" (with quotes) in the input string / / / its sends do not and insertion in the database, but if I do not use ":" it works perfectly fine... At one point, I had a 'Violation' error, but do not know if this is...
NVM, figured out. Escape() to encode the text in html.
-
How to escape the quotes and commas when you use the command of the coil
I am creating a file .cvs with data in my database. I call the function of coil and below select stmt
' Select ' ' ' | ID | '","' || name | '","' || Description | '","'
I want everything to be separated by quotes and commas. Description data can have quotes and commas so how I get away from them in my queue code so that when I use SQL Loader data will get entries in the database correctly.
Thank you!Hello
If the field is closed, so there is nothing else you need to do for the column separator (en).
To use the character encompassing ("") in the field, double it, the same way you use two single quotation marks to signify a single_quote into a SQL string literal:
{code}
' SELECT ' ' ' | ID
|| '","' || name
|| '","' || REPLACE (description
, '"'
, '""'
)
|| '"'
FROM table_x; -
Using the &; quot; as &; quot; operator vs casting?
I have recently read the docs on the types of data in AS3 and I'm still not not clear about some things. If anyone has blogged about this, please point me there.
One of the problems are the "cast" syntax is identical to the syntax of the top-level function. Compare String (objString) to XML (event.result). The latter is a top-level function, but the first is a "cast". Or is it?
An option for the casting of the string is objString.toString (). What is the difference? I'm not so interested in the underlying details of the language, as in understand when to use which.
The same issue exists for the top-level XML (event.result) function, which can be done with the 'like' operator: event.result as XML. When to use which? Are there performance problems? Documentation "operator" is unsatisfactory.
Any discussion of this will be appreciated.
TracyActionScript 3.0 has the ACE operator because it circumvents a gap with the cast operation () in ActionScript. Consider this:
var a: Object = new Array (1,2,3,4).
var b:Array = Array (a);What is b? This is a table of 1 item: [[1,2,3,4]];
The operator got takes care of this:
var b:Array = a, as Array;
The absolute difference in the operators, is that if the cast variable is not of the correct type, the as operator returns null while the operator () throws an exception:
var j: Number = Number (a); exception!
var k: Number = a, as number; In this case, but normally null NaNThe feeling here at Adobe is to use the as operator because it is not ambiguous and just check for Null. If you prefer to catch exceptions and know when X (y) is a cast vs a conversion, then use it. More of a preference, but sometimes only that to do what you need.
Maybe you are looking for
-
When I usually go in the mail from yahoo, there are an icon on the upper left side to access my calendar and a Notepad. They are both gone, but there is a field in the lower left corner that has the buttons. When I click on one or the other, I just g
-
X 230 allows to 04W3814, the map AC7260
CN X 230 using 04W3814, map of AC7260 Thank you
-
Image from 16 bits to 8 bits/RGB
Hi all I have been using the clip and save to AVI examples OR but it does not work for me. My mistake is that my images are 16-bit and the necessary images are either 8 bit/RGB to be converted to avi. How would I achieve that? Please see screenshot
-
trying to find my button code Original title: key code
-
Lenovo 3000 n200 ram expansion
Hi, I just bought a lenovo 3000 N200, it comes with 1 GB of ram... the thing is, I want to extend to 3 GB. When I bought it, they told me to come back Monday to install an aditional GB (you was a combo) and a promotion of lenovo, I won another GB (hu