¶ÁÈ¡oracle blob×Ö·û´®
OleDbConnectioncon=newOleDbConnection(cnnstr);
try
{
con.Open();
}
catch
{}
OleDbCommandcmd=newOleDbCommand(strSQL,con);
System.Data.OleDb.OleDbDataReaderdr=cmd.ExecuteReader();
while(dr.Read())
{
stringdd=dr["gggg"].ToString();
byte[]ooo=(byte[])dr["hhhh"];
stringstr;
str=System.Text.Encoding.Unicode.GetString(ooo);
this.textBox1.Text=str;
}
}
//ÏòÊý¾Ý¿âÖÐдÈë
private void button1_Click(object sender, EventArgs e)
{
oracleConnection1.Open();
OracleCommand cmd = new OracleCommand("UPDATE TEST SET F2 =:blob where F1=:sn ", oracleConnection1);
cmd.Parameters.Add(new OracleParameter("blob",OracleType.Blob));
cmd.Parameters.Add(new OracleParameter("sn",OracleType.Int32));
FileInfo fi = new FileInfo("c:\\dos.doc");
FileStream fs = fi.OpenRead();
byte[] MyData = new byte[fs.Length];
fs.Read(MyData, 0, System.Convert.ToInt32(fs.Length));
fs.Close();
cmd.Parameters["blob"].Value = MyData;
cmd.Parameters["sn"].Value = 1;
&nbs
Ïà¹ØÎĵµ£º
Ò²Ðí¶ÔSQL ServerÀ´Ëµ,È¡Ç°NλµÄÊý¾ÝÊǺܼòµ¥µÄÊÂÇé,Ò»ÌõTOPÓï¾ä¾Í¸ã¶¨ÁË.
ÔÚOracleÖÐÎÒÃÇÍùÍù»á¸Ð¾õµ½Í·ÌÛ,ƽÈÕÀïÒ²³£»áÓõ½,Ö÷ÒªÊÇʹÓÃpartition by.
Óï·¨ÈçÏÂ:
select emp_card_no,work_date,read_card_date,count(rownum) as cnt
from hra_read_car ......
1.´´½¨Ñ§Éú±í£º
CREATE TABLE student (
xh number primary key,
Name varchar2(10) not null);
2. ´´½¨ÐòÁУº
CREATE SEQUENCE student_seq
START WITH 1
INCREMENT BY 1
NOCACHE;
°´»Ø³ ......
Create directoryÈÃÎÒÃÇ¿ÉÒÔÔÚOracleÊý¾Ý¿âÖÐÁé»îµÄ¶ÔÎļþ½øÐжÁд²Ù×÷£¬¼«´óµÄÌá¸ßÁËOracleµÄÒ×ÓÃÐԺͿÉÀ©Õ¹ÐÔ¡£
ÆäÓ﷨Ϊ:
CREATE [OR REPLACE] DIRECTORY directory AS 'pathname';
±¾°¸Àý¾ßÌå´´½¨ÈçÏÂ:
create or replace directory exp_dir as '/tmp';
Ŀ¼´´½¨ÒԺ󣬾ͿÉÒ԰ѶÁдȨÏÞÊÚÓèÌض¨Óû§ ......
ORACLE Êý¾Ý¿â¶ÔÏó
——Ë÷Òý
q Ë÷ÒýÊÇÓë±íÏà¹ØµÄÒ»¸ö¿ÉÑ¡½á¹¹
q ÓÃÒÔÌá¸ß SQL Óï¾äÖ´ÐеÄÐÔÄÜ
q ¼õÉÙ´ÅÅÌI/O
q ʹÓà CREATE INDEX Óï¾ä´´½¨Ë÷Òý
q &n ......
¹ý³Ì¡¢º¯Êý
create or replace procedure p1
is
empname emp.ename%type;
begin
select ename into empname from emp where empno=7788;
dbms_output.put_line(empname);
end;
SQL> ed
SQL> /
Procedure created
SQL> exec p1;
......