front of linetline plus什么意思

OnePlus 5 | TechRadar
Our Verdict
The OnePlus 5 is no longer available, after it was replaced by the OnePlus 5T. A great camera, phenomenal performance and a premium design combine to make this a fantastic buy for anyone looking for a more affordable flagship phone.
Premium design and feel
Fantastic camera
Phenomenal performance
Pricier than previous iterations
Only Full HD display
No microSD support
The OnePlus 5 was a great, affordable flagship smartphone, but it was short lived. Less than six months after its June 2017 launch, you could no longer buy the handset. The reason? The excellent
showed up for the same price, while offering more.[Update: You can no longer purchase the OnePlus 5. It's been replaced by the , which offers smaller bezels, a bigger screen, face unlock and improved rear cameras - all for the same price as the OnePlus 5.]
Looking at the OnePlus 5, it's hard to believe that the company that made it was less than four years old. This is a phone that manages to hold its own alongside flagship devices from companies that have enormous pots of money to spend on research, development and design, and a decade or more of experience making smartphones.OnePlus has always made impressive phones at sub-flagship prices, but with this iteration the Chinese company has learned from previous mistakes, and built on its successes, to create an all-round fantastic phone.Two versions: started at $479 (&449, AU$599)Out of stock on OnePlus website in US, UK and AUSOnePlus 5 specsWeight: 153gDimensions: 154.2 x 74.1 x 7.25mmOS: Android 7.1.1 NougatScreen size: 5.5-inchResolution: 1920 x 1080CPU: Snapdragon 835RAM: 6GB or 8GB of RAMStorage: 64/128GBBattery: 3,300mAhRear camera: 16MP + 20MP dual lensFront camera: 16MP&The OnePlus 5 price was more than the . That's the hard truth about the new phone, but it's partly because OnePlus decided to use more premium materials.OnePlus produced two versions of the OnePlus 5, with the base model coming with 64GB of internal storage and 6GB of RAM, costing $479 (&449, AU$599).The higher-end version, with 128GB of storage and 8GB of RAM, wass priced at $539 (&499, AU$699) and that's the device we reviewed here.&Whichever version you buy, it's a big price jump compared to the OnePlus 3T, which cost $439 (&399, around AU$580) for the 64GB model and $479 (&439, around AU$630) for the 128GB version.And bear in mind that OnePlus had already increased the price for that phone release & the , released in June 2016, was only $399 (&329, around AU$450). If you&re looking to upgrade the OnePlus phone you bought this time last year, you&re going to be spending quite a bit more than you may have anticipated on the OnePlus 5.The official OnePlus 5 release date was June 27, but it's now out of stock on the OnePlus website it most countries, including the US, UK and Australia.Key featuresNew premium design makes it the best-looking OnePlus phone yetDual-lens camera allows for lossless zoom, like the iPhone 7 PlusLooking at the spec list for the OnePlus 5, you might think this is a rather limited upgrade, but there a few key features the company is pushing to make this the next phone you&ll want to buy, first and foremost of which is the new camera.This is now a dual-lens setup that allows you to capture some attractive-looking 'bokeh' shots with artfully blurred backgrounds, as well as boasting a 'lossless' zoom feature, which essentially means that zooming in on subjects will only result in a negligible reduction in image quality.This feature works in a similar way to the shooter on the , but here you're getting it on a more affordable phone. The aperture on the main sensor here is also impressively wide, and it means you&ll be able to take some of the best smartphone photos possible right now.The design of the new phone feels like a big step up for OnePlus. It's still using the same materials as the OnePlus 3T & the body is made of anodized aluminum & but this is the slimmest and most attractive OnePlus phone to date.OnePlus also wants this to be the most powerful phone on the market & and the good news is it's succeeded, with our testing showing it to have the strongest benchmarking scores of any device on the market at the time of testing.DesignThinnest phone OnePlus has ever madeThere's still a 3.5mm headphone jack for wired headsetsOnly available in two colors & dark gray or deep blackThe OnePlus 5 is the best-looking device the company has made to date. When you pick this phone up you can tell right away that it&s made with premium-grade materials.The new handset has a more rounded design than previous iterations, which means it sits comfortably in your palm. It&s also the thinnest phone yet from OnePlus at 7.25mm & almost as thin as the , which is 7.1mmIt feels light in the hand & it weighs 153g to be precise & but not so light that you feel like it may blow away in a forceful gust of wind.OnePlus is talking up the placement of the antenna bands here. According to a spokesperson the color has been specifically designed to try and hide the antenna bands for an unspoiled full-metal look, and when you do spot them they don't detract from the design of the phone.On the right-hand edge of the phone sits the power button, with nothing else to interrupt the clean lines. The left edge features the toggle for silent mode, as well as the volume rocker.The inclusion of the silent switch is an intriguing one. It's something OnePlus has included on every phone since the OnePlus 2, and it's still the only major Android phone player to do so.&Apple is the only other manufacturer that has persisted with the silent switch, but its inclusion on the OnePlus 5 is welcome. It makes it super easy to make the handset cinema, meeting and bedtime ready, and we like that.There&s only one speaker driver, and that sits at the bottom of the phone, next to the USB-C port and 3.5mm headphone jack& yes, despite all the rumors OnePlus has decided to retain the legacy headphone technology for the OnePlus 5.No awkward dongles required here (we're looking at you Apple, HTC and Moto), but Bluetooth is also on board if you fancy going wire-free.OnePlus is also trying to sell us on what it calls the &Horizon Line&, the idea here being that half of the phone is cast in shadow while the other is in light. We're struggling to get on board with this, but it&s also easy to see that this is a beautiful-looking phone that feels elegant in use.One shortcoming in terms of the design of the OnePlus 5 is that it&s not waterproof. A OnePlus spokesperson confirmed to TechRadar that it would survive a drop of rain if you need to use it outside, but it&s not IP-rated, and won&t survive a dunk like the ,
or iPhone 7 will.The OnePlus 5 is only available in two colors, and these are tied to the storage/RAM options. The 64GB/6GB version comes in Slate Gray, while the more expensive 128GB/8GB model comes in Midnight Black.&So if you&re fussy about the color you want then you can&t be fussy about the power and storage you get under the hood, and vice versa.Display5.5-inch Full HD AMOLED screen looks greatMakes for a display with 401 pixels-per-inchThe big headline display-wise is that OnePlus hasn&t decided to upgrade to a QHD resolution screen for the OnePlus 5 at all. Nope, not a sausage.That means you get the same 5.5-inch Full HD AMOLED display from the OnePlus 3T, and it is a little hard not to be disappointed by that considering the increase in price of the handset this year.Of course, OnePlus needs to cut a couple of corners to keep its price tag competitively below its rivals, and to be fair the screen is one of the very few places where it's decided to make a saving.The good news is that the screen on the OnePlus 5 still looks beautiful. It&s a shame the company hasn&t opted for a higher resolution, but at 401 pixels per inch it looks great when you&re watching video, and as it&s AMOLED, blacks and other dark tones look great.Corning&s Gorilla Glass 5 tech is also present to ensure you&re getting a fully protected screen, and to ward off scratches.SqlPLus简介
&&Sql*plus介绍Sql*plus是oracle提供的一个工具程序,既可以在oracle服务器使用,也可以在oracle客户端使用。在windows下分两种,&sqlplus.exe是命令行程序,sqlplusw.exe是窗体程序,通常我们在开始菜单中启动的是后者,两者的功能是一致的。Sql*plus是一个最常用的工具,具有很强的功能,主要有:1.&数据库的维护,如启动,关闭等,这一般在服务器上操作。2.&执行sql语句执行pl/sql。3.&执行sql脚本。4.&数据的导出,报表。5.&应用程序开发、测试sql/plsql。6.&生成新的sql脚本。7.&供应用程序调用,如安装程序中进行脚本的安装。2&dual表dual是一张系统表,同时也被定义成了public同义词。它只有一个字段和一条记录。该表本身的结构和数据没有什么意义,主要是借助该表进行其它操作。如:select&&&sysdate&&&from&&&&--获取函数值select&21+15*3&from&&&&--计算表达式的值说明:不要对dual表进行ddl与dml操作,只进行查询操作。3&sql*plus使用3.1&启动sql*plus1.&不带参数启动启动sqlplusw.exe程序,会弹出登陆框,让输入用户名、密码和连接字符串,在用户名中输入/nolog,表示先进入sql&提示符,先不连接数据库,下面可以利用connect命令连接数据库。启动sqlplus.exe程序,会提示输入用户名与密码。如果用户名输入2.&带参数启动下面列举一些最常见的方式,还有很多可选参数。1)&不连接数据库sqlplus&/nolog2)&连接数据库sqlplus&username/password3)&使用net8连接字符串连接数据库sqlplus&username/password@connstr4)&连接后执行filename指定的sql脚本,sql脚本中是sql命令和sql*plus的设置命令sqlplus&username/password[@connstr]&@filename3.2&sql*plus的命令3.2.1&帮助命令1.&help命令格式:help&命令名&,用于知道某个具体命令的帮助信息。如:help&connect2.&describe命令用户查看表的结构;获取函数,存储过程和包的描述。这是非常有用和常用的一个命令。如:desc&user_tables说明:在sql*plus中,所有命令都可以用前面的四个字母作为整个命令。3.2.2&编辑命令sql*plus会将上一次执行过的sql命令(包括sql语句和pl/sql语句,包括一行或多行)保存到缓存区中,可以对缓存区中信息进行编辑。编辑后可以通过&/&命令执行修改后的缓存区中的命令,如果不休改,则是执行原有命令。1.&list&[n]&命令显示上一条命令中的第n行,如果不指定n,则显示上一命令的所有行,这样当前行就是最后一行。其它操作会对当前行进行操作,所以其它操作需要先执行list命令。如:begininsert&into&test&values(1);/list2.&change命令编辑当前行的内容,先用list命令指定当前行。语法为:change&&&/被修改字串/修改后的串如:list&2change&/(1)/(20)3.&增加新行在第一行插入一行,方法为:输入0,在0后输入文本。如:0&insert&into&test&values(2);在当前行后插入一行,方法为:输入input(或i),回车,输入新行,再回车,会提示再输入新行,如不想输入,输入点号,回车。如:4.&删除行del&--删除缓存区当前行,执行前先用list命令指定当前行del&n&&&删除缓存区指定的行5.&使用操作系统编辑器编辑命令在&sql*plus中输入edit命令,会自动打开系统的缺省的文本编辑器(windows下为notepad),缓存区中内容被装到文本编辑器中,这时可以对其中的内容进行编辑(这时sql*plus处于等待状态),修改完毕后,保存文件后。被修改的内容就会被写入缓存区。这对于修改错误命令很方便。6.&save命令格式:save&文件名&[replace&|&append]save命令的作用是将缓存区中内容保存到指定文件中。如果指定的文件不存在,将会创建,但如果文件目录不存在,将会失败。如果指定文件名的文件已存在,不指定replace或append参数将会失败。指定replace表示将覆盖原文件内容,指定append表示将缓存区内容加到文件后。7.&get命令格式:get&文件名get命令的作用是将指定文件的内容加载到缓存区中,以供编辑或执行。3.2.3&spool命令sql&&spool&文件名执行该命令后,如果指定的文件不存在,则会按指定的文件名创建一个空文本文件,如果目录不存在,会失败。如果指定的文件已存在,则文件内容将会被清空。执行上述命令后,此命令后的所有输出(包括命令、输出提示信息、错误信息等)都会被写入指定的文件。需要说明的时,并不是每输出一行信息,就会立即写入文件,有个缓存过程。Sql&spool&off上述命令就是停止存储,将前面所有输出立即写入文件。Sql&spool&out除完成spool&off命令的功能外,还打印输出的信息。说明:spool&off/out命令必须与spool命令一一对应。Spool命令的用途主要有如下:1)&导出数据2)&记录脚本的执行日志3)&生成新的sql脚本3.2.4&start/@&命令格式:start/@&脚本文件名这样可以将相关的sql/plsql语句,sql*plus的命令写在脚本中,从而执行。最常用的就是安装脚本,升级脚本。如:sql&&start&e:/test.sqlsql&&@e:/test.sql3.2.5&设置sql*plus环境(set命令)可以通过设置参数来改变sql*plus的一些属性,如显示等。如果运行的是sqlplusw.exe程序,通过菜单选项|环境可以通过界面改变这些参数的默认值。也可在sql&提示符下输入set命令来改变参数的值。查看参数的当前设置值的命令是:show&参数名。&&&常见的设置参数命令有:1.&set&pagesize&[n]用于设置每页的行数,范围为1~&50000,如果为0,则表示不分页,不带n,表示为0。否则,缺省情况下,当查询结果的行数超过一页的行数时,就会分页显示,每页的开头会显示列标题信息。2.&set&newpage&[n]该命令与pagesize结合使用,用来设置每一页的顶行的空行数,范围为0~&999,不带n,表示为0。缺省值为1。3.&set&linesize&n设置每行能容纳的字符数,范围为1~32767&。在查询时,通常一条记录会显示一行,如果一行显示不下,则会自动换行。用户输入数据时,当一行输入的值超过一行的最大值时,也会自动换行。4.&set&heading&off|on设置打开(on)或关闭(off)查询结果页的头信息,如列标题。比如,想输出sql语句存储到文件中时,就需要把这关闭。如:select&'insert&into&test1&values('||id||');'&from&5.&set&feedback&off|on设置为on,当执行insert,update,pl/sql等操作时,会提示执行的结果。如果设置为off,则不显示。6.&set&termout&off|on设置为off,执行的信息就不会在屏幕上显示。需要说明的是,该选项只有在脚本中设置,执行脚本时才有效。7.&set&trimspool&off|on设置为on,查询结果输入到文件中时,对于查询结果的后面的空格,将被截掉。8.&set&serveroutput&off|on设置on,在pl/sql中使用dbms_output包输出调试信息时sql*plus中可以显示出来,否则不显示。缺省为off。关于&dbms_output包的详细信息在以后介绍。需要说明的是,该设置只是在当前会话有效,一旦重新连接后,又恢复为默认值。可以在未连接数据库的情况下设置,设置后连接后有效,但一旦重新连接就恢复默认值了。如:begindbms_output.put_line('hello');9.&set&timing&off|on设置为on,每执行一sql或pl/sql,都会显示该执行所需要的时间,通过这可以查看sql语句的执行效率。10.&set&autocommit&on|off|n在sql*plus中,执行dml语句后,需要commit后或者执行了dcl或ddl语句后才会被提交。本命令可以设置让sql*plus自动提交。其中on表示每执行一sql/plsql,都自动提交一下。而off只是当sql*plus退出时才自动提交一下。n表示执行n条sql/plsql语句后就自动提交一下。11.&set&echo&on|off设置为on,sql*plus执行脚本时,都会将每一条执行的sql语句输出来,这样如果执行出错,便于定位。缺省为off&。&
12.&set&verify&on|off设置为off,可以关闭提示确认信息old&1和new&1的显示.&。
3.2.6&show命令通过show&参数名,可以看到当前sql*plus的一些环境参数的设置。还可以查看其它信息,如:show&user查看当前登陆的用户show&error查看sql执行出错的详细信息,因为创建pl/sql对象时即使出错,sql*plus不会报error,只会报warning,而且无法看到详细错务信息,通过show&error就可以看到。3.2.7&column(col)命令该命令可用于设置列的显示属性,常见格式如:1.&col&列名&format&an&[truncate]上面命令用于设置列的显示宽度,n为宽度。Truncate表示如果列值宽度超过n时,就截去超长的部分。不加Truncate,如果列值宽度超过n时,换行显示。如:col&s&format&a20比如一个字段定义了varchar2类型,长度很大,但实际字段值宽度很少,如果不加设置,在sql*plus查询时,会占用定义的宽度,这样看起来不方面。2.&设置数字的显示宽度create&table&test(id&number);insert&into&test&values(678);SQL&&select&*&from&&&&&&&&ID----------8.8889E+14SQL&&select&to_char(id)&from&TO_CHAR(ID)----------------------------------------678col&id&format&&&&--设置数字的显示宽度SQL&&select&*&from&&&&&&&&&&&&&&&&&&&&&&&ID-------------------------&&&&&&6783.&清除列的设置col&列名&clear&--清除指定列的格式设置clear&columns&&&--清除所有列的格式设置3.2.8&host命令通过host命令,可以在sql*plus中执行操作系统命令。如:sql&host&mkdir&e:/temp3.2.9&退出sql*plus语法:exit&[n]说明:通过exit命令退出sql*plus,退出可以带一个错务码。主要是供父进程使用。3.3&执行失败的处理当一个脚本中存在大量的sql/plsql语句时,执行该脚本时,如果其中有一条sql语句执行失败,可能很难发现。如果能让碰到错误时,让sql*plus退出,再结合spool命令查看日志,就很容易知道脚本的执行情况。这可以通过whenever命令来实现。格式一:whenever&sqlerror&exit&[success&|&failure&|&warning&|&n]&[commit&|&rollback&|&none]说明:一旦脚本中该语句之后的某sql语句执行出错,就会停止出错,sql*plus就会自动退出。其中success&|&failure&|&warning&|&n&为设定sql*plus出错后退出带出的错务码,success&|&failure&|&warning为固定的常量,n为指定任意数值。如果加了commit选项,则出错后,sql*plus在退出前,会自动执行commit一下;如果加了&rollback选项,则出错后,sql*plus在退出前,会自动执行rollback一下;如果加了none选项或什么都不加,则退出不会做任何事,但实际上默认设置下sql*plus在退出前会commit一下,所以这种情况与加了commit选项效果一样。例:whenever&sqlerror&exit&sql.sqlcode&--保证了出现错误,立即退出,并返回错误码例:***test.sql***spool&e:/test.txtwhenever&sqlerror&exitselect&*&from&test1233;select&*&from&spool&off格式二:whenever&sqlerror&continue&[commit&|&rollback&|&none]说明:一旦脚本中该语句之后的某sql语句执行出错,会继续往下执行,sql*plus不会自动退出,默认就是这样的设置。如果加了commit选项,则出错后,执行下一条语句前,sql*plus会自动执行commit一下;如果加了rollback选项,则出错后,执行下一条语句前,sql*plus&会自动执行rollback一下;如果什么都没加或加了none选项,则出错后,对前面执行过的语句不会自动添加执行任何commit或rollback&语句,是否commit或rollback,看后面的语句。例:***test.sql***spool&e:/test.txtwhenever&sqlerror&continueselect&*&from&test12;select&*&from&spool&off说明:当创建一个pl/sql对象时,如存储过程,函数,触发器,包等。即使代码写的有问题,在sql*plus执行时不会报error,只会报&warning。这样通过whenever&sqlerror是无法获取到的。而且sql*plus不直接给出出错的详细信息,这可以通过show&error命令看到出错的详细信息。3.4&固化对sql*plus的环境设置通过上面的介绍我们可以知道,可以通过命令设置sql*plus运行环境参数。但sql*plus一旦关闭重新打开,这些参数又恢复成默认值,又需要重新设置,这非常不方便。好的是,oracle提供一种方法可以使这些设置固定下来。如果%ORACLE_HOME%/sqlplus/admin目录下有glogin.sql文件(不同的系统目录和文件名可能不确定),则启动&sql*plus后(如果有初始连接,则连接后),sql*plus会自动执行该脚本,这样就可以在该脚本对sql*plus的参数进行设置,还可以加上特定的sql/plsql语句。可以看出,每次启动sql*plus,不管是谁启动,都会执行glogin.sql脚本。Oracle同时提供一种机制让不同的操作系统用户启动&sql*plus执行自己特定的脚本。方法是,在当前目录下(即运行sql*plus程序时的当前目录)编写一个文件名为login.sql的脚本,将自己特定的设定写入文件,这样启动sql*plus时首先会执行login.sql,然后再执行公共的glogin.sql。这在windows系统下显的不是很方面,因为只有在命令行下启动sql*plus时才有效,且必须先设置当前目录。而在unix下就非常有用,因为unix下每个登陆用户都有自己的主目录,而登陆后当前目录就是主目录,不同的用户可以将login.sql文件放在自己的主目录下。4&日期类型的显示在sql*plus中执行:select&sysdate&from&&发现查询结果是以字符串显示的,但格式不好看。原因是,oracle对日期类型它会自动的按照缺省格式隐式的转换为字符串类型。可以通过t_char函数和to_date函数来实现日期与字符串之间的显示转转。如:select&to_char(sysdate,yyyy-mm-dd&hh24:mi:ss)&from&create&table&test(s&date);insert&into&test&values(to_date(&10:20:22,yyyy-mm-dd&hh24:mi:ss));也可以通过执行sql命令,来改变当前会话的日期格式。如:alter&session&set&nls_date_format=yyyy-mm-dd&hh24:mi:ss;select&sysdate&from&insert&into&test&values(&10:20:22);可以直接将字符串插入到日期类型中,原因是oracle对数据类型会做自动隐式的转换。说明:该设置只在当前会话有效,重新登陆后,又恢复为默认值。5&脚本中变量5.1&替换变量变量前加一个&符号,sql*plus在命令中遇到替换变量时,用真实值去代替,相当于c语言中的宏定义。真实值来源于三个地方:1)&脚本参数带入2)&脚本中直接定义3)&用户动态输入如:select&&num&from&sql*plus中有几个环境参数将影响替换变量,为:set&define&off&|&coff表示关闭替换变量功能。c为定义替换字符(缺省为&),同时启用替换变量功能。set&escape&off&|&c定义转义字符。即&前面如果有指定的c字符,则作为普通字符处理。默认是off,即没有定义转义字符。如:set&escape&/select&/&hellofrom&set&ver&off|on如果为on,在替换前后会列出命令文件的每一行,缺省为on。set&concat&c设置替换变量与其后的其它字符的分隔符,缺省为句点(.)。如:select&&hello.goodfrom&&--&句点不作为输出的一部分等价于:select&&&&hello||goodfrom&select&&hello&goodfrom&&--空格也起到分隔作用,单空格作为输出的一部分select&&&&hello||.goodfrom&5.1.1&脚本带参数脚本可以带参数,在脚本中通过&n来引用参数,n为1表示为第一个参数,2表示第二个参数,依次类推。如:set&ver&connect&omc/&1insert&into&test&values(&2);执行该脚本的方法是:sql&@e:/test.sql&omc&self&45如果参数是字符串,且字符串有空格,应该用双引号或单引号扩起,如果字符串中有双引号,则只能用单引号扩起,如果字符串中要输入单引号,则只能用双引号扩起,且输入两个单引号才代表一个单引号。如:set&ver&connect&omc/&1@&2create&table&test(s&varchar2(20));insert&into&test&values('&3');执行:sql&@e:/test.sql&omc&self&&&hellosql&@e:/test.sql&omc&self&&&hello&worldsql&@e:/test.sql&omc&self&&&hello&worldsql&@e:/test.sql&omc&self&&&hello&zteworldsql&@e:/test.sql&omc&self&&&hello&zteworld正常情况下,slq*plus执行时,碰到&符号,就会作为参数来处理,如果&符号后跟的是数字,就会从命令行中取相应的值替换&&n,如果找不到,如n为3,但执行时只带了2个参数,sql*plus就会在屏幕上提示输入参数。如果&后跟的不是数字,而是其它字符,则sql*plus会把&及其后的字符串(截止到空格为止)当作一个参数提示输入。如:select&hello&good&chinafrom&那么如何将&作为普通字符处理呢?除了前面介绍的定义escape环境参数外,另一方法是,&符号后紧跟单引号(之间可以跟空格)。如:select&hello&||good&chinafrom&select&hello&&&&||good&chinafrom&所以,一般情况下在sql*plus下,执行sql语句时或脚本时,对&字符需要特殊处理一下,因为它是sql*plus中的特殊字符。5.1.2&脚本中定义格式:define&标识符&=&值如:define&n=12define&s=hello--是否加引号没有关系通过加&引用,如:select&&n&from&select&&sfrom&&--注意必须要加引号begindbms_output.put_line('&s');取消定义的方法是:undefine标识符一旦取消定义后,如果在通过&引用,则sql*plus会提示输入。5.1.3&接收用户交互式输入很多时候,在执行脚本时,我们希望有些信息根据脚本的提示,让用户动态输入,从而在下面的sql语句中使用。语法为:accept&var_name&typename&prompt&hint[hide]说明:hide表示以密文方式让用户输入。typename只能是char,number,date三种。如:accept&user_name&char&prompt&please&input&username:accept&passwd&char&prompt&please&input&password:hide通过变量前加&引用:connect&&user_name/&passwd5.2&捆绑变量一般情况下,我们都是在pl/slq中定义变量,如:delclares&varchar2(10);begins:=hello;insert&into&test&values(s);上面的程序段中,定义了变量s,但它只在该程序段有效。那如何定义在整个sql*plus中都有效的变量(这里称为捆绑变量)呢?方法如:var&g_str&varchar2(10)begin&--赋值只能在pl/sql中进行:g_str:='hello';&--注意前面要加冒号select&:g_str&from&&--引用捆绑变量,注意前面要加冒号print&g_str&&&--显示捆绑变量,注意前面不要加冒号declare&--在pl/sql中引用捆绑变量s&varchar2(10);begindbms_output.put_line(:g_str);s:=:g_dbms_output.put_line(s);insert&into&test&values(:g_str);6&脚本例子6.1&生成表的备份脚本编写存储过程,该存储过程生成一个select语句,执行结果为输出指定表的所有记录的insert语句。create&or&replace&function&BuildSelSql(tablename&in&varchar2)&return&varchar2&is&&&cursor&cur(tabname&varchar2)&isselect&column_name,data_type&from&user_tab_columns&where&table_name=upper(tabname)&order&by&COLUMN_ID;&&&tmp&varchar2(4000);&&&msg&varchar2(4000);&&&len&&&&num&begin&&&tmp:='select&''insert&into&'||tablename||'&values(''';&&&for&re&in&cur(tablename)&loopif&re.data_type='CHAR'&or&re.data_type='DATE'&or&re.data_type='VARCHAR2'&&&or&re.data_type='RAW'&then&&&tmp:=tmp||'|'||'|''''''''';&&&tmp:=tmp||'|'||'|'||re.column_name||'|'||'|'||''''''',''';else&&&--tmp:=tmp||'|'||'|'||'decode('||re.column_name||',null,''null'','||re.column_name||')'||'|'||'|'||''',''';&&&tmp:=tmp||'|'||'|'||'nvl('||re.column_name||',0)'||'|'||'|'||''',''';end&&&&end&&&&&&len:=length(tmp);&&&msg:=substr(tmp,1,len-3);&&&&&msg:=msg||''');''&from&'||tablename&||';';&&&return&执行函数例子:select&BuildSelSql('test')&from&&--test为表名set&trimout&onset&trimspool&onset&heading&offset&feedback&offset&termout&offset&ver&offset&linesize&4000set&pagesize&0whenever&sqlerror&exitset&serveroutput&onspool&e:/test1.sqlselect&BuildSelSql('test')&from&spool&offset&pagesize&6btitle&left&''&--分批提交spool&e:/test.txt&&&start&e:/test1.sqlspool&off执行:sql&@e:/test.sql执行后查看e:/test.txt文件的内容。
没有更多推荐了,
加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!}

我要回帖

更多关于 front of line 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信