×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT技术讨论 / 数据库加载方案?
    开发环境, NT平台, Oracle 7~8
    为实现多语言支持,系统现有字典表若干,行数n~n000(每一种语言)
    问题:如何根据用户所选的语言(可大于一种)装载这些表的数据?
    方案一:在DOS Shell (.cmd)文件中实现分支。请指教一二,谢谢。
    方案二:将插入语句根据表和语言分开包入不同的Stored Procedure,用PL/SQL的分支语句。不被采用的语言的SP是否太多余存于DB 中。
    请问是否还有更好的方案?
    • 是否可以这样
      用PRO*C。定义一组BOOLEAN参数。用SWITCH/CASE判断。选择支为真则INSERT。无须对每种语言分别写STORED PROCEDURE。

      1、不知道在DOS下如何把SQL命令写进去。
      2、用STORED PROCEDURE要依赖环境。而PRO*C可以单独编译成一个可执行文件。
      • For this task, the only available tools for me are SQL*Plus and Dos Shell. Now I'm testing the DOS solution. The point is that SQL*Plus doesn't support IF statement. And the same stuff also need to do with SQL*Server
        SQL could be implemented from DOS like this:
        %RDBMS_HOME%\bin\%sqlplus% scott/tiger @%maindir%\sql\sqlstat.sql
        • I think the better way is to use the stored procedure. You have exception handling in PL/SQL which is important in loading data into the database.
          • Thanks for your prompt reply.