首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

高分,关于存储过程的有关问题

2012-12-16 
高分求助,关于存储过程的问题我将创建存储过程的语句写在文件中,在程序通过读文件来创建存储过程if &File.

高分求助,关于存储过程的问题
我将创建存储过程的语句写在文件中,在程序通过读文件来创建存储过程
if &File.Exists(ScriptFile) then
  begin
    fs  := FileStream.Create(ScriptFile,FileMode.Open,FileAccess.Read);
    reader := StreamReader.Create(fs, System.Text.Encoding.Default);
    strScript := reader.ReadToEnd;
    con := TCommon_Method.GetConnection;
    con.Open;
    Command := TCommon_Method.GetCommand;
    Command.Connection := con;
    trans:=con.BeginTransaction;
    try

      Command.Transaction := trans;
      Command.CommandText := strScript;
      Command.CommandType := CommandType.Text;
      Command.ExecuteNonQuery;
      trans.commit;
    except
      trans.rollback;
    end;

    trans:=con.BeginTransaction;
    try
      Command.Transaction := trans;
      Command.CommandText := 'p_updatescript';
      Command.CommandType := CommandType.StoredProcedure;
      Command.ExecuteNonQuery;
      trans.commit;
    except
      trans.rollback;
    end;
    con.Close;
  end;
可是这样创建的存储过程老是提示
Compilation errors for PROCEDURE P_UPDATESCRIPT

Error: PLS-00103: 出现符号 ""在需要下列之一时:
        begin function package pragma
          procedure subtype type use <an identifier>
          <a double-quoted delimited-identifier> form current cursor
          external language
Line: 1
Text: create or replace procedure p_updatescript as
重新手工编译一下又可以!
求助怎么解决

[最优解释]
我给你结答~~短信我
[其他解释]
怎么没人啊
[其他解释]
写在文件中?
没试过
[其他解释]
发贴到 Delphi.net 论坛,看到的人会很少

而且非SQL Server的东东,估计搞.NET的多半不熟
[其他解释]
   p_updatescript   里引号的问题吧

热点排行