在oracle中填充数据库(sqlplus)
我有一个包含一堆表的数据库,我想使用 SQL 插入命令填充数据库。现在我对此很陌生,所以请放宽我的要求。现在这是一个例子:
我有一个像这样的表
TECH PERSONNEL (pplSoft, fname, lname, pittID, expertise, office phone)
,其中 fname 是名字,lname 是姓氏。我想放入
table TECH_PERSONNEL
pplSoft fname lname pittID expertise office_phone expYears supervisor
1110001 Bob Hoffman bh1 Unix systems 412-624-8404 15 1110001
1110002 Terry Wood tw1 Hardware 412-624-8831 14 1110001
但是该表有很多行数据,我是否必须在
INSERT INTO TECH_PERSONNEL pplSOFT ('1110001', '1110002');
表声明之后添加代码?我只是很困惑。
I have a database with a bunch of tables and I want to populate the database using the SQL insert command. Now I am new to this so cut me some slack. Now here is an example:
I have a table like this
TECH PERSONNEL (pplSoft, fname, lname, pittID, expertise, office phone)
Where fname is first name, and lname is last name. And I want to put in
table TECH_PERSONNEL
pplSoft fname lname pittID expertise office_phone expYears supervisor
1110001 Bob Hoffman bh1 Unix systems 412-624-8404 15 1110001
1110002 Terry Wood tw1 Hardware 412-624-8831 14 1110001
However there is many lines of data for that table would I have to put code such as
INSERT INTO TECH_PERSONNEL pplSOFT ('1110001', '1110002');
after the declaration of my table? I'm just confused.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
基本的 INSERT 语句是:
鉴于您的示例 & 如果您不知道您的字段是如何定义的,则可以这样输入一行:
然后是下一行,等等。如果您希望将 csv 或其他类型的文件直接导入到 Oracle 中,那就是另一个问题了。我并没有真正理解你的要求,所以这个答案只是基本的“如何使用 INSERT”。
The basic INSERT statement is:
Given your example & not knowing how your fields are defined, a row could go in as such:
Then the next row, etc. If you're looking to use import a csv or other type of file directly into Oracle, that's a different question. I'm not really following what you're asking, so this answer is just the basic "how to use INSERT".
请原谅我的语言,我正在用手机。
我还想知道如何动态填充表格。在 c/c++ 中随机选择值来随机化表的方式,即
如何在 sqlplus 解析的 .sql 脚本中执行此类操作?
Excuse my language, I'm on a cellphone.
I would also like to know how to dynamically populate a table. The way you randomize tables with random selections of values in c/c++, i.e.
How to do this type of thing in .sql scripts parsed by sqlplus?