Oracle 10g-数据库导入中的无效字符 [英] Oracle 10g - invalid character on DB importing

查看:140
本文介绍了Oracle 10g-数据库导入中的无效字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有几个要导入的SQL文件.

I have several SQL files that I want to import.

一个例子:

CREATE TABLE BB_Department (
    idDepartment number(2)  ,
    DeptName varchar2(25) ,
    DeptDesc varchar2(100) ,
    DeptImage varchar2(25) ,
    CONSTRAINT dept_id_pk PRIMARY KEY(idDepartment) );
insert into bb_department 
   values(1,'Coffee','Many types of coffee beans','coffee.gif');

使用 http://localhost:8080/apex 导入时,我不断收到无效字符"错误

When importing this with http://localhost:8080/apex I continually receive the 'invalid character' error.

似乎一个人一次只能运行一个SQL语句.该错误是由任何分号触发的.

It seems that one can only run ONE SQL statement at a time. The error is triggered by any semi-colons.

一些在线参考资料指出它可能是字符转换-但这似乎并非如此.

Some online references state that it might be char conversion - but this does not seem to be the case.

如何在不触发此操作的情况下在Web界面中导入转储文件?

How can I go about importing dump files, in the web interface, without triggering this?

推荐答案

我仍然不确定您使用的是哪个"Apex Web工具".我假设它是Oracle 10g Express Edition(Oracle 10g XE)的Web界面.

I'm still not quite sure which "Apex web tool" you're using. I'll assume it's the web interface of the Oracle 10g Express Edition (Oracle 10g XE).

如果我将您的SQL语句复制到文本文件中并作为SQL脚本上传,则可以正常运行.它创建表并插入单行.分号可以很好地用作语句定界符.

If I copy your SQL statement into a text file and upload it as a SQL script, I can run it without error. It creates the table and inserts a single row. The semicolons are just fine as statement delimiters.

关于交互式SQL命令页面不能说相同的话.如果它是编辑区域中的唯一命令(没有分号或斜杠),或者我首先选择了该命令(再次没有分号或斜杠),那么我可以成功运行该命令.但是,此页面似乎无法运行多个命令(给出ORA-00911,ORA-00910,ORA-00933或ORA-00905).

The same cannot be said about interactive SQL Commands page. I can successfully run a command if it's either the only command in the edit area (without a semicolon or slash) or if I first select the command (again without a semicolon or slash). However, this page seems incapable of running multiple commands (giving either ORA-00911, ORA-00910, ORA-00933 or ORA-00905).

可能其中一些问题是由于浏览器不兼容引起的.使用Firefox 6,我无法运行或编辑SQL脚本.我可以看到未格式化的SQL文本,但它是只读的,背景为红色.顶部的所有按钮均已失效(或者在Firefox的Javascript错误控制台中抛出异常).使用IE 9,它似乎可以正常工作.

Possibly, some of these problems are due to browser incompatibilities. With Firefox 6, I cannot run or edit SQL scripts. I can see the unformatted SQL text but it is read-only and has a red background. All buttons at the top are dead (or rather throw an exception in Firefox's Javascript error console). With IE 9, it seems to work.

通常,您可以在分行上使用分号或斜杠来分隔Oracle SQL脚本中的命令.要么是:

In general, you can either use a semicolon or slash on a separate line to delimit commands in Oracle SQL scripts. So it's either:

insert into bb_department 
  values(1,'Coffee','Many types of coffee beans','coffee.gif');
insert into bb_department 
  values(2,'Sugar','Sweet','sugar.gif');

或者:

insert into bb_department 
  values(1,'Coffee','Many types of coffee beans','coffee.gif')
/
insert into bb_department 
  values(2,'Sugar','Sweet','sugar.gif')
/

如果您有BEGIN/END块(对于匿名PL/SQL块或存储过程/函数/包),则必须使用斜杠.

If you have a BEGIN/END block, either for a anonymous PL/SQL block or a stored procedure / function / package, you must use the slash.

命令行工具SQL * plus是运行SQL脚本的可靠工具.它绝对支持分号和斜杠.除了SQL语句和PL/SQL块外,它还支持其他一些有用的命令.

A reliable tool to run SQL scripts is the command line tool SQL*plus. It definitely supports semicolons and slashes. In addition to SQL statements and PL/SQL blocks, it also supports several additional useful commands.

一个免费的,有用的图形化工具是SQL Developer(来自Oracle).它支持SQL语句,PL/SQL块和大多数SQL * plus命令.

A graphical, free and useful tool is SQL Developer (from Oracle). It supports SQL statements, PL/SQL blocks and most of the SQL*plus commands.

这篇关于Oracle 10g-数据库导入中的无效字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