Unable to implement Forall in a procedure
Hi,
I have been unsuccessful in inserting data into a target table with resultset from a multiple tables as below.
I'm using Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - 64bit
I'm not sure if the below implementation is possible, Please advice on the error that I'm getting as below
Compilation errors for PROCEDURE PDR.PROC_COMPOSITE_DATA_LOAD
Compilation errors for PROCEDURE PDR.PROC_COMPOSITE_DATA_LOAD
Error: PL/SQL: ORA-00947: not enough values
Line: 37
Text: ) VALUES v1_pershing_staging(i);
Error: PL/SQL: SQL Statement ignored
Line: 29
Text: INSERT INTO PRD_DET_MON_LD(
create or replace procedure PROC_COMPOSITE_DATA_LOAD is
cursor CUR_pershing_staging is
select PRD_MST.PRD_ID,
PRD_MST.Feed_Cur_Id,
prd_stg.effective_date,
'10000' as SRC_id,
prd_stg.accts,
prd_stg.return_type,
prd_stg.mon_return
from PRD_PERSHING_STAGING_LOAD PRD_STG, lv_mst, PRD_MST
where PRD_STG.src ='PERSHING'
and PRD_STG.Src_Provided_Id = lv_mst.geo_manager_code
and lv_mst.lv_id = PRD_MST.lv_id
and prd_mst.end_date > sysdate
and lv_mst.end_date > sysdate;
TYPE t_pershing_staging IS TABLE OF CUR_pershing_staging%ROWTYPE
INDEX by PLS_INTEGER;
v1_pershing_staging t_pershing_staging;
BEGIN
OPEN CUR_pershing_staging;
LOOP
FETCH CUR_pershing_staging BULK COLLECT INTO v1_pershing_staging LIMIT 1000;
FORALL i IN 1..v1_pershing_staging.COUNT
INSERT INTO PRD_DET_MON_LD(
PRD_ID,
CUR_ID,
EFFECTIVE_DATE,
SRC_ID,
UNIT_VALUE,
RETURN_TYPE,
RETURN_VALUE
) VALUES v1_pershing_staging(i);
EXIT WHEN v1_pershing_staging%NOTFOUND;
END LOOP;
CLOSE CUR_pershing_staging;
COMMIT;
END PROC_COMPOSITE_DATA_LOAD;Thanks!
Edited by: Harinath Arasu on Aug 10, 2011 11:51 PM
Test data
SQL> select * from v$version where rownum < 2
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bi
SQL> create table emp
2 (
3 eno integer,
4 ename varchar2(10)
5 )
6 /
Table created.
SQL> create table emp_target
2 (
3 eno integer,
4 ename varchar2(10)
5 )
6 /
Table created.
SQL> insert into emp
2 select level, 'A'||level
3 from dual
4 connect by level <= 1000
5 /
1000 rows created.
SQL> commit
2 /
Commit complete.In the version of oracle you are in referring a record type in FORALL is restricted.
Here is an example
SQL> declare
2 cursor c is select * from emp;
3 type tbl is table of c%rowtype index by pls_integer;
4 emp_tbl tbl;
5 begin
6 open c;
7 loop
8 fetch c bulk collect into emp_tbl limit 100;
9 exit when c%notfound;
10
11 forall i in 1..emp_tbl.count
12 insert into emp_target ( eno, ename )
13 values (emp_tbl(i).eno, emp_tbl(i).ename);
14 end loop;
15 end;
16 /
values (emp_tbl(i).eno, emp_tbl(i).ename);
ERROR at line 13:
ORA-06550: line 13, column 12:
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND
table of records
ORA-06550: line 13, column 12:
PLS-00382: expression is of wrong type
ORA-06550: line 13, column 28:
PLS-00436: implementation restriction: cannot reference fields of BULK In-BIND
table of records
ORA-06550: line 13, column 28:
PLS-00382: expression is of wrong type
ORA-06550: line 13, column 12:
PL/SQL: ORA-22806: not an object or REF
ORA-06550: line 12, column 4:
PL/SQL: SQL Statement ignoredSo you need to do it like this. Declare individual Table Type for each column of the cursor and use it.
SQL> declare
2 cursor c is select * from emp;
3 type eno_tbl is table of emp.eno%type index by pls_integer;
4 type ename_tbl is table of emp.ename%type index by pls_integer;
5 leno eno_tbl;
6 lename ename_tbl;
7 begin
8 open c;
9 loop
10 fetch c bulk collect into leno, lename limit 100;
11 exit when c%notfound;
12
13 forall i in 1..leno.count
14 insert into emp_target ( eno, ename )
15 values (leno(i), lename(i));
16 end loop;
17 end;
18 /
PL/SQL procedure successfully completed.
SQL> select count(*) from emp_target
2 /
COUNT(*)
1000
Similar Messages
-
Unable to pass parameter in oracle procedure through unix shell script
Hi Experts,
I have oracle procedure where in I have to pass the value of procedure parameter through unix script.
Follwoing is the sample procedure which i tried to exceute from the unix.
Procedure:
create or replace procedure OWNER.PRC_TESTING_OWNER(OWNER IN VARCHAR2) AS
sql_stmt varchar2(1000) := NULL;
v_count number := 0;
v_owner varchar2(100) := owner;
begin
sql_stmt:='select count(1) from '||v_owner||'.EMP@infodb where rownum<=10';
execute immediate sql_stmt into v_count;
DBMS_OUTPUT.PUT_LINE(sql_stmt);
DBMS_OUTPUT.PUT_LINE(v_count);
END;The script which I used is:
Unix
#!/bin/ksh
parm=$1
echo start
sqlplus -s scott@DEV/tiger <<EOF >>result_1.txt
set serveroutput on;
select '$parm' from dual;
exec owner.PRC_TESTING_OWNER('$parm');
EOFThe script is working fine that is i am able to pass to parameter value through unix shell script. :)
But if I want to pass the value of the owner in cursor , I am unable to pass this value through unix.
Following the procedure which i am trying to implement.
create or replace procedure OWNER.PRC_TESTING_OWNER(OWNER IN VARCHAR2) IS
v_owner varchar2(100) := owner;
CURSOR main_cur IS
select
i.ROWID rid ,
emp_name,
deptid
from v_owner.employee;
CURSOR subset_cur(c_deptid NUMBER ) IS
SELECT *
FROM v_owner.DEPT d
where d.dept_id=c_deptid;
--##main loop
FOR i IN main_cur LOOP
FOR j IN subset_cur(i.deptid) LOOP
BEGIN
insert into v_owner.RESULT_TABLE
END;
END LOOP;
END LOOP;How can i pass parameter value of the stored procedure through unix script(that is "owner" in this case), when these parameter value is
used in cursor? :(
Can anybody help me regarding the same?
Thanks in Advance !! :DIt's not the parameter in the cursor that is the problem, it's that you are trying to use static SQL for something that won't be known until run time (the owner of the table).
You would need to use something like ...
declare
l_owner varchar2(30) := 'SCOTT';
l_ref_cursor sys_refcursor;
type l_ename_tab is table of scott.emp.ename%type;
l_ename_array l_ename_tab;
begin
open l_ref_cursor for
'select ename
from ' || l_owner || '.emp';
loop
fetch l_ref_cursor bulk collect into l_ename_array limit 10;
exit when l_ename_array.COUNT = 0;
for x in 1 .. l_ename_array.count
loop
dbms_output.put_line(l_ename_array(x));
end loop;
end loop;
close l_ref_cursor;
end;
SMITH
ALLEN
WARD
JONES
MARTIN
BLAKE
CLARK
SCOTT
KING
TURNER
ADAMS
JAMES
FORD
MILLER
PL/SQL procedure successfully completed.
Elapsed: 00:00:00.01 -
Not woking FORALL loop in Procedure related to OCCI
hi Guys,
I have created a procedure with Object as Argument....... give below details...
My requirement is:
Create a Userdefined type which is collection of Attribute e.g (Roll,Salary,Address,Name,Mobile)
Create Index table OR Varray of Userdefined Type....
Create a pocedure argument is Object of Type Varray Or IndexTable......
FORALL.... Loop
Insert Statement
This procedure is Calling in OCCI.....
PROCEDURE
CREATE OR Replace PROCEDURE Object_Student(p student_detail)
AS
BEGIN
FORi in p.first .. p.last loop
INSERT INTO Sample_mix VALUES (p(i));
end loop;
COMMIT;
END Object_Student;
This above was not working..........
ERROR:Not enough values....
After that I changed the PL/SQL in the INSERT statement....
CREATE OR Replace PROCEDURE Object_Student(p student_detail)
AS
BEGIN
FOR i in p.first .. p.last loop
INSERT INTO Sample_mix VALUES (p(i).roll,P(i).SALARY,P(i).ADDRESS,P(i).Name,P(i).mobile);
end Loop;
COMMIT;
END Object_Student;
This is Running Successfully....
Result: Reading Records taking too much time.... OCCI
Terefore , I changed From FOR Loop TO FORALL loop..
CREATE OR Replace PROCEDURE Object_Student(p student_detail)
AS
BEGIN
FORALL i in p.first .. p.last
INSERT INTO Sample_mix VALUES (p(i));
COMMIT;
END Object_Student;
ERROR: Not Enough values......
then modified the procedure
CREATE OR Replace PROCEDURE Object_Student(p student_detail)
AS
BEGIN
FORALL i in p.first .. p.last
INSERT INTO Sample_mix VALUES (p(i).roll,P(i).SALARY,P(i).ADDRESS,P(i).Name,P(i).mobile);
COMMIT;
END Object_Student;
The Above Code is Not working..... giving the following ERRORS...
LINE/COL ERROR
5/32 PLS-00436: implementation restriction: cannot reference fields of
BULK In-BIND table of records
5/42 PLS-00436: implementation restriction: cannot reference fields of
BULK In-BIND table of records
5/54 PLS-00436: implementation restriction: cannot reference fields of
BULK In-BIND table of records
5/67 PLS-00436: implementation restriction: cannot reference fields of
BULK In-BIND table of records
LINE/COL ERROR
Could anybody tell me why here ForALL loop is not Working....??
Everything is successed... Only FORALL loop is not Working in the Procedure....
Is there any Other way .... Please reply me ASAP
Advance thanx for them....
SanjayI alreary added with same structure.....
Still giving the Same Error
I searched and got some help........inserted Like below example....
CREATE OR Replace PROCEDURE emp_Proc(p emp_arr)
AS
BEGIN
forall i in p.first .. p.last
INSERT INTO emp VALUES p(i);
COMMIT;
END emp_Proc;
LINE/COL ERROR
5/2 PL/SQL: SQL Statement ignored
5/2 PL/SQL: ORA-00932: inconsistent datatypes: expected - got -
Is there any solve of folling Error.... -
How to implement simple java stored procedure
I'm using Maxdb 7. 6.03.15 (standalone - no SAP) as a Migration Environment to a new centralized SAP solution.
Most of the work is done in internal DBproc but I need to trig external procedure (those one's written in Java).
I have already spent too much time to find related information and because I need only very simple triggreing, I don't want to learn and deploy product like NetWeaver ... anyone could give me minimal information on how to do that ...
If I'm right, I need to configure the MessageServer and develop a minimist java proc that should be able to register the DBproc (java language) inside DB and handle the MessageServer msg generated by my internal DBproc call to the newly registered java proc ?
I just want to do that as simple as possible, I don't need locking scheme neither multiple request queue ... because I control all access to the DB and all process are completely serialized (It was a design rule).
Could anyone help me ?Thank's Lars for that quick answer !
You wrote,
> AFAIK one development target is to implement UDEs (User Defined Extensions) that will allow the creation of "inside-the-db-code" in >other languages than the one used for the stored procedures.
did you mean "JavaUdeServer" ? I see some interesting code in source tree about that . I investigate a little about but I miss the binary javaUdeServer code (and I don't want to rebuild the distribution also because of different version). The message returned when I tried to call a registered java stored proc was smoething like 'Impossible to contact UDE server'
But the code is still embedded in the kernel (as It can be found in the map files).
I don't find any documentation on that feature ,is it for security reason ? If so I'm ready for a 'No disclosure agreement' (It's not a personal request).
Of course, if the only way is NetWeaver that could be OK but the task seem's to me so heavy regarding my so simple need's ... if there is a short way (samples ?) to kick me on NetWeaver to reach my goal you're welcome !!
(Some piece of code on NetWeaver that allow a procedure to call to external java proc that return hostname will be enough ...).
For you information, (because I have the feeling I got your answer) I already install a trial NetWeaver some week's ago but I don't spent (and I don't have) many times to use It and I have the bad sensation to try driving a big truck only to move a cup of coffee ...(of Java of course !) but perhaps I'm too impatient ?
Regards,
Michel -
Unable to create object from stored procedure universe
Dear All Experts,
I am facing a problem on unable to create object dimensions on a Stored procedure universe. Fyi, I have successfully insert a stored procedure ('SP_Sales') with input parameter (@date) into universe (Universe_1). But I unable create any object based on the the stored procedured ('SP_Sales') due to it show nothing from the Edit Select Statement of 'Object1', empty for Tables nd columns windows.
Thefore, i unable to drag data in WEBI when i select univese as "Universe_1", it will not sure any object. Please advise.
I am using XI4.0, MSSQL2008.Hi ,
You wont be able to edit the object definitions.
u2022 Designer generates one table per selected stored procedure (or many
tables if multiple result sets) and one object per column returned by a
stored procedure.
u2022 The result set structure is determined when you describe the function.
Please refer chapter 7(Page 451) of below document for more details.
[Universe Designer Guide|http://help.sap.com/businessobject/product_guides/boexir31/en/xi3-1_designer_en.pdf]
Hope this helps.
Bilahari M -
Urgent: unable to call a plsql stored procedure with a struts data action
Hello ALL,
I'm trying to call a plsql stored procedure within a struts DataAction,
The scenario is:
When a user a click on a button, then it should call a specific stored procedure,,
I create struts data action a class to handle the event which is to call the procedure
Here is my code:
public class RequestAction extends DataForwardAction
public void onCall(DataActionContext ctx)
String amDef = "model.AppModule";
String config = "AppModuleLocal";
ApplicationModule am =
Configuration.createRootApplicationModule(amDef, config);
try{
AppModuleImpl myAm = (AppModuleImpl)am;
DBTransaction tr = (DBTransaction) myAm.getTransaction();
CallableStatement stmt = tr.createCallableStatement
("begin pkg_test.test; end;", DBTransaction.DEFAULT);
stmt.execute();
stmt.close();
tr.commit();
catch(Exception e){System.out.println(e.getMessage());}
Configuration.releaseRootApplicationModule(am,true);
but when I ran the application and click on the button, I got the following Exception:
04/07/08 00:45:50 ORA-06550: line 1, column 7:
PLS-00201: identifier 'PKG_TEST.TEST' must be declared
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored
It seems that the DBTransaction object unable to see the stored procedure,
Am I do something wrong or miss something???
I've checked the examples on the OTN HOW TO, and searched in the JDeveloper Forum but unable to find an answer,
Please anyone can help???
Thanks a lot
With Regards,
HayatHere's an example application that illustrates how to do this. I haven't had a chance to writeup a little paper to go with it yet, but will as soon as I have a chance.
http://otn.oracle.com/products/jdev/tips/muench/storedproc/CallStoredProc.zip
See the "callStoredProcedure" method in the application module in the Model project.
See the "callStoredProcedure" method binding in the binding container of the "CallStoredProcedure" data page.
Notice the name "event_callStoredProcedure" of the (Call Stored Procedure) button on the CallStoredProcedure.jsp page which triggers the declaratively invocation of the method.
You could also call the method from code in a custom data action.
The code example illustrates how to create your own JDBC prepared statement for invoking the stored procedure, and doing it in a way that is efficient by keeping the prepared statement around across invocations. -
Unable to call a pl/sql procedure from java
Software : Oracle 9i & Red hat linux 9
Code:
import java.io.*;
import java.sql.*;
public class test
public static void main(String args[])
try
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.221:1521:elearn","gowri","gowri");
CallableStatement call=con.prepareCall("{call ins(?,?,?,?)}");
call.setInt(1,5);
call.setString(2,"hari");
call.setString(3,"m");
call.setString(4,"1976-12-26");
if ( call.execute() )
System.out.println("Success");
else
System.out.println("fails");
call.close();
con.close();
catch(Exception ex)
System.out.println("Error :"+ex);
~
~
~
Stored Procedure:
create or replace procedure ins(no in number,name in varchar,sex in varchar,dob in varchar)is
con_day date;
begin
con_day=to_date(dob,'yyyy-mm-dd');
insert into person values(no,name,sex,con_day);
end;
Run Time Error:
Exception in thread "main" java.lang.IncompatibleClassChangeError: oracle.jdbc.driver.OraclePreparedStatement
at 0x40268e17: java.lang.Throwable.Throwable(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025bc8e: java.lang.Error.Error(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025d6b6: java.lang.LinkageError.LinkageError(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x4025c7aa: java.lang.IncompatibleClassChangeError.IncompatibleClassChangeError(java.lang.String) (/usr/lib/./libgcj.so.3)
at 0x40229eed: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x402299cb: JvPrepareClass(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x40248028: java.lang.ClassLoader.linkClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x4025acb3: java.lang.ClassLoader.resolveClass0(java.lang.Class) (/usr/lib/./libgcj.so.3)
at 0x4024646c: java.lang.Class.initializeClass() (/usr/lib/./libgcj.so.3)
at 0x40230912: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
at 0x4038305c: ?? (??:0)
at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x4022e58a: JvInterpMethod.run_synch_object(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
at 0x4038305c: ?? (??:0)
at 0x403831e7: ffi_call_SYSV (/usr/lib/./libgcj.so.3)
at 0x403831a7: ffi_raw_call (/usr/lib/./libgcj.so.3)
at 0x402306e8: JvInterpMethod.continue1(_Jv_InterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x40230ff4: JvInterpMethod.run(ffi_cif, void, ffi_raw, JvInterpMethodInvocation) (/usr/lib/./libgcj.so.3)
at 0x4022e504: JvInterpMethod.run_normal(ffi_cif, void, ffi_raw, void) (/usr/lib/./libgcj.so.3)
at 0x4038305c: ?? (??:0)
at 0x40242dd8: gnu.gcj.runtime.FirstThread.call_main() (/usr/lib/./libgcj.so.3)
at 0x402ad02d: gnu.gcj.runtime.FirstThread.run() (/usr/lib/./libgcj.so.3)
at 0x4024fc4c: JvThreadRun(java.lang.Thread) (/usr/lib/./libgcj.so.3)
at 0x4021c8ac: JvRunMain(java.lang.Class, byte const, int, byte const, boolean) (/usr/lib/./libgcj.so.3)
at 0x08048910: ?? (??:0)
at 0x42015574: __libc_start_main (/lib/tls/libc.so.6)
at 0x080486c1: ?? (??:0)Hi Gowrishankar,
This is just a suggestion (based on a guess). Try changing this line of your code:
call.setInt(1,5);with this line:
call.setBigDecimal(1,5);Good Luck,
Avi. -
Unable to implement WOOgnl parser in my WO application on WO5.4.
Eclipse Version: Juno Service Release 1
java version: 1.6.0_18
WebObject Version = 5.4.3
Steps I am using to implement WOOgnl Parser:-
1- I have imported WOOgnl.framework in build path
2- I have made following changes to build.properties file
ognl.active = true
ognl.helperFunctions=true
ognl.inlineBindings=true
ognl.parseStandardTags=true
The whole build.properties looks like this:-
#Wed Nov 21 13:06:11 EST 2012
classes.dir=bin
component.inlineBindingPrefix=[
component.inlineBindingSuffix=]
component.wellFormedTemplateRequired=true
customInfoPListContent=
eoAdaptorClassName=
embed.Local=false
embed.Project=false
embed.System=false
ognl.active = true
ognl.helperFunctions=true
ognl.inlineBindings=true
ognl.parseStandardTags=true
principalClass=Application
project.name=Empsoft
project.name.lowercase=empsoft
project.type=application
webXML=false
webXML_CustomContent=
When I am using the above steps i am getting error mentioned below:-
A fatal exception occurred: ognl/PropertyAccessor
java.lang.NoClassDefFoundError: ognl/PropertyAccessor
When I am not importing WOOgnl.framework in my build path the project is running fine but I have to remove all the duplicate entries in Wod file else exception is thrown when I am opening the page from UI.
Please let me know where I am going wrong.
Thanks!!!!
Regards
Mritunjay KumarThe ognl properties (ognl.active, ognl.helperFunctions, etc) go in the Properties file in the Resources folder, not in build.properties.
You should rarely have to edit the build.properties file manually. It is edited from eclipse by right clicking on project name and selecting "Properties" from the contextual menu and then editing the settings in WOLips Deployment and WOLips Development. If you are using WOOgnl for inline bindings rather than Apple's inline bindings mechanism then in WOLips Development you should probably change
component.inlineBindingPrefix=[
component.inlineBindingSuffix=]
to
component.inlineBindingPrefix=$
component.inlineBindingSuffix=
so that WOLips validation knows what style inline bindings you are using.
Also I don't understand why you have duplicate entries in wod file. -
How can i implement a Transaction Processing procedure in my web app ?
Im planning to enhance my web app servlet.
the web app is about Online Banking.
since it is Online banking, there would be time where simultaneous user accessing their account. mean several connection is made on my db.
I read some article about Transaction processing, so i think it is wise for me to
implement on my web app but i not sure where to start and in what way can i integrate it with my web app.
here are several thing i have in mind..
making the admin able to monitor , or better if can coordinate the transaction.determine the network traffic on my web app. etc.
any advise or wise opinion please ..thank you for time reading too.Im planning to enhance my web app servlet.
the web app is about Online Banking.
since it is Online banking, there would be time where
simultaneous user accessing their account. mean
several connection is made on my db.
I read some article about Transaction processing, so
i think it is wise for me to
implement on my web app but i not sure where to start
and in what way can i integrate it with my web app.
here are several thing i have in mind..
making the admin able to monitor , or better if can
coordinate the transaction.determine the network
traffic on my web app. etc.
any advise or wise opinion please ..thank you for
time reading too.Read about ACID properties, isolation, and locking mechanisms. It's a database issue, not a network traffic problem.
Please tell me that this is just a homework assignment. If not, please tell me the name of the bank that employs you so I can be sure to never have dealings with them.
% -
I am unable to create a table using procedure..
Hi everyone,
I have given CREATE ANY TABLE privilege to user A and wants to insert data into TAB1 in schema B using a procedure "INSERT INTO B.TAB1 AS SELECT * FROM A.TAB1" but it shows the message--
PL/SQL: ORA-01031: insufficient privileges
Which privilege user A need to do the above task.
Thanks,
AbhijeetSQL> create user a identified by a;
SQL>create user b identified by b;
SQL> grant connect,resource to a;
Grant succeeded.
SQL> grant connect,resource to b;
Grant succeeded.
SQL> grant create any table to a;
Grant succeeded.
SQL> conn a/a
Connected.
SQL> create table tab1 (id number);
Table created.
SQL> insert into tab1 values (1);
1 row created.
SQL> commit;
Commit complete.
SQL> conn b/b
Connected.
SQL> create table tab1 (id number);
Table created.
SQL> insert into b.tab1 select * from tab1;
insert into b.tab1 select * from tab1
ERROR at line 1:
ORA-01031: insufficient privileges
SQL> conn sys as sysdba
Enter password:
Connected.
SQL> grant insert any table to a;
Grant succeeded.
SQL> conn a/a
Connected.
SQL> insert into b.tab1 select * from tab1;
1 row created.
So you need to grant “*insert any table* “ privileges to a;
regards
Liakat hossain -
Unable to run Groovy scripts within procedure
Hi all,
We are managing to automate objects promotion to PROD environment using Groovy. The thing is that we are able to run the script in the Groovy tool successfully, but we are not able to run the same script within a procedure in ODI. The version that we are using is 11.1.1.6.5.
Do you know if this needs further configuration? Does it needs any updgrade?
Below, the script we are currently using, it´s just to create a new physical and logical architecture on the topology tab and write an entry on the context to link logical to physical. Any help would be highly appreciated. Thanks.
Fernando.
import oracle.odi.core.persistence.transaction.support.DefaultTransactionDefinition;
import oracle.odi.domain.util.ObfuscatedString;
import oracle.odi.domain.model.OdiModel;
import oracle.odi.domain.topology.OdiLogicalSchema;
import oracle.odi.domain.topology.OdiPhysicalSchema;
import oracle.odi.domain.topology.OdiDataServer;
import oracle.odi.domain.topology.OdiContext;
import oracle.odi.domain.topology.OdiTechnology;
import oracle.odi.domain.topology.OdiContextualSchemaMapping;
import oracle.odi.domain.topology.AbstractOdiDataServer;
import oracle.odi.domain.topology.finder.IOdiContextFinder;
import oracle.odi.domain.topology.finder.IOdiTechnologyFinder;
def createLogicalSchema(contextCode, techCode, schName, dataserverName, userName, password, url, driver, schema) {
txnDef = new DefaultTransactionDefinition();
tm = odiInstance.getTransactionManager()
txnStatus = tm.getTransaction(txnDef)
contextFinder = (IOdiContextFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiContext.class);
context = contextFinder.findByCode(contextCode);
techFinder = (IOdiTechnologyFinder) odiInstance.getTransactionalEntityManager().getFinder(OdiTechnology.class);
tech = techFinder.findByCode(techCode);
lschema = new OdiLogicalSchema(tech, schName)
dserver = new OdiDataServer(tech, dataserverName)
con = new AbstractOdiDataServer.JdbcSettings(url, driver)
dserver.setConnectionSettings(con)
dserver.setUsername(userName)
dserver.setPassword(password)
pschema = new OdiPhysicalSchema(dserver)
pschema.setSchemaName(schema)
pschema.setWorkSchemaName(schema)
cschema = new OdiContextualSchemaMapping(context, lschema, pschema)
odiInstance.getTransactionalEntityManager().persist(lschema)
odiInstance.getTransactionalEntityManager().persist(dserver)
tm.commit(txnStatus)
return lschema
lschema = createLogicalSchema("DEVELOPMENT", "ORACLE", "LS_HAL_TEST", "DS_HAL_TEST", "ODI_TEST", ObfuscatedString.obfuscate("odi_test"),
"jdbc:oracle:thin:@ourservername:10710:DBAA6T", "oracle.jdbc.OracleDriver", "ODI_TEST")
Notice i've changed the actual name of our server for "ourservername" because I don't know if I´m able to post that information.
Thanks.Hi,
I did try to hard code the parameters values, and it still didn't work. However, I did get a little bit closer, I found out that it doesn't work only whne my stored procedure uses a temporary table.
Any though, why the temporary table would cause this error ?
Thanks -
CA / NDES Virtual Directory Structure Missing in IIS 7 unable to implement SSL for ADMIN sites
We've recently finiallized both an Enterprice 2008 R2 CA and NDES service installtion configuration. All services are running, to include web enrollment for both. CA sits on a DC, as required, and the NDES roll sits on a standalone machine.
All service generated certificates / templates are in place and or issued including SSL certificates for service web front ends.
I'm trying to take the next step in hardening both of the web front ends by requiring SSL web validation and client SSL authentication.
Problem: When examining the site structures, CA and NDES, within the IIS7 configuration manager the following inconsistancies are present:
Enterprise CA:
o No virtual directory is configured or listed under the Certsrv or Enrollment sub-sites, however as previously stated all servies are up and operational.
2. NDES:
o IIS7 configuration manager doesn't list any Certsrv sub-site, but once again all services are up and runniing. I can process SCEP requests via the web.
The following 2 items are listed under the default site on the NDES service machine: Rpc and RpcWithCert
In past experience I would expect those items to be associated with Exchange, but since NDES is new to me they may be standard.
Not to state the obvious but all Sys32 files and folders are correct as both services are running properly. Can anyone tell me if I've missed some critical article on AD CS or IIS7 that tells me why these 2 conditions are present.
Since the Certsrv sub-site exists on the CA I would assume a normal SSL bind will work, but with critical items missing from within IIS7 (at least from my view) i don't want to compound the problem.. Since there is no Certsrv
structure on the NDES machines I'm not sure what the best way to proceed is. Any help would be greatly appreicated.
V/R BECA / NDES all function properly. I'm still reseaching proper IIS 7 SSL implementation, when the virtual directory and sub-site structer is either missing or imcomplete when viewed from within the IIS7 manager.
These services where put into production without a thurough configuration check prior to implementation, so I don't have a test environment setup at the moment to just start playing. I'm thinking this weekend I'm going to have to VSS the current
machines and throw them on the Dev network and see how badly I can break them.
V/R BE -
Unable to implement Constructor Overloading in an inherited class. Plz Help
Please do compile the program in in order to notice the error.
class EmpDet
int id,age;
String name;
String gender;
EmpDet(int id1,String name1,int age1,String gender1)
this.id = id1;
this.name= name1;
this.age= age1;
this.gender = gender1;
void Id_Name()
System.out.println("EmpId : "+id+" and Name : "+name);
void Gender_Age()
System.out.println("Employee is a "+gender+" and is "+age+" years old.");
class Employee extends EmpDet
String locality;
Employee(int a,String b,int c,String d)
super(a,b,c,d);
Employee(String locality1)// Constructor overloading. My problem.
this.locality = locality1;
void locality()
System.out.println("The employee resides at "+locality);
void DiplayStmt()
System.out.println("DISPLAYING EMPLOYEE DETAILS..");
System.out.println("******************************");
public static void main (String[] args)
Employee det = new Employee(010,"John",32,"M");
Employee addr = new Employee("Tambaram");
addr.DiplayStmt();
det.Id_Name();
det.Gender_Age();
addr.locality();
}Hey Thanks.. I guess what you said makes sense.
I was fiding it hard to agree that there needs to be a match between the Constructors of the Base Class and the Sub Class. I altered the program by adding a constructor in the Base class and using the super(0 function in the Sub class and that seems to work..
class EmpDet
int id,age;
String name;
String gender;
EmpDet(int id1,String name1,int age1,String gender1)
this.id = id1;
this.name= name1;
this.age= age1;
this.gender = gender1;
EmpDet(String addr)
System.out.println("Address is implemented in SubClass");
void Id_Name()
System.out.println("EmpId : "+id+" and Name : "+name);
void Gender_Age()
System.out.println("Employee is a "+gender+" and is "+age+" years old.");
class Employee extends EmpDet
String locality;
Employee(int a,String b,int c,String d)
super(a,b,c,d);
Employee(String locality1) // Constructor Overloading
super(locality1);
this.locality = locality1;
void locality()
System.out.println("The employee resides at "+locality);
void DiplayStmt()
System.out.println("DISPLAYING EMPLOYEE DETAILS..");
System.out.println("******************************");
public static void main (String[] args)
Employee det = new Employee(010,"John",32,"M");
Employee addr = new Employee("Tambaram");
addr.DiplayStmt();
det.Id_Name();
det.Gender_Age();
addr.locality();
Message was edited by:
3402102 -
Unable to use ExecuteXMLReader with Stored Procedure
I have been trying to use the ExecuteXMLReader with a CommandType = StoredProcedure and I keep getting the following error:
"Operation is not valid due to the current state of the object."
Below is my code:
Dim cmd as oraclecommand
Dim conn as oracleconnection
Dim xmlreader as xml.xmlreader
conn = new oracleconnection(connectionstring)
conn.open
cmd = new oraclecommand()
cmd.connection = conn
cmd.commandtext = "sp_get_users"
cmd.commandtype = commandtype.storedprocedure
cmd.XmlCommandType = OracleXmlCommandType.Query
cmd.parameters.add("parm1", OracleDbType.RefCursor, ParameterDirection.Output)
xmlreader = cmd.executexmlreader() <-- Error Here
The stored procedure is defined as follows:
procedure sp_get_users (usercursor out ref cursor)
is
begin
open usercursor for
select * from arc_users;
end sp_test;
The same code works if I make the following changes:
cmd.commandtext = "select * from arc_users"
cmd.commandtype = commandtype.text
Any help is greatly appreciated. I have looked everywhere for a solution.
Thanks
Sandra M. VegaRich provided the answer to your immediate problem.
If you are going to be working with an SQL Server BE, I strongly suggest you take some time to learn more about it to save yourself a lot of headaches.
Here is a good place to start
https://msdn.microsoft.com/en-us/library/bb188204.aspx -
Unable to create object from stored procedure
Hi,
we are trying to use a stored procedure to do data preparation.
When we add the stored procedure to a universe, the procedure is executed succesfully and a table with one column, called "1" is created. When we try to create an object from this column, Designer does not allow us to do so.
We already tried to alias the column name in the stored procedure but we still get an unusable column called "1" back.
BO version used is XI R3.0. The stored procedure is written in Cobol on DB2 mainframe.
Does somebody know what we do wrong ?Problem solved.
First we aliased the result columns in the stored procedure, that got rid of the "1".
Then we still could not create an object based on the column in the result set.
Apparently this issue occurs when the length of the column of the result set is too long.
We decreased the length and now we can create the object
Maybe you are looking for
-
How do you change the name of a reminder in the reminder list. I right click and then choose "get information" I can change the colour of the reminder but when I type in the name that I want and then press enter the name stays as "untitled"
-
Superdrive stopped reading DVDs - Can't even mount image
About a month ago my Superdrive quit reading DVDs. It burns then just fine from iDVD, and other data, but will not read them, or any other type of DVD media/movies anymore. (even ones it just made) I can't figure it out. It reads CDs and imports data
-
ITunes has stopped updating this podcast...
I'm curious if anyone has a fix for this ACTUAL iTUNES MESSAGE: "iTunes has stopped updating this podcast becasue you have not listened to any episode recently. Would you like to resume updating this podcast?" It seems crazy to me that iTunes would j
-
Hi, I have two repeat regions. one that displays listings based on a datestamp for the current week. I'm using Access and ASP VB Script. The SQL for that is: SELECT * FROM sellerlistqry WHERE DatePart('ww',Sellerlistdate) = DatePart('ww', now()) The
-
The "P" and "Delete" button doesn't work
While text messaging or emailing the letter P nor the delete button work. Any suggestion?