Import Oracle Procedure
Hi all,
please help me on how to Import stored procedure only from .dmp file.
thanks.
With the help of ugly_DDL.ksh you can extract the DDLs out of a dmp file. Maybe it is worth a look ..
Similar Messages
-
How to pass a array of object to oracle procedure using callable
Hi,
I am calling a oracle stored procedure using callable statement which has IN and OUT parameter of same type.
IN and OUT are array of objects. (ie) IN parameter as Array of Objects and OUT parameter as Array of Objects
here are the steps i have done as advised from oracle forum. correct me if i am in wrong direction
ORACLE types and Stored Procedure
CREATE OR REPLACE
TYPE APPS.DEPARTMENT_TYPE AS OBJECT (
DNO NUMBER (10),
NAME VARCHAR2 (50),
LOCATION VARCHAR2 (50)
CREATE OR REPLACE
TYPE APPS.DEPT_ARRAY AS TABLE OF department_type;
CREATE OR REPLACE package body APPS.insert_object
IS
PROCEDURE insert_object_prc (d IN dept_array, d2 OUT dept_array)
IS
BEGIN
d2 := dept_array ();
FOR j IN 1 .. d.COUNT
LOOP
d2.EXTEND;
d2 (j) := department_type (d (j).dno, d (j).name, d(j).location);
END LOOP;
END insert_object_prc;
END insert_object;
JAVA CODE
Value Object
package com.custom.vo;
public class Dep {
public int empNo;
public String depName;
public String location;
public int getEmpNo() {
return empNo;
public void setEmpNo(int empNo) {
this.empNo = empNo;
public String getDepName() {
return depName;
public void setDepName(String depName) {
this.depName = depName;
public String getLocation() {
return location;
public void setLocation(String location) {
this.location = location;
to call stored procedure
package com.custom.callable;
import com.custom.vo.Dep;
import oracle.jdbc.OracleCallableStatement;
import oracle.jdbc.OracleConnection;
import oracle.jdbc.OracleTypes;
import oracle.jdbc.pool.OracleDataSource;
import oracle.sql.ARRAY;
import oracle.sql.ArrayDescriptor;
import oracle.sql.Datum;
import oracle.sql.STRUCT;
import oracle.sql.StructDescriptor;
public class CallableArrayTryOut {
private static OracleDataSource odcDataSource = null;
public static void main(String[] args) {
OracleCallableStatement callStatement = null;
OracleConnection connection = null;
try {
odcDataSource = new OracleDataSource();
odcDataSource
.setURL("......");
odcDataSource.setUser("....");
odcDataSource.setPassword("....");
connection = (OracleConnection) odcDataSource.getConnection();
} catch (Exception e) {
System.out.println("DB connection Exception");
e.printStackTrace();
Dep[] dep = new Dep[2];
dep[0] = new Dep();
dep[0].setEmpNo(100);
dep[0].setDepName("aaa");
dep[0].setLocation("xxx");
dep[1] = new Dep();
dep[1].setEmpNo(200);
dep[1].setDepName("bbb");
dep[1].setLocation("yyy");
try {
StructDescriptor structDescriptor = new StructDescriptor(
"APPS.DEPARTMENT_TYPE", connection);
STRUCT priceStruct = new STRUCT(structDescriptor, connection, dep);
STRUCT[] priceArray = { priceStruct };
ArrayDescriptor arrayDescriptor = ArrayDescriptor.createDescriptor(
"APPS.DEPT_ARRAY", connection);
ARRAY array = new ARRAY(arrayDescriptor, connection, priceArray);
callStatement = (OracleCallableStatement) connection
.prepareCall("{call insert_object.insert_object_prc(?,?)}");
((OracleCallableStatement) callStatement).setArray(1, array);
callStatement.registerOutParameter(2, OracleTypes.ARRAY,
"APPS.DEPT_ARRAY");
callStatement.execute();
ARRAY outArray = callStatement.getARRAY(2);
Datum[] datum = outArray.getOracleArray();
for (int i = 0; i < datum.length; i++) {
oracle.sql.STRUCT os = (oracle.sql.STRUCT) datum[0];
Object[] a = os.getAttributes();
for (int j = 0; j < a.length; j++) {
System.out.print("Java Data Type :"
+ a[j].getClass().getName() + "Value :" + a[j]
+ "\n");
connection.commit();
callStatement.close();
} catch (Exception e) {
System.out.println("Mapping Error");
e.printStackTrace();
THE ERROR
Mapping Errorjava.sql.SQLException: Inconsistent java and sql object types
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.check_error(DBError.java:1130)
at oracle.sql.StructDescriptor.toOracleArray(StructDescriptor.java:823)
at oracle.sql.StructDescriptor.toArray(StructDescriptor.java:1735)
at oracle.sql.STRUCT.<init>(STRUCT.java:136)
at com.custom.callable.CallableArrayTryOut.main(CallableArrayTryOut.java:48)You posted this question in the wrong forum section. There is one dedicated to Java that was more appropriate.
Anyway here is a link that describes what you should do.
http://download.oracle.com/docs/cd/B19306_01/java.102/b14355/oraarr.htm#i1049179
Bye Alessandro -
Need help for importing oracle 10G dump into 9i database
hi, Someone help me to import oracle 10G dump into 9i database. I'm studying oracle . Im using oracle 10G developer suite(downloaded from oracle) and oracle 9i database. I saw some threads tat we can't import the higher version dumps into lower version database. But i'm badly need help for importing the dump...
or
someone please tell me the site to download oracle 9i Developer suite as i can't find it in oracle site...I didnt testet it to import a dump out of a 10g instance into a 9i instance if this export has been done using a 10g environment.
But it is possible to perform an export with a 9i environment against a 10g instance.
I am just testing this with a 9.2.0.8 environment against a 10.2.0.4.0 instance and is working so far.
The system raises an EXP-00008 / ORA-37002 error after exporting the data segments (exporting post-schema procedural objects and actions).
I am not sure if it is possible to perform an import to a 9i instance with this dump but maybe worth to give it a try.
It should potentially be possible to export at least 9i compatible objects/segments with this approach.
However, I have my doubts if this stunt is supported by oracle ...
Message was edited by:
user434854 -
Import datbase procedure - urgent
Hi
how can we only import database procedure from a dmp file into a database
regards
kedarIf you are using oralce 9i, you can also use dbms_metadata.get_ddl oracle supplied procedure to get the source of your procedure.
select dbms_metadata.get_ddl('PROCEDURE','P1') from dual;
If you have more than one procedure, you can write same in pl/sql to generate dynamic sql for the same.
Jaffar -
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 -
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! & -
- 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. -
How to call an Oracle Procedure and get a return value in Php
Hi Everyone,
Has anyone tried calling an Oracle procedure from Php using the ora functions and getting the return value ? I need to use the ora funtions (no oci)because of compatibility and oracle 7.x as the database.
The reason why I post this here is because the ora_exec funtion is returning FALSE but the error code displayes is good. Is this a bug in the ora_exec funtion ?
My code after the connection call is as follows:
$cur = ora_open($this->conn);
ora_commitoff($this->conn);
$requestid = '144937';
echo $requestid;
$rc = ora_parse($cur, "begin p_ins_gsdata2
(:requestid, :returnval); end;");
if ($rc == true) {
echo " Parse was successful ";
$rc2 = ora_bind ($cur, "requestid", ":requestid", 32, 1);
if ($rc2 == true) echo " Requestid Bind Successful ";
$rc3 = ora_bind ($cur, "returnval", ":returnval", 32, 2);
if ($rc3 == true) echo " Returnval Bind Successful ";
$returnval = "0";
$rc4 = ora_exec($cur);
echo " Result = ".$returnval." ";
if ($rc4 == false) {
echo " Exec Returned FALSE ";
echo " Error = ".ora_error($cur);
echo " ";
echo "ErrorCode = ".ora_errorcode($cur);
echo "Error Executing";
ora_close ($cur);
The Oracle procedure has a select count from a table and it returns the number of records in that table. It's defined as:
CREATE OR REPLACE procedure p_ins_gsdata2 (
p_requestid IN varchar2 default null,
p_retcode OUT varchar2)
as
BEGIN
SELECT COUNT (*) INTO p_retcode
FROM S_GSMRY_DATA_SURVEY
WHERE request_id = p_requestid ;
COMMIT;
RETURN;
END;
Nothing much there. I want to do an insert into a table,
from the procedure later, but I figured that I start with a select count since it's simpler.
When I ran the Php code, I get the following:
144937
Parse was successful
Requestid Bind Successful
Returnval Bind Successful
Result = 0
Exec Returned FALSE
Error = ORA-00000: normal, successful completion -- while
processing OCI function OBNDRA
ErrorCode = 0
Error Executing
I listed the messages on separate lines for clarity. I don't understand why it parses and binds o.k. but the exec returns false.
Thanks again in advance for your help. Have a great day.
Regards,
Rudiretcode=`echo $?`is a bit convoluted. Just use:
retcode=$?I see no EOF line terminating your input. Your flavour of Unix might not like that - it might ignore the command, though I'd be surprised (AIX doesn't).
replace the EXEC line with :
select 'hello' from dual;
and see if you get some output - then you know if sqlplus commands are being called from your script. You didn't mentioned whether you see the banner for sqlplus. Copy/paste the output that you get, it will give us much more of an idea. -
Problem in XML Parsing via oracle procedure...
Hi,
I wrote one oracle procedure for xml parsing.
I have one valid xml file which has "encode UTF-8". The XML file contains some comments also. While we are parsing the xml file at that time it is not parse successfully and also it is not giving any error. After the following line it is skip rest of the codes(lines).
dbms_xmlparser.parseclob(l_parser, l_clob);
At the end of the xml file there are some comments which is like "<!-- abc --> ".
When I am changing the "encode UTF-8 to ISO-88596-1" & removing the comments which wrote on bottom of the file then its working fine, but the files which we are getting from the system is contains the encode UTF-8 and we don't want to preprocess on that xml files. Even if we will do that via shell script or perl script then it will be overhead to the system and in a single stroke our system will parse more than 5k xml files, so if we will do some preprocess on it, it will take some more time approx 1-2 minutes extra.
So, If someone knows any solution of this problem, then please guide & help me on this.
My xml file structure is as follows:-
<?xml version="1.0" encoding="UTF-8"?>
<mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
<child>
<child1>32.401 V5.5</child1>
<child2>ZoneGate</child2>
</child>
<mc>
<newid>
<id>12</id>
</newid>
<mindex>
<date>20111102180000</date>
<mt>abc1</mt>
<mt>abc2</mt>
<mvalue>
<r>val_1</r>
<r>val_2</r>
</mvalue>
</mindex>
</mc>
</mcd>
<!--
ALARM STATUS
morning 10
afternoon 14
evening 18
night 22
-->
<!--
PARAM:EID = 1
PARAM:GId = 3
PARAM:GSId = 0
--!>
And my oracle procedure is as follows:-
create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
-- Defining the variables
ecode NUMBER;
emesg VARCHAR2(200);
l_bfile BFILE;
l_clob CLOB;
l_dest_offset INTEGER:=1;
l_src_offset INTEGER:=1;
l_Char_set_id NUMBER := NLS_CHARSET_ID('UTF8');
l_lang_context INTEGER := dbms_lob.default_lang_ctx;
l_warning INTEGER;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl1 dbms_xmldom.DOMNodeList;
l_nl2 dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
node1 dbms_xmldom.DOMNode;
colid integer ; -- column id used for identifying which column it belongs.
l_xmltype XMLTYPE;
sub_xmltype XMLTYPE;
num_nodes number;
l_index PLS_INTEGER;
l_subIndex PLS_INTEGER;
starttime Date;
temp_datatime VARCHAR(25);
columnname varchar2(300);
columnvalue varchar2(300);
-- creating a Type which is a type of "test_hem" table RowType, which I created in SVN server
TYPE tab_type IS TABLE OF test_hem%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
-- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
l_bfile := BFileName('MY_FILES', xmlfile);
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
--dbms_lob.loadFromFile(dest_lob => l_clob,
-- src_lob => l_bfile,
-- amount => dbms_lob.getLength(l_bfile));
dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
dbms_lob.close(l_bfile);
-- make sure implicit date conversions are performed correctly
dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
dbms_output.put_line('Date format set');
-- Create a parser.
l_parser := dbms_xmlparser.newParser;
dbms_output.put_line('output 1');
-- Parse the document and create a new DOM document.
dbms_xmlparser.parseclob(l_parser, l_clob);
dbms_output.put_line(' passed parsing');
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_output.put_line(' passed getdocument');
-- Free resources associated with the CLOB and Parser now they are no longer needed.
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
-- Get a list of all the EMP nodes in the document using the XPATH syntax.
l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
-- Loop through the list and create a new record in a tble collection
FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
l_n := dbms_xmldom.item(l_nl1, cur_sel);
t_tab.extend;
-- Use XPATH syntax to assign values to he elements of the collection.
dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
-- putting the state and vendorname into the table rowtype
dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
END LOOP;
-- getting the version and putting into the table rowtype
l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
-- selecting the nodes whose starting tag is "mindex"
l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
-- checking the total number of nodes whose starting through "mi"
num_nodes := dbms_xmldom.getLength(l_nl1);
l_index := 1;
-- For loop to iterate the nodes.
FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
-- whole current node is selected and storing into the node1 variable
node1 := dbms_xmldom.item(l_nl1, cur_sel);
-- setting the xmltype as AL32UTF8
l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
-- if selecting parent node containing the mt child node then only proceed else skip that parent node.
IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
-- fetch the datatime, convert it into to_date format and store it into table rowtype
temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
l_subIndex := 1;
while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
-- getting mt and corresponging mvalue/r values
dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
l_subIndex := l_subIndex + 1;
-- getting the column to which this mapping belongs.
select columnid into colid from abc_table where columnname=name;
CASE colid
WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
END CASE; -- end of case statement.
END LOOP;
-- Insert data into the real table from the table collection.
FORALL i IN t_tab.first .. t_tab.last
INSERT INTO test_hem VALUES t_tab(i);
END IF;
l_index := l_index + 1;
COMMIT;
END LOOP;
commit;
EXCEPTION
WHEN OTHERS THEN
ecode := SQLCODE;
emesg := SQLERRM;
dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;Sorry Odie,
I am new to this site as well as PL/SQL. I am giving additional details which you had mentioned in your last comments.
our Oracle Database version is "10.2.0.4.0"
The structure of target table Instrument_Details is as follows:
Create table Instrument_Details (
instrument_id Integer Primary Key,
provider_name Varchar2(32),
version_number Varchar2(32),
location_id Integer,
installation_date Date,
granularity Integer,
time_out Integer );
Note:- Here test_hem is alias of Instrument_details.
Here instrument_id is a primary key.
provider_name contains the child2 xml tag value.
version_number contains the child1 xml tag value.
location_id contains the newid/id value which is map to other table which fetching the location name corresponding to the location_id.
installation_date contains the date xml tag value.
Now we have created one mapping tables where we mapped the xml tag values "mt" with table column name means "abc1 = granularity", "abc2 = time_out" in that table.
these table column value are written under mvalue xml tag.
_Our Database Character set is_:-
NLS_CHARACTERSET WE8ISO8859P1
Now as you suggest me to format your code. I am writing the xml code and procedure code again.
My xml file structure is as follows:-
<?xml version="1.0" encoding="UTF-8"?>
<mcd xmlns:HTML="http://www.w3.org/TR/REC-xml">
<child>
<child1>32.401 V5.5</child1>
<child2>ZoneGate</child2>
</child>
<mc>
<newid>
<id>12</id>
</newid>
<mindex>
<date>20111102180000</date>
<mt>abc1</mt>
<mt>abc2</mt>
<mvalue>
<r>val_1</r> -- here val_1 and val_2 are numeric values
<r>val_2</r>
</mvalue>
</mindex>
</mc>
</mcd>
<!--
ALARM STATUS
morning 10
afternoon 14
evening 18
night 22
-->
<!--
PARAM:EID = 1
PARAM:GId = 3
PARAM:GSId = 0
--!> And my oracle procedure is as follows:-
create or replace procedure loadXMLtotable(dir_name IN varchar2, xmlfile IN varchar2) AS
-- Defining the variables
ecode NUMBER;
emesg VARCHAR2(200);
l_bfile BFILE;
l_clob CLOB;
l_dest_offset INTEGER:=1;
l_src_offset INTEGER:=1;
l_Char_set_id NUMBER := NLS_CHARSET_ID('UTF8');
l_lang_context INTEGER := dbms_lob.default_lang_ctx;
l_warning INTEGER;
l_parser dbms_xmlparser.Parser;
l_doc dbms_xmldom.DOMDocument;
l_nl1 dbms_xmldom.DOMNodeList;
l_nl2 dbms_xmldom.DOMNodeList;
l_n dbms_xmldom.DOMNode;
node1 dbms_xmldom.DOMNode;
colid integer ; -- column id used for identifying which column it belongs.
l_xmltype XMLTYPE;
sub_xmltype XMLTYPE;
num_nodes number;
l_index PLS_INTEGER;
l_subIndex PLS_INTEGER;
starttime Date;
temp_datatime VARCHAR(25);
columnname varchar2(300);
columnvalue varchar2(300);
-- creating a Type which is a type of "Instrument_Details" table RowType, which I created in SVN server
TYPE tab_type IS TABLE OF Instrument_Details%ROWTYPE;
t_tab tab_type := tab_type();
BEGIN
-- Passing the xmlfile and virtual directory name which we gave at the time of directory creation
l_bfile := BFileName('MY_FILES', xmlfile);
dbms_lob.createtemporary(l_clob, cache=>FALSE);
dbms_lob.open(l_bfile, dbms_lob.lob_readonly);
--dbms_lob.loadFromFile(dest_lob => l_clob,
-- src_lob => l_bfile,
-- amount => dbms_lob.getLength(l_bfile));
dbms_lob.loadclobfromfile(l_clob, l_bfile, dbms_lob.getlength(l_bfile),
l_dest_offset, l_src_offset, l_Char_set_id, l_lang_context, l_warning);
dbms_lob.close(l_bfile);
-- make sure implicit date conversions are performed correctly
dbms_session.set_nls('NLS_DATE_FORMAT','''YYYY-MON-DD HH24:MI:SS''');
dbms_output.put_line('Date format set');
-- Create a parser.
l_parser := dbms_xmlparser.newParser;
dbms_output.put_line('output 1');
-- Parse the document and create a new DOM document.
dbms_xmlparser.parseclob(l_parser, l_clob);
*-- Below lines are skipping....*
dbms_output.put_line(' passed parsing');
l_doc := dbms_xmlparser.getDocument(l_parser);
dbms_output.put_line(' passed getdocument');
-- Free resources associated with the CLOB and Parser now they are no longer needed.
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
-- Get a list of all the EMP nodes in the document using the XPATH syntax.
l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/child');
-- Loop through the list and create a new record in a tble collection
FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
l_n := dbms_xmldom.item(l_nl1, cur_sel);
t_tab.extend;
-- Use XPATH syntax to assign values to he elements of the collection.
dbms_xslprocessor.valueOf(l_n,'child1/text()',t_tab(t_tab.last).country);
-- putting the state and vendorname into the table rowtype
dbms_xslprocessor.valueOf(l_n,'child2/text()',t_tab(t_tab.last).state);
END LOOP;
-- getting the version and putting into the table rowtype
l_n := dbms_xslprocessor.selectSingleNode(dbms_xmldom.makeNode(l_doc),'//mcd/mc/newid/id');
dbms_xslprocessor.valueOf(l_n,'id/text()',t_tab(t_tab.last).id);
-- selecting the nodes whose starting tag is "mindex"
l_nl1 := dbms_xslprocessor.selectNodes(dbms_xmldom.makeNode(l_doc),'//mcd/mc/mindex');
-- checking the total number of nodes whose starting through "mi"
num_nodes := dbms_xmldom.getLength(l_nl1);
l_index := 1;
-- For loop to iterate the nodes.
FOR cur_sel IN 0 .. dbms_xmldom.getLength(l_nl1) - 1 LOOP
-- whole current node is selected and storing into the node1 variable
node1 := dbms_xmldom.item(l_nl1, cur_sel);
-- setting the xmltype as AL32UTF8
l_xmltype := xmltype(l_bfile, nls_charset_id('AL32UTF8'));
-- if selecting parent node containing the mt child node then only proceed else skip that parent node.
IF (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r') > 0) Then
-- fetch the datatime, convert it into to_date format and store it into table rowtype
temp_datatime := dbms_xslprocessor.valueOf(node1, 'date/text()');
t_tab(t_tab.last).data_time := to_char(to_date(temp_datatime, 'YYYYMmcDHH24MISS'));
l_subIndex := 1;
while (l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mt[' || l_subIndex || ']') > 0 and l_xmltype.Existsnode('//mcd/mc/mindex[' || l_index || ']/mvalue/r['|| l_subIndex || ']') > 0 ) LOOP
-- getting mt and corresponging mvalue/r values
dbms_xslprocessor.valueOf(node1,'mt[' || l_subIndex || ']/text()',columnname);
dbms_xslprocessor.valueOf(node1,'mvalue/r[' || l_subIndex || ']/text()',columnvalue);
l_subIndex := l_subIndex + 1;
-- getting the column to which this mapping belongs.
select columnid into colid from abc_table where columnname=name;
CASE colid
WHEN 1 THEN t_tab(t_tab.last).col1 := columnvalue;
WHEN 2 THEN t_tab(t_tab.last).col2 := columnvalue;
WHEN 3 THEN t_tab(t_tab.last).col3 := columnvalue;
ELSE dbms_output.put_line('No column mapping for counter ' || columnname) ;
END CASE; -- end of case statement.
END LOOP;
-- Insert data into the real table from the table collection.
FORALL i IN t_tab.first .. t_tab.last
INSERT INTO test_hem VALUES t_tab(i);
END IF;
l_index := l_index + 1;
COMMIT;
END LOOP;
commit;
EXCEPTION
WHEN OTHERS THEN
ecode := SQLCODE;
emesg := SQLERRM;
dbms_output.put_line(TO_CHAR(ecode) || '-' || emesg);
dbms_lob.freetemporary(l_clob);
dbms_xmlparser.freeParser(l_parser);
dbms_xmldom.freeDocument(l_doc);
END;Thanks in advance for your help... -
Issue with IN parameter of Oracle Procedure returning two RefCursors...
Hi all,
I'm having a nightmare with an Oracle procedure that takes one input parameter and returns two RefCursors as outputs. I recently got help in this forum getting a procedure to work that took no inputs but returned two refcursors and that's still working fine. So, for my current issue I have a procedure defined as follows:
PROCEDURE getQueueInfo(domainKey char, importQueues OUT ODPNet.refcur, exportQueues OUT ODPNet.refcur) IS
BEGIN
OPEN importQueues FOR SELECT
source_key, source_applid,
import_status(source_key) as status,
time_added, time_processed
FROM wm_import_source_header
WHERE source_id = domainKey
ORDER BY source_key DESC;
OPEN exportQueues FOR SELECT
h.source_key, d.source_applid,
export_status(h.source_key) as status,
d.source_wire_code, d.destination_wire_code, h.time_added,
h.time_transmitted
FROM wm_export_source_header h, wm_export_source_data d
WHERE h.source_key = d.source_key
and d.source_id = domainKey
ORDER BY h.source_key DESC;
END getQueueInfo;This is defined within a package called ODPNet as with my previous procedure and all works fine (I can execute within Oracle SQL Developer and it returns the expected results). Within my .NET application my code is as follows:
try
using (OracleConnection conn = new OracleConnection(connString))
using (OracleCommand comm = new OracleCommand())
comm.CommandText = "ODPNet.getQueueInfo";
comm.CommandType = CommandType.StoredProcedure;
comm.Connection = conn;
OracleParameter domainKey = new OracleParameter();
OracleParameter importQueues = new OracleParameter();
OracleParameter exportQueues = new OracleParameter();
domainKey.OracleDbType = OracleDbType.Char;
importQueues.OracleDbType = OracleDbType.RefCursor;
exportQueues.OracleDbType = OracleDbType.RefCursor;
domainKey.Value = "UKBD72";
domainKey.Direction = ParameterDirection.Input;
importQueues.Direction = ParameterDirection.Output;
exportQueues.Direction = ParameterDirection.Output;
comm.Parameters.Add(domainKey);
comm.Parameters.Add(importQueues);
comm.Parameters.Add(exportQueues);
conn.Open();
comm.ExecuteNonQuery();
OracleDataReader dr1 = ((OracleRefCursor)importQueues.Value).GetDataReader();
OracleDataReader dr2 = ((OracleRefCursor)exportQueues.Value).GetDataReader();
if (dr1.HasRows)
while (dr1.Read())
result6 += dr1["source_applid"].ToString() + "<br>";
else
result6 += "No Rows";
if (dr2.HasRows)
while (dr2.Read())
result7 += dr2["source_applid"].ToString() + "<br>";
else
result7 += "No Rows";
catch (Exception ex)
result6 = ex.ToString();
}The value I want to submit as the IN parameter of the procedure is "UKBD72". but I'm really not sure how to apply this and then return my two refcursors into separate datareaders (except for the input parameter stuff the code above is exactly what I did with the other procedure that returned two ref cursors and still works fine). When I run this code I get no errors, I just get told that each DataReader has no rows returned, which shouldn't be right.
Any help with this would be hugely appreciated.
Cheers,
SebSorry folks, after staring at this over and over, eventually going to sleep and coming back to it with some fresh eyes I realised I was just being a complete idiot - I was feeding the procedure different data in the .NET app than I was when testing in Oracle SQL Developer. Low and behold once I gave it the right data it worked!
Silly me... -
Special excise duty in import pricing procedure are creadited in GR
Dear Guys,
I have configured the import pricing procedure, new condition type for special excise duty.But while creation of Po it is not coming automatically we hav enter manually. But we want the it shuld come automatically.
And second I have created the import Po with special excise duty. And then posted customs MIRO. the below are the entries i.e
CVD ,ECS on cvd ,SECS on CVD ,basisc custonm duty ECS on basic custom,SCES on basic customs & special excise duty
20400134 THE COMMISIONER OF C 3700016680 V0 1,064.00-
16020412 GR/IR CLG-CVD 3700016680 V0 47.00
16020411 GR/IR CLG-CUSTOM 3700016680 V0 60.00
16020412 GR/IR CLG-CVD 3700016680 V0 150.00
16020412 GR/IR CLG-CVD 3700016680 V0 260.00
16020411 GR/IR CLG-CUSTOM 3700016680 V0 150.00
16020412 GR/IR CLG-CVD 3700016680 V0 147.00
16020411 GR/IR CLG-CUSTOM 3700016680 V0 250.00
And i posted the goods receipt. the special excise duty also creadited that shuld have to come in GR. Plz suggest what settings i have missed out. .
GR aacounting entrei in that you can find the GR/IR CLG-CVD (Special excise duty)
9 23040101 TRADING PIPE JPB 3700016680 1,645,607.00
6 16020402 GR/IR CLG-RM-IMP 3700016680 1,635,000.00-
0 41025051 TRD PUR PIPE JPB 3700016680 1,635,000.00
0 41040101 COST OF GOODS PUR 3700016680 1,645,607.00-
6 16020411 GR/IR CLG-CUSTOM 3700016680 460.00-
0 41025051 TRD PUR PIPE JPB 3700016680 207.00
0 41025051 TRD PUR PIPE JPB 3700016680 400.00
0 16020412 GR/IR CLG-CVD 3700016680 147.00-
0 16020410 GR/IR CLG-FRT(IMP) 3700016680 10,000.00-
0 41025051 TRD PUR PIPE JPB 3700016680 10,000.00
Quick respose will highly apprciable.
Regards,
KirthiDear Friend,
For that condition has to appear automatically you has to maintain that condition in MEK1 transaction code for or if you assigned any access sequence to that condition type remove that it will come automatically
regards
pramod -
Long mode not supported during import Oracle solaris 11 for vritual Box...
Hello buddy,
I try to import Oracle solaris 11 into Oracle vritual Box. but it shows ''Long mode not supported,Rebooting ....". Then reboot again and again..
what is going on ? My PC is WinXP 32bit.
Thanksuser1934450 wrote:
Hello buddy,
I try to import Oracle solaris 11 into Oracle vritual Box. but it shows ''Long mode not supported,Rebooting ....". Then reboot again and again..
what is going on ? My PC is *WinXP 32bit* .
ThanksUse the forum search function before typing a new question.
You might find that whatever you want to ask is already discussed in the forum.
Then you won't have to make a post.
Your question has indeed already been asked a few times, and recently.
Take a look at the search results. -
How to get resultset from oracle procedure use ejb3
how to get resultset from oracle procedure use ejb3
i know oracle procedure should like this
Create or replace PROCEDURE resultset_test(
aaa IN NUMBER,
bbb OUT sys_refcursor) ....
but what s the ejb3 scripts looks like? please give me an example or link~
ths- there are no EJB3 scripts, only compiled application code
- the part of the EJB spec that deals with databases is called the Java Persistence API, but likely you are just looking for the JDBC API.
Now you should know what to Google to get your "example script": "java jdbc oracle procedure" -
Problem in calling oracle procedure from java
Oracle procedure with the following parameters.
CREATE OR REPLACE PROCEDURE CREDITED_TO_STORE_INSERT (P_CUST# IN NUMBER,
P_INV_DATE IN DATE,
P_MEMO# IN NUMBER,
P_SESS_ID IN VARCHAR2 ) IS
BEGIN
/*.........Procedure Body with select and insert statements there no OUT or return variable/value......*/
END;
Now i am calling this procedure with the java code in java.
public boolean execProcedure(String storeNo, String invoiceDate, String claimNo, String sessionID) throws SQLException {
CallableStatement cstmt = null;
java.sql.Date invicDate = this.StringToDate(invoiceDate);
try
cstmt = conn.prepareCall("{call WEBUSER.CREDITED_TO_STORE_INSERT(?,?,?,?,?,?)}");
cstmt.setInt(1, Integer.parseInt(storeNo));
cstmt.setDate(2, invicDate);
cstmt.setInt(3, Integer.parseInt(claimNo));
cstmt.setString(4, sessionID);
cstmt.execute();
catch (Exception e)
System.out.println (e);
} // catch (Exception e)
finally
try
cstmt.close();
catch (Exception ex)
} // catch (Exception ex)
} // finally
return true;
But it will return the following exception.
[STDOUT] java.sql.SQLException: Missing IN or OUT parameter at index:: 5
i don't know why :( please help me ...your procedure has 4 parameters but in the prepared statement you define 6 placeholders
-
How to zip a csv file in a oracle procedure
Hi
i've just created an oracle procedure to put a 120 MB csv file in a shared folder but i need a way to zip this file...is it possible inside a procedure with a command??
My only alternative is to use toad after a SELECT...but it isn't my goal?
Please help meHi,
You can create a stored procedure that will contain a PL/SQL code that will "create" a scheduled job. Take a look at example below:
-- I created a bash file that will be executed in order to create the zipped file
oracle@legatti:/tmp> cat zipfile.sh
#!/bin/sh
/usr/bin/zip /tmp/test.zip /tmp/test.dmp
-- This is the file that will be zipped
oracle@legatti:/tmp> ls -lh test.dmp
-rwxrwxrwx 1 oracle oinstall 193M 2007-12-27 10:10 test.dmp
-- I will connect to Oracle in order to create the stored procedure
oracle@legatti:/tmp> sqlplus / as sysdba
SQL*Plus: Release 10.1.0.2.0 - Production on Thu Dec 27 10:18:39 2007
Copyright (c) 1982, 2004, Oracle. All rights reserved.
Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
-- Let's create the stored procedure
SQL> create or replace procedure zip is
2 begin
3 dbms_scheduler.create_job(job_name => 'zipfile',
4 job_type => 'executable',
5 job_action => '/tmp/zipfile.sh',
6 enabled => true,
7 auto_drop => true);
8 end;
9 /
Procedure created.
-- Now, run the procedure created above
SQL> exec zip;
PL/SQL procedure successfully completed.
-- Just certify that job was executed successfully
SQL> select job_name,status,log_date,run_duration
2 from dba_scheduler_job_run_details
3 where job_name='ZIPFILE';
JOB_NAME STATUS LOG_DATE RUN_DURATION
ZIPFILE SUCCEEDED 27/12/07 10:19:18,883833 -02:00 +000 00:00:17
-- Now you can take a look at zipped file below
SQL> !ls -lh test.*
-rwxrwxrwx 1 oracle oinstall 193M 2007-12-27 10:10 test.dmp
-rw-r--r-- 1 oracle oinstall 32M 2007-12-27 10:19 test.zipHave a lot of fun ... ;-)
Cheers
Legatti
Maybe you are looking for
-
Questions on IDing and upgrading my Media Live PC
I got a Media Live PC a while ago and am just getting around to setting it up for use as my main PC. The basic spec is OK - 5400+ X2 cpu and 4GBs of DDR2-800 (which I might add another 4GBs to as there are two free DIMM slots). What I would like to
-
User Move stuck.....
I have a user that I moved from a post office I am consolidating. It is stuck in the process right now, currently at the retry mailbox item retrieval. I did, before the move, a standard content/structure gwcheck before, then did one with deldupfolder
-
Help needed with certificates for RDS Host servers
Hi, We currently have 4 RD Session-Host servers in our network. All four servers are member of a TS farm. We also have a TS Gatway server. I managed to give the TSGW server a certificate but I need your support on this on the RDS servers. What happen
-
Can not change themes after upgrading to 6.0
I installed my desktop software , connected my 9300 curve via usb and an update/upgrade of blackberry 6.0 was available. After fully installing I cannot change my themes. Themes are still available in my app world and no longer gives the run or activ
-
Help!! my iPhone4s won't turn on
My phone won't turn on. I tried charging it. Holding down the sleep and home button still nothing. I even plugged my iPhone into my computer while holding down the home button and still nothing happened. Anyone know what I'm doing wrong?