Displaying full sql error text?
I'm using getErrorCode() and getMessage() to display the following for an sql error
SQL error: SQLCODE: -551, SQLSTATE: 42501, SQLERRMC: auth-id ;operation;object-name
The SQLERRMC only has the auth-id, operation and object-name. How do I build this error message without doing it manually (detect 551 and build the error string)?
auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation ON OBJECT object-name
Write an abstract DataAccessException class for your data that wraps a java.sql.SQLException and subclass it for this particular database.Then have the concrete class do the work of checking the SQL error code and state and put out a nicer error message.
That's what Rod Johnson recommends in his "Expert 1-On-1 J2EE".
Similar Messages
-
Automatically displaying the error text for a form field when the validator fails?
Hi,
Flex 2 has a very nice feature to display custom text next to
a form field whose validation failed. But the user has to move the
mouse over the form field to display the text. Is there a way to
invoke this feature programmatically?
What I would like to do is validate form fields on submit and
- if validation fails for a form field - set focus on that form
field and automatically display the custom error text in the red
blurb. Focusing works fine but I cant' get the text to render...
MarkusThanks Bregent.
Weirdest thing...I just tried a Google search for a solution to this problem and came across another thread on this forum. By the time I got to the bottom of it I realised one of those taking part was myself from years ago! Jeesh, been here before or what!
Changed my recordset to...
<%
Dim rsPROP__MMColParam
rsPROP__MMColParam = "0"
If (Request.Form("categoryID") <> "") Then
rsPROP__MMColParam = Request.Form("categoryID")
End If
%>
<%
Dim rsPROP__MMColParam1
rsPROP__MMColParam1 = "1"
If (Request.Form("categoryID") <> "") Then
rsPROP__MMColParam1 = Request.Form("categoryID")
End If
%>
<%
Dim rsPROP
Dim rsPROP_cmd
Dim rsPROP_numRows
Set rsPROP_cmd = Server.CreateObject ("ADODB.Command")
rsPROP_cmd.ActiveConnection = MM_cs_STRING
rsPROP_cmd.CommandText = "SELECT prodid, product, categoryID FROM dbo.products WHERE ISNULL(?,0) = 0 OR categoryID = ?"
rsPROP_cmd.Prepared = true
rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param1", 5, 1, -1, rsPROP__MMColParam) ' adDouble
rsPROP_cmd.Parameters.Append rsPROP_cmd.CreateParameter("param2", 5, 1, -1, rsPROP__MMColParam) ' adDouble
Set rsPROP = rsPROP_cmd.Execute
rsPROP_numRows = 0
%>
...and it works fine.
Appreciate the help. I would have taken your advice and done an If Else on the WHERE clause to acheive the same.
Thank you.
NJ -
Error in critical report ERROR Text is appearing in the dollar
Hi guru's,
i'm having issue in a report . ERROR Text is appearing in the dollar amount field(Column) inods level andDB level its working fine but in the reporting it displays with the "ERROR" text
in production system this issue starts from this month only till june its working fine
the report looks like in the production system in july is
state /provinence country
2.17 ERROR 0.00
3.45 ERROR 0.00
0.00 2.11ERROR
Kindly let me know......Helpful answers will be rewardedHi,,
Have u correctly assigned 0CURRENCY to ur R/3 source field which has currency units liek WAERS
Check if there data in them
In reporting side,,
Can u give this NODIM(Key figure), then execute the query again.
It shud nt show up
thanks -
Display SQL query in error text
Using CFMX 6.1.
Is it possible to get our error handler page to display the
SQL query that fails and causes an error?
If tried #error.sql# but it doesn't exist after a db
exception. If I put a cftry around a particular query and then use
cfcatch.sql within a cfcatch tag pair, it works fine. But given our
error handler page is for the entire site, I can't use cfcatch, at
least not the way the site is currently architected. I was hoping
error.sql would work since my quick ref quide states that "Any
cfcatch variable that applies to exception type can be accessed
within the Error scope. But then it doesn't list Error.SQL or
CFCATCH.SQL for that matter in any documentation I've seen, yet the
later works in cfcatch tags.
Any help would be appreciated.You don't have to place a CFTRY/CFCATCH around each query. I
don't know how many pages you have in your application, but you
could do something like the following:
1. Replace <body> with <body><CFTRY>
2. Replace </body> with the following
<CFCATCH TYPE="database">
<CFMODULE TEMPLATE="customErrorPage.cfm"
sqlStatement="#CFCATCH.Sql# " message="#CFCATCH.message#">
</CFCATCH>
</CFTRY>
</body>
You can use a global search-and-replace utility, such as
SR32, to make this task painless. Click
here to go to the SR32
site. -
hi
Sometimes the exception returns something like: "ORA-06502: PL/SQL: numeric or value error: character string buffer too small".
It's not so readable since it doesn't report neither the table, the column and the value it tried to write.
it would be useful to get the current procedure name at the moment the Exception happened or is catched.
How can I obtain that?
i want to show error text in form that showed user which procedure, function or package raised this error, like in pl/sql developer when you test a procedure or function, for example:
i have this procedure in my form that raised ora-1403(no_data_found) and i called it by a button on the form:
Procedure chk_data Is
Lv_Find Number;
Begin
Select 1
Into Lv_Find
From Lmp_Routing_Headers Lrh
Where Lrh.Cod_Route_Rohed = '3007';
End;
i want to show user this error that raised in chk_data and error is ora-1403(no_data_found).
how can i do that?
Edited by: 793034 on 25/09/2011 05:55 ص
Edited by: 793034 on 25/09/2011 07:01 صi want to show user this error that raised in chk_data and error is ora-1403(no_data_found).I'm confused. It sounds like your form is already reporting the error to your user!
i have this procedure in my form that raised ora-1403(no_data_found) and i called it by a button on the form:If you want to be able to trap this error and report something more meaningful to your user then I suggest you use either the On-Error trigger or add an exception handler to your procedure. I suggest you add the exception handler so the error is handled in the procedure itself rather than add code to generically handle all "No Data Found" exceptions. For example:
Procedure chk_data Is
Lv_Find Number;
Begin
Select 1
Into Lv_Find
From Lmp_Routing_Headers Lrh
Where Lrh.Cod_Route_Rohed = '3007';
EXCEPTION
WHEN NO_DATA_FOUND THEN
-- Display your message here!
End;Hope this helps,
Craig B-)
If someone's response is helpful or correct, please mark it accordingly. -
ORA-06521: PL/SQL: Error mapping function while writting into a text file
Hi,
I'm getting an errror ORA-06521: PL/SQL: Error mapping function while trying to write data into a text file.
I'm using the following code:
--To create a new directory
create or replace directory temp as 'C:/temp';
declare
l_str varchar2(1000);
output_file utl_file.file_type;
cursor test_write_cur is
select EMPNO,ENAME,JOB,SAL,HIREDATE
from EMP
where DEPTNO=30;
begin
output_file := utl_file.fopen('TEMP','TESTFILE.txt','w');
for test_write_rec IN test_write_cur
loop
l_str := test_write_rec.EMPNO||'^'||test_write_rec.ENAME||'^'||test_write_rec.JOB||'^'||
test_write_rec.HIREDATE||'^'||test_write_rec.SAL||chr(10);
utl_file.put_line(output_file,l_str);
end loop;
utl_file.fclose(output_file);
end;Please suggest me if i'm wrong.
Thanks & Regards,
Sanket MishraDear Sanket,
I think you are need use TO_CHAR() function
to_char(test_write_rec.EMPNO) ,
to_char(test_write_rec.HIREDATE,'DD.MM.YYYY')
to_char(test_write_rec.SAL) -
SQL error not displayed. Instead wwv_flow.accept was not found
Hi,
My Question:
Why does the SQL error in this case not get propagated up the chain?
BACKGOUND:
Just spent a few hours trying to figure out why when trying to insert into a table using a wizard created page I was getting the error: The requested URL /pls/htmldb/wwv_flow.accept was not found on this server. It turns out that the error message is a red herring, and the problem was caused by a SQL error that I thought should have been caught and displayed.
When running the page under debug, the error is displayed, but run as Joe Blow user, the www_flow.accept error is received.
DETAILS
Process details where the insert takes place:</h3>
Process point:
After Submit - after computations and validations
Process Messaging
Process Error Message
Unable to insert a row to TRAINING_SESSIONS
HTML DB ERROR (NOT IN DEBUG MODE)
This is the error the end user sees in the browser:
The requested URL /pls/htmldb/wwv_flow.accept was not found on this server
APACHE ERROR_LOG
[Sun Jun 06 17:50:28 2004] [error] [client 127.0.0.1] [ecid: 1086508225:10.6.6.6:1724:1732:320,0] mod_plsql: /pls/htmldb/wwv_flow.accept HTTP-404 ORA-03113: end-of-file on communication channel
[Sun Jun 06 17:50:28 2004] [alert] [client 127.0.0.1] [ecid: 1086508225:10.6.6.6:1724:1732:320,0] mod_plsql: Unable to reset state for mode 0: Err 3114 url=>/pls/htmldb/wwv_flow.accept
HTMLDB DEBUG MODE OUTPUT
This is what you see when running the page as developer with debug on:
0.01: Processing point: AFTER_SUBMIT
0.01: ...PLSQL (AFTER_SUBMIT)
INSERT INTO "TRAINING_SESSIONS" ("TRNG_ID",
"COURSE_ID",
"START_DATE",
"LOCATION",
"COST")
VALUES ( TRNG_SEQ.NEXTVAL,
:P27_COURSE_ID,
:P27_START_DATE,
:P27_LOCATION
:P27_COST)
0.01: Show ERROR page...
0.04: Processing point: AFTER_ERROR_HEADER Home
Error Unable to insert a row to TRAINING_SESSIONS
OK
0.06: Processing point: BEFORE_ERROR_FOOTER
ORA-06550: line 6, column 9: PL/SQL: ORA-00947: not enough values ORA-06550: line 1, column 7: PL/SQL: SQL Statement ignored
ACTUAL PROBLEM:
The sequence TRNG_SEQ does not exist!Has anyone found what causes this problem? I am running HTMLDB 1.6
I have a HTMLDB application running against four databases. I develop in one and export and import the application to all databases. It appears that on the databases that are NOT development, this www_flow.accept was not found comes up instead of the error page.
Please help! We are getting so close to wanting to release this application. -
Mail doesn't display full email text, only displays the subject line
Mail doesn't display full email text, only displays the subject line.
My preview shows first three lines of email, but when I chose the email specifically mail doesn't display any lines of text. Been this way for about ten days. Please help. BenAwesome. Rebooting the phone worked. I had never turned the phone off before (for the next guy - you hold down the "sleep" button for longer than you'd think and that'll do a full shutdown). thank you for your help.
-
Bex report doesn't display full text information......
Hi Experts,
My bex report is not displaying full text information.
I have set that particular infoobject length as 40 and also have selected long text and Long Description in Bex Tab of the InfoObject.
In my DSO the data is available in complete lenght but in my Bex report it just displays half information
Instead of displaying Service Order Released its displays Service Order Rel
Can anyone help me to resolve this issue please.
ThanksHello,
Setting up the BEx Property for Object, is not sufficient enough to display in the query output. You can always overwrite the object level settings in the query designing.
Moreover, when you create a query, system always overwrite your object level settings and apply the query level settings.
Make sure, you have selected Long Text in the query for that characteristic.
- Danny -
would like to display time of occurrence and error text, so possibly a table instead of a listbox
You can check on the alliance page for a product that does this, but there are no LabVIEW utilities to do this specific task. You will have to build one yourself it seems.
-
FULL SQL TEXT를 찾는 방법
PURPOSE
전통적으로 특정 process가 실행하고 있는 SQL을 살펴보기 위해 V$SQL / V$SQL_TEXT 등의 view가 사용됩니다. 다만, varchar2 datatype이므로 full SQL을 볼 수 없다는 제한이 있습니다.
10g 부터는 SQL_FULLTEXT 라는 CLOB 형태의 컬럼을 통해 1000 byte 가 넘는 SQL text도 열람할 수 있게 되었습니다.
CONTENTS
1. test에 사용할 SQL text
2. 전통적 방법으로 접근
3. 새로운 방법으로 접근
4. 요약
1. 다음과 같은 TEST 목적의 query가 있습니다. 영문캐릭터만 사용하여 SELECT 부터 DUAL까지 1125 글자이므로, 1125 bytes 입니다.
select /* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa */ * from dual;
이 query를 SCOTT 으로 수행해봅니다.
2. 전통적 방법으로 접근
새로운 SESSION을 열어 다음과 같이, SCOTT 으로 접속된 SESSION의 sid 및 serial# 를 확인합니다.
(1) USERNAME을 통해 sid 및 serial# 를 확인
select b.sid, b.serial#, b.username
from v$session b where b.username ='SCOTT';
SID SERIAL# USERNAME
309 1198 SCOTT
(2) 확인된 정보를 통해, SQL TEXT를 확인합니다.
VARCHAR2(1000)에 저장된 DATA 이므로, 다음과 같이 FULL SQL은 확보하지 못했습니다.
set linesize 50
column sql_fulltext format a60 word_wrap
break on sql_text skip 1
select s.username username, s.osuser, s.program, a.sql_text SQL
from v$sql a, v$session s
where s.sid = 309 and s.serial# = 1198
and a.address = s.sql_address and a.hash_value = s.sql_hash_value;
USERNAME
OSUSER
PROGRAM
SQL
SCOTT
oracle
[email protected] (TNS V1-V3)
select /* aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
USERNAME
OSUSER
PROGRAM
SQL
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
USERNAME
OSUSER
PROGRAM
SQL
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
USERNAME
OSUSER
PROGRAM
SQL
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
USERNAME
OSUSER
PROGRAM
SQL
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
3. 새로운 방법으로 접근
새로운 SESSION을 열어 다음과 같이, SCOTT 으로 접속된 SESSION의 sid 및 serial# 를 확인합니다.
(1) USERNAME을 통해 sid 및 serial# 를 확인
select s.username username, s.osuser, s.program, a.sql_text SQL
from v$sql a, v$session s
where s.sid = 309 and s.serial# = 1198
and a.address = s.sql_address and a.hash_value = s.sql_hash_value;
SID SERIAL# USERNAME
309 1198 SCOTT
(2) 확인된 정보를 통해, SQL TEXT를 확인합니다.
VARCHAR2(1000)에 저장된 DATA 이므로, CLOB datatype인 SQL_FULLTEXT 컬럼에 접근하였으므로 full SQL text를 확보할 수 있습니다.
set linesize 50
column sql_fulltext format a60 word_wrap
break on sql_text skip 1
select
replace(translate(a.sql_fulltext,'0123456789','999999999'),'9','')
SQL_FULLTEXT
from v$sql a, v$session s
where
s.sid = 309 and s.serial# = 1198
and a.address = s.sql_address and a.hash_value = s.sql_hash_value
and a.sql_text like '%aaaaaaaaaaa%'
group by replace(translate(a.sql_fulltext,'0123456789','999999999'),'9','');
set linesize 50
column sql_fulltext format a60 word_wrap
break on sql_text skip 1
SQL_FULLTEXT
select /*
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL_FULLTEXT
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
SQL_FULLTEXT
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
*/ * from dual
4. 요약
10g 이상 버젼에서는, 다음과 같은 형태의 query를 응용함으로서 FULL SQL TEXT를 확보할 수 있습니다.
select
replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
SQL_FULLTEXT
from v$sql
where sql_text like '%<찾고자_하는_SQL_KEYWORD>%'
group by replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
NOTE
혹시라도 SQL TEXT가 4000 BYTE 이상 저장되어 있는 경우라면, ORA-22835 가 발생합니다. (VARCHAR2 형태로 출력되는 과정에서 최대 4000 BYTE 라는 제한조건이 발생됩니다) 이 경우, 다음과 같이 4000 byte만 읽도록 DBMS_LOB.SUBSTR()을 설정해줄 수 있습니다.
*** BEFORE
replace(translate(sql_fulltext,'0123456789','999999999'),'9','')
*** AFTER
replace(translate(dbms_lob.substr(a.sql_fulltext,4000,1),'0123456789','999999999'),'9','')
만약 4000 BYTE 이상의 SQL text 가 모두 필요, java/proc/developer 등의 CLOB 처리가 가능한 3rd part tool를 사용해주시거나, 필요한 APP를 작성해주셔야 합니다.
References
Note 437304.1스크립트의 RMAN 구동 후 돌려 주시는 구문 중에 $db_bk_sql 호출하여 백업을 받으시는데 채널 할당하는 부분에 format 구문을 넣어서 각 채널에서 저장하는 위치을 다르게 잡아 줄 수 있습니다. 대신 쓰시는 backup database 구문에서 format 관련된 부분을 빼 주셔야 합니다...
예로
ALLOCATE CHANNEL disk1 DEVICE TYPE DISK FORMAT '/disk1/backups/%U';
뒤으 %U는 구분을 해 주기위해서 쓴 구문이구요... 위 구문과 같은 형식으로 채널 할당을 조절해 주시면 원하시는 대로 백업을 나누어서 할 수 있을 겁니다...
추가적으로 더 다양한 형식으로 컨트롤을 할 수 있지만 그런 부분들은 백업 정책 및 기타 고려 사항을 참고해서 구성을 하셔야 입맛에 맞게 조절할 수 있으리라 봅니다.
글 수정:
명품 관 -
Error Text = PL/SQL: ORA-00926
Can some one tell me what the problem is with this, fairly urgent
ERROR:Line # = 120 Column # = 28 Error Text = PL/SQL: ORA-00926: missing VALUES keyword
Line # = 120 Column # = 2 Error Text = PL/SQL: SQL [b]Statement ignored
Oracle Migration Workbench
CREATE OR REPLACE FUNCTION "SA"."SPCXDB_DELIVERPRJ" (
CurrUser_ID IN NUMBER DEFAULT NULL,
Object_ID IN NUMBER DEFAULT NULL,
Path_ID IN NUMBER DEFAULT NULL,
IsLastPhase IN NUMBER DEFAULT NULL,
NewPhase_ID IN NUMBER DEFAULT NULL,
User_ID IN NUMBER DEFAULT NULL,
Comment_ IN VARCHAR2 DEFAULT NULL,RC1_CALL IN OUT Omwb_emulation.globalPkg.RCT1 )
RETURN INTEGER
AS
CurrUser_ID_ NUMBER(10,0) := CurrUser_ID;
Object_ID_ NUMBER(10,0) := Object_ID;
Path_ID_ NUMBER(10,0) := Path_ID;
IsLastPhase_ NUMBER(3,0) := IsLastPhase;
NewPhase_ID_ NUMBER(10,0) := NewPhase_ID;
User_ID_ NUMBER(10,0) := User_ID;
Comment__ VARCHAR2(255) := Comment_;
StoO_selcnt INTEGER;
StoO_error INTEGER;
StoO_rowcnt INTEGER;
StoO_crowcnt INTEGER := 0;
StoO_fetchstatus INTEGER := 0;
StoO_errmsg VARCHAR2(255);
StoO_sqlstatus INTEGER;
tempVar1 NUMBER :=3;
tempVar2 NUMBER :=1;
id NUMBER(10,0);
CURSOR ptr IS
SELECT Object_ID
FROM TT_DVROBJECTS;
dummy_var1 INTEGER;
/****** Object: Stored Procedure dbo.spCXDB_deliverprj Script Date: 2003-11-12 14:21:41 ******/
-- currently logged user id
BEGIN
NULL;
/*[SPCONV-ERR(12)]:(set XACT_ABORT) Manual conversion required*/
1) update project
IF SPCXDB_DELIVERPRJ.IsLastPhase_ = 0 THEN
BEGIN
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBObjects
SET DvrPath_ID = SPCXDB_DELIVERPRJ.Path_ID_,
DvrPhase_ID = SPCXDB_DELIVERPRJ.NewPhase_ID_,
DvrUser_ID = SPCXDB_DELIVERPRJ.User_ID_
WHERE Object_ID = SPCXDB_DELIVERPRJ.Object_ID_;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
-- Status = 4
END;
ELSE
BEGIN
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBObjects
SET DvrPath_ID = 0,
DvrPhase_ID = 0,
DvrUser_ID = 0
WHERE Object_ID = SPCXDB_DELIVERPRJ.Object_ID_;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
-- Status = 0
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBDeliverPaths
SET RefCount = RefCount - 1
WHERE Path_ID = SPCXDB_DELIVERPRJ.Path_ID_;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
2) get all subobjects , subprojects and documents
END;
END IF;
/* Emulating @@TRANCOUNT functionality in Oracle model */
omwb_emulation.globalPkg.trancount:=omwb_emulation.globalPkg.trancount+1;
/*[SPCONV-ERR(55)]:CREATE TABLE TT_DVROBJECTS_2-- TT_DVROBJECTS Will be used -- statement passed to ddl file*/
DELETE FROM TT_DVROBJECTS;
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
INSERT INTO TT_DVROBJECTS ; /*ERROR:Line # = 120 Column # = 28 Error Text = PL/SQL: ORA-00926: missing VALUES keyword
Line # = 120 Column # = 2 Error Text = PL/SQL: SQL Statement ignored
SQL SERVER 2000
BEGIN TRAN
CREATE TABLE #DvrObjects ( Object_ID int NOT NULL )
NSERT
#DvrObjects
EXEC
spCXDB_expandtree @Object_ID,3,1 */
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
BEGIN
/* demoDMS*/sa.spCXDB_expandtree(SPCXDB_DELIVERPRJ.Object_ID_,
tempVar1,
tempVar2,
RC1 => RC1_CALL);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
3) put documents and projects onto deliver path
NULL;/*DECLARE CURSOR ptr */
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
StoO_crowcnt := 0;
OPEN ptr;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
StoO_crowcnt := 0;
FETCH ptr INTO
SPCXDB_DELIVERPRJ.id;
EXCEPTION
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
IF ptr%NOTFOUND THEN
StoO_sqlstatus := 2;
StoO_fetchstatus := -1;
ELSE
StoO_sqlstatus := 0;
StoO_fetchstatus := 0;
END IF;
<<i_loop1>>
WHILE ( StoO_fetchstatus = 0) LOOP
BEGIN
-- IF (SELECT Status FROM CXDBObjects WHERE Object_ID = @id) = 4 AND
BEGIN
StoO_selcnt := 0;
StoO_error := 0;
StoO_rowcnt := 0;
SELECT 1 INTO StoO_selcnt
FROM DUAL
WHERE 0 <> (
SELECT DvrPhase_ID
FROM CXDBObjects
WHERE Object_ID = SPCXDB_DELIVERPRJ.id ) AND SPCXDB_DELIVERPRJ.Path_ID_
= (
SELECT DvrPath_ID
FROM CXDBObjects
WHERE Object_ID = SPCXDB_DELIVERPRJ.id );
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
IF StoO_selcnt != 0 THEN
BEGIN
BEGIN
BEGIN
StoO_selcnt := 0;
StoO_error := 0;
StoO_rowcnt := 0;
SELECT 1 INTO StoO_selcnt
FROM DUAL
WHERE 0 = (
SELECT type_
FROM CXDBObjects
WHERE Object_ID = SPCXDB_DELIVERPRJ.id );
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
IF StoO_selcnt != 0 THEN
BEGIN
-- update project data
IF SPCXDB_DELIVERPRJ.IsLastPhase_ = 0 THEN
BEGIN
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBObjects
SET DvrPath_ID = SPCXDB_DELIVERPRJ.Path_ID_,
DvrPhase_ID = SPCXDB_DELIVERPRJ.NewPhase_ID_,
DvrUser_ID = SPCXDB_DELIVERPRJ.User_ID_
WHERE Object_ID = SPCXDB_DELIVERPRJ.id;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
-- Status = 4
END;
ELSE
BEGIN
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBObjects
SET DvrPath_ID = 0,
DvrPhase_ID = 0,
DvrUser_ID = 0
WHERE Object_ID = SPCXDB_DELIVERPRJ.id;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
-- Status = 0
--decrease path reference counter
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
UPDATE sa.CXDBDeliverPaths
SET RefCount = RefCount - 1
WHERE Path_ID = SPCXDB_DELIVERPRJ.Path_ID_;
StoO_rowcnt := SQL%ROWCOUNT;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
END;
END IF;
END;
ELSE
BEGIN
BEGIN
dummy_var1 := /* demoDMS*/sa.spCXDB_deliverdocument(SPCXDB_DELIVERPRJ.CurrUser_ID_,
SPCXDB_DELIVERPRJ.id,
SPCXDB_DELIVERPRJ.Path_ID_,
SPCXDB_DELIVERPRJ.IsLastPhase_,
SPCXDB_DELIVERPRJ.NewPhase_ID_,
SPCXDB_DELIVERPRJ.User_ID_,
SPCXDB_DELIVERPRJ.Comment__);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
END;
END IF;
END;
END;
END IF;
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
StoO_crowcnt := 0;
FETCH ptr INTO
SPCXDB_DELIVERPRJ.id;
EXCEPTION
WHEN OTHERS THEN
StoO_rowcnt := 0;
StoO_selcnt := 0;
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
IF ptr%NOTFOUND THEN
StoO_sqlstatus := 2;
StoO_fetchstatus := -1;
ELSE
StoO_sqlstatus := 0;
StoO_fetchstatus := 0;
END IF;
END;
END LOOP;
BEGIN
StoO_error := 0;
StoO_rowcnt := 0;
CLOSE ptr;
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
WHEN OTHERS THEN
StoO_error := SQLCODE;
StoO_errmsg := SQLERRM;
raise_application_error(SQLCODE, SQLERRM,true);
END;
NULL;
/* Emulating @@TRANCOUNT functionality in Oracle model */
IF omwb_emulation.globalPkg.trancount = 1 THEN
COMMIT WORK;
END IF;
IF omwb_emulation.globalPkg.trancount > 0 THEN
omwb_emulation.globalPkg.trancount:=omwb_emulation.globalPkg.trancount-1;
END IF;
RETURN (0);
END SPCXDB_DELIVERPRJ;
Thank'sHi Hilary,
This is the original T-SQL code. Please, help me.
CREATE PROCEDURE spCXDB_deliverPrj
@CurrUser_ID int, -- currently logged user id
@Object_ID int,
@Path_ID int,
@IsLastPhase tinyint,
@NewPhase_ID int,
@User_ID int,
@Comment varchar(255) = NULL
AS
SET XACT_ABORT ON
1) update project
IF @IsLastPhase = 0
BEGIN
UPDATE
CXDBObjects
SET
DvrPath_ID = @Path_ID,
DvrPhase_ID = @NewPhase_ID,
DvrUser_ID = @User_ID
-- Status = 4
WHERE
Object_ID = @Object_ID
END
ELSE
BEGIN
UPDATE
CXDBObjects
SET
DvrPath_ID = 0,
DvrPhase_ID = 0,
DvrUser_ID = 0
-- Status = 0
WHERE
Object_ID = @Object_ID
UPDATE
CXDBDeliverPaths
SET
RefCount = RefCount - 1
WHERE
Path_ID = @Path_ID
END
2) get all subobjects , subprojects and documents
BEGIN TRAN
CREATE TABLE #DvrObjects ( Object_ID int NOT NULL )
INSERT
#DvrObjects
EXEC
spCXDB_expandtree @Object_ID,3,1
3) put documents and projects onto deliver path
DECLARE @id int
DECLARE ptr CURSOR FOR SELECT Object_ID FROM #dvrobjects
OPEN ptr
FETCH NEXT FROM ptr INTO @id
WHILE(@@FETCH_STATUS = 0)
BEGIN
-- IF (SELECT Status FROM CXDBObjects WHERE Object_ID = @id) = 4 AND
IF (SELECT DvrPhase_ID FROM CXDBObjects WHERE Object_ID = @id) <> 0 AND
(SELECT DvrPath_ID FROM CXDBObjects WHERE Object_ID = @id) = @Path_ID
BEGIN
IF (SELECT type FROM CXDBObjects WHERE Object_ID = @id) = 0
BEGIN
-- update project data
IF @IsLastPhase = 0
BEGIN
UPDATE
CXDBObjects
SET
DvrPath_ID = @Path_ID,
DvrPhase_ID = @NewPhase_ID,
DvrUser_ID = @User_ID
-- Status = 4
WHERE
Object_ID = @id
END
ELSE
BEGIN
UPDATE
CXDBObjects
SET
DvrPath_ID = 0,
DvrPhase_ID = 0,
DvrUser_ID = 0
-- Status = 0
WHERE
Object_ID = @id
--decrease path reference counter
UPDATE
CXDBDeliverPaths
SET
RefCount = RefCount - 1
WHERE
Path_ID = @Path_ID
END
END
ELSE
BEGIN
EXEC spCXDB_deliverdocument @CurrUser_ID, @id,@Path_ID,@IsLastPhase,@NewPhase_ID,@User_ID, @Comment
END
END
FETCH NEXT FROM ptr INTO @id
END
CLOSE ptr
DEALLOCATE ptr
COMMIT TRAN
RETURN(0)
Regards,
Emilia. -
Error converting SQL Server text field to Oracle CLOB
I am trying to convert an SQL Server DB to Oracle DB using DB link. The issue I am facing is one of the SQL Server table contains text field and we are trying to convert the text field to CLOB.
The error I am getting is "SQL Error: ORA-00997: illegal use of LONG datatype"
The statement is something like this.
Insert into oracle_table
Select col_1,col_2,col_3,col_4,col_5 from sql_table@sqldblink;
Please help.Hi,
This is a known restriction involving long columns -
(1) LONG datatype not supported with use of DBLINK when insert or update involves a select statement
(2) LONG datatype cannot be used in a WHERE clause, in INSERT into ... SELECT ... FROM
constructs, and in snapshots.
The workround is to use a PL/SQL procedure or try the SQLPLUS COPY command.
If you have access to My Oracle Support then review these notes -
Cannot Move A Long From non Oracle database Ora-00997: Illegal Use Of Long Datatype (Doc ID 1246594.1)
How To Workaround Error: Ora-00997: Illegal Use Of Long Datatype (Doc ID 361716.1)
Regards,
Mike -
Find the full sql text of the currently executing query
Hi,
I wish to find the full sql text of currently executing sql.
Tried through v$sql and v sqltext_with_newlines but it doesn't give the full sql.
We do not want to enable trace to get sql query.
How to get this ?
Thanks.Hye,
I got my answer on the below link,
Getting data from sql_fulltext
Thanks. -
Hi, unable to display full text on selection screen
hi all
please any one tell me how one can display full text on selection screen because whatevery i have defined in text for selection screen variable is not displaying full text, some letters are missing.
for example :
Poste(s) du document de facturation
above text i want to display on selection screen.
but only Poste(s) du document de factur
is displying. some letters are missing
please try to solve this
thanking in advanceHi Raj,
Check this..
SELECTION-SCREEN COMMENT fmt name.
Additions
1. ... FOR TABLE dbtab
2. ... FOR FIELD f
3. ... MODIF ID mod
4. ... ID id
Effect
Generates a comment on the selection screen. For the name name , there are two options:
name takes the form TEXT-xxx where xxx is a three-character name for a text symbol. In this case, the contents of the text symbol are displayed at runtime, i.e. the text cannot be changed dynamically. name is another eight-character name. Here, you create a field with the name name in the length specified in the format fmt< /> and it is then generated as an output field on the selection screen. The contents of these comments must therefore be set at runtime (e.g. at INITIALIZATION or - in the case of comments in the database include program DBldbSEL - in the routine INIT of the database program SAPDBldb . They can also be changed when the selection screen is being processed.
Note
The field name is generated automatically and so cannot be defined with DATA .
With comments, you must always specify a format fmt (see variant ULINE ).
Note
You must program a new line yourself via the format fmt .
<b>Example
SELECTION-SCREEN BEGIN OF LINE.
SELECTION-SCREEN COMMENT 10(20) TEXT-001
FOR FIELD PARM.
SELECTION-SCREEN POSITION POS_LOW.
PARAMETERS PARM LIKE SAPLANE-PLANETYPE.
SELECTION-SCREEN END OF LINE.
This code displays a 20-byte long comment followed by the parameter at the normal position ( POS_LOW ) on the same line. If the user presses F1 for both objects, the documentation of SAPLANE-PLANETYPE is displayed.</b>
Regards,
Raj
Maybe you are looking for
-
Runtime error while putting negative value in to table control field
Hi Guys, I am working on a Table Control which has Currency and quantity fields.In PBO when the program is trying put a negative value then It is going into a runtime error. The Error description is, Runtime errors DYNPRO_FIELD_
-
ITunes for Windows 7 64 Bit. Download is where?
Having been forced to a 64Bit Windows 7 PC I have to install iTunes on that. The Apple download site detects the Windows 64 Bit OS and offers the iTunes software for it but it does not down load it. Any ideas?
-
Can a BC4J-JSP App live within a Portlet
I've read the posts AND the docs AND still do not have a clear idea if a BC4J-JSP application can live within Portal. I DO NOT WANT to click on a link from Portal and open a * NEW * window, I want the BC4J App to be contained within the Portal. Can a
-
Link Location and Ok does not work under Link Properties in E-mail
Cannot Paste URL address in Link Location under Link Properties, states No Names anchors or headings in this page. and OK does work. Thanks.
-
All of a sudden when take a pic get message "file system out of resources". When I try to review current pics just shows me generic thumbnails??