mikebai.com

  • Home
  • dev
  • DotNET
  • M365
  • 搞笑
  • 杂七杂八
  • FocusDict
個人BLOG
it developer
dev

ORACLE字符类型详解----char、nchar、varchar、varchar2、nvarchar2

    oracle提供了五种字符数据类型:char、nchar、varchar、varchar2、nvarchar2。     char:使用数据库字符集来存储数据,长度固定,如果存储的数据没有达到指定长度,自动补足空格。指定长度时,默认长度的计量单位由NLS_LENGTH_SEMANTICS(默认为字节byte)参数决定,但是我们可以手动指定为char或者byte。oracle建议使用NLS_LENGTH_SEMANTICS来指定计量单位,这样可以提高效率。char类型的最大存储长度为2000个字节,在plsql中,最大存储长度可以达到32767个字节。使用char时,可以不指定最大长度,此时最大长度为1.     nchar:使用国家字符集来存储数据,长度固定,如果存储的数据没有达到指定长度,数据库自动补足空格。指定长度时,采用char为计量单位,不可以手动指定其他单位。最大存储长度为2000个字节,在plsql中,其最大存储长度可以达到32767个字节。使用nchar时,可以不指定最大长度,此时最大长度为1.   varchar2: 使用数据库字符集存储数据,长度可变,如果存储数据没有达到指定长度,不自动补足空格。可使用char,byte为计量单位,默认受参数NLS_LENGTH_SEMANTICS的影响。最大存储长度为4000个字节,在plsql中,存储长度可达32767个字节。必须指定最大长度,长度最小值为1.   nvarchar2:使用国家字符集来存储数据,长度可变,如果存储的数据没有达到指定长度,不自动补足空格。指定长度时,采用char为计量单位,不可以手动指定其他单位。最大存储长度为4000个字节,在plsql中,其最大存储长度可以达到32767个字节。必须指定最大长度,长度最小值为1.   varchar:oracle目前并没有实现该数据类型,当前版本下,varchar与varchar2完全一致,但不保证将来不会单独设计varchar。     下面我们只讨论char和varchar2的区别,至于nchar   nvarchar2  varchar,我相信聪明的同仁们肯定可以触类旁通。      1:char 与varchar2在存储上的区别,仅仅在于char会使用空格来填充空间,由于varchar2采用变长的方式存储数据,因此可以节省空间,这是毋庸置疑的。      2:在效率方面,varchar2和char在某些情况下,各有优劣,并没有实质上的差别。可以参考tom大师的文章:http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:2668391900346844476      3:在字符比较上的差别,是char和varchar2的主要差别。当两个字符串进行比较时,如果其中任何一个字符串为varchar2类型(文本串作为char类型来处理),那么两个字符串直接进行比较;如果不存在varchar2类型的字符串,在比较之前,会将其中较短的字符串末尾补充空格至与较长字符串长度一致,然后进行字符的比对。      

2014-08-06 0comments 118hotness 0likes mikebai Read all
DotNET

note_20140804

http://www.mroma.net/blog/c-helper-functions-to-map-a-datatable-or-datarow-to-a-class-object/ http://www.codeproject.com/Articles/17279/Using-mciSendString-to-play-media-files http://www.honeywellaidc.com/zh-CN/Pages/Product.aspx?category=2d-barcode-scanner&cat=HSM&pid=1900 enon 1900, 1910, 1902, 1912, and Granit 1910i, 1911i User's Guide Xenon-UG Rev J 8/14 http://www.idautomation.com/kb/scan_function_keys.html http://www.chongshang.com.cn/news/view.asp?id=467 http://stackoverflow.com/questions/587840/how-to-distinguish-between-multiple-input-devices-in-c-sharp/589326#589326 http://www.codeproject.com/Articles/17123/Using-Raw-Input-from-C-to-handle-multiple-keyboard

2014-08-04 0comments 124hotness 0likes mikebai Read all
DotNET

PLSQL INTO no_data_found EXCEPTION

http://stackoverflow.com/questions/7163996/how-to-select-into-a-variable-in-pl-sql-when-the-result-might-be-null http://stackoverflow.com/questions/2360655/jquery-event-handlers-always-execute-in-order-they-were-bound-any-way-around-t

2014-07-15 0comments 119hotness 0likes mikebai Read all
DotNET

使用VS2012调试OFFICE2007

FROM You can get VS 2012 working with Office 2007. First create an Outlook 2010 Add-In and modify the project file (.csproj) so that it will open in Office 2007 and not look for Office 2010 when run. Here is the project settings change (Outlook example): Source XPath: //Project/ProjectExtensions/VisualStudio/FlavorProperties/ProjectProperties/@DebugInfoExeName

