database.sarang.net
UserID
Passwd
Database
DBMS
MySQL
PostgreSQL
Firebird
Oracle
Informix
ㆍSybase
MS-SQL
DB2
Cache
CUBRID
LDAP
ALTIBASE
Tibero
DB 문서들
스터디
Community
공지사항
자유게시판
구인|구직
DSN 갤러리
도움주신분들
Admin
운영게시판
최근게시물
Sybase Q&A 1438 게시물 읽기
No. 1438
sybase trigger 쿼리 에러 문의
작성자
최종환(huucally)
작성일
2006-02-14 20:18ⓒ
2006-02-14 20:26ⓜ
조회수
4,649

CREATE TRIGGER archive_data_iu ON archive_data
FOR INSERT,UPDATE AS
begin
if (select fl_enable from inserted) = 1
begin
insert queue_table (table_name, vdkkey, action)
select 'v_v_archive_data', convert(char(30), inserted.id),'0'
from inserted
end
else
begin
insert queue_table (table_name, vdkkey, action)
select 'v_v_archive_data', convert(char(30), inserted.id),'2'
from inserted
end
end

 

 

-------- 에러 메세지 ----

[Error] Script lines: 1-2 --------------------------
Subquery returned more than 1 value. This is illegal when the subquery follows =, !=, <, <= , >, >=, or when the subquery is used as an expression.
Msg: 512, Level: 16, State: 1
Server: sybase2, Procedure: archive_data_iu, Line: 4

 

 

 

if (select fl_enable from inserted) = 1 이부분에서 에러가 나는것 같은데.. 어떻게 수정 하여야

하는지 답변 부탁 드립니다..

 

 

 

 

이 글에 대한 댓글이 총 2건 있습니다.

별이상은 없는것 같은데요

 

version이 뭔지요?

 

메세지 자체는 fl_enable의 건수가 1건보다 많다인데요

 

 

버그인것 같은데요

지연님이 2006-02-15 11:51에 작성한 댓글입니다. Edit

이렇게 바꿔보세요

 

CREATE TRIGGER archive_data_iu ON archive_data
FOR INSERT,UPDATE AS
begin
if @@rowcount = 1
begin
insert queue_table (table_name, vdkkey, action)
select 'v_v_archive_data', convert(char(30), inserted.id),'0'
from inserted
end
else
begin
insert queue_table (table_name, vdkkey, action)
select 'v_v_archive_data', convert(char(30), inserted.id),'2'
from inserted
end
end

존넘님이 2006-02-15 16:45에 작성한 댓글입니다. Edit
[Top]
No.
제목
작성자
작성일
조회
1441temp table 문제 입니다. [3]
조경남
2006-02-16
8356
1440out of LOCKS 문제.. [1]
허남훈
2006-02-15
4482
1439필드값을 전부 곱하려면. [4]
궁금
2006-02-15
3590
1438sybase trigger 쿼리 에러 문의 [2]
최종환
2006-02-14
4649
1437Recursive 쿼리는 어떻게 해야하나요? [3]
하롱
2006-02-14
4480
1436원격 연결관련 질문입니다. [1]
이민규
2006-02-14
3752
1435Java Service 에러 [1]
김기택
2006-02-13
3603
Valid XHTML 1.0!
All about the DATABASE... Copyleft 1999-2024 DSN, All rights reserved.
작업시간: 0.022초, 이곳 서비스는
	PostgreSQL v16.2로 자료를 관리합니다