Error -29400ORA-29400: data cartridge error IMG-00714: internal error
Hi,
I have a table with a blob column containing images, not
intermedia column.
I am using intermedia process method to change some images,
change maxScale and compression.
I get this error when I try to change certain images
-29400ORA-29400: data cartridge error
IMG-00714: internal error
Does anyone know why?
P.S. how do you do an explict close of ORDSYS variable
after initializing?
Thank you
David Wilton
This is my testing procedure:
PROCEDURE change_image (P_SCANNED_IMAGES_REC IN NUMBER) IS
v_intermed_image ORDSYS.ORDImage := ORDSYS.ORDImage.init();
BEGIN
select image_data
into v_intermed_image.source.localdata
from obra.scanned_images
where scanned_images_rec = p_scanned_images_rec
for update;
v_intermed_image.process('compressionFormat=FAX4,maxScale=1696
2200');
update obra.scanned_images
set image_data = v_intermed_image.source.localdata
where scanned_images_rec = p_scanned_images_rec;
commit;
exception
when others then
dbms_output.put_line('An exception occurred');
dbms_output.put_line(sqlcode || sqlerrm);
END;
David,
I suspect you'll need to supply a TIFF image for the interMedia
engineers to experiment on. The error message you received is
essentially a "last chance" error message and isn't specific
enough for diagnosis of your problem.
Cheers
..Dan
Similar Messages
-
ORA-29400: data cartridge error/IMG-00703: unable to read image data error
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0
ORA-29400: data cartridge error
IMG-00703: unable to read image data
ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 75
ORA-06512: at "ORDSYS.ORDIMERRORCODES", line 65
ORA-06512: at "ORDSYS.ORDIMG_PKG", line 37
ORA-06512: at "ORDSYS.ORDIMAGE", line 927
is raised when the following trigger is processing certain JPGs (example). Other JPGs are handled as expected:
create or replace trigger photo_size_trg
before insert or update on photos
for each row
declare
photo_width integer;
begin
-- Check to see if the new photograph is different from the old one... --
if dbms_lob.compare(:old.photo, :new.photo) != 0
then
-- ...if so, check to see if it's wider than the desired 250 pixel --
-- maximum... --
photo_width := to_number(ordImage.getMetadata(:new.photo)(1).extract('/ordImageAttributes/width/text()').getStringVal());
if photo_width > 250
then
-- ...and if so, apply an image transform that will resize to the photo --
-- to a maximum of 250 pixels wide, keeping the original aspect ratio. --
-- There doesn't seem to be an elegant way of specifying a constraint --
-- in one dimension like this, so the height is specifed as a large --
-- enough value to cover all practical contingencies. --
ordImage.process(:new.photo, 'maxScale=250 10000');
end if;
end if;
end;Any thoughts/suggestions?hi,
I am getting following error,kindly help me out to rectify this ..
thank you
ORA-29400: data cartridge error
ORA-00600: internal error code, arguments: [kokbCollTerminate], [13], [], [], [], [], [], [] -
Hi,everyone,
I had installed R Enterprise in my Oracle 11.2.0.1 base on win7,using the R 2.13.2, ORE 1.1, I can using the part function: like
library(ORE)
options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient.exe', show.error.locations=TRUE)
> ore.connect(user = "RQUSER",password = "RQUSERpsw",conn_string = "", all = TRUE)
> ore.is.connected()
[1] TRUE
> ore.ls()
[1] "IRIS_TABLE"
> demo(package = "ORE")
Demos in package 'ORE':
aggregate Aggregation
analysis Basic analysis & data processing operations
basic Basic connectivity to database
binning Binning logic
columnfns Column functions
cor Correlation matrix
crosstab Frequency cross tabulations
derived Handling of derived columns
distributions Distribution, density, and quantile functions
do_eval Embedded R processing
freqanalysis Frequency cross tabulations
graphics Demonstrates visual analysis
group_apply Embedded R processing by group
hypothesis Hyphothesis testing functions
matrix Matrix related operations
nulls Handling of NULL in SQL vs. NA in R
push_pull RDBMS <-> R data transfer
rank Attributed-based ranking of observations
reg Ordinary least squares linear regression
row_apply Embedded R processing by row chunks
sql_like Mapping of R to SQL commands
stepwise Stepwise OLS linear regression
summary Summary functionality
table_apply Embedded R processing of entire table
> demo("aggregate",package = "ORE")
demo(aggregate)
---- ~~~~~~~~~
Type <Return> to start : Return
> #
> # O R A C L E R E N T E R P R I S E S A M P L E L I B R A R Y
> #
> # Name: aggregate.R
> # Description: Demonstrates aggregations
> # See also summary.R
> #
> #
> #
>
> ## Set page width
> options(width = 80)
> # List all accessible tables and views in the Oracle database
> ore.ls()
[1] "IRIS_TABLE"
> # Create a new table called IRIS_TABLE in the Oracle database
> # using the built-in iris data.frame
>
> # First remove previously created IRIS_TABLE objects from the
> # global environment and the database
> if (exists("IRIS_TABLE", globalenv(), inherits = FALSE))
+ rm("IRIS_TABLE", envir = globalenv())
> ore.drop(table = "IRIS_TABLE")
> # Create the table
> ore.create(iris, table = "IRIS_TABLE")
> # Show the updated list of accessible table and views
> ore.ls()
[1] "IRIS_TABLE"
> # Display the class of IRIS_TABLE and where it can be found in
> # the search path
> class(IRIS_TABLE)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> search()
[1] ".GlobalEnv" "ore:RQUSER" "ESSR"
[4] "package:ORE" "package:ORExml" "package:OREeda"
[7] "package:OREgraphics" "package:OREstats" "package:MASS"
[10] "package:OREbase" "package:ROracle" "package:DBI"
[13] "package:stats" "package:graphics" "package:grDevices"
[16] "package:utils" "package:datasets" "package:methods"
[19] "Autoloads" "package:base"
> find("IRIS_TABLE")
[1] "ore:RQUSER"
> # Select count(Petal.Length) group by species
> x = aggregate(IRIS_TABLE$Petal.Length,
+ by = list(species = IRIS_TABLE$Species),
+ FUN = length)
> class(x)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> x
species x
1 setosa 50
2 versicolor 50
3 virginica 50
> # Repeat FUN = summary, mean, min, max, sd, median, IQR
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = summary)
species Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
1 setosa 1.0 1.4 1.50 1.462 1.575 1.9 0
2 versicolor 3.0 4.0 4.35 4.260 4.600 5.1 0
3 virginica 4.5 5.1 5.55 5.552 5.875 6.9 0
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = mean)
species x
1 setosa 1.462
2 versicolor 4.260
3 virginica 5.552
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = min)
species x
1 setosa 1.0
2 versicolor 3.0
3 virginica 4.5
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = max)
species x
1 setosa 1.9
2 versicolor 5.1
3 virginica 6.9
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = sd)
species x
1 setosa 0.1736640
2 versicolor 0.4699110
3 virginica 0.5518947
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = median)
species x
1 setosa 1.50
2 versicolor 4.35
3 virginica 5.55
> aggregate(IRIS_TABLE$Petal.Length, by = list(species = IRIS_TABLE$Species),
+ FUN = IQR)
species x
1 setosa 0.175
2 versicolor 0.600
3 virginica 0.775
> # More than one grouping column
> x = aggregate(IRIS_TABLE$Petal.Length,
+ by = list(species = IRIS_TABLE$Species,
+ width = IRIS_TABLE$Petal.Width),
+ FUN = length)
> x
species width x
1 setosa 0.1 5
2 setosa 0.2 29
3 setosa 0.3 7
4 setosa 0.4 7
5 setosa 0.5 1
6 setosa 0.6 1
7 versicolor 1.0 7
8 versicolor 1.1 3
9 versicolor 1.2 5
10 versicolor 1.3 13
11 versicolor 1.4 7
12 virginica 1.4 1
13 versicolor 1.5 10
14 virginica 1.5 2
15 versicolor 1.6 3
16 virginica 1.6 1
17 versicolor 1.7 1
18 virginica 1.7 1
19 versicolor 1.8 1
20 virginica 1.8 11
21 virginica 1.9 5
22 virginica 2.0 6
23 virginica 2.1 6
24 virginica 2.2 3
25 virginica 2.3 8
26 virginica 2.4 3
27 virginica 2.5 3
> # Sort the result by ascending value of count
> ore.sort(data = x, by = "x")
species width x
1 virginica 1.4 1
2 virginica 1.7 1
3 versicolor 1.7 1
4 virginica 1.6 1
5 setosa 0.5 1
6 setosa 0.6 1
7 versicolor 1.8 1
8 virginica 1.5 2
9 versicolor 1.1 3
10 virginica 2.4 3
11 virginica 2.5 3
12 virginica 2.2 3
13 versicolor 1.6 3
14 setosa 0.1 5
15 virginica 1.9 5
16 versicolor 1.2 5
17 virginica 2.0 6
18 virginica 2.1 6
19 setosa 0.3 7
20 versicolor 1.4 7
21 setosa 0.4 7
22 versicolor 1.0 7
23 virginica 2.3 8
24 versicolor 1.5 10
25 virginica 1.8 11
26 versicolor 1.3 13
27 setosa 0.2 29
> # by descending value
> ore.sort(data = x, by = "x", reverse = TRUE)
species width x
1 setosa 0.2 29
2 versicolor 1.3 13
3 virginica 1.8 11
4 versicolor 1.5 10
5 virginica 2.3 8
6 setosa 0.4 7
7 setosa 0.3 7
8 versicolor 1.0 7
9 versicolor 1.4 7
10 virginica 2.1 6
11 virginica 2.0 6
12 virginica 1.9 5
13 versicolor 1.2 5
14 setosa 0.1 5
15 versicolor 1.6 3
16 versicolor 1.1 3
17 virginica 2.4 3
18 virginica 2.5 3
19 virginica 2.2 3
20 virginica 1.5 2
21 virginica 1.6 1
22 virginica 1.4 1
23 setosa 0.6 1
24 setosa 0.5 1
25 versicolor 1.8 1
26 virginica 1.7 1
27 versicolor 1.7 1
> # Preserve just 1 row for duplicate x's
> ore.sort(data = x, by = "x", unique.keys = TRUE)
species width x
1 setosa 0.5 1
2 virginica 1.5 2
3 versicolor 1.1 3
4 setosa 0.1 5
5 virginica 2.0 6
6 setosa 0.3 7
7 virginica 2.3 8
8 versicolor 1.5 10
9 virginica 1.8 11
10 versicolor 1.3 13
11 setosa 0.2 29
> ore.sort(data = x, by = "x", unique.keys = TRUE, unique.data = TRUE)
species width x
1 setosa 0.5 1
2 virginica 1.5 2
3 versicolor 1.1 3
4 setosa 0.1 5
5 virginica 2.0 6
6 setosa 0.3 7
7 virginica 2.3 8
8 versicolor 1.5 10
9 virginica 1.8 11
10 versicolor 1.3 13
11 setosa 0.2 29
but when I use the following The ore.doEval command get the errors,
> ore.doEval(function() { 123 })
Error in .oci.GetQuery(conn, statement, ...) :
ORA-29400: data cartridge error
ORA-24323: ?????
ORA-06512: at "RQSYS.RQEVALIMPL", line 23
ORA-06512: at line 4
and I try to run the demo("row_apply", package="ORE") get the same errors:
demo("row_apply",package = "ORE")
demo(row_apply)
---- ~~~~~~~~~
Type <Return> to start : Return
> #
> # O R A C L E R E N T E R P R I S E S A M P L E L I B R A R Y
> #
> # Name: row_apply.R
> # Description: Execute R code on each row
> #
> #
>
> ## Set page width
> options(width = 80)
> # List all accessible tables and views in the Oracle database
> ore.ls()
[1] "IRIS_TABLE"
> # Create a new table called IRIS_TABLE in the Oracle database
> # using the built-in iris data.frame
>
> # First remove previously created IRIS_TABLE objects from the
> # global environment and the database
> if (exists("IRIS_TABLE", globalenv(), inherits = FALSE))
+ rm("IRIS_TABLE", envir = globalenv())
> ore.drop(table = "IRIS_TABLE")
> # Create the table
> ore.create(iris, table = "IRIS_TABLE")
> # Show the updated list of accessible table and views
> ore.ls()
[1] "IRIS_TABLE"
> # Display the class of IRIS_TABLE and where it can be found in
> # the search path
> class(IRIS_TABLE)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> search()
[1] ".GlobalEnv" "ore:RQUSER" "ESSR"
[4] "package:ORE" "package:ORExml" "package:OREeda"
[7] "package:OREgraphics" "package:OREstats" "package:MASS"
[10] "package:OREbase" "package:ROracle" "package:DBI"
[13] "package:stats" "package:graphics" "package:grDevices"
[16] "package:utils" "package:datasets" "package:methods"
[19] "Autoloads" "package:base"
> find("IRIS_TABLE")
[1] "ore:RQUSER"
> # The table should now appear in your R environment automatically
> # since you have access to the table now
> ore.ls()
[1] "IRIS_TABLE"
> # This is a database resident table with just metadata on the R side.
> # You will see this below
> class(IRIS_TABLE)
[1] "ore.frame"
attr(,"package")
[1] "OREbase"
> # Apply given R function to each row
> ore.rowApply(IRIS_TABLE,
+ function(dat) {
+ # Any R code goes here. Operates on one row of IRIS_TABLE at
+ # a time
+ cbind(dat, dat$Petal.Length)
+ })
Error in .oci.GetQuery(conn, statement, ...) :
ORA-29400: data cartridge error
ORA-24323: ?????
ORA-06512: at "RQSYS.RQROWEVALIMPL", line 26
ORA-06512: at line 4
>
whether my oracle's version 11.2.0.1 has no the RDBMS bug fix, and other problems? ThanksOracle R Enterprise 1.1. requires Oracle Database 11.2.0.3, 11.2.0.4. On Linux and Windows. Oracle R Enterprise can also work with an 11.2.0.1 or 11.2.0.2 database if it is properly patched.
Embedded R execution will not work without a patched database. Follow this procedure to patch the database:
1. Go to My Oracle Support:http://support.oracle.com
2. Log in and supply your Customer Support ID (CSI).
3. Choose the Patches & Updates tab.
4. In the Patch Search box, type 11678127
and click Search
5. Select the patch for your version of Oracle Database, 11.2.0.1.
6. Click Download to download the patch.
7. Install the patch using OPatch. Ensure that you are using the latest version of OPatch.
Sherry -
after I generate signature for every image insert into the database, I directly retrive them and compare them , but I got exception like:
exception raised java.sql.SQLException: ORA-29400: data cartridge error
IMG-00923: Signature is empty
ORA-06512: at "ORDSYS.ORDIMAGESIGNATURE", line 5
ORA-06512: at line 1
Image matching score computation failed
Done.
my source code like:
try
{ // try
// contains OrdImageSignature object
Statement stmt = con.createStatement();
OracleResultSet get_sig_result1= (OracleResultSet) stmt.executeQuery("select signature from photos where id =" + 9);
get_sig_result1.next();
OrdImageSignature img_sig1 = (OrdImageSignature)get_sig_result1.getCustomDatum(1,OrdImageSignature.getFactory());
OracleResultSet get_sig_result2= (OracleResultSet) stmt.executeQuery("select signature from photos where id =" + 10);
get_sig_result2.next();
OrdImageSignature img_sig2 = (OrdImageSignature)get_sig_result2.getCustomDatum(1,OrdImageSignature.getFactory());
float gscore
= OrdImageSignature.evaluateScore
( img_sig1, img_sig2, "color=1" );
System.out.println("score value (global color comparison):" + gscore);
float lscore
= OrdImageSignature.evaluateScore
( img_sig1, img_sig2, "color=1 location=1" );
System.out.println("Score value (local color comparison):" + lscore);
get_sig_result2.close();
get_sig_result1.close();
stmt.close();
} // try
catch(Exception e)
{ // catch
System.out.println("exception raised " + e);
System.out.println("Image matching score computation failed");
} // catch (Exception e)I just want to make my question clear, so I put my code to create signature here:
//initialization
stmt = (OraclePreparedStatement)conn.prepareStatement(
"insert into photos ( id , description , sequence ,image, thumb, signature ) " +
" values (?,?,?,ORDSYS.ORDImage.init(),ORDSYS.ORDImage.init(),ORDSYS.ORDImageSignature.init())" );
stmt = (OraclePreparedStatement)conn.prepareStatement(
"select image ,thumb ,signature from photos where id = ? for update" );
stmt.setString( 1, id );
rset = (OracleResultSet)stmt.executeQuery();
if ( !rset.next() )
throw new ServletException( "new row not found in table" );
OrdImage image =
(OrdImage)rset.getCustomDatum( 1, OrdImage.getFactory());
OrdImage thumb =
(OrdImage)rset.getCustomDatum( 2, OrdImage.getFactory());
OrdImageSignature signature =
(OrdImageSignature)rset.getCustomDatum(3,OrdImageSignature.getFactory());
//after load photo to image, generate image, thumb and signature
try
image.processCopy( "maxScale=50,50", thumb );
catch ( SQLException e )
thumb.deleteContent();
thumb.setContentLength( 0 );
System.out.println("after processCopy to make the thumb");
try{
image.setProperties();
image.importData(ctx);
signature.generateSignature(image);
catch(Exception e)
{ // catch
System.out.println("exception raised " + e);
System.out.println("image signature generation failed");
} // catch
//then , save into database
stmt = (OraclePreparedStatement)conn.prepareStatement(
"update photos set image = ? where id = ? " );
stmt.setCustomDatum( 1, image );
stmt.setString( 2, id );
stmt.execute();
stmt.close();
System.out.println("after update image");
stmt = (OraclePreparedStatement)conn.prepareStatement(
"update photos set thumb = ? where id = ? " );
stmt.setCustomDatum( 1, thumb);
stmt.setString( 2, id );
stmt.execute();
stmt.close();
System.out.println("after update thumb");
stmt = (OraclePreparedStatement)conn.prepareCall(
"update photos set signature = ? where id =? ");
stmt.setCustomDatum(1,signature);
stmt.setString( 2, id );
stmt.execute();
stmt.close() ;
System.out.println("after update signature");
//then, go back to my last post to retrive signature and compare. I got the errors.
can anyone help me? thanks. -
Data Cartridge error / IMG-00599
Hi, I have the following code:
create or replace function QBEFileSearch(url varchar2, filename varchar2) return imagelist is
compare_sig ORDSYS.ORDImageSignature;
seedimage ordsys.ordimage;
seedimagesig ordsys.ordimagesignature;
ctx RAW(4000) := null;
weights varchar2(64) := 'color="0,33" texture="0,33" shape="0,33" location="0,0"';
treshhold number;
imagenumber number;
ilist imagelist := imagelist(100);
counter integer := 1;
cursor getimages is
select inumber from tbl_images b
WHERE ORDSYS.IMGSimilar(b.signature, seedimagesig, weights, treshhold)=1;
BEGIN
seedimage := ordsys.ordimage.init('HTTP', url, filename);
seedimagesig := ordsys.ordimagesignature.init();
seedimagesig.generatesignature(seedimage);
treshhold := 50;
open getimages;
loop
fetch getimages into imagenumber;
exit when getimages%NOTFOUND;
ilist.extend;
ilist(counter):= imagenumber;
counter := counter +1;
end loop;
return (ilist);
end QBEFileSearch;
But I get the error message (Translated from Norwegian):
ERROR at line 1:
ORA-29400: Data Cartidge Error
IMG-00599: Internal Error
ORA-06512: at "ORDSYS.ORDIMGSIG_PKG", line 0
ORA-06512: at "ORDSYS.ORDIMAGESIGNATURE", line 90
ORA-06512: at "I0065.QBEFILESEARCH", line 22
ORA-06512: at line 5
when I try to execute it with the following code:
declare
results imagelist := imagelist();
begin
results := QBEFileSearch('laserlasse.no/bilder/', 'vcss.gif');
end;
Any Ideas?See my reply to your previous post....
-
I was trying to develop a data cartridge. I tried the sample code Power Demand Cartridge Example (chapter 11)given in Oracle Documentation "Oracle 8i Data Cartridge Developer's Guide Release 2 (8.1.6)". All objects, indextypes, tables and indexes were successfully created. When I issue the select statement it gives the following error.
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine
Oracle Documentation for ORA-29902 say only this much. "Examine the error messages produced by the index type code and take appropriate action.".
The problem here is that Oracle is unable to invoke the module ODCIIndexStart(). I am unable to find out where the error lies. If anybody knows please help.
MohanThe select statement used for testing the index is
POWERCARTUSER> SELECT P.Region, P.Sample.TotGridDemand ,P.Sample.MaxCellDemand, P.Sample.MinCellDemand FROM PowerDemand_Tab P WHERE Power_Equals(P.Sample,2,8) = 1;
SELECT P.Region, P.Sample.TotGridDemand ,P.Sample.MaxCellDemand, P.Sample.MinCellDemand FROM PowerD
ERROR at line 1:
ORA-29902: error in executing ODCIIndexStart() routine -
Data Cartridge Implementation - PGA Memory Problem
Hi,
I have modified the Data Cartridge implementation explained in the article at http://www.oracle-developer.net/display.php?id=422.
More precisely I have modified it to create not only the type returned, but also the select statement.
The problem I have, is that the PGA memory through the execution of my package always increases, and when it ends the execution the PGA doesn't get released.
I'm wondering if i'm missing something on the ODCITableClose.
Object spec:
create or replace type t_conf_obj as object
atype anytype, --<-- transient record type
static function ODCITableDescribe(rtype out anytype,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number,
static function ODCITablePrepare(sctx out t_conf_obj,
tf_info in sys.ODCITabFuncInfo,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number,
static function ODCITableStart(sctx in out t_conf_obj,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number,
member function ODCITableFetch(self in out t_conf_obj,
nrows in number,
rws out anydataset
) return number,
member function ODCITableClose(self in t_conf_obj
) return number
);Object Body
create or replace type body t_conf_obj as
static function ODCITableDescribe(rtype out anytype,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number
is
r_sql pck_conf_calcolo.rt_dynamic_sql;
v_rtype anytype;
stmt dbms_sql.varchar2a;
begin
HERE I CREATE MY SELECT STATEMENT
if p_cz_conf_livello is null and p_id_profilo is null then
stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
elsif p_cz_conf_livello is not null then
stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
p_id_profilo,
p_cz_conf_livello,
p_dt_rif
else
stmt (1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
p_id_profilo
end if;
|| parse the sql and describe its format and structure.
r_sql.cursor := dbms_sql.open_cursor;
dbms_sql.parse(r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
dbms_sql.describe_columns2(r_sql.cursor,
r_sql.column_cnt,
r_sql.description);
dbms_sql.close_cursor(r_sql.cursor);
|| create the anytype record structure from this sql structure.
anytype.begincreate(dbms_types.typecode_object, v_rtype);
for i in 1 .. r_sql.column_cnt loop
v_rtype.addattr(r_sql.description(i).col_name,
case
--<>--
when r_sql.description(i).col_type in (1, 96, 11, 208) then
dbms_types.typecode_varchar2
--<>--
when r_sql.description(i).col_type = 2 then
dbms_types.typecode_number
when r_sql.description(i).col_type in (112) then
dbms_types.typecode_clob
--<>--
when r_sql.description(i).col_type = 12 then
dbms_types.typecode_date
--<>--
when r_sql.description(i).col_type = 23 then
dbms_types.typecode_raw
--<>--
when r_sql.description(i).col_type = 180 then
dbms_types.typecode_timestamp
--<>--
when r_sql.description(i).col_type = 181 then
dbms_types.typecode_timestamp_tz
--<>--
when r_sql.description(i).col_type = 182 then
dbms_types.typecode_interval_ym
--<>--
when r_sql.description(i).col_type = 183 then
dbms_types.typecode_interval_ds
--<>--
when r_sql.description(i).col_type = 231 then
dbms_types.typecode_timestamp_ltz
--<>--
end,
r_sql.description(i).col_precision,
r_sql.description(i).col_scale,
r_sql.description(i).col_max_len,
r_sql.description(i).col_charsetid,
r_sql.description(i).col_charsetform);
end loop;
v_rtype.endcreate;
|| now we can use this transient record structure to create a table type
|| of the same. this will create a set of types on the database for use
|| by the pipelined function...
anytype.begincreate(dbms_types.typecode_table, rtype);
rtype.setinfo(null,
null,
null,
null,
null,
v_rtype,
dbms_types.typecode_object,
0);
rtype.endcreate();
return odciconst.success;
exception when others then
-- indicate that an error has occured somewhere.
return odciconst.error;
end odcitabledescribe;
static function ODCITablePrepare(sctx out t_conf_obj,
tf_info in sys.ODCITabFuncInfo,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number
is
r_meta pck_conf_calcolo.rt_anytype_metadata;
begin
|| we prepare the dataset that our pipelined function will return by
|| describing the anytype that contains the transient record structure...
r_meta.typecode := tf_info.rettype.getattreleminfo(1,
r_meta.precision,
r_meta.scale,
r_meta.length,
r_meta.csid,
r_meta.csfrm,
r_meta.type,
r_meta.name);
|| using this, we initialise the scan context for use in this and
|| subsequent executions of the same dynamic sql cursor...
sctx := t_conf_obj(r_meta.type);
return odciconst.success;
end;
static function ODCITableStart(sctx in out t_conf_obj,
p_cz_conf_categoria in number,
p_id_profilo in number default null,
p_cz_conf_livello in number default null,
p_dt_rif in varchar2 default to_char(sysdate,'ddmmyyyy')
) return number
is
r_meta pck_conf_calcolo.rt_anytype_metadata;
stmt dbms_sql.varchar2a;
begin
HERE I CREATE MY SELECT STATEMENT
if p_cz_conf_livello is null and p_id_profilo is null then
stmt := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria
elsif p_cz_conf_livello is not null then
stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
p_id_profilo,
p_cz_conf_livello,
p_dt_rif
else
stmt(1) := pck_conf_calcolo.GetSQLConfCategoria(p_cz_conf_categoria,
p_id_profilo
end if;
|| we now describe the cursor again and use this and the described
|| anytype structure to define and execute the sql statement...
pck_conf_calcolo.r_sql.cursor := dbms_sql.open_cursor;
dbms_sql.parse(pck_conf_calcolo.r_sql.cursor, stmt, stmt.first, stmt.last, false, dbms_sql.native);
dbms_sql.describe_columns2(pck_conf_calcolo.r_sql.cursor,
pck_conf_calcolo.r_sql.column_cnt,
pck_conf_calcolo.r_sql.description);
for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
|| get the anytype attribute at this position...
r_meta.typecode := sctx.atype.getattreleminfo(i,
r_meta.precision,
r_meta.scale,
r_meta.length,
r_meta.csid,
r_meta.csfrm,
r_meta.type,
r_meta.name);
case r_meta.typecode
--<>--
when dbms_types.typecode_varchar2 then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor, i, '', 32767);
--<>--
when dbms_types.typecode_number then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as number));
--<>--
when dbms_types.typecode_date then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as date));
--<>--
when dbms_types.typecode_raw then
dbms_sql.define_column_raw(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as raw),
r_meta.length);
--<>--
when dbms_types.typecode_timestamp then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as timestamp));
--<>--
when dbms_types.typecode_timestamp_tz then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as timestamp with time zone));
--<>--
when dbms_types.typecode_timestamp_ltz then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as timestamp with local time zone));
--<>--
when dbms_types.typecode_interval_ym then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as interval year to month));
--<>--
when dbms_types.typecode_interval_ds then
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as interval day to second));
--<>--
when dbms_types.typecode_clob then
--<>--
dbms_sql.define_column(pck_conf_calcolo.r_sql.cursor,
i,
cast(null as clob));
--<>--
end case;
end loop;
|| the cursor is prepared according to the structure of the type we wish
|| to fetch it into. we can now execute it and we are done for this method...
pck_conf_calcolo.r_sql.execute := dbms_sql.execute(pck_conf_calcolo.r_sql.cursor);
return odciconst.success;
end;
member function ODCITableFetch(self in out t_conf_obj,
nrows in number,
rws out anydataset
) return number
is
type rt_fetch_attributes is record(
v2_column varchar2(32767),
num_column number,
date_column date,
clob_column clob,
raw_column raw(32767),
raw_error number,
raw_length integer,
ids_column interval day to second,
iym_column interval year to month,
ts_column timestamp,
tstz_column timestamp with time zone,
tsltz_column timestamp with local time zone,
cvl_offset integer := 0,
cvl_length integer);
r_fetch rt_fetch_attributes;
r_meta pck_conf_calcolo.rt_anytype_metadata;
begin
rws := null;
if dbms_sql.fetch_rows(pck_conf_calcolo.r_sql.cursor) > 0 then
|| first we describe our current anytype instance (self.a) to determine
|| the number and types of the attributes...
r_meta.typecode := self.atype.getinfo(r_meta.precision,
r_meta.scale,
r_meta.length,
r_meta.csid,
r_meta.csfrm,
r_meta.schema,
r_meta.name,
r_meta.version,
r_meta.attr_cnt);
|| we can now begin to piece together our returning dataset. we create an
|| instance of anydataset and then fetch the attributes off the dbms_sql
|| cursor using the metadata from the anytype. longs are converted to clobs...
anydataset.begincreate(dbms_types.typecode_object, self.atype, rws);
rws.addinstance();
rws.piecewise();
for i in 1 .. pck_conf_calcolo.r_sql.column_cnt loop
r_meta.typecode := self.atype.getattreleminfo(i,
r_meta.precision,
r_meta.scale,
r_meta.length,
r_meta.csid,
r_meta.csfrm,
r_meta.attr_type,
r_meta.attr_name);
case r_meta.typecode
--<>--
when dbms_types.typecode_varchar2 then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.v2_column);
rws.setvarchar2(r_fetch.v2_column);
--<>--
when dbms_types.typecode_number then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.num_column);
rws.setnumber(r_fetch.num_column);
--<>--
when dbms_types.typecode_date then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.date_column);
rws.setdate(r_fetch.date_column);
--<>--
when dbms_types.typecode_raw then
dbms_sql.column_value_raw(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.raw_column,
r_fetch.raw_error,
r_fetch.raw_length);
rws.setraw(r_fetch.raw_column);
--<>--
when dbms_types.typecode_interval_ds then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.ids_column);
rws.setintervalds(r_fetch.ids_column);
--<>--
when dbms_types.typecode_interval_ym then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.iym_column);
rws.setintervalym(r_fetch.iym_column);
--<>--
when dbms_types.typecode_timestamp then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.ts_column);
rws.settimestamp(r_fetch.ts_column);
--<>--
when dbms_types.typecode_timestamp_tz then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.tstz_column);
rws.settimestamptz(r_fetch.tstz_column);
--<>--
when dbms_types.typecode_timestamp_ltz then
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.tsltz_column);
rws.settimestampltz(r_fetch.tsltz_column);
--<>--
when dbms_types.typecode_clob then
--<>--
dbms_sql.column_value(pck_conf_calcolo.r_sql.cursor,
i,
r_fetch.clob_column);
rws.setclob(r_fetch.clob_column);
--<>--
end case;
end loop;
|| our anydataset instance is complete. we end our create session...
rws.endcreate();
end if;
return odciconst.success;
end;
member function ODCITableClose(self in t_conf_obj
) return number
is
begin
dbms_sql.close_cursor(pck_conf_calcolo.r_sql.cursor);
pck_conf_calcolo.r_sql := null;
return odciconst.success;
end;
end;We have an Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 running on Windows 2003 sp2.
Thanks in advance.
Riccardo.I'm getting confused with so much answers!!!
-
Oracle CEP JDBC Data Cartridge
Hello,
I'm trying to implement Oracle CEP JDBC Data Cartridge
according to :
http://docs.oracle.com/cd/E23943_01/apirefs.1111/e12048/datacartjdbc.htm#CIHCEFBH
The problem is that it fails on deployment with following error :
<Exception thrown from prepare method com.oracle.cep.cartridge.jdbc.JdbcCartridgeContext.checkCartridgeContextConfig.
java.lang.AssertionError: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
I've added file that contains this class to classpath (com.bea.core.datasource6_1.10.0.0.jar) ,
but get the same error .
Any help would be appreciated .
Regards,
DmitryHello Wei Xiong,
I have the same error when I trying to configure Oracle CQL Processor Table Source according to :
http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/processorcql.htm#CIHCCADG
I've configured table source and had the same error on deployment :
<The application context "check_entrance" could not be started: org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is com.bea.wlevs.ede.api.StatementException: Could not start rule [DBEventQuery] due to error: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is com.bea.wlevs.ede.api.StatementException: Could not start rule [DBEventQuery] due to error: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
at com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:145)
It's look like a same issue.
I've added zip file of my Eclipse project and config.xml of my CEP domain to e-mail.
Thank you !
Regards,
Dmitry -
Restore Issue On LTO-4 Ultrium RW data cartridge
HI,
I have One tape & monthly taking normal backup of my files.Today i am trying to take backup i got a message that media full insert the new media or press cancel the current job....So i press cancel..
Now I want restore the previous back up files..when i insert the tap i am getting below image error
OS : Windows 2003 Server : LTO-4 Ultrium RW data cartridge.
Thank you all...Hi,
Please check if the tape is corrupted or not. If the tape is corrupted, you could refer to the article below to restore the previous back up files.
How to Restore Data from a Backup Set that Contains a Missing or Corrupted Tape
http://support.microsoft.com/kb/244805/en-us
Best Regards,
Mandy
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. -
I have installed Oracle COM Data Cartridge, but I have problem with creating objects.
While calling ORDCom.CreateObject method I always get error represented by HRESULT value = -2147467259 (Ox80004005). Does anybody know what may be purpose of this error?
nullHello Wei Xiong,
I have the same error when I trying to configure Oracle CQL Processor Table Source according to :
http://docs.oracle.com/cd/E23943_01/dev.1111/e14301/processorcql.htm#CIHCCADG
I've configured table source and had the same error on deployment :
<The application context "check_entrance" could not be started: org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is com.bea.wlevs.ede.api.StatementException: Could not start rule [DBEventQuery] due to error: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
org.springframework.beans.FatalBeanException: Error in context lifecycle initialization; nested exception is com.bea.wlevs.ede.api.StatementException: Could not start rule [DBEventQuery] due to error: java.lang.ClassNotFoundException: weblogic.jdbc.wrapper.PoolConnection
at com.bea.wlevs.spring.ApplicationContextLifecycle.onApplicationEvent(ApplicationContextLifecycle.java:145)
It's look like a same issue.
I've added zip file of my Eclipse project and config.xml of my CEP domain to e-mail.
Thank you !
Regards,
Dmitry -
Data Cartridges in Oracle 10g XE
Has anybody ever used Oracle 10g Express Edition and installed a third party data cartridge?
Just wondered if they worked OK and were allowed under the licence agreement. I haven't read anywhere in the licence that they are forbidden and I wondered if it was possible to install them.
Many thanks.They are permitted.
Pproperly designed 'cartridges' use the published Oracle spec. If they live within the restrictions of XE (size, CPU, and no Java stored procedures) they should work.
Oracle Locator is an example of a properly designed cartridge. So is intermedia.
Locator does not have any Java SPs and works in XE.
intermedia does use Java SPs and does not work in XE. -
Mapping a field to a custom data cartridge function
Hi,
I'm looking for a way to get toplink to map a field in a class to a custom data cartridge function.
I'm using Toplink 11g tp3. Is this kind of mapping possible?.
Thanks in advance for any help.
- SunilThe easiest way to do this would probably be to define a view in the database that performs the function, and map your class to the view instead of the table.
Another option would be to map the class to the normal field and do a ReportQuery that applies the function when desired. -
Spatial data cartridge usage examples
Hi
Are there any tutorials or other usage examples for the new spatial data cartridge?
I mean something more than just the plain documentation.
Thanks,
RoyHi,
You could use Oracle Spatial Java Class Library, available at: http://www.oracle.com/technology/software/products/spatial/index.html
It is quite easy to use it.
Regards,
Andrejus -
Is Oracle Data Cartridge a built in component of Oracle 8?
Is Oracle Data Cartridge a built in component of Oracle 8? Or
is it an add on item which needs to be purchased separately?
Thanks,
Adam Tadj
[email protected]
Opinions expressed or questions asked are mine not of my
employer.
nullWell, I am a novice, but I think all of the posts have hit on something. The web fron end application was built with a combination of Visual basic and Visual Studio 2003. My one question now that the curiosity has been settled about why the table is there is now, when and how does it actually get created. I am trying to retrace the steps of the original developers. i.e, was the table automatically created, once the Development software attached to the database, and did the database realize, "hey a .net development program is trying to access me", let me create the MICROSOFTDTPROPERTIES Table.
because another utility table they seem to have is something called GTMBAVERSION. It also only has one row, and it has columns called
Major, Minor, Revision, and Versiondate
The data in those columns, respectivley are 3, 0, 1, 12/5/2003 3:26:49 PM
Now two of the "user accounts" within the tables are GTMBA, and GTMSM. In terms of owners, those are the two owners of those two tables.
Inside of the .net program, the gtmsm account is used to make the actual connection to the database. -
Problem converting data in XML file to internal table data
Hi all,
I have a requirement. I need to convert an XML file to internal table data and based on that data do Goods Receipt in SAP.
With the help of this blog /people/r.eijpe/blog/2005/11/10/xml-dom-processing-in-abap-part-i--convert-an-abap-table-into-xml-file-using-sap-dom-approach
I am able to convert the XML file to data in SAP. But this blog will display the output on screen as ELELEMNT = nodename VALUE= value of that node.
But I donu2019t want in that way, I want to store all the data in XML file in an internal table so that I can make use of those values and do Goods Recipt in SAP.
Can some one suggest how should I read the data in an internal table.
Here is my code..what changes should I make?
*& Report z_xit_xml_check
REPORT z_xit_xml_check.
TYPE-POOLS: ixml.
TYPES: BEGIN OF t_xml_line,
data(256) TYPE x,
END OF t_xml_line.
DATA: l_ixml TYPE REF TO if_ixml,
l_streamfactory TYPE REF TO if_ixml_stream_factory,
l_parser TYPE REF TO if_ixml_parser,
l_istream TYPE REF TO if_ixml_istream,
l_document TYPE REF TO if_ixml_document,
l_node TYPE REF TO if_ixml_node,
l_xmldata TYPE string.
DATA: l_elem TYPE REF TO if_ixml_element,
l_root_node TYPE REF TO if_ixml_node,
l_next_node TYPE REF TO if_ixml_node,
l_name TYPE string,
l_iterator TYPE REF TO if_ixml_node_iterator.
DATA: l_xml_table TYPE TABLE OF t_xml_line,
l_xml_line TYPE t_xml_line,
l_xml_table_size TYPE i.
DATA: l_filename TYPE string.
PARAMETERS: pa_file TYPE char1024 DEFAULT 'c:\temp\orders_dtd.xml'.
Validation of XML file: Only DTD included in xml document is supported
PARAMETERS: pa_val TYPE char1 AS CHECKBOX.
START-OF-SELECTION.
Creating the main iXML factory
l_ixml = cl_ixml=>create( ).
Creating a stream factory
l_streamfactory = l_ixml->create_stream_factory( ).
PERFORM get_xml_table CHANGING l_xml_table_size l_xml_table.
wrap the table containing the file into a stream
l_istream = l_streamfactory->create_istream_itable( table = l_xml_table
size = l_xml_table_size ).
Creating a document
l_document = l_ixml->create_document( ).
Create a Parser
l_parser = l_ixml->create_parser( stream_factory = l_streamfactory
istream = l_istream
document = l_document ).
Validate a document
IF pa_val EQ 'X'.
l_parser->set_validating( mode = if_ixml_parser=>co_validate ).
ENDIF.
Parse the stream
IF l_parser->parse( ) NE 0.
IF l_parser->num_errors( ) NE 0.
DATA: parseerror TYPE REF TO if_ixml_parse_error,
str TYPE string,
i TYPE i,
count TYPE i,
index TYPE i.
count = l_parser->num_errors( ).
WRITE: count, ' parse errors have occured:'.
index = 0.
WHILE index < count.
parseerror = l_parser->get_error( index = index ).
i = parseerror->get_line( ).
WRITE: 'line: ', i.
i = parseerror->get_column( ).
WRITE: 'column: ', i.
str = parseerror->get_reason( ).
WRITE: str.
index = index + 1.
ENDWHILE.
ENDIF.
ENDIF.
Process the document
IF l_parser->is_dom_generating( ) EQ 'X'.
PERFORM process_dom USING l_document.
ENDIF.
*& Form get_xml_table
FORM get_xml_table CHANGING l_xml_table_size TYPE i
l_xml_table TYPE STANDARD TABLE.
Local variable declaration
DATA: l_len TYPE i,
l_len2 TYPE i,
l_tab TYPE tsfixml,
l_content TYPE string,
l_str1 TYPE string,
c_conv TYPE REF TO cl_abap_conv_in_ce,
l_itab TYPE TABLE OF string.
l_filename = pa_file.
upload a file from the client's workstation
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_filename
filetype = 'BIN'
IMPORTING
filelength = l_xml_table_size
CHANGING
data_tab = l_xml_table
EXCEPTIONS
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Writing the XML document to the screen
CLEAR l_str1.
LOOP AT l_xml_table INTO l_xml_line.
c_conv = cl_abap_conv_in_ce=>create( input = l_xml_line-data replacement = space ).
c_conv->read( IMPORTING data = l_content len = l_len ).
CONCATENATE l_str1 l_content INTO l_str1.
ENDLOOP.
l_str1 = l_str1+0(l_xml_table_size).
SPLIT l_str1 AT cl_abap_char_utilities=>cr_lf INTO TABLE l_itab.
WRITE: /.
WRITE: /' XML File'.
WRITE: /.
LOOP AT l_itab INTO l_str1.
REPLACE ALL OCCURRENCES OF cl_abap_char_utilities=>horizontal_tab IN
l_str1 WITH space.
WRITE: / l_str1.
ENDLOOP.
WRITE: /.
ENDFORM. "get_xml_table
*& Form process_dom
FORM process_dom USING document TYPE REF TO if_ixml_document.
DATA: node TYPE REF TO if_ixml_node,
iterator TYPE REF TO if_ixml_node_iterator,
nodemap TYPE REF TO if_ixml_named_node_map,
attr TYPE REF TO if_ixml_node,
name TYPE string,
prefix TYPE string,
value TYPE string,
indent TYPE i,
count TYPE i,
index TYPE i.
node ?= document.
CHECK NOT node IS INITIAL.
ULINE.
WRITE: /.
WRITE: /' DOM-TREE'.
WRITE: /.
IF node IS INITIAL. EXIT. ENDIF.
create a node iterator
iterator = node->create_iterator( ).
get current node
node = iterator->get_next( ).
loop over all nodes
WHILE NOT node IS INITIAL.
indent = node->get_height( ) * 2.
indent = indent + 20.
CASE node->get_type( ).
WHEN if_ixml_node=>co_node_element.
element node
name = node->get_name( ).
nodemap = node->get_attributes( ).
WRITE: / 'ELEMENT :'.
WRITE: AT indent name COLOR COL_POSITIVE INVERSE.
IF NOT nodemap IS INITIAL.
attributes
count = nodemap->get_length( ).
DO count TIMES.
index = sy-index - 1.
attr = nodemap->get_item( index ).
name = attr->get_name( ).
prefix = attr->get_namespace_prefix( ).
value = attr->get_value( ).
WRITE: / 'ATTRIBUTE:'.
WRITE: AT indent name COLOR COL_HEADING INVERSE, '=',
value COLOR COL_TOTAL INVERSE.
ENDDO.
ENDIF.
WHEN if_ixml_node=>co_node_text OR
if_ixml_node=>co_node_cdata_section.
text node
value = node->get_value( ).
WRITE: / 'VALUE :'.
WRITE: AT indent value COLOR COL_GROUP INVERSE.
ENDCASE.
advance to next node
node = iterator->get_next( ).
ENDWHILE.
ENDFORM. "process_dom
Any help would be highly apperciated.
regards,
Jessica SamPavel Vera,
With your example i tries doing the following .....
I tried to convert the data of XML file to internal table data. I am collecting the data in internal table to do goos recipt with that data.
Please find my XML file, ABAP pgm and XSLT pgm . I donu2019t know what I am missing I am not getting any output. I donu2019t know what is wrong please help me with this
Below is my XML file, My code and XSLT Program. In the below XML file I need to collect Vendor Number, Order Number, and Date tags which occur only once for one XML file.
I also need to collect the following tags from <Shipmentdetail>
<Shipmentdetail> has following child nodes and I need to collect them
TrackingNumber
Freight
Weight
ShipmentDate
ShipmentMethod
Need to collect to collect the following tags from <ProductInformation>
<ProductInformation> has following child nodes and I need to collect them
LineNumber
SKUNumber
OrderedQuantity
ShippedQuantity
UOM
The <Shipmentdetail> and <ProductInformation> are child nodes of <OrderShipment>
The <Shipmentdetail> occurs only ones but the <ProductInformation> can occur once or many times and will be dynamic and differs depening on the input file.
My XML file is as follows
<?xml version="1.0" encoding="iso-8859-1" ?>
- <ShipmentHeader>
<AccountID />
- <OrderShipment>
<VendorNumber>1000</VendorNumber>
<OrderNumber>P00009238</OrderNumber>
<OrderType>Stock</OrderType>
<Company />
<Division />
<Department />
<Date>20061120</Date>
<CartonCount>2</CartonCount>
<ShipAllProducts>No</ShipAllProducts>
- <ShipmentDetail>
<TrackingNumber>1ZR3W891PG47477811</TrackingNumber>
<Freight>000000010000</Freight>
<ShipmentDate>20061120</ShipmentDate>
<ShipmentMethod>UPS1PS</ShipmentMethod>
</ShipmentDetail>
- <ProductInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000001000000</OrderedQuantity>
<ShippedQuantity>00000001000000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <ProductInformation>
<LineNumber>000000002</LineNumber>
<SKUNumber>938EN</SKUNumber>
<AdvSKUNumber>001 7294</AdvSKUNumber>
<SKUID />
<OrderedQuantity>00000000450000</OrderedQuantity>
<ShippedQuantity>00000000450000</ShippedQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</ProductInformation>
- <CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
<CaseInformation>
<LineNumber>000000001</LineNumber>
<SKUNumber>110FR</SKUNumber>
<AdvSKUNumber>003 4518</AdvSKUNumber>
<SKUID />
<SSCCNumber>00000001668000002487</SSCCNumber>
<CaseQuantity>00000001000000</CaseQuantity>
<UOM>EA</UOM>
<Factor>1</Factor>
</CaseInformation>
- </OrderShipment>
</ShipmentHeader>
My Program
TYPE-POOLS abap.
CONSTANTS gs_file TYPE string VALUE 'C:\temp\test.xml'.
* This is the structure for the data from the XML file
TYPES: BEGIN OF ts_shipment,
VendorNumber(10) TYPE n,
OrderNumber(20) TYPE n,
OrderType(8) TYPE c,
Date(8) TYPE c,
END OF ts_shipment.
TYPES: BEGIN OF ts_shipmentdetail,
TrackingNumber(30) TYPE n,
Freight(12) TYPE n,
Weight(14) TYPE n,
ShipmentDate(8) TYPE c,
ShipmentMethod(8) TYPE c,
END OF ts_shipmentdetail.
TYPES: BEGIN OF ts_productinformation,
LineNumber(9) TYPE n,
SKUNumber(20) TYPE c,
OrderedQuantity(14) TYPE n,
ShippedQuantity(14) TYPE n,
UOM(4) TYPE c,
END OF ts_productinformation.
* Table for the XML content
DATA: gt_itab TYPE STANDARD TABLE OF char2048.
* Table and work ares for the data from the XML file
DATA: gt_shipment TYPE STANDARD TABLE OF ts_shipment,
gs_shipment TYPE ts_shipment.
DATA: gt_shipmentdetail TYPE STANDARD TABLE OF ts_shipmentdetail,
gs_shipmentdetail TYPE ts_shipmentdetail.
DATA: gt_productinformation TYPE STANDARD TABLE OF ts_productinformation,
gs_productinformation TYPE ts_productinformation.
* Result table that contains references
* of the internal tables to be filled
DATA: gt_result_xml TYPE abap_trans_resbind_tab,
gs_result_xml TYPE abap_trans_resbind.
* For error handling
DATA: gs_rif_ex TYPE REF TO cx_root,
gs_var_text TYPE string.
* Get the XML file from your client
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = gs_file
CHANGING
data_tab = gt_itab
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
not_supported_by_gui = 17
error_no_gui = 18
OTHERS = 19.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPMENT".
GET REFERENCE OF gt_shipment INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPMENT'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "ISHIPDET".
GET REFERENCE OF gt_shipmentdetail INTO gs_result_xml-value.
gs_result_xml-name = 'ISHIPDET'.
APPEND gs_result_xml TO gt_result_xml.
* Fill the result table with a reference to the data table.
* Within the XSLT stylesheet, the data table can be accessed with
* "IPRODDET".
GET REFERENCE OF gt_productinformation INTO gs_result_xml-value.
gs_result_xml-name = 'IPRODDET'.
APPEND gs_result_xml TO gt_result_xml.
* Perform the XSLT stylesheet
TRY.
CALL TRANSFORMATION z_xml_to_abap3
SOURCE XML gt_itab
RESULT (gt_result_xml).
CATCH cx_root INTO gs_rif_ex.
gs_var_text = gs_rif_ex->get_text( ).
MESSAGE gs_var_text TYPE 'E'.
ENDTRY.
* Writing the data from file for gt_shipment
*Collecting the Shipping Data from the XML file to internal table gt_shipment
*and writing the data to the screen
LOOP AT gt_shipment INTO gs_shipment.
WRITE: / 'VendorNumber:', gs_shipment-VendorNumber.
WRITE: / 'OrderNumber :', gs_shipment-OrderNumber.
WRITE: / 'OrderType :', gs_shipment-OrderType.
WRITE: / 'Date :', gs_shipment-Date.
WRITE : /.
ENDLOOP. "gt_shipment.
LOOP AT gt_shipmentdetail INTO gs_shipmentdetail.
WRITE: / 'TrackingNumber:', gs_shipmentdetail-TrackingNumber.
WRITE: / 'Freight :', gs_shipmentdetail-Freight.
WRITE: / 'Weight :', gs_shipmentdetail-Weight.
WRITE: / 'ShipmentDate :', gs_shipmentdetail-ShipmentDate.
* WRITE: / 'ShipmentMethod :' gs_shipmentdetail-ShipmentMethod
WRITE : /.
ENDLOOP. "gt_shipmentdetail.
LOOP AT gt_productinformation INTO gs_productinformation.
WRITE: / 'LineNumber:', gs_productinformation-LineNumber.
WRITE: / 'SKUNumber :', gs_productinformation-SKUNumber.
WRITE: / 'OrderedQuantity :', gs_productinformation-OrderedQuantity.
WRITE: / 'ShippedQuantity :', gs_productinformation-ShippedQuantity.
WRITE: / 'UOM :', gs_productinformation-UOM.
WRITE : /.
ENDLOOP. "gt_productinformation.
XSLT Program
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output encoding="iso-8859-1" indent="yes" method="xml" version="1.0"/>
<xsl:strip-space elements="*"/>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPMENT>
<xsl:apply-templates select="//OrderShipment"/>
</ISHIPMENT>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="OrderShipment">
<item>
<VENDORNUMBER>
<xsl:value-of select="VendorNumber"/>
</VENDORNUMBER>
<ORDERNUMBER>
<xsl:value-of select="OrderNumber"/>
</ORDERNUMBER>
<ORDERTYPE>
<xsl:value-of select="OrderType"/>
</ORDERTYPE>
<DATE>
<xsl:value-of select="Date"/>
</DATE>
</item>
</xsl:template>
<xsl:template match="/">
<asx:abap xmlns:asx="http://www.sap.com/abapxml" version="1.0">
<asx:values>
<ISHIPDET>
<xsl:apply-templates select="//OrderShipment/ShipmentDetail"/>
</ISHIPDET>
</asx:values>
</asx:abap>
</xsl:template>
<xsl:template match="ShipmentDetail">
<item>
<TRACKINGNUMBER>
<xsl:value-of select="TrackingNumber"/>
</TRACKINGNUMBER>
<FREIGHT>
<xsl:value-of select="Freight"/>
</FREIGHT>
<SHIPMENTDATE>
<xsl:value-of select="ShipmentDate"/>
</SHIPMENTDATE>
<SHIPMENTMETHOD>
<xsl:value-of select="ShipmentMethod"/>
</SHIPMENTMETHOD>
</item>
</xsl:template>
</xsl:transform> .
Any help is highly appreciated. If anyone encountered this situation before please let me know where i am going wrong in my XSLT transformation.
Any Help will be highly apppreciated. Thanks in advance
Regards,
Jessica Sam
Maybe you are looking for
-
How do I print selected pages from a multi page document
How do I print selected pages from a multi page document? This question was solved. View Solution.
-
File access parameter in file adapter at receiver side
Hi Experts, 1- i am using file adapter at receiver side. i want to create my file with time stamp for that i have given the file construction mode = add time stamp and put file directly .but it is showing time in file name???????? 2. i want my fil
-
[AI 10]How to create a global process swatch?
Hi, Please provide code snippets for creating a new global process swatch(the global check box ticked in Swatch options) with the speficied name,color values & color mode(CMYK,RGB)in Illustrator 10. Thanks in advance. myriaz
-
Can i see my contacts on my computer
I Dont have my iphone (4) on me can i still access my contacts though my computer (older Mac Pro) ? Is there anyway to open them from a folder in my computer (Mac Pro)? Please I'm desperate to find my contacts via my computer!!!!
-
What is "Photo Library" in Photos application?
I think this happened since upgrading to iLife 09, but I'm not sure. I used to have two albums in Photos: Camera Roll and iPod. The latter is an album in iPhoto and I have iTunes set to sync with just that album. But now I have three albums in Photos