2014-07-04 0comments 119hotness 0likes mikebai Read all
dev

Jquery获得控件值的方法

 一 Jquery获得服务器控件值的方法 由于ASP.NET网页运行后,服务器控件会随机生成客户端id,jquery获取时候不太好操作,google了下,总结有以下3种方法: 服务器控件代码:<asp:TextBox ID="txtUserID" runat="server"></asp:TextBox>  1. $("#<%=txtUserID.ClientID%>").val(); 2. $("input[id*=txtUserID]").val(); 3. $("*[id$=txtUserID]").val(); 二 Jquery获得控件值的方法 取值: $("")是一个jquery对象,而不是一个dom element value是dom element的属性 jquery与之对应的是val

2014-07-03 0comments 104hotness 0likes mikebai Read all
dev

jQuery常用的元素查找方法总结

$("#myELement")    选择id值等于myElement的元素,id值不能重复在文档中只能有一个id值是myElement所以得到的是唯一的元素  $("div")           选择所有的div标签元素,返回div元素数组  $(".myClass")      选择使用myClass类的css的所有元素  $("*")             选择文档中的所有的元素,可以运用多种的选择方式进行联合选择:例如$("#myELement,div,.myclass")  层叠选择器:  $("form input")         选择所有的form元素中的input元素  $("#main > *")          选择id值为main的所有的子元素  $("label + input")     选择所有的label元素的下一个input元素节点,经测试选择器返回的是label标签后面直接跟一个input标签的所有input标签元素  $("#prev ~ div")       同胞选择器,该选择器返回的为id为prev的标签元素的所有的属于同一个父元素的div标签  基本过滤选择器:  $("tr:first")               选择所有tr元素的第一个  $("tr:last")                选择所有tr元素的最后一个  $("input:not(:checked) + span")    过滤掉:checked的选择器的所有的input元素  $("tr:even")               选择所有的tr元素的第0,2,4... ...个元素(注意:因为所选择的多个元素时为数组,所以序号是从0开始)  $("tr:odd")                选择所有的tr元素的第1,3,5... ...个元素  $("td:eq(2)")             选择所有的td元素中序号为2的那个td元素  $("td:gt(4)")      

2014-07-03 0comments 101hotness 0likes mikebai Read all
dev

Jquery元素查找

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head>    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">    <title>Jquery选择器(层级+属性)</title>    <script type="text/javascript" language="JavaScript" src="../lib/jquery/jquery-1.3.2.js">         </script>    <link rel="stylesheet" type="text/css" href="../Default.css">         <script type="text/javascript" language="JavaScript">         $(document).ready(function(){          //在给定的祖先元素下匹配所有的后代元素 //     $("form input").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //在给定的父元素下匹配所有的子元素,不包括孙子元素等其他后代元素 //                $("form>input").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //匹配在label元素后面的input原书 //                $("label + input").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //找到所有与表单同辈的 input 元素(级数深度一样的元素) //     $("form ~ input").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //查找所有 name 属性包含 'man' 的 input 元素 //     $("input[name*='man']").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //查找所有 name 属性不是 newsletter 的 input 元素 //     $("input[name!='newsletter']").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });                 //查找所有 name 属性不是 milkman 的 input 元素 //     $("input[name='milkman']").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });          //查找所有 name 属性以 'letter' 结尾的 input 元素 //     $("input[name$='letter']").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });                 //查找所有 name 属性以 'letter' 结尾的 input 元素 //     $("input[name^='news']").each(function(){ //      $("span").append("被选中的元素Name属性值为:"+$(this).attr("name")+"<br/>"); //     });                 //查找所有含有 id 属性的 div 元素 //              $("div[id]").each(function(){ //   &nbs

2014-07-03 0comments 96hotness 0likes mikebai Read all
dev

