Error At Substr
I have a table called "*TEST_CLOB*" which contains three fields.......id,filename and txt_file......
from which "txt_file" field contains a file in CLOB datatype with the following data in each line
*243890##28-3-2011#185#RKP#02#TYPE B, R.K. PURAM, Block/Sector : XII, 904, DELHI#Shri. S. K. NAGI#Asstt. Director of Estates##*
I write the following code to read this field into another table ... and error is coming.....
insert into sample_int (F1,F2,F3,F4,F5,F6,F7,F8,F9,F10 )
*( select F1,F2,F3,F4,F5,F6,F7,F8,F9,F10*
from
with t as
select cast(dbms_lob.substr(txt_file,dbms_lob.getlength(txt_file),1) as varchar(4000)) txt_file
from test_clob
select dbms_lob.substr
*(t.txt_file, dbms_lob.instr(t.txt_file, '#', 1,1)-1, 1) as F1*
*,substr(t.txt_file, instr(t.txt_file, '#')+1, (instr(t.txt_file, '#',1, 2) - instr(t.txt_file, '#'))-1 ) as F2*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 2)+1, (instr(t.txt_file, '#',1, 3) - instr(t.txt_file, '#',1, 2))-1 ) as F3*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 3)+1, (instr(t.txt_file, '#',1, 4) - instr(t.txt_file, '#',1, 3))-1 ) as F4*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 4)+1, (instr(t.txt_file, '#',1, 5) - instr(t.txt_file, '#',1, 4))-1 ) as F5*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 5)+1, (instr(t.txt_file, '#',1, 6) - instr(t.txt_file, '#',1, 5))-1 ) as F6*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 6)+1, (instr(t.txt_file, '#',1, 7) - instr(t.txt_file, '#',1, 6))-1 ) as F7*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 7)+1, (instr(t.txt_file, '#',1, 8) - instr(t.txt_file, '#',1, 7))-1 ) as F8*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 8)+1, (instr(t.txt_file, '#',1, 9) - instr(t.txt_file, '#',1, 8))-1 ) as F9*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 9)+1, (length(t.txt_file) - instr(t.txt_file, '#',1, 10))-1 ) as F10*
from test_clob t
Error at Command Line:1 Column:12
Error report:
SQL Error: ORA-32035: unreferenced query name defined in WITH clause
32035. 00000 - "unreferenced query name defined in WITH clause"
*Cause: There is at least one WITH clause query name that is not
referenced in any place.
*Action: remove the unreferenced query name and retry
How can we remove this above error........what's wrong with this code.???
I almost done all the things.... But now the new problem is here.............
this is the actual pl/sql code, which I have written and the error is coming in this code.....
insert into sample1_int (F1,F2,F3,F4,F5,F6,F7,F8,F9,F10 )
*( select F1,F2,F3,F4,F5,F6,F7,F8,F9,F10*
from
with t as
select cast(dbms_lob.substr(txt_file,dbms_lob.getlength(txt_file),1) as varchar(4000)) txt_file
from test_clob
select dbms_lob.substr
*(t.txt_file, dbms_lob.instr(t.txt_file, '#', 1,1)-1, 1) as F1*
*,substr(t.txt_file, instr(t.txt_file, '#')+1, (instr(t.txt_file, '#',1, 2) - instr(t.txt_file, '#'))-1 ) as F2*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 2)+1, (instr(t.txt_file, '#',1, 3) - instr(t.txt_file, '#',1, 2))-1 ) as F3*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 3)+1, (instr(t.txt_file, '#',1, 4) - instr(t.txt_file, '#',1, 3))-1 ) as F4*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 4)+1, (instr(t.txt_file, '#',1, 5) - instr(t.txt_file, '#',1, 4))-1 ) as F5*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 5)+1, (instr(t.txt_file, '#',1, 6) - instr(t.txt_file, '#',1, 5))-1 ) as F6*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 6)+1, (instr(t.txt_file, '#',1, 7) - instr(t.txt_file, '#',1, 6))-1 ) as F7*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 7)+1, (instr(t.txt_file, '#',1, 8) - instr(t.txt_file, '#',1, 7))-1 ) as F8*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 8)+1, (instr(t.txt_file, '#',1, 9) - instr(t.txt_file, '#',1, 8))-1 ) as F9*
*,substr(t.txt_file, instr(t.txt_file, '#',1, 9)+1, (length(t.txt_file) - instr(t.txt_file, '#',1, 10))-1 ) as F10*
from t
Error report:
SQL Error: ORA-06502: PL/SQL: numeric or value error: character string buffer too small
ORA-06512: at line 1
*06502. 00000 - "PL/SQL: numeric or value error%s"*
**Cause:*
**Action:*
Similar Messages
-
Hi GURUS,
I m new to oracle here i created a table in oracle 10g(10.1.0.2.0) named
create table iv_master(
iv_code varchar2(6) not null,
iv_name varchar2(50) not null,
created_at varchar2(15) default substr(sys_context('userenv','ip_address'),1,20),
created_on date default sysdate,
created_by varchar2(5) not null,
modified_at varchar2(15) default substr(sys_context('userenv','ip_address'),1,20),
modified_on date default sysdate,
modified_by varchar2(5) not null,
constraint iv_master_pk primary key(iv_code))
Now i want to remove this 'default' keyword in created_at & modified_at fields
i tried alter table command but it is not working.tell me the way to remove this default keyword and also in created_on ,modified_on..(without dropping the table)
i tried the following statement,
create table test (ipaddr varchar2(20) SUBSTR(SYS_CONTEXT('USERENV','IP_ADDRESS')1,20));
but i m getting.this following error
ERROR at line 1:
ORA-00922: missing or invalid option
pls tell me where i m wrong...and also tell me the query to do it...
Advance thanks for all...Hi,
bharathit wrote:
Hi GURUS,
I m new to oracle here i created a table in oracle 10g(10.1.0.2.0) named
create table iv_master(
iv_code varchar2(6) not null,
iv_name varchar2(50) not null,
created_at varchar2(15) default substr(sys_context('userenv','ip_address'),1,20),
created_on date default sysdate,
created_by varchar2(5) not null,
modified_at varchar2(15) default substr(sys_context('userenv','ip_address'),1,20),
modified_on date default sysdate,
modified_by varchar2(5) not null,
constraint iv_master_pk primary key(iv_code))
Now i want to remove this 'default' keyword in created_at & modified_at fieldsYou can't have the default functionality without the "DEFAULT" keyword.
Are you saying that you no longer want a default value? That's the same as saying DEFAULT NULL, and you can change the table like this:
ALTER TABLE iv_master
MODIFY ( created_at DEFAULT NULL
, modified_at DEFAULT NULL
);Edited by: Frank Kulash on Feb 17, 2010 12:59 PM
Changed ALTER TABLE example to modify both columns. -
Hi,
I have the below code for one of the fields placed in different xml tags and I need to limit the number of characters on REPORTING_NAME to 20. Do I need to limit in the first expression or the 2nd.
I tried using substring(./REPORTING_NAME,1,20) within the already existing concat() function but it throws an error while checking the preview. I tried adding xdoxslt before substring but didn't work. Also, I tried doing the same in the 2nd TAG but still the same. Can anyone help?
TAG 1:
<?for-each-group:AC_EARNINGS;xdoxslt:ifelse(substring(./JURISDICTION_CODE,1,2)='05',concat(./REPORTING_NAME,ORIGINAL_DATE_EARNED,RATE_MUL),concat(REPORTING_NAME,RATE_MUL)) ?><?sort:PROCESSING_PRIORITY;'ascending';data-type='number'?><?sort:ELEMENT_TYPE_ID;'ascending';data-type='number'?><?sort:ORIGINAL_DATE_EARNED;'ascending'?>
TAG 2:
<? if: position() <=19?><?if: sum(current-group()/CURRENT_HOURS[./text()!=''] )!= 0 or sum(current-group()/CURRENT_AMOUNT[./text()!='']) != 0 or sum(current-group()/YTD_AMOUNT[./text()!='']) != 0?><?current-group()/REPORTING_NAME?>
Thanks!i misunderstood
what is and where is errors ????
in
substring(./REPORTING_NAME,1,20) or
>
TAG 1:
<?for-each-group:AC_EARNINGS;xdoxslt:ifelse(substring(./JURISDICTION_CODE,1,2)='05',concat(./REPORTING_NAME,ORIGINAL_DATE_EARNED,RATE_MUL),concat(REPORTING_NAME,RATE_MUL)) ?><?sort:PROCESSING_PRIORITY;'ascending';data-type='number'?><?sort:ELEMENT_TYPE_ID;'ascending';data-type='number'?><?sort:ORIGINAL_DATE_EARNED;'ascending'?>
>
or
>
TAG 2:
<? if: position() <=19?><?if: sum(current-group()/CURRENT_HOURS[./text()!=''] )!= 0 or sum(current-group()/CURRENT_AMOUNT[./text()!='']) != 0 or sum(current-group()/YTD_AMOUNT[./text()!='']) != 0?><?current-group()/REPORTING_NAME?>
>
plz see example of using substring and format_date
Re: Date format in Excel report output
post sample xml for test -
Returning Error Code in Fault Response Message
Hi There,
Here is the background:
We are using Security Interceptor component of BPEL PM for handling security procedures. We have extended the default ACLManager and provided the custom access control checks. The method overridden in the custom sub-class is isAllowedYoExecuteProcess (Signature: public boolean isAllowedToExecuteProcess(BPELProcessId processID, NormalizedMessage normalizedMessage) throws ServerException). This method throws ServerException, whenever there are any errors. ServerException allows to create the error message and error code in its constructor (Signature: public ServerException(java.lang.String message, int errorCode)).
The issue:
We have set the error code and error message and thrown the new ServerException. However when the SoapFault is consumed by a SoapClient (or BPEL console dashboard), we see the fault String like this:
Error while invoking inbound message handler.
An error has occurred while attempting to invoke the inbound message handler class "class com.collaxa.cube.security.Authenticator" for the message "". The exception reported was: Could not apply security [Sample Exception to test SOAP Fault]
The String within the square bracket is what we had in ServerException. However I do not see the error code what I also had in ServerException. Please help me, how the error code needs to be set, so that the same can be retrieved by the Soap Client. Also, is there any way, I can just get the error message what I set (not the above jumbled one)
Thanks & regards,
KrishnaThis is "intended" - as we are just called by the engine, and every failure there is wrapped w/o the error code. I would recommend to store the error nr with the message .. and parse that ..
litterally it's String error = message.substring(message.indexOf("Could not apply security ["),message.lastIndexOf("]")))
hth clemens -
Hi,
I recently installed JDeveloper and Oracle Express Edition. To set up SQL*Plus I went into Tools->Preferences->Database Connections and pointed the SQL*Plus executable to
C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe
which is part of the Oracle Express Edition. When I try to run an SQL query from JDeveloper I get the following error:
The target sqlplus.exe cannot be started because it is not a runnable target.
Double clicking on the file successfully runs sql*plus. Any ideas?
Thanks
CassonOK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Error with User Type when publish a PL/SQL Web Service in JDeveloper
Hi,
I am using Jdeveloper 10.1.2.1 , have a PL/SQL package with these predefined types (types definition not include inside package);
type reg_perfil as object (perfil varchar2(30), status varchar2(30))
type tab_perfiles as table of reg_perfil
type res_error as object (cerror number(1), cerror_ora varchar2(12), terror varchar2(50));
type res_perfiles as object (error res_error, perfiles tab_perfiles)
then I have a function:
FUNCTION ff_perfiles(...) RETURN res_perfiles;
When I publish from JDeveloper this package I get all the .java and sqlj files, but one of them is empty (TabperfilesUser.java) and of course compilation fails because it is looking for referenced class "TabPerfilesUser" that not exists!
I know this is because is trying to map tab_perfiles type but there is some error.
I realized that if I change the code of all files and replace "TabPerfilesUser" for "TabPerfilesBase" (this file and class was generated correctly) .... it works!!!, but of course I have to find another way to fixe it without changing generated code! (you know future maintenance).
Is this a bug??? what could I do? ... by the way this happens also with JDveloper 10.1.3
thanks...OK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Hi,
When I publish a PL/SQL package as a web service in J2EE 1.4 (Jax-RPC) Web Service version get this error:
oracle.j2ee.ws.common.tools.api.ValidationException: Error in database webservices assembly
at oracle.j2ee.ws.tools.wsa.db.WSADBPlugin.processDBEndpoint(WSADBPlugin.java:329)
at oracle.j2ee.ws.tools.wsa.Util.processDBEndpoint(Util.java:887)
at oracle.jdeveloper.webservices.model.plsql.PLSQLGenerator.preparePLSQLPortTypes(PLSQLGenerator.java:734)
at oracle.jdeveloper.webservices.model.plsql.PLSQLGenerator.doGeneration(PLSQLGenerator.java:233)
at oracle.jdeveloper.webservices.model.Generator.generateImpl(Generator.java:447)
at oracle.jdeveloper.webservices.model.Generator.generate(Generator.java:295)
at oracle.jdeveloper.webservices.model.WebService.saveEditImpl(WebService.java:3971)
at oracle.jdeveloper.webservices.model.WebService.mav$saveEditImpl(WebService.java)
at oracle.jdeveloper.webservices.model.WebService$1.run(WebService.java:3817)
at oracle.jdeveloper.webservices.model.GeneratorUI$GeneratorAction.run(GeneratorUI.java:446)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
at java.lang.Thread.run(Thread.java:595)
GRAVE: JPublisher error: please check assembler settings, database connection and database schema. Use debug=true for details.
and when use J2EE 1.3 (Oracle) version WEb Service get this error:
java.lang.NullPointerException
at oracle.jdevimpl.webservices.generator.WrapperClassGenerator.generate(WrapperClassGenerator.java:262)
at oracle.jdevimpl.webservices.generator.SPWebServiceGenerator$1.run(SPWebServiceGenerator.java:285)
at oracle.ide.dialogs.ProgressBar.run(ProgressBar.java:551)
at java.lang.Thread.run(Thread.java:595)
..... Is this a BUG????
please help!OK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Urgent : Error while creating PL/SQL web service in JDeveloper 11R2
Hi,
I am new to web services and I have a requirement to create web services in PL/SQL. I installed JDeveloper 11R2 in my machine and connected it to my local schema.
My database is Oracle 10g.
I am able to see my package in JDeveloper. But when I try to "Publish as JAX-RPC web service..."I am getting the following error:
oracle.jdeveloper.webservices.tools.WsdlValidationException: oracle.j2ee.ws.common.tools.api.ValidationException: Error in database webservices assembly
Error in database webservices assembly
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.newWsdlValidationException(WsaAdaptor.java:1126)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.processDbEndpoint(WsaAdaptor.java:609)
at oracle.jdeveloper.webservices.tools.WebServiceTools.processDbEndpoint(WebServiceTools.java:689)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.jdeveloper.webservices.tools.WebServiceTools$1.invoke(WebServiceTools.java:132)
at $Proxy28.processDbEndpoint(Unknown Source)
at oracle.jdeveloper.webservices.model.plsql.generator.PlsqlConfigureGenerator.createPortTypes(PlsqlConfigureGenerator.java:293)
at oracle.jdeveloper.webservices.model.generator.ConfigureServiceGenerator.action(ConfigureServiceGenerator.java:66)
at oracle.jdeveloper.webservices.model.plsql.generator.PlsqlConfigureGenerator.action(PlsqlConfigureGenerator.java:105)
at oracle.jdeveloper.webservices.model.generator.GeneratorAction.run(GeneratorAction.java:142)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
Caused by: oracle.j2ee.ws.common.tools.api.ValidationException: Error in database webservices assembly
at oracle.j2ee.ws.tools.wsa.db.WSADBPlugin.processDBEndpoint(WSADBPlugin.java:207)
at oracle.j2ee.ws.tools.wsa.Util.processDBEndpoint(Util.java:1221)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at oracle.jdevimpl.webservices.util.Debug.invoke(Debug.java:343)
at oracle.jdevimpl.webservices.tools.wsa.Assembler$2$1.invoke(Assembler.java:217)
at $Proxy29.processDBEndpoint(Unknown Source)
at oracle.jdevimpl.webservices.tools.wsa.WsaAdaptor.processDbEndpoint(WsaAdaptor.java:598)
... 14 more.
When I searched in google I came across solutions like "The error is caused by missing SYS.SQLJUTL definition in XE. " But my database is not XE and one more thing I noticed is there is no start_oc4j.bat file in the JDeveloper home.
I would appreciate if anybody can throw some light on the issue.
Regards,
BJOK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Column Formula with Error in OBIEE 11g
Hello,
On Oracle Business Intelligence Enterprise Edition 11g, I am trying to create an analysis. The database is MySQL. In the database, there is a field of type varchar(10). This
field shows a date. In OBIEE 11g, when creating the analysis, in the Criteria tab, I choose this column (varchar) and edit the formula of it. The operation that I want to do is:
YEAR(CURRENT_DATE) - SUBSTRING("TableName"."ColumnName" FROM 1 FOR 4) where the ColumnName is the name of the column of type varchar(10)
but I get an error: +[nQSError: 10058] A general error has occurred. [nQSError: 43113] Message returned from OBIS. [nQSError: 27002] Near <->: Syntax error [nQSError: 26012]+
If I execute the same query directly on the MySQL database, I get the desired result without any error.
Also, if I use the following formula, I also get an error:
CAST((SUBSTRING("TableName"."ColumnName" FROM 1 FOR 4)) AS INTEGER)
So, I am asking why the first query throws an error in OBIEE 11g but not when it runs directly on the MySQL database. Also, how can I convert in OBIEE 11g a string to integer?
Thank you in advance,
GriseldaBusiness Intelligence Foundation wrote:
Hi
Im getting below error in Bi11g. core application services is down.
Error:
[nQSError: 46066] Operation cancelled.
[nQSError: 46067] Queue has been shut down. No more operations will be accepted.
If anyone Know tell me.
Thanks and Regards
sathyaHi sathya,
It could mean several different things. Do you know if the administrator have shut down the services? If you have access to the server, check to see if all the services are up and running.
Thanks,
-Amith. -
Error when publishing a PL/SQL package as a Webservice
Hi all,
I am using the JDeveloper (10.1.3.1.0) to publish a PL/SQL package as a Webservice, and I am having some troubles on the generation process.
The problem that I am facing is on the generated code for the database side, where some methods have a “$GET_” at the end of its name.
This “$GET_” is handled by the database as a special word, and the package can’t be compiled.
If the ‘$’ character is removed from all the methods, the package can be compiled and the Webservice works fine.
What’s wrong? Is there a bug on the generation process of the JDeveloper?
Regards,
Rui TorresOK, This is the PL/SQL package:
Function:
FUNCTION Obtener_paises RETURN res_webservice AS
v_respuesta res_webservice;
i PLS_INTEGER:=1;
CURSOR C_paises IS
SELECT cpais, tpais
FROM paises
ORDER BY tpais;
BEGIN
v_respuesta := res_webservice(null,null);
v_respuesta.error := res_error(null,null,null);
v_respuesta.error.cerror := 0;
v_respuesta.error.cerror_ora := 0;
v_respuesta.error.terror := null;
v_respuesta.datos := res_datos ();
FOR v_pais IN C_paises LOOP
v_respuesta.datos.extend;
v_respuesta.datos(i) := reg_datos(null,null);
v_respuesta.datos(i).codigo := v_pais.cpais;
v_respuesta.datos(i).descripcion := v_pais.tpais;
i := i + 1;
END LOOP;
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:0');
RETURN v_respuesta;
EXCEPTION
WHEN OTHERS THEN
v_respuesta.error.cerror := 1;
v_respuesta.error.cerror_ora := SQLCODE;
v_respuesta.error.terror := substr(SQLERRM,1,80);
Insertar_log(NULL,SYSDATE,'C','Obtener_paises',NULL,'ERROR:1 '||substr(SQLERRM,1,120));
RETURN v_respuesta;
END Obtener_paises;
TYPES USED:
CREATE OR REPLACE
TYPE res_webservice AS OBJECT (error res_error, datos res_datos);
CREATE OR REPLACE
TYPE res_error AS OBJECT (cerror NUMBER(1), cerror_ora VARCHAR2(12), terror VARCHAR2(80));
CREATE OR REPLACE
TYPE res_datos AS TABLE OF reg_datos;
CREATE OR REPLACE
TYPE reg_datos AS OBJECT(codigo VARCHAR2(12), descripcion VARCHAR2(150));
Thanks in advanced...
Could happen this bacause of these defined types??? -
Hi, I've to insert/update records in pretty large table, and require an efficient way to do this. The majority of actions will be inserts, although there will be updates. How can I trap an insert constraint error and then do an update instead. Also, is this the most efficient way to do this??
C.You can do something like this:
sql >> CREATE TABLE tbl_numbers
2 (
3 num number ,
4 description varchar2(20) ,
5 error varchar2(3) default 'NO'
6 )
7 tablespace index_4m
8 /
Table created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 1 , 'One' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 2 , 'Two' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 3 , 'Three' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 4 , 'Four' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 5 , 'Five' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 6 , 'Six' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 7 , 'Seven' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 8 , 'Eight' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 9 , 'Nine' )
4 /
1 row created.
sql >> insert into tbl_numbers
2 ( num , description )
3 values ( 10 , 'Ten' )
4 /
1 row created.
sql >> commit
2 /
Commit complete.
PROCEDURE PR_INSERT_UPDATE
IS
TYPE array_n IS TABLE OF NUMBER ;
TYPE array_v IS TABLE OF VARCHAR2(20) ;
t_num array_n ;
t_description array_v ;
e_ForallError EXCEPTION ;
PRAGMA EXCEPTION_INIT ( e_ForallError , -24381 ) ;
CURSOR cur IS
SELECT num , description
FROM tbl_numbers ;
BEGIN
OPEN cur ;
LOOP
FETCH cur BULK COLLECT INTO t_num , t_description LIMIT 100 ;
BEGIN
FORALL i IN t_num.FIRST .. t_num.LAST SAVE EXCEPTIONS
INSERT INTO tbl_numbers
( num , description )
VALUES ( t_num(i) , t_description(i)||'----------------' ) ;
COMMIT ;
EXCEPTION
WHEN e_ForallError THEN
t_num.DELETE ;
FOR i IN 1 .. SQL%BULK_EXCEPTIONS.COUNT LOOP
t_num.EXTEND ;
t_num(t_num.COUNT) := SQL%BULK_EXCEPTIONS(i).ERROR_INDEX ;
END LOOP ;
FORALL i IN 1 .. t_num.COUNT
UPDATE tbl_numbers
SET error = 'YES'
WHERE num = t_num(i) ;
COMMIT ;
END ;
EXIT WHEN cur%NOTFOUND ;
END LOOP ;
EXCEPTION
WHEN OTHERS THEN
dbms_output.put_line('Error Code: '||SQLCODE) ;
dbms_output.put_line('Error Desc: '||SUBSTR(SQLERRM,1,200)) ;
RAISE ;
END PR_INSERT_UPDATE ;
sql >> select * from tbl_numbers;
NUM DESCRIPTION ERR
1 One NO
2 Two NO
3 Three NO
4 Four NO
5 Five NO
6 Six NO
7 Seven NO
8 Eight NO
9 Nine NO
10 Ten NO
10 rows selected.
sql >> exec PR_INSERT_UPDATE
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.00
sql >> select * from tbl_numbers;
NUM DESCRIPTION ERR
1 One NO
2 Two NO
3 Three YES
4 Four NO
5 Five NO
6 Six NO
7 Seven YES
8 Eight YES
9 Nine NO
10 Ten NO
1 One---------------- NO
2 Two---------------- NO
4 Four---------------- NO
5 Five---------------- NO
6 Six---------------- NO
9 Nine---------------- NO
10 Ten---------------- NO
17 rows selected. -
ORA-29278: SMTP transient error - Need Help
I am getting below error from my code block though i am not calling UTL_SMTP package.
It is confusing to me and I am not getting how to debug this.
Please help me.
My Orable DB Version - Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
Error Message
ERROR: -29278 ORA-29278: SMTP transient error: 421 Service not
available
ORA-06512: at "SYS.UTL_SMTP", line 20
ORA-06512: at "SYS.UTL_SMTP",
line 96
ORA-06512: at "SYS.UTL_SMTP", line 138
ORA-06512: at "W_ADM_DW.DW
PL/SQL procedure successfully completed.
{code}
*Pseudo-code of my code block*
{code}
VARIABLE Ret number
set serveroutput on size 20000
show serveroutput
DECLARE
--Local variable declaration
BEGIN
select count(*)
into v_count
from <Table_Name>
where <Column_Name>=<YYYYMM>;
if v_count > 0 then
SELECT PARTITION_NAME
INTO v_partition_name
FROM ALL_TAB_PARTITIONS
WHERE TABLE_NAME='<Table_Name>'
AND INSTR(PARTITION_NAME,<YYYYMM>,1,1)<>0;
v_sql := utl_particion.truncate_partition('&3','<Table_Name>', v_partition_name);
if v_sql!=0 then
raise_application_error(-20088,'Error in Truncate partition');
:Ret := 2;
end if;
commit;
end if;
v_sql:='alter session enable resumable timeout 72000 name ''<Table_Name>''';
execute immediate v_sql;
v_sql := ' INSERT /*+ APPEND*/ INTO '<Table_Name>'';
v_sql := v_sql || ' ( <column_name1>, ';
v_sql := v_sql || ' <column_name2>, ';
v_sql := v_sql || ' <column_name3>, ';
v_sql := v_sql || ' <column_name4>, ';
v_sql := v_sql || ' ) ';
v_sql := v_sql || ' SELECT /*+ PARALLEL(<Source_Table_Name>,6)*/';
v_sql := v_sql || ' <column_name1>, ';
v_sql := v_sql || ' <column_name2>, ';
v_sql := v_sql || ' <column_name3>, ';
v_sql := v_sql || ' <column_name4>, ';
v_sql := v_sql || ' FROM <Source_Table_Name> WHERE <column_name> BETWEEN ' || v_frm_date || ' AND ' || v_to_date;
execute immediate v_sql;
v_total:=SQL%ROWCOUNT;
commit;
EXCEPTION
WHEN OTHERS THEN
ROLLBACK;
dbms_output.put_line ('ERROR: '|| SQLCODE || ' ' || substr(SQLERRM,1,200));
:Ret := 2;
END;
{code}Thanks for identifying utl_particionpackage. I tried to check the code of this package, but it has wrapped, so i cannot see the code.
But one thing i have observed - If utl_particion.truncate_partition internally calling UTL_SMTP package and I am getting error from this package then this will catch by below code -
v_sql := utl_particion.truncate_partition('&3','<Table_Name>', v_partition_name);
if v_sql!=0 then
raise_application_error(-20088,'Error in Truncate partition');
:Ret := 2;
end if;and after that it will catch by user define error exception block (This i did not mention in my earlier post)
WHEN excepcion_ctrl THEN
dbms_output.put_line (WRN: '|| substr(SQLERRM,4,200));
:Ret:=0;But it has catch by when others exception -
I think inside utl_particion.truncate_partition procedure has proper exception handling. So when some error will occur it will return '0'. If there is no proper exception handling then we can assume the error will propagate to When Others Exception block.
Please tell me my understanding is correct or not. -
Quick question- substr...
I have the following code:
<%
java.util.Enumeration headerNames = request.getHeaderNames();
String accLang = request.getHeader("Accept-Language");
out.println(accLang.substr(0,4));
%>
and I am getting and error: Method substr(int, int) not found in class java.lang.String. If I don't do the substr then it works fine so I am getting the variable. Is the syntax wrong, all I want to do is print the first four characters of accLang?
Thanks.please look for the api documentation for the exact signature. The function is substring not substr
-
Not getting all of the results from ALL_OBJECTS in Procedure
I created the following procedure under a DBA account. The procedure selects info from ALL_OBJECTS. When I execute the procedure under this same DBA account, It does not return objects of all owners; only owners like SYSTEM, SYS, PUBLIC, and the DBA account itself.
But if I run the same code anonymously in SQLplus, under the same DBA account, I get objects of all the other owners that I also have access to.
What do I need to do in order to have the procedure return objects of all the other owners?
Here's the procedure:
CREATE OR REPLACE procedure xxx
IS
CURSOR C1 IS
select distinct owner
from all_objects
order by owner;
OwnName VARCHAR2(30);
BEGIN
OPEN C1;
LOOP
fetch c1 into OwnName;
EXIT WHEN C1%NOTFOUND;
dbms_output.put_line ('Owner ' || OwnName);
END LOOP;
dbms_output.put_line ('Procedure xxx Ended');
CLOSE C1;
EXCEPTION
WHEN OTHERS THEN
IF C1%ISOPEN THEN CLOSE C1; END IF;
DBMS_OUTPUT.PUT_LINE (CHR(0));
DBMS_OUTPUT.PUT_LINE ('OwnName: '||OwnName);
DBMS_OUTPUT.PUT_LINE ('SQL Code: '||TO_CHAR(SQLCode));
DBMS_OUTPUT.PUT_LINE ('Error Message: '||SUBSTR(SQLERRM, 1, 200));
END;
Thank you.When you execute the code from within a procedure, instead of within an anonymous pl/sql block, it only applies the privileges that have been granted directly and does not apply any of the privileges that have been granted through roles. If you "set role none", then execute your anonymous pl/sql block, you will see the same limited result set that you are getting from the procedure.
-
EFT Payment Program. Writing to a flat file using UTL Package
Hi guys
I wonder if someone can help me. I'm battling with something in pl/sql. I have a procedure that writes to a flat file. Each procedure I call writes a single section of the file, e.g "create_hdr_rec_line_fn" writes the header on top of the file and "create_std_trx_rec_line_fn" writes the body below the header. Then lastly the procedure that writes the trailer at the bottom of the file.
My problem comes here: I have a proc that calculates the hash total.
This is done by " utl_file.put_line(g_file_id, g_seed_number)". I want to write the hash total next to the trailer section of the file and not below it. How can I do this? Here's the example of the flat file produced. The very last line is the hash total, but I my hash total to be on the same line as the (Trailer). I want it to be just next to the trailer. I hope my question is clear. Please see my procedure below the flat file.
Thanking you in advance....
My flat file
FHSSVSDIM15000932008102810483220081028T (header)
SD0009300100001D19874200019873402211ACSA JOHANNESBURG INTERNATIONA (Line1-Detail)SC00093001D14540500014540057261IS H/O MAIN ACCOUNT 0000000124959315207 (Line-Transaction)
ST00093000000700000000070000000000020000001806378410000000000000000000001806378 (Trailer)
58298239848772973764654319387982 (hash total)
My procedure
PROCEDURE eft(errbuf OUT NOCOPY VARCHAR2,
retcode OUT NOCOPY NUMBER,
p_payment_batch IN VARCHAR2) IS
v_eft_date VARCHAR2(100);
BEGIN
v_eft_date := TO_CHAR(SYSDATE, 'DD-MON-RRRR_HH24_MI_SS');
g_payment_batch := p_payment_batch;
g_file_name := 'EFT'||v_eft_date||'.txt';
g_file_id := utl_file.fopen(g_dir_name,
g_file_name,
'W');
utl_file.put_line(g_file_id,
create_hdr_rec_line_fn);
create_std_trx_rec_line_fn(g_file_id);
create_std_contra_rec_line_fn(g_file_id);
create_std_trailer_fn(g_file_id);
utl_file.put_line(g_file_id,
g_seed_number);
utl_file.fclose_all;
IF (update_tables != TRUE) THEN
Fnd_File.put_line(Fnd_File.LOG, 'Failed to update payment batch tables. Cancel the batch');
END IF;
EXCEPTION
WHEN OTHERS THEN
Fnd_File.put_line(Fnd_File.LOG, 'Print Error - eft' || SUBSTR(SQLERRM, 1, 250));
END eft;user643734 wrote:
Hi cdkumar
I'm not quite sure if I understand what you mean. Are you saying that I should use the "PUT" to write 'create_std_trailer_fn' and and then use the "PUT_LINE" to write 'g_seed_number'? Could you please show me what you mean by changing the proc I posted on my question with your suggestions.How about, rather than use code it for you, you try changing the code and giving it a go yourself.
Essentially PUT_LINE will write out the data and put a "new line" character on the end so the next output will appear on the following line; PUT will just output the data without terminating the line, so any subsequent output will just append to the end.
It's very simple. Give it a go.
Maybe you are looking for
-
Text tool not working in photoshop cs4
I'm on a Macbook Pro running snow leopard, and for some reason, the text tool won't let me change the color of a text to anything outside of greyscale. For example, I select the text, click on the 'change color' box, select red, and press OK. But the
-
How to setup HTTP client for HTTP to File scenario
Hey guys i have a scenario wherein one of our clients is sending invoices(as XML message) over HTTP(client is outside our landscape) and i have to to send this invoice to a File system from where it will be picked up by an ABAP code(picking of the f
-
Could not read from the source. Please check if it has moved or been deleted
hi all, when i try to render a afx project from media encoder i get the following message "Could not read from the source. Please check if it has moved or been deleted" i've read on the forum that this is due to an old installation of Premiere. I'm u
-
I am unable to view submenus in IE7, Firefox or Netscape. I used the Spry Nemu Bar Horizontal and Vertical templates provided with Dreamweaver 8. Does anyone have the necessary code for this? www.co.pierce.wi.us
-
How can I configure my keyboard to portuguese from brazil, and can write "c̡", "á", "ã", etc ?