Character Length of a Query
What is the maximum length or a query in Oracle? I have to build a query with a variable length where clause and cannot find any doc on how many characters my select statement may contain.
http://otn.oracle.com/docs/products/oracle9i/doc_library/release2/server.920/a96536/ch44.htm#288033
All I did was use the search engine at handy-dandy "HOW TO: Find online documentation for Oracle" link that Andrew just posted about 6 hours ago.
See: Re: Calling a service method from a DataAction
Michael
Similar Messages
-
Querying CHAR columns with character length semantics unreliable
Hi again,
It appears that there is a bug in the JDBC drivers whereby it is highly unlikely that the values of CHAR columns that use character length semantics can be accurately queried using ResultSet.getString(). Instead, the drivers return the value padded with space (0x#20) characters out to a number of bytes equal to the number of characters multiplied by 4. The number of bytes varies depending on the number and size of any non-ascii characters stored in the column.
For instance, if I have a CHAR(1) column, a value of 'a' will return 'a ' (4 characters/bytes are returned), a value of '\u00E0' will return '\u00E0 ' (3 characters / 4 bytes), and a value of '\uE000' will return '\uE000 ' (2 characters / 4 bytes).
I'm currently using version 9.2.0.3 of the standalone drivers (ojdbc.jar) with JDK 1.4.1_04 on Redhat Linux 9, connecting to Oracle 9.2.0.2.0 running on Solaris.
The following sample code can be used to demonstrate the problem (where the DDL at the top of the file must be executed first):
import java.sql.*;
import java.util.*;
This sample generates another bug in the Oracle JDBC drivers where it is not
possible to query the values of CHAR columns that use character length semantics
and are NOT full of non-ascii characters. The inclusion of the VARCHAR2 column
is just a control.
CREATE TABLE TMP2
TMP_ID NUMBER(10) NOT NULL PRIMARY KEY,
TMP_CHAR CHAR(10 CHAR),
TMP_VCHAR VARCHAR2(10 CHAR)
public class ClsCharSelection
private static String createString(char character, int length)
char characters[] = new char[length];
Arrays.fill(characters, character);
return new String(characters);
} // private static String createString(char, int)
private static void insertRow(PreparedStatement ps,
int key, char character)
throws SQLException
ps.setInt(1, key);
ps.setString(2, createString(character, 10));
ps.setString(3, createString(character, 10));
ps.executeUpdate();
} // private static String insertRow(PreparedStatement, int, char)
private static void analyseResults(PreparedStatement ps, int key)
throws SQLException
ps.setInt(1, key);
ResultSet results = ps.executeQuery();
results.next();
String tmpChar = results.getString(1);
String tmpVChar = results.getString(2);
System.out.println(key + ", " + tmpChar.length() + ", '" + tmpChar + "'");
System.out.println(key + ", " + tmpVChar.length() + ", '" + tmpVChar + "'");
results.close();
} // private static void analyseResults(PreparedStatement, int)
public static void main(String argv[])
throws Exception
Driver driver = (Driver)Class.forName(
"oracle.jdbc.driver.OracleDriver").newInstance();
DriverManager.registerDriver(driver);
Connection connection = DriverManager.getConnection(
argv[0], argv[1], argv[2]);
PreparedStatement ps = null;
try
ps = connection.prepareStatement(
"DELETE FROM tmp2");
ps.executeUpdate();
ps.close();
ps = connection.prepareStatement(
"INSERT INTO tmp2 ( tmp_id, tmp_char, tmp_vchar " +
") VALUES ( ?, ?, ? )");
insertRow(ps, 1, 'a');
insertRow(ps, 2, '\u00E0');
insertRow(ps, 3, '\uE000');
ps.close();
ps = connection.prepareStatement(
"SELECT tmp_char, tmp_vchar FROM tmp2 WHERE tmp_id = ?");
analyseResults(ps, 1);
analyseResults(ps, 2);
analyseResults(ps, 3);
ps.close();
connection.commit();
catch (SQLException e)
e.printStackTrace();
connection.close();
} // public static void main(String[])
} // public class ClsColumnInsertionFYI, this has been mentioned as early as November last year:
String with length 1 became 4 when nls_lang_semantics=CHAR
and was also brought up in Feburary:
JDBC thin driver pads CHAR col to byte size when NLS_LENGTH_SEMANTICS=CHAR -
Query Rules - length limitation on query conditions set via powershell
My current client has 200 custom keywords in SP 2010 which they would like to migrate to SP 2013 query results. I have powershell scripts to perform the export from SP 2010 and import into one of three SP 2013 environments.
One limitation I have found in powershell -- that does not happen in the search service application UI! -- is a 100 character length limit on the keywords used for matching query conditions (synonym data in SP 2010). The keywords can be set through
the UI without limitation but are limited to 100 characters when using powershell! It makes no sense!
I suppose my final update could be done by hand (ugh!) and I would much rather be able to script these updates.
Any pointers or help?Hi grobinson,
If you used this code line in your Powershell and have the following error:
[string[]]$QueryRuleTerms=@($QueryRuleConditionTerm)
Exception calling "CreateKeywordCondition" with "2" argument(s): "The value must be at most 100 characters long.
Parameter name: Term"
At line:2 char:1
+ $QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerm ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ArgumentOutOfRangeException
You need to use the following code line with Split() method to add the multiple terms, it will work.
$QueryRuleConditionTerm = "a1;a10;a100;a101;a102;a103;a104;a105;a106;a11;a12;a13;a14;a15;a16;a17;a18;a19;a2;a20;a21;a22;a23;a24;a25;a26;a27;a28;a29;a3;a30;a31;a32;a33;a34;a35;a36;a37;a38;a39;a4;a40;a41;a42;a43;a44;a45;a46;a47;a48;a49;a5;a50;a51;a52;a53;a54;a55;a56;a57;a58;a59;a6;a60;a61;a62;a63;a64;a65;a66;a67;a68;a69;a7;a70;a71;a72;a73;a74;a75;a76;a77;a78;a79;a8;a80;a81;a82;a83;a84;a85;a86;a87;a88;a89;a9;a90;a91;a92;a93;a94;a95;a96;a97;a98;a99;a991"
#use the following codeline, it worked for me
[string[]] $QueryRuleTerms = $QueryRuleConditionTerm.Split(";")
$QueryRuleConditions = $QueryRule.QueryConditions
$QueryRuleCondition = $QueryRuleConditions.CreateKeywordCondition($QueryRuleTerms,$true)
$QuerySourceContextCondition = $QueryRule.CreateSourceContextCondition($ResultSource)
$QueryRule.Update()
Thanks,
Daniel Yang
Forum Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Daniel Yang
TechNet Community Support -
Convert all VARCHAR2 data types to character length semantics
Hi,
I am wondering if there is an easy way to convert all columns in the database of data type VARCHAR2(x BYTE) to VARCHAR2(x CHAR)?
Regards
HåkanThe DMU does not allow character length semantics migration for the following type of objects:
- Columns already in character length semantics
- Data dictionary columns
- Columns under Oracle-supplied application schemas
- CHAR attribute columns of ADT
- Columns in clusters
- Columns on which partition keys are defined
Please check if the disabled nodes you observed in the wizard fall under one of these categories. -
How set maximum character length in Fxml
Hey can any body help me set Maximum character length in Fxml.
thanx in advanceI wrote my own TextField.
I can't give you the code right now, but it's easy to create it by yourself.
0 - create a private method that deletes any unwanted char/s: restoreRightLength();
1 - Add a listener on the textProperty of your TextField/TextArea that calls restoreRightLength() method.
2 - Override the following methods:
@Override
public void replaceText(int start, int end, String text) {
super.replaceText(start, end, text);
restoreRightLength();
@Override
public void replaceSelection(String text) {
super.replaceSelection(text);
restoreRightLength(); -
Extend character length of an idoc segment
Hello Gurus,
Our client requires a longer character length for NAME2 and STRAS. SAP standard is that character length for this is 35. Is there a way to extend the length of these idoc segments? Thanks in advance.About which IDOC are you talking?
And why do you need more characters?
If you are talking about CREMAS vendor or DEBMAS customer,
then you should consider the ADRMAS Idoc as well.
Because addresses are stored in central address managment tables sind 4.6 release.
CREMAS and DEBMAS do not support central address management.
Please read OSS note 306275 and 384462 for migration of addresses -
I have a question about the length of character. If i set the variable (e.g. GG) of internal table and its character length is 1000. <e.g. data: gg(1000).>
and put it into one of the columns of the report listing.
but that column only can see part of it (from 0 to 128 characters only).
So if i want to change to excel, then the latter part of this field is omitted... How can i retain all the characters when export to excel format.
coz i don't want to miss any data from here.but all the fields is get from the table (in the program)....
for example:
itab-CLOSING = xxxx-xxxxx. (which contains more than 255 characters)
(i've use strlen( itab-CLOSING ) to check the length, it's normal ), but
wa-fieldname = 'CLOSING'.
wa-reptext_ddic = 'Closing Date/Time'.
append wa to fcat.
clear wa.
the column itab-closing just show in the screen for the first 128 characters only. so i can't still get the whole data when export to excel ... -
Character length of an editable fields
hi frnz,
I have created an editable field in an ALV report.My client wants the character length of this editable field as 1000.I have made the data type as 'STRINGS' and length as '1000', but still in this editable field i am able to feed only upto character length of 128 not beyond this value.The text which my client wants to feed is of 950 characters. Could anyone give some solution for this
Thanks
PraveenHi, i think you have to give intlen and outputlen in field catalog
FIELDCAT-INTLEN = 1000.
FIELDCAT-OUTPUTLEN = 1000.
Please check the doc of field catalog
[http://help.sap.com/saphelp_erp2004/helpdata/en/ff/4649a6f17411d2b486006094192fe3/content.htm]
Regards,
Ben -
Character Length in the Alias Naming
Is there a limitation to character length in the alias of a member name?
Thanks, Was running into issues and thought this to be the case, just did not know the exact limitation!
-
DRG-11112: length of CLOB query value exceeds maximum of 64000
Is there a CLOB length limitation when running an Oracle Text search? (v 11.1.0.7) I have checked the Reference Guide and Application Developer's Guide.
--create table
create table nk_1929(id number, vc_a clob);
--insert dummy data
declare
vc_clob clob;
begin
vc_clob := lpad(to_clob('a'), 222920, 'a');
insert into nk_1929 values(1, vc_clob);
end;
--create index
create index nk_1929_ndx on nk_1929(vc_a)
indextype is ctxsys.context parameters('
datastore ctxsys.default_datastore
stoplist ctxsys.empty_stoplist');
--run query with a search string longer than 64000
declare
str1 clob;
query_term clob;
begin
select vc_a into query_term from nk_1929 where id = 1;
str1 := 'select id from nk_1929 where contains(vc_a, :1) > 0';
execute immediate str1 using query_term;
end;
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-11112: length of CLOB Query Value exceeds maximum of 64000
Please let me know if I am missing something here?Same 64000 CLOB query value limitation is also generated with a simple select:
--run query with a search string longer than 64000
declare
vn_id number;
query_term clob;
begin
select vc_a into query_term from nk_1929 where id = 1;
select max(id) into vn_id from nk_1929 where contains(vc_a, query_term) > 0;
end;
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
DRG-11112: length of CLOB Query Value exceeds maximum of 64000 -
How can we increase the character length of SAP batch???
HI MM guru's,
we want to increase the character length for the SAP batch i.e raise it to 14 characters. how can we posibbly do that live.
Regards,
Sameer Jalalthanks,
but any alternative?
Regards,
Sameer Jalal -
Character Length restrictions in BW
Dear BW Experts,
We are getting data from an external source. We have a field whose length is more than 60. I am unable to bring this field in to BW since BW has the restriction of not more than 60 character length. I cannot split the field since it is like a comment field.
Could you tell me if there are other ways of getting such data in to BW where the length is more than 60 say like 500 or 1000 in length.
Thanks,
SaiHi Sai,
As we all know maximum length of info object is 60.The only way to get the data more than 60 is create another info object and add this as attributes to the base info object and make this attributes as display attributes.
check the below blog, you have clear explanation
/people/sap.user72/blog/2006/05/27/long-texts-in-sap-bw-modeling
Regards,
Venkatesh -
Editor maximum character length allowance
Greedings,
Is it possible to make an editor to have a max character length? and how is that possible?
Thank you1. 256
2. The best online source of this information is probably the IBM LDAP schema reference site:
http://www-1.ibm.com/servers/eserver/iseries/ldap/schema/
Just click on attribute types on the left hand menu then scroll down to the attribute you wish to find out information about. You will notice OC information is on this site as well ...
HTH,
-Chris Larivee -
Max Character Length for Text Variables
Hi folks,
Quick question:
Does OPA have a max character length for text variables?
-IsamuObviously common sense prevails here. The system is unlikely to perform very well if you start passing around MBs of data in text variables!
-
ID character length - 16 or 20?
What is the max character length of dimension IDs in BPC for NW? I thought it was 16 initially but now apparently is 20? According to an SAP doc:
"Dimension field names may ONLY be max of 16 characters instead of 20"
I understand property values can be up to 60 or greater. But, what about the the value of an ID? Does the above mean IDs can only be 16?Hi John,
According to Scott from SAP, ID can be 20 characters.
Ba
Here is message from page 5 of below thread:
BPC NW - Questions on How to Automate Master Data Loads
Scott Cairncross
Posts: 272
Registered: 1/5/05
Forum Points: 548
Re: BPC NW - Questions on How to Automate Master Data Loads
Posted: Jan 21, 2010 10:17 AM in response to: Dries Paesmans Reply
MDA - 20100121.zip (126.5 file.size.kilobyte)
Hi Dries,
Velavan and I have been meaning to publish a new guide for sometime however we have not gotten the time to update everything. I am attaching a transport with the latest and greatest updates here to the forum for your and the rest of the communities benefit.
There are some things to watch out for. Specifically if you are using scenario 1 of the guide and you are trying to load from an infoObject into a BPC Dimension where the infoObjects technical length is greater than 20 (the maximum length for a BPC Dimension) it automatically generates a hash key for the ID value that is 20 characters in length. This is not the behavior when running scenario 2.
I hope this update helps.
Cheers, Scott
Maybe you are looking for
-
Can someone please tell me why my flex swf isnt appearing in firefox?
Like the title says, could someone possibly explain to me what im doing wrong with embedding this swf? **My code works fine in chrome**...But doesn't appear in FireFox, and it look compacted in IE, like its only set to a 5% height or something. All I
-
Can multiple users share one file for iphoto
I want to be able to have all the user profiles on our iMac access the same files for iPhoto, so when one user adds photos they are there for anyone who logs on.
-
Does time machine work with NAS?
I'm planning to buy one of those cool 3TB NAS drives which can work with macs, windows, android and iOS. I wanted to know if TM backups can work with NAS? Neerav
-
Premiere Pro cc 2014 do not import After Effects composition. Inside Premiere Pro CC 2014 is not possible call back After Effects, is not possible to work with After Effects. Thank you
-
Excel worksheet to be saved in other location too as a copy
Hi, I would like to use a vba code for an excel 2007 ducument with macros to be saved in an other location too as a copy! thank you,