使用JQuery获取对象的几种方式

 1、先讲讲JQuery的概念 JQuery首先是由一个 America 的叫什么 John Resig的人创建的,后来又很多的JS高手也加入了这个团队。其实 JQuery是一个JavaScript的类库,这个类库集合了很多功能方法,利用类库你可以用简单的一些代码实现一些复杂的JS效果。 2、JQuery实现了 代码的分离 不用再网页中加入如:onclick之类的事件来调用函数了,直接引入JQuery类库和自己编写的JQuery代码就可以了; 如: $(function(){    $("Element").click{function(){           alert("点击我哦!");      }    } }); 上面的代码中 只要定义了Element 这个元素  后面的click是动作 alert("点击我哦!");这个是要执行的代码,当然你可以有很多的操作在这个函数中; 这里面的$这个号代表JQuery的意思 ,就是引用类库了。。。我是这么理解的; 3、JQuery的核心的一些方法 each(callback) '就像循环 $("Element").length; ‘元素的个数,是个属性 $("Element").size(); ’也是元素的个数,不过带括号是个方法 $("Element").get(); ‘某个元素在页面中的集合,以数组的形式存储 $("Element").get(index); ’功能和上面的相同,index表示第几个元素,数组的下标 $("Element").get().reverse(); ‘把得到的数组方向 $("Element1").index($("Element2")); ’元素2在元素1中的索引值是。。。 4、基本对象获取(注意这里获取的都是Jquery对象而不是Dom对象哦,但是他俩是可以转换滴) $("*")  ‘表示获取所有对象   但是我至今没这样用过 $("#XXX") ’获得 id=XXX 的元素对象(id可以是标签的id或CSS样式id) 常用 $("input[name='username']")   获得input标签中name='userName'的元素对象 常用 $(".abc") ' 获得样式class的名字是.abc的元素对象  常用 $("div") ' 标签选择器 选择所有的div元素  常用 $("#a,.b,span") '表示获得ID是a的元素和使用了类样式b的元素以及所有的span元素 $("#a .b p") 'ID号是a的并且使用了 b样式的 所有的p元素 示例: <html>     <head>         <title>jquery测试</title>         <meta http-equiv="content-type" content="text/html; charset=UTF-8">         <script type="text/javascript" src="../js/jquery-1.4.1.js"></script>         <style type="text/css">         .checkCss{             color:blue;         }         .redioCss{             color:red;         }         </style>         <script type="text/javascript">             $(function(){                 // $("#XXX") 获得id=XXX的所有Jquery对象                 $("#subt").click(function(){                     // $("XXX") 获得XXX标签名的所有Jquery对象                     alert("input 标签的对象个数为:"+$("input").length);                     // $("XXX[name='YYY']") 获得XXX标签名下name='YYY'的所有Jquery对象                     // val()获得属性值                     alert("name='userName'的输入框内容为:"+$("input[name='userName']").val());                     // 注意获得value值的第二种方式                     alert("name='note'的输入框内容为:"+$("input[name='note']").attr("value"));                 

2014-07-03 0comments 100hotness 0likes mikebai Read all
DotNET

老金真呆

参见   http://weblogs.asp.net/soever/archive/2007/02/20/enumerating-projects-in-a-visual-studio-solution.aspx   下面这个例子说是好用,不过我跑出来是null,但是项目列表个数的确对。 你自己研究下吧 http://www.wwwlicious.com/2011/03/envdte-getting-all-projects.html#!/2011/03/envdte-getting-all-projects.html  

2012-08-03 0comments 106hotness 0likes mikebai Read all
dev

Android widget, click event, multiple instances

Ok… I started to do some Android devel… And I started to like it, even if it is based on Java, works in Eclipse and has a ton of classes. Now, the first project is a widget (weather widget). For this, there’s this “AppWidgetProvider” class that implements the design and functions for data retrieval (using threads), and also a configuration Activity. When the configuration activity finishes (a “Save” button is pressed), a static function of the AppWidgetProvider class is called. This static function updates the settings of the widget and also does something of interest: it sets the event handler for “onClick” – so that when I click (touch) the widget, to be able to modify the layout somehow (to rotate a needle). This is a part of the static function that updates the widget:...RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.widget_layout);Intent clickIntent = new Intent(context, DigiStation.class);clickIntent.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, appWidgetId);PendingIntent pendingIntent = PendingIntent.getBroadcast(context, appWidgetId, clickIntent, 0);views.setOnClickPendingIntent(R.id.widget_normal_relativelayout, pendingIntent);appWidgetManager.updateAppWidget(appWidgetId, views);... The AppWidgetProvider class is called “DigiStation” – we’re using it for creating an intent that targets it. Ok. For handling the events, the DigiStation class (which is of type AppWidgetProvider) implements the function “onReceive”. The function is called with two parameters: the context and the intent. Now, the issue was to be able to distinguish between multiple instances of the same AppWidgetProvider class. To be able to do that, I had to put some extra information in the intent (clickIntent.putExtra). The field contains the appWidgetId – the widget ID – of the instance. The onReceive function looks like this: @Overridepublic void onReceive(Context context, Intent intent) {    if…

2012-04-18 0comments 97hotness 0likes mikebai Read all
1…2829303132…62

Recent Posts

  • c# winform适配高dpi
  • com.microsoft.sqlserver.jdbc.SQLServerException “trustServerCertificate”属性设置为“false”,但驱动程序无法使用安全套接字层 (SSL) 加密与 SQL Server建立安全连接
  • java -cp 用法介绍
  • HTML 容器元素
  • MVC的cshtml的介绍

Recent Comments

No comments to show.

COPYRIGHT © 2025 mikebai.com. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang