Oracle Procedure + Object
Hi,
how it's possible to get an user defined Oracle Object with a procedure?
Always I get the failure:
Unsupported Oracle data type USERDEFINED encountered.
my code:
string sSQL = "begin beleg_read(out_beleg,in_stapel_nr);end;";
OracleParameter p1 = cmdOra.Parameters.Add("out_beleg", OracleType.Blob); // Blob = own Type??
p1.Direction = ParameterDirection.ReturnValue;
OracleParameter p2 = cmdOra.Parameters.Add("in_stapel_nr", OracleType.Number);
p2.Direction = ParameterDirection.Input;
p2.Value = 4;
cmdOra.ExecuteNonQuery(); // failure
Thank's for help,
jörg
odp.net has no object support (yet)
Arnold
Similar Messages
-
OCI 22303 exception - Pass object to type Record in oracle procedure
Recently i had my first encounter with ODP.NET and Oracle. I'm developing a a datalayer that can access a stored procedure on an Oracle database.
The problem i'm having is the following:
I'm using this method to pass my parameters to the procedure: http://www.codeproject.com/KB/cs/CustomObject_Oracle.aspx
I have also attempted this approach:
http://developergeeks.com/article/48/3-steps-to-implement-oracle-udt-in-odpnet
I always get the message (litteraly):
Oracle.DataAccess.Client.OracleException: OCI-22303: type "e;PAC$WEBSHOP_PROCS"."CUSTOMER_IN_RECTYPE" not found.
It sounds weird to me, but what are the "es doing here in the error message I see?
Some code i use:
OracleParameter objParam = new OracleParameter
OracleDbType = OracleDbType.Object,
Direction = ParameterDirection.Input,
ParameterName = "PAC$WEBSHOP_PROCS.P_CUSTOMER_IN",
UdtTypeName = "PAC$WEBSHOP_PROCS.WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE",
Value = card
The information i have about the Oracle procedure:
CREATE OR REPLACE PACKAGE PAC$WEBSHOP_PROCS IS
TYPE CUSTOMER_IN_RECTYPE IS RECORD
(CUS_STO_IDENTIFIER NUMBER(2)
,CUS_IDENTIFIER NUMBER(6)
,CH_IDENTIFIER NUMBER(2)
,CH_CARD_VERSION NUMBER(1)
PROCEDURE PRC$WS_VALIDATE_CARD
(P_CUSTOMER_IN IN PAC$WEBSHOP_PROCS.CUSTOMER_IN_RECTYPE
,P_RETURN_CODE IN OUT NUMBER
Any help to cover my problem would be greatly appreciated.
Thx
Edited by: 836497 on 14-feb-2011 4:36The only way to call it as is would be via an anonymous plsql block, where you create the record type inside the block. Interacting with the block via ODP would be limited to scalar values.
Here's a PLSQL example just to demonstrate. Here, v1 and v2 are bind variables of scalar type, which you'd setup/bind via ODP instead of the SQL prompt as I did, but I thought this might keep things simpler for the example.
The other choice would be to write a wrapper procedure that takes type OBJECT that you can call from ODP, and inside that procedure convert them to/from RECORD and call the original procedure.
Hope it helps,
Greg
SQL> drop package somepack;
Package dropped.
SQL> create package somepack as
2 type somerectype is record(n1 number);
3 function somefunc (v1 somerectype) return somerectype;
4 end;
5 /
Package created.
SQL>
SQL> create package body somepack as
2 function somefunc (v1 somerectype) return somerectype is
3 begin
4 return v1;
5 end;
6 end;
7 /
Package body created.
SQL>
SQL>
SQL> var v1 number;
SQL> exec :v1 := 5;
PL/SQL procedure successfully completed.
SQL> var v2 number;
SQL>
SQL>
SQL> declare
2 localvar1 somepack.somerectype;
3 localvar2 somepack.somerectype;
4 begin
5 localvar1.n1 := :v1;
6 localvar2 := somepack.somefunc(localvar1);
7 :v2 := localvar2.n1;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> print v2;
V2
5
SQL> -
Issu for running insert statement in oracle procedure.
Hi expert,
I ran a oracle procedure with a insert statement inside as:
insert into table1 select....
but I got error message related to this insert statement as "SQLERRM= ORA-08103: object no longer exists"
I ran this statement separately in toad, no error message, but no data result from this execute.
please tell how to fix this issue.
Many Thanks,
Edited by: 918440 on 27-Jun-2012 8:04 AMHi friend,
my insert statement is as follows:
INSERT INTO HIROC_RU_FACT_S
select
pp.policy_fk,
pp.transaction_log_fk,
p.policy_no,
p.policy_type_code,
hiroc_rpt_user.hiroc_get_entity_name(pp.policy_fk,'POLHOLDER') policy_holder,
pp.risk_fk,
r.risk_base_record_fk,
r.entity_fk,
hiroc_sel_entity_risk_name2 (pp.risk_fk,r.entity_fk) risk_name,
substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2) rating_state_code,
hiroc_get_province_name(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2), 'PROVINCE_CODE', 'L') rating_state_name,
hiroc_get_provicne_pol_prefix(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2),p.policy_type_code) rating_prov_pol_prefix,
nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) rating_peer_group_code,
hiroc_get_lookup_desc('PEER_GROUP',nvl(r.risk_cls_used_to_rate,pth.peer_groups_code),'L') rating_peer_group_name,
pth.policy_term_history_pk,
pth.term_base_record_fk,
to_char(pth.effective_from_date,'yyyy') term_effective_year,
c.coverage_pk,
c.coverage_base_record_fk,
pc.coverage_code,
c.product_coverage_code,
pc.long_description,
pp.coverage_component_code,
c.effective_from_date,
c.effective_to_date,
cls.coverage_code coverage_class_code,
cls.coverage_long_desc coverage_class_long_desc,
decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null) exposure_unit, --hiroc_get_expos_units_by_cov(c.coverage_pk,pc.coverage_code,c.effective_from_date,c.effective_to_date) exposure_unit,
decode(pp.coverage_component_code ,'GROSS',cls.number_of_patient_day,null) number_of_patient_day,
pth.effective_from_date term_eff_from_date,
pth.effective_to_date term_eff_to_date,
pp.premium_amount premium_amount,
(case when (pc.coverage_code in ('CP','MC1','MC2','MC3','MC4','HR','F') or pc.coverage_code like 'ST%') and
pp.coverage_component_code != 'RISKMGMT' then
(nvl(pp.premium_amount,0))
else
0
end) primary_premium,
(hiroc_get_risk_units(hiroc_get_provicne_pol_prefix(substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2),p.policy_type_code)-- rating_prov_pol_prefix
,nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) -- rating_peer_group_code
,cls.coverage_code --coverage_class_code
,decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null)
,pp.premium_amount
,(case when (pc.coverage_code in ('CP','MC1','MC2','MC3','MC4','HR','F') or pc.coverage_code like 'ST%') and
pp.coverage_component_code != 'RISKMGMT' then
(nvl(pp.premium_amount,0))
else
0
end) -- primary_premium
,p.policy_type_code
,trunc(pth.effective_to_date))) risk_units
from proddw_mart.rmv_territory_makeup tm,
proddw_mart.rmv_premium_class_makeup pcm,
proddw_mart.rmv_product_coverage pc,
proddw_mart.rmv_coverage c,
proddw_mart.rmv_risk r,
proddw_mart.rmv_policy_term_history pth,
proddw_mart.rmv_policy p,
proddw_mart.rmv_transaction_log tl,
proddw_mart.rmv_policy_premium pp,
(select /* +rule */
p.policy_no,
p.policy_start_date,
p.policy_end_date,
r.risk_pk,
r.risk_description,
c.coverage_pk,
c.parent_coverage_base_record_fk,
pc.parent_product_covg_code,
pc.coverage_code,
pc.short_description coverage_short_desc,
pc.long_description coverage_long_desc,
c.exposure_unit,
pc.exposure_basis_code,
c.number_of_patient_day,
p.policy_start_date policy_effective_date,
p.policy_end_date policy_expiry_date,
c.effective_from_date,
c.effective_to_date,
to_char(c.effective_from_date,'YYYY') class_eff_year
from proddw_mart.odwr_coverage_only c
,proddw_mart.odwr_product_coverage pc
,proddw_mart.odwr_risk r
,proddw_mart.odwr_policy p
where pc.code = c.product_coverage_code
and pc.parent_product_covg_code is not null -- coverage classes only
and r.risk_pk = c.risk_base_record_fk
and c.accounting_to_date = to_date('1/1/3000','mm/dd/yyyy') -- only open records
and c.base_record_b = 'N'
and p.base_record_b = 'N'
and p.policy_pk = r.policy_fk
and p.accounting_to_date = to_date('1/1/3000','mm/dd/yyyy') -- only open records
group by p.policy_no,
p.policy_start_date,
p.policy_end_date,
r.risk_pk,
r.risk_description,
c.coverage_pk,
c.parent_coverage_base_record_fk,
pc.parent_product_covg_code,
pc.coverage_code,
pc.short_description, -- coverage_short_desc,
pc.long_description, -- coverage_long_desc,
c.exposure_unit,
pc.exposure_basis_code,
c.number_of_patient_day,
p.policy_start_date, -- policy_effective_date,
p.policy_end_date, -- policy_expiry_date,
c.effective_from_date,
c.effective_to_date,
to_char(c.effective_from_date,'YYYY')-- class_eff_year
) cls
where tm.risk_type_code = r.risk_type_code
and tm.county_code = r.county_code_used_to_rate
and tm.effective_from_date <= pp.rate_period_from_date
and tm.effective_to_date > pp.rate_period_from_date
and pcm.practice_state_code (+) = r.practice_state_code
and pcm.risk_class_code (+) = r.risk_cls_used_to_rate
and nvl(pcm.effective_from_date, pp.rate_period_from_date) <= pp.rate_period_from_date
and nvl(pcm.effective_to_date, to_date('01/01/3000','mm/dd/yyyy')) > pp.rate_period_from_date
and pc.code = c.product_coverage_code
and c.base_record_b = 'N'
and ( c.record_mode_code = 'OFFICIAL'
and (c.closing_trans_log_fk is null or
c.closing_trans_log_fk != tl.transaction_log_pk)
or c.record_mode_code = 'TEMP'
and c.transaction_log_fk = tl.transaction_log_pk )
and c.parent_coverage_base_record_fk is null
and c.effective_from_date < c.effective_to_date
and c.effective_from_date <= pp.rate_period_from_date
and c.effective_to_date > pp.rate_period_from_date
and c.accounting_from_date <= tl.accounting_date
and c.accounting_to_date > tl.accounting_date
and c.coverage_base_record_fk=pp.coverage_fk
and r.base_record_b = 'N'
and ( r.record_mode_code = 'OFFICIAL'
and (r.closing_trans_log_fk is null or
r.closing_trans_log_fk != tl.transaction_log_pk)
or r.record_mode_code = 'TEMP'
and r.transaction_log_fk = tl.transaction_log_pk )
and r.effective_from_date < r.effective_to_date
and r.effective_from_date <= pp.rate_period_from_date
and r.effective_to_date > pp.rate_period_from_date
and r.accounting_from_date <= tl.accounting_date
and r.accounting_to_date > tl.accounting_date
and r.risk_base_record_fk = pp.risk_fk
and pth.base_record_b = 'N'
and ( pth.record_mode_code = 'OFFICIAL'
and (pth.closing_trans_log_fk is null or
pth.closing_trans_log_fk != tl.transaction_log_pk)
or pth.record_mode_code = 'TEMP'
and pth.transaction_log_fk = tl.transaction_log_pk )
and pth.accounting_from_date <= tl.accounting_date
and pth.accounting_to_date > tl.accounting_date
and pth.term_base_record_fk = pp.policy_term_fk
and p.policy_pk = pp.policy_fk
and tl.transaction_log_pk = pp.transaction_log_fk
and pp.active_premium_b = 'Y'
and pp.rate_period_type_code in ('CS_PERIOD','SR_PERIOD')
and pp.rate_period_to_date > pp.rate_period_from_date
and tl.accounting_date <= sysdate
and p.policy_cycle_code = 'POLICY'
and substr(p.policy_no,1,1) <> 'Q'
and tl.transaction_log_pk = (select max(pp.transaction_log_fk)
from proddw_mart.rmv_policy_premium pp,proddw_mart.rmv_transaction_log tl2
where pth.term_base_record_fk = pp.policy_term_fk
and pp.transaction_log_fk = tl2.transaction_log_pk
and tl2.accounting_date <= sysdate )
and p.policy_type_code in ('LIABCRIME','MIDWIFE')
and pth.accounting_to_date = to_date('01/01/3000','mm/dd/yyyy') --<<<******* eliminates duplicates
and p.policy_no = cls.policy_no
-- and r.risk_pk = cls.risk_pk
and c.coverage_base_record_fk = cls.parent_coverage_base_record_fk(+)
and cls.effective_from_date < pth.effective_to_date -- from date less than period end date
and cls.effective_to_date > pth.effective_from_date -- to date greater than period start date
and cls.policy_effective_date < pth.effective_to_date -- from date less than period end date
and cls.policy_expiry_date > pth.effective_from_date -- to date greater than period start date
group by pp.policy_fk,
pp.transaction_log_fk,
p.policy_no,
p.policy_type_code,
pp.risk_fk,
r.risk_base_record_fk,
r.entity_fk,
substr(trim(nvl(r.county_code_used_to_rate,pth.issue_state_code)),1,2), -- rating_state_code,
r.county_code_used_to_rate,
pth.issue_state_code,
nvl(r.risk_cls_used_to_rate,pth.peer_groups_code) , -- rating_peer_group_code,
r.risk_cls_used_to_rate,
pth.peer_groups_code,
pth.policy_term_history_pk,
pth.term_base_record_fk,
to_char(pth.effective_from_date,'yyyy'), --term_effective_year,
c.coverage_pk,
c.coverage_base_record_fk,
pc.coverage_code,
c.product_coverage_code,
pc.long_description,
pp.coverage_component_code,
c.effective_from_date,
c.effective_to_date,
cls.coverage_code, -- coverage_class_code,
cls.coverage_long_desc, -- coverage_class_long_desc,
decode(pp.coverage_component_code ,'GROSS',cls.exposure_unit,null),-- exposure_unit,
decode(pp.coverage_component_code ,'GROSS',cls.number_of_patient_day,null), -- number_of_patient_day,
pth.effective_from_date, --term_eff_from_date,
pth.effective_to_date, --, --term_eff_to_date,
pp.premium_amount ;Edited by: BluShadow on 27-Jun-2012 16:12
added {noformat}{noformat} tags for readability. PLEASE READ {message:id=9360002} AS PREVIOUSLY REQUESTED! & -
Hi,
We have a problem with a Oracle procedure call using the Sql Execute
Procedure statement.
The call gives us this error :
SYSTEM ERROR: (This error was converted)
(This error was converted)
OpenCursor failed for SQL statement in project LFB010, class
ClsDemarreLFB010,
method Demarre, methodId 4, line 32, error from database is:
ORA-01036: illegal variable name/num
Class: qqdb_ResourceException
Distributed method called: qqdb_SessionProxy.OpenCursor!22 (object
name
instance/d4745a10-c8e4-11d1-97fd-90cad1e7aa77:0x196:0x4/lfb010_cl0/lfb010_cl
0-fonctiondbservice0x196:0x2)
from partition "LFB010_CL0_Client", (partitionId =
D4745A10-C8E4-11D1-97FD-90CAD1E7AA77:0x196:0x4, taskId =
[D4745A10-C8E4-11D1-97FD-90CAD1E7AA77:0x196.3]) in application
"FTLaunch_cl0", pid 4290975297 on node LAXOU146 in environment
CentralEnv
Oracle error: 1036, Server: sipre_tcp, UserName: forte
Database Statement: begin
:qqReturnValue := AID_CUMUL_ELTVAL;
end;
Class: qqdb_ResourceException ..........
And this is the TOOL code :
BEGIN TRANSACTION
TmpEtat : IntegerData = new;
TmpEtat.SetValue (( SQL EXECUTE PROCEDURE AID_CUMUL_ELTVAL ON SESSION
FonctionDBService ));
Etat = TmpEtat.Value;
END TRANSACTION;
Our procedure has no parameter and when we put a dummy parameter to the
procedure and pass it in the TOOL SQL statement, it works fine althoug the
Forté help says the parameter list is optionnal !
We tried to execute the procedure in a "SQL Select OurProdecure Into ..."
statement, but it does'nt work because there is a SQL update in the
procedure and it is forbidden by Oracle.
Has anyone seen this error before ?
Any ideas would be greatly appreciated.
Many thanks and regards,
Manuel DEVEAUX
Previade, France
e-mail : deveauxpreviade.frHi,
We have a problem with a Oracle procedure call using the Sql Execute
Procedure statement.
The call gives us this error :
SYSTEM ERROR: (This error was converted)
(This error was converted)
OpenCursor failed for SQL statement in project LFB010, class
ClsDemarreLFB010,
method Demarre, methodId 4, line 32, error from database is:
ORA-01036: illegal variable name/num
Class: qqdb_ResourceException
Distributed method called: qqdb_SessionProxy.OpenCursor!22 (object
name
instance/d4745a10-c8e4-11d1-97fd-90cad1e7aa77:0x196:0x4/lfb010_cl0/lfb010_cl
0-fonctiondbservice0x196:0x2)
from partition "LFB010_CL0_Client", (partitionId =
D4745A10-C8E4-11D1-97FD-90CAD1E7AA77:0x196:0x4, taskId =
[D4745A10-C8E4-11D1-97FD-90CAD1E7AA77:0x196.3]) in application
"FTLaunch_cl0", pid 4290975297 on node LAXOU146 in environment
CentralEnv
Oracle error: 1036, Server: sipre_tcp, UserName: forte
Database Statement: begin
:qqReturnValue := AID_CUMUL_ELTVAL;
end;
Class: qqdb_ResourceException ..........
And this is the TOOL code :
BEGIN TRANSACTION
TmpEtat : IntegerData = new;
TmpEtat.SetValue (( SQL EXECUTE PROCEDURE AID_CUMUL_ELTVAL ON SESSION
FonctionDBService ));
Etat = TmpEtat.Value;
END TRANSACTION;
Our procedure has no parameter and when we put a dummy parameter to the
procedure and pass it in the TOOL SQL statement, it works fine althoug the
Forté help says the parameter list is optionnal !
We tried to execute the procedure in a "SQL Select OurProdecure Into ..."
statement, but it does'nt work because there is a SQL update in the
procedure and it is forbidden by Oracle.
Has anyone seen this error before ?
Any ideas would be greatly appreciated.
Many thanks and regards,
Manuel DEVEAUX
Previade, France
e-mail : deveauxpreviade.fr -
On making call to Oracle procedures from Java, Value becomes null on oracle
We are using some user defined Oracle data types in my Java/J2EE application
and some of them are Oracle collections(ex. VARRAY).
We are making a call to Procedures/Functions from Java, there are some
parameters of user defined data types declared in the
procedures/functions, from java the values are properly setting to these
user defined data type parameters and sending to Procedures.
We are not getting any exception at Java side and Oracle side and values
are becoming blank/null at oracle procedure side for the parameters of
user defined data types.
But when do the count of collection of user defined data type then it is
properly giving the size of collection(VARRAY).
When we are trying to read the values from the collection(VARRAY) it is
giving blank/null value and there is no exception.
Please let me know if you have any suggestion on this?user7671994 wrote:
When we are trying to read the values from the collection(VARRAY) it is
giving blank/null value and there is no exception.If you are talking about VARCHAR2 parameters of the objects - then you should add orai18n.jar to classpath. -
Can we create java_object data type in oracle procedure
i want to construct java_object like data stucture in oracle procedure, then i have to retrieve the object
via callable statement. is it possible? or any other solutions?i want to construct java_object like data stucture in
oracle procedure, then i have to retrieve the object
via callable statement. is it possible? No.
or any other
solutions?Of course. Return the data, and construct it in java. -
Java Visualizer for Oracle 8i Object model
I have used the java visualizer demo version that is within Ora8iR2 but it cant work with oracle spatial object model I think this version is designed for the relational model.
Where I can find a object model oracle spatial visualizer??
Where I can find any oraclevector2image (jpeg or gif) traslator?
Anybody knows whats the procedure for geolocate the address field of any other table in the database?
nullThis is a duplicate question. Answers are in the other posting. Thanks.
Dan -
Export: ". exporting post-schema procedural objects and actions"
Hi all,
I am trying to do a full database export from the server and an import to another PC.
I tried exporting recieved the following warnings:
. exporting synonyms
. exporting views
. exporting referential integrity constraints
. exporting stored porcedures
. exporting operators
. exporting indextypes
. exporting bitmap, functional and extensible indexes
. exporting posttables actions
. exporting triers
. exporting matrializes views
. exporting snapshot logs
. exporting job queues
. exporting refresh grups and children
. exporting dimensions
. exporting post-schema procedural objects and actions
EXP-00008: ORACLE error 903 encountered
ORA-00903: invalid table name
ORA-06512: at "SYS.DBMS_RULE_EXP_RL_INTERNAL", line 311
ORA-06512: at "SYS.DBMS_RULE_EXP_RULES", line 142
ORA-06512: at line 1
EXP-00083: The previous problem occurred when callig SYS.DBMS_RULES.schema_info_exp
. exporting user history table
. exporting defualt and system auditing options
. exporting statistics
Export terminated successfully with warnings.
I been through the forum and was advised to run the catalog.sql, then rerun the exp command.
I did as suggested but the export hangs at the last line:
Export donw in WE8MSWIN1252 character set and AL16UTF16 NCHAR character set
About to export the entire database ...
. exporting tablespace definitions
. exporting profiles
. exporting user definitions
. exporting roles
. exporting resource costs
. exporting rollback segment definitions
. exporting database links
. exporting sequence numbers
. exporting directory aliases
. exporting context namespaces
. exporting foreign function library names
. exporting PUBLIC type synonyms
. exporting private type synonyms
. exporting object type definitions <- hangs here
Is there a way to resolve this? Or should I approach another method?
Any of your help is greatly appreciated. Thank you.
Thanks and Regards
SanI am also trying to figure all the stuffs out. I try to answer as much as I know. Thanks.
What is the export utility version?
Using exp, "Export: Release 9.2.0.1.0"
What is the import utility version?
Using imp, "Import: Release 9.2.0.1.0"
What version of Oracle database are you trying to export?
9.2.0.1.0
Into what version of Oracle database are you trying to import?
9.2.0.1.0
What are the database character sets and values of environment variable 'NLS_LANG' for each case?
Not sure about this but I didnt change any parameters of the character set, should be
WE8MSWIN1252
Using WinXP OS, <- quite problematic, having a hard time trying to configure. :( -
How to identify the locks in oracle db objects? i dont have access to check
How to identify the locks in oracle db objects? i dont have access to check the v$lock or v$ objects. i dont have dba access. what are the symptoms for table, row or objects lock? how v guess it would be lock?
Thanks in advance friends..I believe you will have to call your DBA on the phone in that case.
You can query something with a select ... for update nowait.
If it raises an exception you can handle it within a when section.
-- Running in one session
SQL> create table t1 as select 1 col1 from dual;
Table created
SQL> select * from t1 for update nowait;
COL1
1
SQL>
-- now running in a different session
SQL> select * from t1 for update nowait;
select * from t1 for update nowait
ORA-00054: resource busy and acquire with NOWAIT specified
SQL> set serveroutput on
SQL>
SQL> DECLARE
2 CURSOR cur1 IS
3 SELECT col1 FROM t1 FOR UPDATE NOWAIT;
4 v_col1 NUMBER;
5 locking_error EXCEPTION;
6 PRAGMA EXCEPTION_INIT(locking_error, -00054);
7 BEGIN
8 OPEN cur1;
9 EXCEPTION
10 WHEN locking_error THEN
11 dbms_output.put_line('Busted locking my rows!');
12 END;
13 /
Busted locking my rows!
PL/SQL procedure successfully completed
SQL> Now, surely you won't be able to tell anything else other than there was something locked there.
But none of the details you would find in the views. -
Using oracle procedural gateway to connect to mq series
Hi,
I am working on setting up my connection to export data from oracle database to db2 using mq-series.
MQ-Series client software and oracle procedural gateway v9 are installed on HP-UX .
initsid.ora & initsid.gtwboot file for the gateway are configured. listener.ora and tnsnames.ora are also configured and running.
I created a dblink and then tried to test my connection using the test scripts given by IBM.
I got the following error,
ORA-04052: error occurred when looking up remote object [email protected]
ORA-00604: error occurred at recursive SQL level 1
ORA-28509: unable to establish a connection to non-Oracle system
ORA-02063: preceding line from DCY3
I generated a trace and I got the following information from listener.trc
nsopen: opening transport...
nttcnp: Validnode Table IN use; err 0x0
nttcnp: getting sockname
nttcnr: waiting to accept a connection.
nttcnr: getting sockname
nttvlser: valid node check on incoming node 172.25.228.7
nttvlser: Accepted Entry: 172.25.228.7
nttcon: set TCP_NODELAY on 11
nsopen: transport is open
nsnainit: inf->nsinfflg[0]: 0xd inf->nsinfflg[1]: 0xd
nsopen: global context check-in (to slot 4) complete
nsanswer: deferring connect attempt; at stage 5
nscon: doing connect handshake...
nscon: got NSPTCN packet
nsevdansw: exit
nsbeqaddr: connecting...
sntpcall: About to exec /u46/oracle/app/oracle/product/bin/pg4mqc90drv
sntpcall: detaching from parent with additional fork
sntpcall: only 0 bytes read
sntpcall: Can't read from pipe; err[1] = 32
nserror: nsres: id=4, op=72, ns=12547, ns2=12560; nt[0]=517, nt[1]=32, nt[2]=0;
ora[0]=0, ora[1]=0, ora[2]=0
nscon: sending NSPTRF packet
nstimarmed: no timer allocated
nsclose: closing transport
nsclose: global context check-out (from slot 4) complete
nsglecmd: Deallocating cxd 0x40045ef0.
Listener.log gave me the following information,
12-JAN-2010 14:47:34 * (CONNECT_DATA=(SID=dcy3)) * (ADDRESS=(PROTOCOL=tcp)(HOST=
172.25.228.7)(PORT=59501)) * establish * dcy3 * 12500
TNS-12500: TNS:listener failed to start a dedicated server process
TNS-12547: TNS:lost contact
TNS-12560: TNS:protocol adapter error
TNS-00517: Lost contact
HPUX Error: 32: Broken pipe
I researched online and made sure that I have enough swap,memory on my OS.I increased the value for processes in init.ora file.
My log files have not exceeded the maximum limit.
The trace shows that my listener is loosing contact when it is trying to read the driver from /u46/oracle/app/oracle/product/bin/pg4mqc90drv.
I am not sure how to proceed from this point,though I have a thought of relinking my libraries in oracle.
Can anyone give any information on this.Hi,
listener.ora,
DCY3LSNR =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL=IPC)
(KEY=ORAIPC)
(ADDRESS =
(PROTOCOL=TCP)
(HOST=fngtest)
(PORT=1414)
SID_LIST_DCY3LSNR =
(SID_LIST =
(SID_DESC =
(SID_NAME=DCY3)
(ORACLE_HOME=/u46/oracle/app/oracle/product)
(PROGRAM=pg4mqc90drv)
STARTUP_WAIT_TIME_DCY3LSNR=0
CONNECT_TIMEOUT_DCY3LSNR=1000
TRACE_LEVEL_DCY3LSNR=4
TRACE_DIRECTORY_DCY3LSNR=/u46/oracle/app/oracle/product/network/trace
TRACE_FILE_DCY3LSNR=listener
LOG_DIRECTORY_DCY3LSNR=/u46/oracle/app/oracle/product/network/log
LOG_FILE_DCY3LSNR=listener
$ cat initDCY3.ora
#===========================================================================
# GATEWAY INITIALIZATION FILE:
# Oracle Procedural Gateway for IBM MQSeries Client (pg4mqc90).
#===========================================================================
SET HS_DB_NAME=
SET HS_DB_DOMAIN=
SET LOG_DESTINATION=/u46/oracle/app/oracle/product/pg4mqseries/log/DCY3.log
SET QUEUE_MANAGER=DCY3
SET AUTHORIZATION_MODEL=RELAXED
SET TRANSACTION_MODEL=SINGLE_SITE
SET TRANSACTION_LOG_QUEUE=tx_queue_name
SET TRANSACTION_RECOVERY_USER=rec_user
SET TRANSACTION_RECOVERY_PASSWORD=rec_password
SET TRACE_LEVEL=0
$ cat initDCY3.gtwboot
#============================================================================
# GATEWAY BOOT FILE:
# Oracle Procedural Gateway for IBM MQSeries Client (pg4mqc90).
#============================================================================
GATEWAY_SID=DCY3
SERVER_PATH=/u46/oracle/app/oracle/product/bin/pg4mqc90
LOG_DESTINATION=/u46/oracle/app/oracle/product/pg4mqseries/log/DCY3boot.log
LD_LIBRARY_PATH=/usr/lib:/opt/mqm/lib:/u46/oracle/app/oracle/product/lib
MQSERVER=FNGTEST.DCY3/TCP/TCPIP03
#MQCCSID=850
#MODE=DEBUG
I have pasted my listener.ora and init files.
Can anyone pls give me more information on this. -
How to get file names for one oracle directory object.
Hi all ,
I defined one oracle directory object . Now I want to know how many files stored under this object in physical directory and their names ? anyone know how to do it by pl/sql ?
Thanks,
GeorgeChris Poole has an [XUTIL_FINDFILES package|http://www.chrispoole.co.uk/apps/xutlff.htm] which can do this in pure SQL. It does require, though, that your DBA install code in the SYS schema and that you rely on the behavior of an undocumented X$ table. That may not be possible in certain environments.
I personally prefer a small Java stored procedure along the lines of [this one from Tom Kyte|http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:439619916584]. It isn't a pure PL/SQL solution, but it tends to fit relatively cleanly in any environment. Most DBAs will be willing to grant the privileges this sort of approach requires where they would be hesitant to grant the access necessary for XUTIL_FINDFILES.
Justin -
Trying to pass Oracle array/object type to Java
I have a Java class with two inner classes that are loaded into Oracle:
public class PDFJ
public static class TextObject
public String font_name;
public int font_size;
public String font_style;
public String text_string;
public static class ColumnObject
public int left_pos;
public int right_pos;
public int top_pos;
public int bottom_pos;
public int leading;
public TextObject[] column_texts;
}I have object types in Oracle as such that bind to the Java classes:
CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT" AS OBJECT
EXTERNAL NAME 'PDFJ$TextObject'
LANGUAGE JAVA
USING SQLData(
"FONT_NAME" VARCHAR2(25) EXTERNAL NAME 'font_name',
"FONT_SIZE" NUMBER EXTERNAL NAME 'font_size',
"FONT_STYLE" VARCHAR2(1) EXTERNAL NAME 'font_style',
"TEXT_STRING" VARCHAR2(4000) EXTERNAL NAME 'text_string'
CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_TEXT_ARRAY" AS
TABLE OF "PROGRAMMER"."PDFJ_TEXT";
CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN" AS OBJECT
EXTERNAL NAME 'PDFJ$ColumnObject'
LANGUAGE JAVA
USING SQLData(
"LEFT_POS" NUMBER EXTERNAL NAME 'left_pos',
"RIGHT_POS" NUMBER EXTERNAL NAME 'right_pos',
"TOP_POS" NUMBER EXTERNAL NAME 'top_pos',
"BOTTOM_POS" NUMBER EXTERNAL NAME 'bottom_pos',
"LEADING" NUMBER EXTERNAL NAME 'leading',
"COLUMN_TEXTS" "PROGRAMMER"."PDFJ_TEXT_ARRAY" EXTERNAL NAME 'column_texts'
CREATE OR REPLACE TYPE "PROGRAMMER"."PDFJ_COLUMN_ARRAY" AS
TABLE OF "PROGRAMMER"."PDFJ_COLUMN";
/I successfully (as far as I know) build a PDFJ_COLUMN_ARRAY object in a PL/SQL procedure. The PDFJ_COLUMN_ARRAY contains PDFJ_COLUMN objects; each of those objects contains a PDFJ_TEXT_ARRAY of PDFJ_TEXT objects (Example: pdf_column_array(i).pdf_text_array(i).text_string := 'something';). In this procedure, I pass this PDFJ_COLUMN_ARRAY as a parameter to a Java function. I assume the Java function parameter is supposed to be a oracle.sql.ARRAY object.
I cannot figure out how to decompose this generic ARRAY object into a ColumnObject[] array. I also tried Googling and searching the forums, but I can't figure out matching search criteria. I was wondering if anyone here knows anything about passing user-defined Oracle type objects to a Java function and retrieving the user-defined Java class equivalents that they are supposedly mapped to--especially a user-defined array type of user-defined object types containing another user-defined array type of user-defined object types.Ok. I will try asking on the JDBC forum. So, don't
flame me for cross-posting. :PWe won't, if over there you just post basically a
link to this one.
sigh Guess what, he did it the flame-deserving way. It's crossposted at:
http://forum.java.sun.com/thread.jspa?threadID=602805
<flame level="mild">Never ceases to amaze me how people don't think that posting a duplicate rather than a simple link isn't wasteful, as people could end up answering in both of them, not seeing each other's answers</flame> -
Exporting system procedural objects and actions
Hi
Version-Oracle 11.2.0
When i'm trying to export a blank dump it's getting hanged'.Even after 4 hours it's showing
'exporting system procedural objects and actions'.
Following is the command
'exp username/password file=E:\Export\Blank.dmp log=E:\Export\Blank.log full=y indexes=n rows=n'
Any helpuser588120 wrote:
Hi
Version-Oracle 11.2.0
When i'm trying to export a blank dump it's getting hanged'.Even after 4 hours it's showing
'exporting system procedural objects and actions'.
Following is the command
'exp username/password file=E:\Export\Blank.dmp log=E:\Export\Blank.log full=y indexes=n rows=n'
Any helpTry to export only one table
Do you get any error on your log file?
If you fail to export any table, then try to TRACE the Data Pump job. Use the following Metalink note:
*Export/Import DataPump Parameter TRACE - How to Diagnose Oracle Data Pump [ID 286496.1]*
My Oracle Video Tutorials - http://kamranagayev.wordpress.com/oracle-video-tutorials/ -
Convert php script to oracle procedure
To all please help me... I wanna convert php script to oracle procedure..and the script is (exp)..
<?php
include("../config/koneksi.php");
$customer=$_POST['customer'];
$tanggal1=$_POST['theDate1'];
$tanggal2=$_POST['theDate2'];
$no_bulan=substr($tanggal1,0,2);
$bulan_sajah= (substr($no_bulan,0,1)=='0')? substr($no_bulan,1,1) : $no_bulan;
$tahun_sajah=substr($tanggal1,3,4);
$blnkmrn=(int)$bulan_sajah;
$thnkmrn=(int)$tahun_sajah;
if ($blnkmrn==1) {
$bulan_lalu=12;
$tahun_lalu=$thnkmrn-1;}
else {
$bulan_lalu=$blnkmrn-1;
$tahun_lalu=$thnkmrn;
$bulanlalu=strval($bulan_lalu);
$tahunlalu=strval($tahun_lalu);
$sql = "select nip_nas from edo_customer_master_dives where standard_name='$customer'";
$stm = ociparse($conn,$sql);
ociexecute($stm);
ocifetch($stm);
$data=ociresult($stm,1);
$sql12 = "select PRODUCT_LINE_ID,sum(REVENUE)
from PA_FACT_REV_BILLED_CC
where nip_nas='$data' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
$stm12 = ociparse($conn,$sql12);
ociexecute($stm12);
$total_revenue=0;
$i="0";
while (ocifetch($stm12)){
$rev_items=ociresult($stm12,1);
$revenue=ociresult($stm12,2);
$sql2 = "select * from PA_FACT_REV_BILLED_CC
where nip_nas='$data' and PRODUCT_LINE_ID='$rev_items'";
$stm2 = ociparse($conn,$sql2);
ociexecute($stm2);
ocifetch($stm2);
$tahun=ociresult($stm2,1);
$bulan=ociresult($stm2,2);
$nipnas=ociresult($stm2,3);
$prod_line=ociresult($stm2,4);
$rev_item=ociresult($stm2,5);
//$revenue=ociresult($stm2,6);
$query1 = "select standard_name from edo_customer_master_dives where nip_nas='$nipnas'";
$st1 = ociparse($conn,$query1);
ociexecute($st1);
ocifetch($st1);
$nama_cust=ociresult($st1,1);
$query2 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$prod_line'";
$st2 = ociparse($conn,$query2);
ociexecute($st2);
ocifetch($st2);
$nama_prod_line=ociresult($st2,1);
$query3 = "select REV_TYPE_LNAME from parameter.p_rev_type@dwhnas where REV_TYPE_ID='$rev_item'";
$st3 = ociparse($conn,$query3);
ociexecute($st3);
ocifetch($st3);
$nama_rev_item=ociresult($st3,1);
$query4="select sum(total_usage) from PA_FACT_TRAFFIC_CC where PRODUCT_LINE_ID='$prod_line' and nip_nas='$nipnas' and year_id='$tahun_sajah' and month_id='$bulan_sajah' group by PRODUCT_LINE_ID";
$st4 = ociparse($conn,$query4);
ociexecute($st4);
ocifetch($st4);
$total_usage=ociresult($st4,1);
$total=$revenue + $total_usage;
echo $tahun." ".$bulan." ".$nama_cust." ".$nama_prod_line." ".$nama_rev_item." ".$revenue." ".$total_usage." ".$total."<br>";
$total_revenue=$total_revenue+$total;
$i++;
echo $total_revenue;
//cost of product
$query5="select * from PA_FACT_TRAFFIC_CC where nip_nas='$nipnas' and year_id='$tahunlalu' and month_id='$bulanlalu'";
$st5 = ociparse($conn,$query5);
ociexecute($st5);
$total1=0;
$total2=0;
$total3=0;
$total4=0;
$total5=0;
while (ocifetch($st5)){
$nipnas=ociresult($st5,3);
$lineid=ociresult($st5,4);
$itemid=ociresult($st5,5);
$call=ociresult($st5,6);
$unit=ociresult($st5,7);
$query6 = "select prod_line_lname from parameter.p_prod_line@dwhnas where prod_line_id='$lineid'";
$st6 = ociparse($conn,$query6);
ociexecute($st6);
ocifetch($st6);
$nama_prod_line=ociresult($st6,1);
$query7 = "select REV_item_LNAME from parameter.p_rev_item@dwhnas where REV_item_ID='$itemid'";
$st7 = ociparse($conn,$query7);
ociexecute($st7);
ocifetch($st7);
$nama_rev_item=ociresult($st7,1);
$query8 = "select * from cost_of_product where prod_line_lname='$nama_prod_line' and REV_item_LNAME='$nama_rev_item' and end_date is null";
$st8 = ociparse($conn,$query8);
ociexecute($st8);
ocifetch($st8);
$lineid_cost=ociresult($st8,1);
$itemid_cost=ociresult($st8,2);
$satuan=ociresult($st8,5);
$nilai=ociresult($st8,7);
if (strtoupper($satuan)=='MENIT') $total1=$total1+(($unit/60)*$nilai);
if (strtoupper($satuan)=='KBPS') $total2=$total2+($unit*$nilai);
if (strtoupper($satuan)=='SMS') $total3=$total3+($call*$nilai);
if (strtoupper($satuan)=='SSL') $total4=$total4+($call*$nilai);
if (strtoupper($satuan)=='SST') $total5=$total5+($call*$nilai);
$total_cost_pots=$total1+$total2+$total3+$total4+$total5;
echo $total_cost_pots;
?>
this script just for exp.Please convert step by step. for example
(1) remove inverted quotation mark ( ` )
(2) modify constraints syntax (PRIMARY KEY,UNIQUE KEY, KEY etc.) to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/clauses002.htm#g1053592]Oracle constraints.
(3) modify some datatype to [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/sql_elements001.htm#i45441]Oracle datatype
(4) think how to convert auto_increment ([url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_6015.htm#i2067093]Sequence, [url http://download-west.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_7004.htm#i2235611]Beffore Trigger etc. on Oracle)
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14251/adfns_packages.htm#sthref864
http://download-west.oracle.com/docs/cd/B19306_01/appdev.102/b14261/toc.htm -
- I have a Product list box (asp.net) used as multiple selected values for a parameter.
- The Product ID is defined in the Oracle procedure as NUMBER data type.
- In my crystal report, I have a parameter field allow multiple values as p_product_id type as Number. This is the code in my Record Selection Formula for the report:
({?p_product_id}[1] = -1 OR {Procedure_name.product_id} in {p_product_id})
- In C#, this is my code
List<decimal?> productUnit = new List<decimal?>();
int counter = 0;
decimal prod;
for (int i = 0; i < lstProducts.Items.Count; i++)
if (lstProducts.Items[i].Selected)
if (decimal.TryParse(lstProduct.Items[i].Value, out prod))
productUnit.Add((decimal?)prod);
counter++;
if (counter == 0)
productUnit.Add(-1);
ReportingDAO rDataFactory = new ReportingDAO();
retVal = rDataFactory.GetProductReport(productUnit);
public CrystalDecisions.CrystalReports.Engine.ReportDocument GetProductReport(List<decimal?> productUnit)
CrystalDecisions.CrystalReports.Engine.ReportDocument retVal = new rptProductDownload();
ReportLogon rptLog = new ReportLogon();
rptLog.Logon(retVal, "RPT_PRODUCT_DOWNLOAD");
retVal.SetParameterValue("p_product_id", productUnit);
I keep having the "Value does not fall within the expected range" when I debug. My question is, is the data type I used for procedure/Crystal report/ and C# correct ? I always have problem with the data type. Any help would be
appreciated
Thank youHi progGirl,
Thank you for your post, but Microsoft doesn't provide support for CrystalReport now. Please post your question in SAP official site here:
http://forums.sdn.sap.com/forum.jspa?forumID=313
Thank you for your understanding.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.
Maybe you are looking for
-
Error while upgrading from 4.0 to 4.1
Hello, I tried to upgrade from APEX 4.0.0.00.46 to APEX 4.1. It seems the installation went okay, but that the migration of the old applications to the new version went wrong. This is what I got: PL/SQL procedure successfully completed. -- Now beginn
-
Spacing in NavigationSettings.xml
Hi all, I tried to modify the XML entries in order to define the width of the page columns. I added this entries in NavigationSettings.xml (101 is the ID of my PlugNav): <intPlumtreeDPTableSpacing101 value="4" /><intPlumtreeDPLeftWidth101 value="200"
-
Quick Steps can't access my Outlook Contacts
Hello, Quick Steps doesn't seem to be able to access my Outlook Contacts in Outlook 2010. When I try to add contacts for actions such as "Reply and Delete" or "Forward" in the "Respond" category, it gives me the "Address Book: Global Address List". I
-
The repository TESTDS1 cannot be found
Hi, We have copied every thing from one repository to TESTDS1. This repo is there and we are able to login to this repo using SOAP UI. But we are getting below error when we try to call the Import_Repo_Object <?xml version="1.0" encoding="utf-8" ?
-
Problema a stampare?!?
salve a tutti, ho un problema a stampare un file scritto con text edit... qualcino sa dirmi come posso fare?