Data_length of number data type
when I checked for the columns with data type as number in dba_tab_cols it is showing 22 for all the columns irrespective of the precision and scale. why is it so?
also can you tell what data length exactly means?
Edited by: user12288160 on May 19, 2010 3:04 AM
Hi tom,
I am doing database sizeing. I am expecting that one of my table will have 50,000,000 records in
future(say within 6 month). That table has composite primary key(5 columns). All the columns are
NUMBER data type. In All_tab_column I could see the data length is always 22. So I tried to
decrease the length( Number(10)). Then also its saying data length is 22. But I Know that I can't
enter data in this field more than 10 digits. So In this case it should be 12. But why its showing
22(Data_length field in All_tab_columns).
My question is, for my sizeing calculation, should I take this length 12 or 22?.
Thanks
Followup August 12, 2004 - 9am Central time zone:
that is the max length -- numbers are stored as varying length character strings.
Source: http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:1619552483055
REgards
Asif Kabir
Similar Messages
-
Ho to Comapre with Number Data Type
hi
My reqt is to do validation in ValidateEntity Method.
How to compare the with Number Data type:
For ex: Number a = gatAbc();
If(a>10)
throw new oaExcption...
But while comapring i got compiler Error
Error(218,17): method >(oracle.jbo.domain.Number, int) not found in class abc.oracle.apps.per.irc.pqr.schema.server.XxabcEOImpl
So plz tell me how to compare the integer value with Number data type
ThanxCheck with float. It will work definitely.
float number = Float.parseFloat(HrsPerDay); //HrsPerDay is a String and I am converting it to float
if(( number <= 0) || (number >= 21))
throw new OAAttrValException(OAAttrValException.TYP_VIEW_OBJECT,
"xxCopyResourceVO1",
rowi.getKey(),
"NoOfCopies",
rowi.getAttribute("NoOfCopies"),
"PA",
"xx_xx_COPY_POSITIVE_NUM");
}Here in this code i am also checking that the Hours cannot be less then 0 and greater than 20.
Thanks
--Anil -
Hi All,
I have few issues with "Number" data type
1) trying to convert string "0.0000007" to Number i am getting value with exponential (1e-7). This is only when we have more than 5 0's after decimal.
2) If i try to do below calculation, i am not getting exact value:
ex: 999999.999999+999999999999=1000000999999-999999999999 = 1000000(expected should be:999999.999999)
0.3*6=1.79999998 (exact value: 1.8)
Please let me know what might be the issue......
Thanks in advance to all....That's standard behavior for floating point. If you search the forum for
past discussions of floating point and Number you'll see explanations why.
To get displayable strings, use toPrecision or toFixed -
NUMBER Data type's Negative Scale
This is what I read in the 1z0-051 Study Guide:
The NUMBER data type may optionally be qualified with a precision and a scale. The precision sets the maximum number of digits in the number, and the scale is how many of those digits are to the right of the decimal point. If the scale is negative, this has the effect of replacing the last digits of any number inserted with zeros, which do not count toward the number of digits specified for the precision. If the number of digits exceeds the precision, there will be an error; if it is within the precision but outside the scale, the number will be rounded (up or down) to the nearest value within the scale. I am not sure if I understood this paragraph the correct way or not and hence this query:
I created this table t1
create table t1
(col1 number,
col2 number(4),
col3 number(4,2),
col4 number(4,-2));
INSERT INTO T1 (COL4) VALUES (1234); = 1200 is inserted
INSERT INTO T1 (COL4) VALUES (12.34); = 0 is inserted
INSERT INTO T1 (COL4) VALUES (12345.34); = 12300 is inserted. Should is not throw an error as the whole value should be of length 4 (including the precision).
However, INSERT INTO T1 (COL4) VALUES (123456789.34); throws error.How is this working? Please help!
Edited by: TuX4EvA on Sep 29, 2009 4:12 AMPlease, observe the following example:
CREATE TABLE test1
col1 NUMBER (6, 2),
col2 NUMBER (6, -1),
col3 NUMBER (6, -2),
col4 NUMBER (6, -3)
INSERT INTO test1 (col1, col2, col3, col4) VALUES (1234.89, 1234.89, 1234.89, 1234.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (1000.89, 1000.89, 1000.89, 1000.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (2020.02, 2020.02, 2020.02, 2020.02);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (56, 56, 56, 56);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (56.89, 56.89, 56.89, 56.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (20.89, 20.89, 20.89, 20.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (49.89, 49.89, 49.89, 49.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (50.89, 50.89, 50.89, 50.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (501.89, 501.89, 501.89, 501.89);
INSERT INTO test1 (col1, col2, col3, col4) VALUES (158.23, 158.23, 158.23, 158.23);
COMMIT;
SELECT * FROM test1;When you select from the table, you will receive:
col1 col2 col3 col4
1234,89 1230 1200 1000
1000,89 1000 1000 1000
2020,02 2020 2000 2000
56 60 100 0
56,89 60 100 0
20,89 20 0 0
49,89 50 0 0
50,89 50 100 0
501,89 500 500 1000
158,23 160 200 0From this example and according to the oracle documentation SQL Reference one could see that scale equal to -1 means to round the precision to the tens, -2 means to the hundreds, -3 - to the thousands and so on. But I cannot say it as well as it is said on page 44 from [Oracle Database SQL Reference|http://download.oracle.com/docs/cd/B19306_01/server.102/b14200.pdf].
Hope it was useful :) -
What is the size of number data type.
what is the size of number data type (in term of memory storage ;byte ).
Does it make different in size if mention number(38,0)?
Thanks all in advance...:)
Edited by: user10648897 on Jan 7, 2009 6:43 AMNUMBER (p,s)
Number having precision p and scale s. The precision p can range from 1 to 38. The scale s can range from -84 to 127.number(38,0) = number(38)
http://download.oracle.com/docs/cd/B19306_01/server.102/b14196/schema002.htm#sthref472 -
Number data type and schematool kodo2.3.3
Hi!
I have a class that has a data member of type 'Number' (java.lang.Number).
When I run the 'schematool' to generate the tables in the datastore, it
seems to ignore this Number field. If i change the type to Integer or
Float, and then run schematool, a corresponding column is correctly
created in the table in the database. Is there anything special that needs
to be indicated in the metadata file for Number data types?
Thanks
VijayI have a class that has a data member of type 'Number' (java.lang.Number).
When I run the 'schematool' to generate the tables in the datastore, it
seems to ignore this Number field.It's pretty strnage, but the Number type isn't mentioned as a supported
persistent type in the JDO specification, and so Kodo doesn't yet support
it. I say it's strange because as you pointed out, all concrete subclasses
of Number are supported: Integer, Float, Double, BigDecimal, BigInteger,
etc.
We recently realized this oversite ourselves, and so supporting Number fields
is on our to-do list. For the time being, however, you're stuck with
declaring the field to be some conrete type. -
How to handle NUMBER data type of SQL
Hello All,
I have to call an Oracle store procedure developed by 3rd party, it has once of the input parameter as NUMBER.
Since NUMBER SQL data type is not support by PI 7.0 (http://help.sap.com/saphelp_nwpi71/helpdata/EN/44/7b72b2fde93673e10000000a114a6b/content.htm),
when I am execute this scenario, it through an error for - Unsupported parameter type 'NUMBER'.
I cannot change the store procedure or any thing in Oracle.
I gone through some thread but did not find any help. NUMBER type for Oracle SP
Please let me know if there any work around.
Thanks in Advance.
PradeepThanks for your reply.
I cannot customize the stored procedure parameter to NUMERIC, as this is standard SP is from a product.
Below is the final XML generated with error on PALC and PREL parameter for NUMBER, ideally it should be
<PALC isInput="true" type="NUMBER"/>
<PREL isInput="true" type="NUMBER"/>
<Statement xmlns="">
<LSA_REL_DM action="EXECUTE">
<table>ACQDR.lsa_rel_dm</table>
<PPROJECTID isInput="true" type="VARCHAR">85LJ24210</PPROJECTID>
<PDMC isInput="true" type="VARCHAR">LJ200-A-J00-00-00-00-00AAA-00K-AA</PDMC>
<PLCN isInput="true" type="VARCHAR"/>
<PALC isInput="true"/>
<PTYPE isInput="true" type="CHAR"/>
<PSOURCE_CODE isInput="true" type="VARCHAR"/>
<PREL isInput="true"/>
<PRFU isInput="true" type="VARCHAR"/>
<POBJECT isInput="true" type="BLOB"><dmodule xsi:noNamespaceSchemaLocation="C:/Projects/S1000D/Document/schema/TIR_Parts_Vendors.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><identAndStatusSection><dmAddress><dmIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="00" subSubSystemCode="00" assyCode="00" disassyCode="00" disassyCodeVariant="AAA" infoCode="00K" infoCodeVariant="A" itemLocationCode="A"/><language languageIsoCode="US" countryIsoCode="sx"/><issueInfo issueNumber="0" inWork="1"/></dmIdent><dmAddressItems><issueDate year="20111107" month="20111107" day="20111107"/><dmTitle><techName>General</techName><infoName>Organizations technical information repository</infoName></dmTitle></dmAddressItems></dmAddress><dmStatus><security securityClassification="01"/><responsiblePartnerCompany enterpriseCode="24210"><enterpriseName>Learjet</enterpriseName></responsiblePartnerCompany><originator enterpriseCode="24210"><enterpriseName>Learjet</enterpriseName></originator><applicCrossRefTableRef><dmRef><dmRefIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="00W" infoCodeVariant="A" itemLocationCode="A"/></dmRefIdent></dmRef></applicCrossRefTableRef><brexDmRef><dmRef><dmRefIdent><dmCode modelIdentCode="LJ200" systemDiffCode="A" systemCode="J00" subSystemCode="0" subSubSystemCode="0" assyCode="00" disassyCode="00" disassyCodeVariant="A" infoCode="022" infoCodeVariant="B" itemLocationCode="D"/></dmRefIdent></dmRef></brexDmRef></dmStatus></identAndStatusSection><content><techRepository><partRepository/></techRepository></content></dmodule></POBJECT>
<PSTATUS isInput="true" type="CHAR">D</PSTATUS>
<PISSTYPE isInput="true" type="CHAR"/>
<POBJECT_CLASS isInput="true" type="VARCHAR">XML</POBJECT_CLASS>
</LSA_REL_DM>
</Statement>
Thanks in Advance -
Loading unpacked Zoned data into NUMBER data types
I need to use SQL*Loader to load data created on an MVS machine (EBCDIC) which is FTP'd to AIX (converted to ASCII during the FTP). Some of the data elements have signed unpacked numeric data. These need to be loaded into two types of fields in Oracle - 1) defined as data type NUMBER(19) 2) - defined as data type NUMBER (38,2) (i.e. dollar field with 2 decimal positions). For the dollar data I am loading there is an implied decimal. I need to know how to code SQL*Loader statements to handle these two situations. Because I have zoned unpacked source the resulting data loaded into the table must have a trailing sign (only if negative). Also the dollar fields need to have an explicit decimal inserted - and these dollar fields could also end up being negative.
Any help would be appreciated. Various google searches have not given me the answers I need.979755 wrote:
Most helpful. Pardon a few follow-on questions:
1. The Zoned definition refers (I hope) to the data on the input file - regardless of the definition of the field field being loaded in the table (in my case the field in the table is defined as NUMBER) - is this a true statement?
True, in your controlfile you set (for example): , zonedCol POSITION(x:y) ZONED(precision,scale)
2. If I am correct on item 1, if I have a negative number in the input file (let's say a negative 10) is a trailing sign loaded into the database (so it will be 10-)?
NO, to deal with signed numbers, you set trailing signs as table column in a staging table and then apply to real table.
3. What happens to any leading zeroes when the data is loaded into the table?
Ignored.
4. For dollar fields where the source has an implied decimal but I want an implicit decimal in loaded into the table and the number can be positive or negative, can I specify this as ZONED (10.2) in the control file?
See answer #2.
ZONED (10,2) implies field is 10 characters long and the last two are decimals.
5. And finally, regarding item 4 my understanding is that ZONED (10.2) would result in 12345678.12 (with a negative sign if appropriate) - is this a correct understanding?
Nope, only the digits. That is why we use staging table to capture the sign.
PS: The best would be to create external table on the source file.
Edited by: L-MachineGun on Jan 4, 2013 3:12 PM -
Table Functions, Direct Database Requests, and NUMBER data types
Hello. I call a number of table functions from our BI Enterprise server, and I've elected to do so using Direct Database Requests (I believe you can also call table functions in the physical layer of the repository, but that's not what I'm doing). The problem is that whenever I return any number from the table function that is not a whole number (1.23, for example), BI assigns the INTEGER datatype to the field instead of the DOUBLE datatype, thereby rounding my number to the nearest integer. Here's a concise example:
Create these 3 database objects:
CREATE OR REPLACE TYPE my_row AS OBJECT (my_num NUMBER);
CREATE OR REPLACE TYPE my_tab AS TABLE OF my_row;
CREATE OR REPLACE FUNCTION my_table_function RETURN my_tab
PIPELINED IS
BEGIN
PIPE ROW(my_row(1.23));
END;
Then make this your query in your Direct Database Request:
SELECT my_num FROM table(my_table_function);
That query correctly returns "1.23" when it's called from the database. In BI, on the other hand, it returns "1" (and labels the field an INTEGER instead of DOUBLE data type). If in the Direct Database Request you change the Column Properties ->Data Format -> Decimal Places from 0 to 2, it then not surprisingly displays "1.00". I then tried changing MY_ROW.MY_NUM's datatype by explicitly specifying precision, and no luck. BI still labels this field as an INTEGER. Then I started trying to trick BI by massaging the SQL statement itself. None of the following worked:
SELECT to_number(my_num) as my_num2 FROM table(my_table_function);
SELECT my_num2 + 0.01 as my_num3 FROM (SELECT my_num - 0.01 AS my_num2 FROM table(my_table_function));
SELECT to_number(to_char(my_num)) as my_num2 FROM table(my_table_function);
SELECT to_number(substr(to_char('x'||my_num),2)) as my_num2 FROM table(my_table_function);
Now I did find a solution, but I'm surprised that I have to resort to this:
SELECT * FROM (SELECT /*+ NO_MERGE */ my_num FROM table(my_table_function));
Does anyone out there know of a better way to do this? The above is a hack in my opinion. :)
Thanks in advance for any input.
-JimYes, it's really amazing.
But I got it.
CREATE OR REPLACE TYPE my_row AS OBJECT (my_num NUMBER(10,2));and in your SQL :
SELECT cast(my_num as double precision) as my_num2 FROM table(my_table_function);I have the good result and I see the numbers after the comma.
Very tricky !
Edited by: gerardnico on Jul 7, 2009 2:55 PM change number(10,2) by double precision ......... pfffff -
Number data-type saving problem through PL/SQL
hi,
I am having a field in my table called "amount" with type number(17,3). I am facing some problem while saving the data through pl/sql developer.
while i am inserting data like 123456789012.567 its working fine but when I am inserting 1234567890123.567 for amount field its now showing any error while saving, but actually its storing "1234567890123.570" in DB. Similar thing is happening when I was saving "12345678901234.567",actually its saving "12345678901234.600".
Whenever I was getting for 17 digits it's rounding last 3 and for 16 its rounding 2.
I am using oracle10g as DB server.
please suggest how to solve this particular problem as i am stuck or the alternate ways...
Thanks,
ShouvikIt is a display problem, not a storage problem. i'm not sure what the equivalent in PL/SQL Developer is, but this sqlplus example seems to replicate your stated issue.
SQL> create table t (num number(17,3));
Table created.
SQL> insert into t values (123456789012.567);
1 row created.
SQL> insert into t values (1234567890123.567);
1 row created.
SQL> insert into t values (12345678901234.567);
1 row created.
SQL> commit;
Commit complete.
SQL> set numwidth 16
SQL> select * from t;
NUM
123456789012.567
1234567890123.57
12345678901234.6
SQL> set numwidth 25
SQL> /
NUM
123456789012.567
1234567890123.567
12345678901234.567You need to expand the display width for numbers.
John -
Migrate SqlServer BigInt DataType to Ora Number data type - customizable ?
Hello,
i'm trying to migrate a sql-server 2005 db to oracle 10 using Sql-Developer v 1.2.0.
Every column having datatype bigint is converted to a Number(10,0) column.
Is it possible to customize this convertion cause i would like to have a Number(19,0) column ?
Thanks in adavance !SQL> desc emp_test;
Name Null? Type
EMPNO NUMBER(6)
ENAME VARCHAR2(20)
JOB VARCHAR2(9)
MGR NUMBER(4)
HIREDATE DATE
SAL NUMBER(7,2)
COMM NUMBER(7,2)
DEPTNO NUMBER(2) -
Adding scale to a number data type
I have a current column that is Number(22) that has many rows in it. I would
like to keep the 22 and add 2 to the scale, can this be done on the fly????Why not try
ALTER TABLE a MODIFY num_col NUMBER( 24, 2);
and see what happens. If it works you are done. If not add a column number(24,2), update the table to set the new column = to the old column, alter that table to drop the old column, alter the table to rename the new column to the old columns name. Or set the old column null, modify it, update back to it from the new column, then drop the new column, or use DBMS_REDEFINITION.
It is well to try something before coming here for a solution. Then tell us what you have tried and the results. -
Error;invaild number. different data type: how to insert
In testtable, ID(number(12), amount(number(12))
Now I want to insert the following record. I got error,a invalid number .
insert into testtable(id,amount) values('111','9,000.00');
I think data type is different. amount is number type but '9,000.00' is varchar2.
How can i insert '9,000.00' to number data type?
I do insert to_number('9,000.00'). It doesn't work.
Would you help me for this problem.as amount is a number field it will only take data of type number only.so if ue data is not number type u need to convert it to number and insert it.
however u can select it in the same format(original),using something like this:
SQL> SELECT ename employee, TO_CHAR(sal, '99,990.99') from emp;
EMPLOYEE TO_CHAR(SA
SMITH 800.00
ALLEN 1,600.00
WARD 1,250.00
JONES 2,975.00
MARTIN 1,250.00
BLAKE 2,850.00
CLARK 2,450.00
SCOTT 3,000.00
KING 5,000.00
TURNER 1,500.00
ADAMS 1,100.00
EMPLOYEE TO_CHAR(SA
JAMES 950.00
FORD 3,000.00
MILLER 1,300.00
14 rows selected. -
PLS-00306: wrong number or types of arguments in call in a for loop
Dear all
I recently put up another post about the same error message but as the message now relates to another part of my programme and, in my mind at least, a different conceptual idea, I thought I should start a new top. If that is not right thing to have done then please let me know. I am working in 10.2.
I am trying to pass through multiple variables. When I run the code at the end of this question I get an error message:
PLS-00306: wrong number or types of arguments in call to 'CUR_MAP_LIST'This relates to the line:
FOR var_map_list IN cur_map_list (par_map_list (n))I think the reason the error message comes up is because par_map_list is a associate array / PL/SQL table and cur_map_list is based on %rowtype. Although I could be wrong. However I am not sure what I should be doing so that I don't get such an error message.
I was reading through page 623 on Web Development 9i (by Brown; pub. McGrew-Hill) and pages 357-358 of Oracle Web Application Programming for PL/SQL Developers (by Boardman, Caffrey, Morse, Rosenzweig; pub. Prentice Hall), in order to try and write my code. As well as Oracle's Application Developer’s Guide - Fundamentals (Release 2), page 11-6. In particular the Web Development book uses the following:
create or replace procedure query_department
(in_dept_no owa_util.ident_arr)
is
cursor dept_cursor (nbt_dept_no emp.deptno%TYPE) is
select empno, ename, mgr, sal, comm
from scott.emp
where deptno = nbt_dept_no;
begin
for x in 1 .. in_dept_no.count loop
for dept_rec in dept_cursor(in_dept_no (x)) loop
end loop;
end loop;
end;In that example the cursor selects empno, ename, mgr, sal and comm from emp. So if it is doing that the cursor must be of a VARCHAR2 and NUMBER data type. What I don't understand is the for dept_rec in part. For a start I am not sure where dept_rec comes from? If it is a NUMBER data type, how can the in_dept_no, which is a owa_util.ident_arr associate array / PL/SQL data type work with it. Unfortunately because the example is incomplete and doesn't include procedures relating to the in variables, I am unable to run it and try and learn from what it is doing, so that I can try and relate the concept to my own work.
My programme is as follows. There may be other errors in the code not relating to this error. If so I hope to find these and resolve them once I understand what I should be doing here:
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
var_xml_theme VARCHAR2(32767);
BEGIN
PROCMAPLIST (empty, var_xml_theme);
END maps;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr,
par_xml_theme OUT VARCHAR2
AS
CURSOR cur_map_list IS
SELECT MT.map_title
MI.map_id
OMSN.map_sheet_number_id
WRMF.web_raster_map_id
FROM MAP_TITLE MT
MAP_INFO MI
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF,
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
var_map_list cur_map_list%ROWTYPE;
var_xml_theme VARCHAR2(32767);
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR n IN 1 .. par_map_list.COUNT
LOOP
FOR var_map_list IN cur_map_list (par_map_list (n))
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "WRMFB'||
var_map_list.web_raster_map_id||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
NAME = "Display selected maps"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;Thank you for reading. Kind regards
TimDear everyone
I have now resolved the problems I was having with multiple values and checkboxes, thanks to comments in this thread, read large chucks of Oracle PL/SQL Programming by Steve Feuerstein and suddenly realising where I am going wrong in terms of thinking.
For a start, I when I was dealing with the multiple values, I was trying to get PL/SQL to pass them out. Of course this is done by the action part of the input form. Although I have not done much web coding, I did know about this. However because I was so engrossed in trying to understand how multiple values work, I didn't relate the two ideas. I even mind mapping the problem and still didn't get it.
I also did not think to change my the action from post command to get, so that I could see what was coming out. However that would not have made too much of a difference because the other problem I had was related to where sub programmes were declared. The function which received the values was privately declared, and not in the package spec. This meant the web browser could not find the function as that can only make use of the programmes declared publicly.
Once I made these changes, as well as correcting other minor typing mistakes, the values passed through as expected. The only other mistake I made was to include the name option after the submit input type. In my case I did not need to submit the value of that button. The revised code is as follows. In this version I replaced the function with a procedure that simply prints the checkbox values to screen. I have also made the input form action get, instead of post, so that the values can be seen in the web browser address bar:
create or replace
PACKAGE MAPSITE AS
PROCEDURE MAPS;
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT OWA_UTIL.IDENT_ARR
PROCEDURE PROCDISPLAY
(maplist IN OUT OWA_UTIL.IDENT_ARR);
END MAPSITE;
create or replace
PACKAGE BODY MAPSITE AS
--Global variables--
gvar_mapviewer_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/mapviewer/omserver';
gvar_proc_host VARCHAR2(56) := 'http://tiger.iso.port.ac.uk:7785/www/geg50160';
gvar_xml_request VARCHAR2(100) :='?xml_request=<?xml version="1.0" standalone="yes"?>';
--Main calling programming--
PROCEDURE MAPS AS
empty owa_util.ident_arr;
BEGIN
PROCCHECKLIST (empty);
END MAPS;
--create checkboxes--
PROCEDURE PROCCHECKLIST
(par_check_list IN OUT owa_util.ident_arr
AS
CURSOR cur_map_list IS
SELECT MT.map_title,
MI.map_id,
OMSN.map_sheet_number_id,
WRMF.web_raster_map_id
FROM MAP_TITLE MT,
MAP_INFO MI,
MAP_SHEET_NUMBER OMSN,
WEB_RASTER_MAP_FILE WRMF
WHERE MI.map_title_id = MT.map_title_id
AND MI.map_id = OMSN.map_id
AND WRMF.map_id = MI.map_id
AND WRMF.map_sheet_number_id = OMSN.map_sheet_number_id;
BEGIN
htp.htmlOpen;
htp.headOpen;
htp.headClose;
htp.bodyOpen;
htp.print('<FORM METHOD = "post"
ACTION = "'||gvar_proc_host||'.mappackage.procdisplay">');
htp.print('<FIELDSET>
<LEGEND> Select the maps you wish to display </LEGEND>');
FOR var_map_list IN cur_map_list
LOOP
htp.print(' <UL>
<LI>
<LABEL FOR = "WRMF'||
var_map_list.web_raster_map_id||'">
<INPUT type = "checkbox"
id = "WRMFB'||
var_map_list.web_raster_map_id||'"
name = "maplist"
CHECKED = "' ||
par_map_list ||'"
value = "'||var_map_list.web_raster_map_id||'"
/>
Map title: '|| var_map_list.map_title||'<BR>
Sheet number: '||var_map_list.map_sheet_number||'');
htp.print('</LABEL>
</LI>
</UL>');
END LOOP;
htp.print('</FIELDSET>');
htp.print('<p>
<INPUT TYPE = "submit"
VALUE = "Display selected maps" />
</FORM>');
htp.bodyClose;
END PROCCHECKLIST;
---PROCDISPLAY PROCEDURE---
PROCEDURE PROCDISPLAY (maplist IN OUT owa_util.ident_arr)
IS
BEGIN
FOR n IN 1..maplist.COUNT
LOOP
htp.print('Checkbox value i.e. var_map_list.web_raster_map_id is: ' ||maplist(n)||'
<P>');
END LOOP;
END PROCDISPLAY;
END MAPSITE;Kind regards
Tim -
Dynamic ORDER BY clause - Possible different data types...
I have a lexical parameter in my ORDER BY clause:
ORDER BY &P_ORDER_BY
My problem is that I have to designate this parameter as either a date, character or number, but the user defined column being ordered by could be any one of these. When I designate the parameter as a character type, and a number data type column is chosen, it orders by that value, but it orders it as though it were a character field, referencing the initial digit and not the overall numeric value. If I choose a number parameter type, and a character value is chosen, I get an invalid number error, and so on.
Anyone have any ideas how I can do this?Okay, now we're on the right track. The lexical parameter I'm using allows the user to choose from a list of the columns being retrieved in the SELECT statement, so it will always be one that's in there, as you said. Now, since I don't know which one it's going to be, I can't just make all but one of them 'None' for the break order, BUT, what I intended to do was to add a column to the SELECT statement that would always return the column they chose, and I could put the break order on that column, leaving all the rest 'None'. However, in the past, this has created 2 problems for me.
1.) As I mentioned in the first post, the column being returned could have a data type of character, number or date, but the parameter must be designated as only one of these. So, if the user chooses to order by a column having a value with a data type other than what the parameter is designated to be, then I get errors, it doesn't order correctly, etc...
2.) This is the strange, but anytime I've marked all but one column as 'None' for the Break Order, my child data doesn't always stay with the parent. For example, the report is on an IT request database. The 'group fields' consist of data elements that are demographic info.of a request (requester, date requested, description, etc...), and the details for each request list out the comments that have been made in the system for that request. The problem I'm seeing when I set the break orders this way is that each request displays not only its own comments, but it lists out comments for other requests as well, and there doesn't seem to be any logic to which request's comments it lists in addition to its own, it just lists as many as will fit on the page...I don't know if I explained that very well, but that's what's happening.
Does any of that make sense? Any ideas?
Maybe you are looking for
-
Hello i was wondering if i can get FTTC because up the road near my Cab has been dug up and looks like they are packing up now. Here is what it says on the ADSL checker thing. Your cabinet is planned to have WBC FTTC by 30th September 2012. Our test
-
Time Capsule + Wired Connection for Xbox 360 Problom
i just bought a eithernet wire for time capsule since my my wireless network aint working i got it to work for my ps3 no problom but appertly the 360 is doomed all the way around it ses thers a problom with my ip adress when it seems fine im verry co
-
Flex4 How to set background image in Vgroup..?
Hi., I have using v flex 4 vgroup to set background image., but image was not display.. any change my code., <fx:Style> .backgroundImage color:#808080; fontWeight:bold; fontSize:18; fontSt
-
Hi, WHile using oracle v2 parser, I am getting empty element tag as <table/> which is correctly rendered in nav but not in ie. i want it to be <table></table> this is correctly displayed by both. Below is sample code of xsl.. <table> <xsl:for-each se
-
No Document Libraries available GW8
I think i must be missing something very basic. I created GW Library object in Console One; it is associated with the only PO we have; but when a client tries to link via tools/options/documents; we get the error "no document libraries available". Al