Convert OutputText's Number into Terabytes
Hi,
I have the following requirement where we display the Storage Volume size (for ex:11929649152 bytes) as an output text.
Do we have any number format component in adf to convert this number (11929649152) into Terabytes.
Thanks,
Kiran
Create a new custom jsf converter for your requirement.
http://download.oracle.com/docs/cd/B31017_01/web.1013/b28967/web_val006.htm
Regards,
Similar Messages
-
How do i convert a plain number into hh:mm:ss
Below is a part of my spreadsheet i am setting up for travelling.
The driving time number is derived from a "IF" calculation that divides the "Distance" by a number depending upon the selection in the "Road" column (Data validation list)
The calculation is corect i would just like to know how to format the "6.9125" to show 6:54:45. I have a desktop calculator that will convert plain numbers into hh-mm-ss would just like to do this in my spreadsheet.
This is the formula that the 6.9125 is derived from
=IF([@ROAD]="Bitumen",[@DISTANCE]/80,IF([@ROAD]="Dirt",[@DISTANCE]/50,IF([@ROAD]="Track",[@DISTANCE]/30,IF([@ROAD]="4WD",[@DISTANCE]/15,0))))
Thanks in advance for the help
Regards
Andrew
DISTANCE
ROAD
DRIVING TIME
553
Bitumen
6.9125
0
It is better to temporarily fail with a plan that will ultimately succeed than to temporarily succeed with a plan that must ultimately failChange the formula to
=IF([@ROAD]="Bitumen",[@DISTANCE]/80,IF([@ROAD]="Dirt",[@DISTANCE]/50,IF([@ROAD]="Track",[@DISTANCE]/30,IF([@ROAD]="4WD",[@DISTANCE]/15,0))))/24
and format the cell with the formula with the custom format h:mm:ss, or if it is possible that driving times are over 24 hours, use [h]:mm:ss
Regards, Hans Vogelaar (http://www.eileenslounge.com) -
How to convert workflow template number into transation code?
Hi Experts,
We are using WS20000081 Leave request workflow in SAP 4.7.I created one customized workflow according to the client requirement.How can i convert WS99900009 into Transaction?
I created one absence type with workflow template WS99900009.While applying a leave it is showing the erroe as "WS99900009 is unknown" .
Please help me to resolve this problem.
Thanks,
HemalathaHi Arun
WS20000081 and WS04200009 are triggering when i applied a leave.But i need to add some amore task in that.For that i created the Customized workflow.Then we tried to create Rule groups with custom workflow id number in ESS settiongs.It was saying that ws99900009 is unknown.And we tried to replace the WS20000081 by ws99900009.It was alos saying that ws99900009 transaction is unknown.
So pls guide me how to convert ws99900009 into transaction?
Thanks in advance
Regards,
Hemalatha -
Regarding Converting the Decimal number into rounded value...
Hi,
i have a decimal number as " 58240990.00 " , i wanted this to rounded value .
for example I am expecting to see 58241 for the above number.
shell we can do in any way.. if so please let me knw fast.. it is urgent..
thanks in advance.
thanks,
Suresh..Dear Suresh,
Go through the following code chunk:
DATA : p TYPE p DECIMALS 2 VALUE '2.49'.
DATA i TYPE i.
i = CEIL( p ).
WRITE : i.
Regards,
Abir
Don't forget to award Points * -
How to convert an exponential number into a simple double number
in my database there is a value, say, 15958885 and what i am getting in my java class is 1.5958885E7 now the problem is that i want to display this value without this exponential form, please help me for this as I am not getting how to do it
please tell me if you have any other solution for
this. well i am ok with the solution i got but sill
if you have something.The first response (by Kaj) told you exactly how this is done in Java. Just in case you missed it, you use the java.text.DecimalFormat class. Go read the Javadoc. -
Convertion of number into sentence
i want to convert the number into sentence. i their is any short cut way to covert the number like 1,400,250 into "I million forty thousand two hundred and fifty"
Hi,
Please have a look on this thread.
Re: Try This Code (Number to Charcter)
Regards -
I need help with converting an InDesign file into a PDF file.
I've tried looking into the program and seeing if i can do it, but it is not giving me the option.
I need to be able to do this for work purposes.
Please help.Try Exporting. There are also number of useful Export PDF presets that come with design.
What do you want to do with the PDF? -
Setting Font for converting multiple text files into PDF using VB 6.0
Dear All,
Am converting multiple text files into PDF using VB6.0. Currently, am unable to control the font face and size for the generated files. Below is the procedure am using for each file;
Public Sub proc_convert_to_PDF(srcFilename As String, destFilename As String)
Dim p_AcroApp As CAcroApp
Dim p_VDoc As CAcroAVDoc
Dim p_DDoc As CAcroPDDoc
Dim IsOk As Boolean
Set p_AcroApp = CreateObject("AcroExch.App")
Set p_VDoc = CreateObject("AcroExch.AVDoc")
Call p_VDoc.Open(srcFilename, "")
Set p_VDoc = p_AcroApp.GetActiveDoc
If p_VDoc.IsValid Then
Set p_DDoc = p_VDoc.GetPDDoc
' Fill in pdf properties.
p_DDoc.SetInfo "Title", Format(Date, "dd-mm-yyy")
p_DDoc.SetInfo "Subject", srcFilename
If p_DDoc.Save(1 Or 4 Or 32, destFilename) <> True Then
MsgBox "Failed to save " & srcFilename
End If
p_DDoc.Close
End If
'Close the PDF
p_VDoc.Close True
p_AcroApp.Exit
'Clear Variables
Set p_DDoc = Nothing
Set p_VDoc = Nothing
Set p_AcroApp = Nothing
End Sub
What I need;
1) to be able to set the font face of the destination file ( destFilename)
2) to be able to set the font size of the destination file ( destFilename)
Am using Adobe Acrobat 7.0 Type Library
Kindly Help.
Thanks in advanceWe didn't say it doesn't work. We said it isn't supported.
There are a number of other ways to make a PDF. The one which would
give the most control is if your application directly printed to GDI,
controlling the font directly. This could print to Adobe PDF.
You could look for an application that gives control of font for
printing.
You could use a text-to-PostScript system and distill the result. You
could even look for a non-Adobe text-to-PDF.
Working in the unsupported and dangerous world you chose, the font
size for text conversion is set (and this is very bad design from
Adobe) in the settings for Create PDF > From Web Page. There is no API
to this.
Aandi Inston -
How to convert warning message MM071 into error message
Hello All,
I have flag deletion indicator for 1 material thru tcode MM06
Now i have to convert that error message into warning message..
For the same i went to path--spro - Mat mgmt-purchasing-Environmentdata-define attributes of System messages,but it didnt solved my purpose..
How to solve it...Helpful answers will be highly appreciated
Regards
NanoSAPdear sir.
pl check message number ME-051 this message for Material & flagged for deletion.
regards
jrp -
How to convert exponent to number format
Hi,
how to convert exponent to number format.My column is in number and the data is in exponent format .for example data is 2.44705130197009E18 .when i do field name haveing this data like
select * from table name where filed name =2.44705130197009E18 ,field name is of number (20) data type .but i am not getting any data fectched .
your advice is at most appriciated .
Regards,
SujaExample of what I was saying...
SQL> create table myexp (name number);
Table created.
SQL> insert into myexp values (2447051301970090001);
1 row created.
SQL> select name from myexp;
NAME
2.4471E+18
SQL> col name format 9999999999999999999999999999999999999
SQL> select name from myexp;
NAME
2447051301970090001
SQL>
The number you are seeing as an exponent is not just the number that is stored with lots of 0's on it, there's other information you are missing, so you need to change your format to see the true value. -
How convert to jpg picture into bmp ?
Hi experts,
I am trying to convert my jpg picture into bmp. for this i write one report but showing some
TRANSFER WA_MIME1 TO DSN1.
HERE IS MY FULL CODE PLZ HELP ME.
REPORT ZSE78_7.
DATA: blob TYPE w3mimetabtype,
blob_size TYPE w3param-cont_len,
blob_type TYPE w3param-cont_type .
DATA:
p_color_scheme TYPE char20 ,
p_labels_groupid TYPE igs_label_tab,
p_labels_category TYPE igs_label_tab ,
p_data TYPE igs_data_tab,
p_charttype TYPE char20,
p_legend TYPE char20,
l_igs_chart TYPE REF TO cl_igs_chart ,
l_igs_chart_engine TYPE REF TO cl_igs_chart_engine,
i_igs_image_converter TYPE REF TO cl_igs_image_converter,
mime TYPE w3mimetabtype,
html TYPE w3htmltabtype,
html_line TYPE w3html,
l_msg_text(72) TYPE c,
l_url TYPE w3url,
l_content_length TYPE i,
l_content_type TYPE w3param-cont_type,
l_content_subtype TYPE w3param-cont_type.
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = 'e:\katoch.jpg'
filetype = 'BIN'
* HAS_FIELD_SEPARATOR = ' '
* HEADER_LENGTH = 0
* READ_BY_LINE = 'X'
* DAT_MODE = ' '
* CODEPAGE = ' '
* IGNORE_CERR = ABAP_TRUE
* REPLACEMENT = '#'
* CHECK_BOM = ' '
IMPORTING
filelength = l_content_length
* HEADER =
TABLES
data_tab = mime
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
OTHERS = 17
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT i_igs_image_converter .
i_igs_image_converter->input = 'image/jpeg'.
i_igs_image_converter->output = 'image/x-ms-bmp'.
i_igs_image_converter->width = '100'.
i_igs_image_converter->height = '100'.
CALL METHOD i_igs_image_converter->set_image
EXPORTING
blob = mime
blob_size = l_content_length.
CALL METHOD i_igs_image_converter->execute
EXCEPTIONS
communication_error = 1
internal_error = 2
external_error = 3
OTHERS = 4.
IF sy-subrc = 0.
CALL METHOD i_igs_image_converter->get_image
IMPORTING
blob = blob
blob_size = blob_size
blob_type = blob_type.
DATA dsn1(20) TYPE c VALUE 'E:\test.bmp'.
DATA wa_mime1 TYPE w3mime.
*DATA wa_mime1 TYPE w3mimetabtype.
OPEN DATASET dsn1 FOR OUTPUT IN BINARY MODE.
LOOP AT blob INTO wa_mime1.
TRANSFER wa_mime1 TO dsn1.
CLEAR wa_mime1.
ENDLOOP.
MESSAGE ' successfull' TYPE 'I'.
CLOSE DATASET dsn1.
ELSE.
DATA: num TYPE i, message TYPE string.
CALL METHOD i_igs_image_converter->get_error
IMPORTING
number = num
MESSAGE = message.
MESSAGE 'not successfull' TYPE 'I'.
ENDIF.HI
i already converted it in binary form but when i transferring it to binary mode it generate error.
the code is like this.
LOOP AT blob INTO wa_mime1.
TRANSFER wa_mime1 TO dsn1.
CLEAR wa_mime1.
ENDLOOP.
CLOSE DATASET dsn1. -
Hai
How to convert the given date into number.
Thanks & regards
srikkanth.MLook at these posts
Please help me in Converting Lilian Format to Date
converstion to date
and try something like this.
SELECT sysdate,sysdate-to_date('15-10-1582','DD-MM-YYYY') lilian_dt FROM dual; -
Convert scanned handwriting (raster) into digital ink (vector)
Do any of the Adobe products (or any other software) convert raster based images into vector... specifically I am wanting to convert pages of scanned handwriting into digital ink (NOT editable text). I will then use a suitable tablet and stylus to add/remove handwritten words to the digital ink text. I have been using Onenote and a Surface Pro and stylus to generate handwritten text but have a number of existing manually handwritten pages that I would like to convert to digital ink and then modify in Onenote or some other suitable program.
illustrator, indesign, flash, shape and probably several other adobe products can convert rasters to vectors.
-
How to bridge (fill) gaps when converting a 2006 geometry into a 2002 geometry
Is it at all possible to bridge (fill) gaps when converting a 2006 geometry into a single 2002 geometry. I have a solution for the conversion from 2006 to 2002 provided by BHall but upon further investigation investigation of my dataset some of the multi line polygons have gaps which I need to fill and I am not sure how to go about this.
Here is a simple example of what I am trying to achieve
Before
SELECT (sdo_geometry(2006, 81989, NULL,
mdsys.sdo_elem_info_array(1,2,1,5,2,1,9,2,1,13,2,1),
mdsys.sdo_ordinate_array(16,0.999,16.998,-0.001,17.253,-0.001,18.003,0.999,18.003,0.999,19.001,0.999,19.001,0.999,19.999,-0.001)))
FROM dual
After
SELECT (sdo_geometry(2006, 81989,NULL,
mdsys.sdo_elem_info_array(1,2,1),
mdsys.sdo_ordinate_array(16,0.999,17.253,-0.001,18.003,0.999,19.001,0.999,19.999,-0.001))) FROM dual
Thanks in advanceOkay Roché,
You might need to break this problem down into smaller parts for the forum. All your examples show the gap being replaced by a single vertice - e.g. you want to "snap" the gap together. I'd suggest this is just complicating your question. Once the gap is filled (with a line) then you can run SDO_UTIL.REMOVE_DUPLICATE_VERTICES afterwards to remove the new line if its below your tolerance. I think that Bryan's code wrapped in remove duplicate vertices will solve your second scenario. But overall I think it would be helpful to focus just on the filling and leave the snapping for a follow-up question.
So back to scenario #1, below is some code I wrote a while back that might do what you want or at least get you started. Note that the input must be a multistring and the multistring cannot be "spaghetti". In other words each line in the multistring must be disjoint or at most touch other lines only at endpoints. The goal is to sift through the lines and create a single linestring using the smallest gaps. It's not subtle and will indeed produce bad geometries if the inputs are setup in an impossible manner. There are also some rare geodetic bugs with SDO_GEOM.RELATE that crop up. So you'll note I test both distance and relate in some places. That's intentional though kind of dumb.
Hopefully this helps. If you improve the code please shoot a copy back to me.
Cheers,
Paul
CREATE OR REPLACE PACKAGE dz_gap_fill
AUTHID CURRENT_USER
AS
FUNCTION linear_gap_filler(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN MDSYS.SDO_GEOMETRY;
END dz_gap_fill;
CREATE OR REPLACE PACKAGE BODY dz_gap_fill
AS
FUNCTION fast_point(
p_x IN NUMBER
,p_y IN NUMBER
,p_z IN NUMBER DEFAULT NULL
,p_m IN NUMBER DEFAULT NULL
,p_srid IN NUMBER DEFAULT 8265
) RETURN MDSYS.SDO_GEOMETRY
AS
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_x IS NULL
OR p_y IS NULL
THEN
RAISE_APPLICATION_ERROR(-20001,'x and y cannot be NULL');
END IF;
-- Step 20
-- Do the simplest solution first
IF p_z IS NULL
AND p_m IS NULL
THEN
RETURN SDO_GEOMETRY(
2001
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,NULL
,NULL
,NULL
END IF;
-- Step 30
-- Do the other wilder choices
IF p_z IS NULL
AND p_m IS NOT NULL
THEN
RETURN SDO_GEOMETRY(
3301
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,p_m
,NULL
,NULL
ELSIF p_z IS NOT NULL
AND p_m IS NULL
THEN
RETURN SDO_GEOMETRY(
3001
,p_srid
,SDO_POINT_TYPE(
p_x
,p_y
,p_z
,NULL
,NULL
ELSIF p_z IS NOT NULL
AND p_m IS NOT NULL
THEN
RETURN SDO_GEOMETRY(
4401
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,1,1)
,SDO_ORDINATE_ARRAY(p_x,p_y,p_z,p_m)
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END fast_point;
FUNCTION get_start_point(
p_input IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_dims PLS_INTEGER;
int_gtyp PLS_INTEGER;
int_lrs PLS_INTEGER;
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
END IF;
-- Step 20
-- Gather information about the geometry
int_dims := p_input.get_dims();
int_gtyp := p_input.get_gtype();
int_lrs := p_input.get_lrs_dim();
-- Step 30
-- Handle point and multipoint inputs
IF int_gtyp = 1
THEN
RETURN p_input;
ELSIF int_gtyp = 5
THEN
RETURN SDO_UTIL.EXTRACT(p_input,1);
END IF;
-- Step 40
-- Return results
IF int_dims = 2
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,NULL
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,NULL
,p_input.SDO_ORDINATES(3)
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 0
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(3)
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs IN (4,0)
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(3)
,p_input.SDO_ORDINATES(4)
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(1)
,p_input.SDO_ORDINATES(2)
,p_input.SDO_ORDINATES(4)
,p_input.SDO_ORDINATES(3)
,p_input.SDO_SRID
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END get_start_point;
FUNCTION get_end_point(
p_input IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_dims PLS_INTEGER;
int_gtyp PLS_INTEGER;
int_lrs PLS_INTEGER;
int_len PLS_INTEGER;
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
END IF;
-- Step 20
-- Gather information about the geometry
int_dims := p_input.get_dims();
int_gtyp := p_input.get_gtype();
int_lrs := p_input.get_lrs_dim();
int_len := p_input.SDO_ORDINATES.COUNT();
-- Step 30
-- Handle point and multipoint inputs
IF int_gtyp = 1
THEN
RETURN p_input;
ELSIF int_gtyp = 5
THEN
RETURN SDO_UTIL.EXTRACT(
p_input
,SDO_UTIL.GETNUMELEM(p_input)
END IF;
-- Step 40
-- Return results
IF int_dims = 2
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,NULL
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,NULL
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_SRID
ELSIF int_dims = 3
AND int_lrs = 0
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,NULL
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs IN (4,0)
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 3)
,p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_SRID
ELSIF int_dims = 4
AND int_lrs = 3
THEN
RETURN fast_point(
p_input.SDO_ORDINATES(int_len - 3)
,p_input.SDO_ORDINATES(int_len - 2)
,p_input.SDO_ORDINATES(int_len)
,p_input.SDO_ORDINATES(int_len - 1)
,p_input.SDO_SRID
ELSE
RAISE_APPLICATION_ERROR(-20001,'ERR!');
END IF;
END get_end_point;
FUNCTION is_spaghetti(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN VARCHAR2
AS
num_tolerance NUMBER := p_tolerance;
ary_strings MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
ary_starts MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
ary_ends MDSYS.SDO_GEOMETRY_ARRAY := MDSYS.SDO_GEOMETRY_ARRAY();
int_count PLS_INTEGER;
ary_start_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
ary_end_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
ary_inside_count MDSYS.SDO_NUMBER_ARRAY := MDSYS.SDO_NUMBER_ARRAY();
BEGIN
-- Step 10
-- Check over incoming parameters
IF p_input IS NULL
THEN
RETURN NULL;
ELSIF p_input.get_gtype = 2
THEN
RETURN 'FALSE';
ELSIF p_input.get_gtype <> 6
THEN
RAISE_APPLICATION_ERROR(-20001,'input gtype must be 2 or 6');
END IF;
IF num_tolerance IS NULL
THEN
num_tolerance := 0.05;
END IF;
-- Step 20
-- Break multistring into single linestrings with nodes
int_count := SDO_UTIL.GETNUMELEM(p_input);
ary_strings.EXTEND(int_count);
ary_starts.EXTEND(int_count);
ary_ends.EXTEND(int_count);
ary_start_count.EXTEND(int_count);
ary_end_count.EXTEND(int_count);
ary_inside_count.EXTEND(int_count);
FOR i IN 1 .. int_count
LOOP
ary_strings(i) := SDO_UTIL.EXTRACT(p_input,i);
ary_starts(i) := get_start_point(ary_strings(i));
ary_ends(i) := get_end_point(ary_strings(i));
END LOOP;
-- Step 30
-- Loop through and count the nodes connections
FOR i IN 1 .. int_count
LOOP
ary_start_count(i) := 0;
ary_end_count(i) := 0;
ary_inside_count(i) := 0;
FOR j IN 1 .. int_count
LOOP
IF i != j
THEN
IF SDO_GEOM.RELATE(
ary_starts(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','ON')
THEN
ary_start_count(i) := ary_start_count(i) + 1;
ELSIF SDO_GEOM.RELATE(
ary_ends(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','ON')
THEN
ary_end_count(i) := ary_end_count(i) + 1;
ELSIF SDO_GEOM.RELATE(
ary_strings(i),
'DETERMINE',
ary_strings(j),
num_tolerance
) IN ('TOUCH','CONTAINS','COVERS','OVERLAPBYINTERSECT')
THEN
ary_inside_count(i) := ary_inside_count(i) + 1;
END IF;
END IF;
END LOOP;
IF ary_start_count(i) > 1
OR ary_end_count(i) > 1
OR ary_inside_count(i) > 0
THEN
RETURN 'TRUE';
END IF;
END LOOP;
RETURN 'FALSE';
END is_spaghetti;
FUNCTION points2segment(
p_point_one IN MDSYS.SDO_POINT_TYPE
,p_point_two IN MDSYS.SDO_POINT_TYPE
,p_srid IN NUMBER
) RETURN MDSYS.SDO_GEOMETRY
AS
BEGIN
IF ( p_point_one.Z IS NULL AND p_point_two.Z IS NOT NULL )
OR ( p_point_one.Z IS NOT NULL AND p_point_two.Z IS NULL )
THEN
RAISE_APPLICATION_ERROR(
-20001,
'both points must have the same number of dimensions, point_one Z is ' ||
NVL(TO_CHAR(p_point_one.Z),'') ||
' and point_two Z is ' ||
NVL(TO_CHAR(p_point_two.Z),'')
END IF;
IF p_point_one.Z IS NULL
THEN
RETURN SDO_GEOMETRY(
2002
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(p_point_one.X,p_point_one.Y,p_point_two.X,p_point_two.Y)
ELSE
RETURN SDO_GEOMETRY(
3002
,p_srid
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(p_point_one.X,p_point_one.Y,p_point_one.Z,p_point_two.X,p_point_two.Y,p_point_two.Z)
END IF;
END points2segment;
FUNCTION points2segment(
p_point_one IN MDSYS.SDO_GEOMETRY
,p_point_two IN MDSYS.SDO_GEOMETRY
) RETURN MDSYS.SDO_GEOMETRY
AS
int_gtype1 PLS_INTEGER;
int_dims1 PLS_INTEGER;
int_gtype2 PLS_INTEGER;
int_dims2 PLS_INTEGER;
point_one MDSYS.SDO_POINT_TYPE;
point_two MDSYS.SDO_POINT_TYPE;
BEGIN
int_gtype1 := p_point_one.get_gtype();
int_dims1 := p_point_one.get_dims();
int_gtype2 := p_point_two.get_gtype();
int_dims2 := p_point_two.get_dims();
IF int_gtype1 = 1
AND int_gtype2 = 1
AND int_dims1 = int_dims2
AND p_point_one.SDO_SRID = p_point_two.SDO_SRID
THEN
NULL; -- Good
ELSE
RAISE_APPLICATION_ERROR(
-20001
,'both point objects must be points and have the same number of dimensions and SRIDs'
END IF;
IF int_dims1 = 4
THEN
RETURN SDO_GEOMETRY(
4402
,p_point_one.SDO_SRID
,NULL
,SDO_ELEM_INFO_ARRAY(1,2,1)
,SDO_ORDINATE_ARRAY(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,p_point_one.SDO_ORDINATES(3)
,p_point_one.SDO_ORDINATES(4)
,p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,p_point_two.SDO_ORDINATES(3)
,p_point_two.SDO_ORDINATES(4)
ELSE
-- Use the sdo_point_type method for the rest
IF p_point_one.SDO_POINT IS NOT NULL
THEN
point_one := p_point_one.SDO_POINT;
ELSE
IF int_dims1 = 3
THEN
point_one := SDO_POINT_TYPE(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,p_point_one.SDO_ORDINATES(3)
ELSE
point_one := SDO_POINT_TYPE(
p_point_one.SDO_ORDINATES(1)
,p_point_one.SDO_ORDINATES(2)
,NULL
END IF;
END IF;
IF p_point_two.SDO_POINT IS NOT NULL
THEN
point_two := p_point_two.SDO_POINT;
ELSE
IF int_dims1 = 3
THEN
point_two := SDO_POINT_TYPE(
p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,p_point_two.SDO_ORDINATES(3)
ELSE
point_two := SDO_POINT_TYPE(
p_point_two.SDO_ORDINATES(1)
,p_point_two.SDO_ORDINATES(2)
,NULL
END IF;
END IF;
RETURN points2segment(
p_point_one => point_one
,p_point_two => point_two
,p_srid => p_point_one.SDO_SRID
END IF;
END points2segment;
FUNCTION linear_gap_filler(
p_input IN MDSYS.SDO_GEOMETRY
,p_tolerance IN NUMBER DEFAULT 0.05
) RETURN MDSYS.SDO_GEOMETRY
AS
sdo_input MDSYS.SDO_GEOMETRY := p_input;
num_tolerance NUMBER;
int_counter PLS_INTEGER;
ary_edges MDSYS.SDO_GEOMETRY_ARRAY;
ary_starts MDSYS.SDO_GEOMETRY_ARRAY;
ary_ends MDSYS.SDO_GEOMETRY_ARRAY;
ary_nearest MDSYS.SDO_NUMBER_ARRAY;
ary_distance MDSYS.SDO_NUMBER_ARRAY;
num_temp NUMBER;
num_nearest NUMBER;
int_winner PLS_INTEGER;
int_winner2 PLS_INTEGER;
sdo_point1 MDSYS.SDO_GEOMETRY;
sdo_point2 MDSYS.SDO_GEOMETRY;
boo_done BOOLEAN;
num_one NUMBER;
num_two NUMBER;
int_looper PLS_INTEGER := 1;
BEGIN
-- Step 10
-- Check over incoming parameters
IF num_tolerance IS NULL
THEN
num_tolerance := 0.05;
END IF;
IF sdo_input IS NULL
OR sdo_input.get_gtype() <> 6
THEN
RETURN sdo_input;
END IF;
IF is_spaghetti(sdo_input,p_tolerance) = 'TRUE'
THEN
RETURN sdo_input;
END IF;
<> ary_edges := MDSYS.SDO_GEOMETRY_ARRAY();
ary_starts := MDSYS.SDO_GEOMETRY_ARRAY();
ary_ends := MDSYS.SDO_GEOMETRY_ARRAY();
ary_nearest := MDSYS.SDO_NUMBER_ARRAY();
ary_distance := MDSYS.SDO_NUMBER_ARRAY();
-- Step 20
-- Break multistring into edges and start and end nodes
int_counter := SDO_UTIL.GETNUMELEM(sdo_input);
ary_edges.EXTEND(int_counter);
ary_starts.EXTEND(int_counter);
ary_ends.EXTEND(int_counter);
FOR i IN 1 .. int_counter
LOOP
ary_edges(i) := SDO_UTIL.EXTRACT(sdo_input,i);
ary_starts(i) := get_start_point(ary_edges(i));
ary_ends(i) := get_end_point(ary_edges(i));
END LOOP;
-- Step 30
-- Determine the closest endpoints
ary_nearest.EXTEND(int_counter);
ary_distance.EXTEND(int_counter);
FOR i IN 1 .. int_counter
LOOP
num_nearest := NULL;
int_winner := NULL;
FOR j IN 1 .. int_counter
LOOP
IF j != i
THEN
num_temp := SDO_GEOM.SDO_DISTANCE(
ary_edges(i)
,ary_edges(j)
,num_tolerance
IF num_nearest IS NULL
OR num_temp < num_nearest
THEN
num_nearest := num_temp;
int_winner := j;
END IF;
END IF;
END LOOP;
ary_nearest(i) := int_winner;
ary_distance(i) := num_nearest;
END LOOP;
-- Step 40
-- Find the smallest gap
int_winner := NULL;
num_nearest := NULL;
FOR i IN 1 .. int_counter
LOOP
IF num_nearest IS NULL
OR ary_distance(i) < num_nearest
THEN
int_winner := i;
num_nearest := ary_distance(i);
int_winner2 := ary_nearest(i);
END IF;
END LOOP;
-- Step 50
-- Determine the endpoints to connect
num_one := SDO_GEOM.SDO_DISTANCE(
get_start_point(ary_edges(int_winner)),
ary_edges(int_winner2),
num_tolerance
num_two := SDO_GEOM.SDO_DISTANCE(
get_end_point(ary_edges(int_winner)),
ary_edges(int_winner2),
num_tolerance
IF ( num_one = 0 AND SDO_GEOM.RELATE(
get_start_point(ary_edges(int_winner)),
'ANYINTERACT',
ary_edges(int_winner2),
num_tolerance
) = 'TRUE' )
OR ( num_two = 0 AND SDO_GEOM.RELATE(
get_end_point(ary_edges(int_winner)),
'ANYINTERACT',
ary_edges(int_winner2),
num_tolerance
) = 'TRUE' )
THEN
sdo_point1 := NULL;
ELSIF num_one < num_two
THEN
sdo_point1 := get_start_point(ary_edges(int_winner));
ELSE
sdo_point1 := get_end_point(ary_edges(int_winner));
END IF;
num_one := SDO_GEOM.SDO_DISTANCE(
get_start_point(ary_edges(int_winner2)),
ary_edges(int_winner),
num_tolerance
num_two := SDO_GEOM.SDO_DISTANCE(
get_end_point(ary_edges(int_winner2)),
ary_edges(int_winner),
num_tolerance
IF ( num_one = 0 AND SDO_GEOM.RELATE(
get_start_point(ary_edges(int_winner2)),
'ANYINTERACT',
ary_edges(int_winner),
num_tolerance
) = 'TRUE' )
OR ( num_two = 0 AND SDO_GEOM.RELATE(
get_end_point(ary_edges(int_winner2)),
'ANYINTERACT',
ary_edges(int_winner),
num_tolerance
) = 'TRUE' )
THEN
sdo_point2 := NULL;
ELSIF num_one < num_two
THEN
sdo_point2 := get_start_point(ary_edges(int_winner2));
ELSE
sdo_point2 := get_end_point(ary_edges(int_winner2));
END IF;
-- Step 50
-- Smash together
IF sdo_point1 IS NULL
OR sdo_point2 IS NULL
THEN
sdo_input := SDO_UTIL.CONCAT_LINES(
ary_edges(int_winner),
ary_edges(int_winner2)
ELSE
sdo_input := SDO_UTIL.CONCAT_LINES(
SDO_UTIL.CONCAT_LINES(
ary_edges(int_winner),
points2segment(sdo_point1,sdo_point2)
ary_edges(int_winner2)
END IF;
boo_done := TRUE;
FOR i IN 1 .. int_counter
LOOP
IF i NOT IN (int_winner,int_winner2)
THEN
sdo_input := SDO_UTIL.APPEND(sdo_input,ary_edges(i));
boo_done := FALSE;
END IF;
END LOOP;
-- Step 60
-- Check if valid if returning
IF sdo_input.get_gtype() = 2
OR boo_done = TRUE
THEN
RETURN sdo_input;
END IF;
int_looper := int_looper + 1;
GOTO TOP_OF_IT;
END linear_gap_filler;
END dz_gap_fill; -
How to convert trailing minus sign into the leading minus sign
Hi
Can any plz tell me How to convert trailing minus sign into the leading minus sign? I mean in PI the amount filed shows like 150.00- i want to convert that into -150.00.
Thanks
GovindaHi Shabarish,
The code works but what if the input is something like [ 10.000-] i.e. with some spaces before 10.000- and the output as per your code comes as [- 10.000]. How do we tackle such cases if there is inconsistency in data i.e. some values come as [ 10.000-] i.e. spaces before the number and some values as [12.000-].
The output of this will come as
[- 10.000]
[-12.000]
How to make it as
[-10.000]
[-12.000]
Regards,
Shaibayan
Maybe you are looking for
-
Hi, just want to ask other user's opinion about the situation accessing OVI-store from a foreign country. At the moment the situation is like this: If you are in a foreign country, OVI-store redirects you to the local store. This means for example, i
-
Hello! i am a bit of a newbie to JSP and I have a problem. I am trying to run a simple jsp page that when run will display the id of the person logged into the PC. We are using tomcat and I have been trying the following <html> <head><title>Hello</ti
-
Anyone know how to cancel purchased downloads?
So I have all these downloads - huge files - that I don't want anymore/ don't want to download... Can I get rid of them permanently without downloading 1st? I keep having to "pause" them every few minutes whenever I'm in iTunes...
-
NAFTA Certificate of Origin (CBP Form 434)
I've been looking around, and I would have thought there would be a seeded report that covered this as it seems like it would be a common report/request, but is there a NAFTA Cert report hiding somewhere within Order Management or Shipping? I think
-
Hello, Im using one of those super soft special cloths and "DATA BECKER" LCD cleaner.... basically Im getting streaks... Any advice from anyone on the best way to clean my screen? Thank you!