由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - PL/SQL Help!!!
相关主题
SQL一不小心就出错Question about T-SQL
how to open 32 bit excel file on 64 bit system?[转载] Hehe,不好意思,another question:)
请教一个数据库设计的问题USE statement in SQL 7
dbms_java error, need help...请教set和select 的区别
oracle 安装求助HELP!!! PL/SQL write to a file
select a recipeA question about recursive query
[转载] 真的没有人懂 ORACLE pro*c阿? :((((请各位帮我看看这个最简单的Stored Procedure (转载)
About write/read binary files in PBNeed help on finding dependency objects
相关话题的讨论汇总
话题: comp话题: company话题: pl话题: sql话题: name
进入Database版参与讨论
1 (共1页)
r**e
发帖数: 57
1
For some reason, the following code does not work:
DECLARE
Comp_id NUMBER;
Comp_name CHAR(20) := 'ACME SHOWERS';
BEGIN
SELECT company_id_seq.NEXTVAL INTO comp_id
FROM dual;
INSERT INTO company (company_id, company_name)
VALUES (comp_id, comp_name);
END;
It seems that I can not use the Comp_id directly because when I change comp_id
to some real data, it works.
a****c
发帖数: 25
2
You need check if your sequence company_id_seq works or not first.

comp_id

【在 r**e 的大作中提到】
: For some reason, the following code does not work:
: DECLARE
: Comp_id NUMBER;
: Comp_name CHAR(20) := 'ACME SHOWERS';
: BEGIN
: SELECT company_id_seq.NEXTVAL INTO comp_id
: FROM dual;
: INSERT INTO company (company_id, company_name)
: VALUES (comp_id, comp_name);
: END;

n********a
发帖数: 68
3
What is the error msg?

comp_id

【在 r**e 的大作中提到】
: For some reason, the following code does not work:
: DECLARE
: Comp_id NUMBER;
: Comp_name CHAR(20) := 'ACME SHOWERS';
: BEGIN
: SELECT company_id_seq.NEXTVAL INTO comp_id
: FROM dual;
: INSERT INTO company (company_id, company_name)
: VALUES (comp_id, comp_name);
: END;

1 (共1页)
进入Database版参与讨论
相关主题
Need help on finding dependency objectsoracle 安装求助
select 跟 set 的区别?select a recipe
question about import xml to sql table[转载] 真的没有人懂 ORACLE pro*c阿? :((((
SQL Server 2005 Exec( )About write/read binary files in PB
SQL一不小心就出错Question about T-SQL
how to open 32 bit excel file on 64 bit system?[转载] Hehe,不好意思,another question:)
请教一个数据库设计的问题USE statement in SQL 7
dbms_java error, need help...请教set和select 的区别
相关话题的讨论汇总
话题: comp话题: company话题: pl话题: sql话题: name