Form has missing values when the database sourced column is less than 0
Hello,
I have Apex 4.0. I am making a very simiple form on a table with lots of number columns. When I go into the form linked from a report, it pulls all of the values in from the table for a certain row except for the numbers that are less than 1. Very strange.
Any ideas?
Thanks,
Mark
Joe Upshaw wrote:
No, there is, for sure, no such restriction, Mark. To convince yourself of this, just manually add a Page Item to your form. Set "Display As" to number field and set the default to -999. It will display -999.
Could it be a mismatch between the data type of your source SELECT and the "Display As" on the form field? On the main report, what is the data type for the corresponding column?
On the field, is the Source Type "Database Column" and is the "Source value or expression" set to the correct, corresponding column name?Also
When I go into the form linked from a report, it pulls all of the values in from the tableHow does this happen?
Any other processes run on page rendering?
Any Post Calculation Computations or Format Masks used on the form items?
Similar Messages
-
Restrict the LONG RAW Column with less than 32760 bytes in the SELECT
When i am trying to access a LONG RAW Dataype wchich has characters greter than 32760 bytes i am getting this error.
Error -6502: ORA-06502: PL/SQL: numeric or value error
I came to know that PL/SQL will only be able to access the first 32760 bytes of a LONG RAW. If we try to fetch a LONG RAW from the database into PL/SQL variable which exceeds the 32760 byte limit then we encountered the above error.
Can anyone tell to avoid this error can we write a query to restrict the output to get only those records which has LONG RAW length less than 32760 bytes.
Since we canot use utl_raw.length() in the Select Statement, is there any function to restrict the the records for less than 32760 Bytes only for LONG RAW datatype, so that i will not get any records for more than 32760 bytes and we will not get this error.
REquest you to please help.Hi
we do not have an option of migrating the LONG RAW to BLOB or any kind of ALTER to the table.
We want to restrict the use of Records from the Table which has data for LONG RAW column less than 32760 bytes, so that we will not get the PL/SQL numberic Error
any function for LONG RAW that can be used in SQL like for varchar2 we can use
select length(NAME) < 100 from tb_emp+
i.e it will get records only which has NAME less than 100 characters. -
How to get group when the data source from system instead of UME database
Hig guys,
How to get group when the data source comes from backend system instead of UME database?
I tried to use
IUMPrincipal RefGroup = WPUMFactory.getGroupFactory().getGroup(groupName);
But I was not able to get the group. But in "UserAdministrator", I can find this groupName.
Which kind of API can I use?
Thanks in advance!
Regards,
Liying
Message was edited by:
Liying WangOk,
try this:
com.sapportals.portal.security.usermanagement.IGroupFactory ep5GroupFactory = userManagementService.getGroupFactory();
IGroupFactory groupFactory = UMFactory.getGroupFactory();
com.sap.security.api.IGroup group = groupFactory.getGroupByUniqueName(groupName);
IUMPrincipal ep5Principal = ep5GroupFactory.getEP5Group(group);
This should do the trick,
Romano
PS: and thanks for the stars! -
Sending the Value to the database of the selected item in the radioButton
I want to pass the value to the database that I selected on the radioButton
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
<mx:Text y="36" text="The Christian and Missionary Alliance Churches of the Philippines, Inc" width="581" fontWeight="bold" fontSize="15" horizontalCenter="46"/>
<mx:Text y="59" text="( C A M A C O P)" fontWeight="bold" fontSize="12" horizontalCenter="8"/>
<mx:Text y="77" text="MEMBERSHIP IDENTIFICATION FORM" width="502" fontSize="17" fontWeight="bold" textAlign="center" horizontalCenter="0"/>
<mx:Text y="101" text="Date: " width="47" fontWeight="bold" textAlign="center" horizontalCenter="-71"/>
<mx:DateField y="99" id="dateToday" horizontalCenter="18" editable="true" width="140" enabled="true"/>
<mx:Label y="153" text="District:" fontWeight="bold" horizontalCenter="-418"/>
<mx:TextInput y="151" maxChars="15" id="district" width="249" enabled="true" horizontalCenter="-260"/>
<mx:Text y="179" text="Name of Local Church:" fontWeight="bold" horizontalCenter="-378"/>
<mx:TextInput y="177" width="400" id="nameLocalChurch" maxChars="255" enabled="true" horizontalCenter="-104"/>
<mx:Text y="205" text="Local Church Address:" fontWeight="bold" horizontalCenter="-378"/>
<mx:TextInput y="203" width="401" id="addressLocalChurch" maxChars="255" enabled="true" horizontalCenter="-105"/>
<mx:Text y="231" text="Name:" fontWeight="bold" horizontalCenter="-422"/>
<mx:TextInput y="229" width="489" id="givenName" maxChars="255" enabled="true" horizontalCenter="-149"/>
<mx:Text y="254" text="(Given Name/Middle Name/Family Name - CAPITALIZE)" fontStyle="italic" horizontalCenter="-158"/>
<mx:Text y="284" text="Position in the Church: " fontWeight="bold" horizontalCenter="-376"/>
<mx:TextInput y="276" width="401" id="posInChurch" maxChars="225" enabled="true" horizontalCenter="-105"/>
<mx:Text y="310" text="Profession/Title:" fontWeight="bold" horizontalCenter="-393"/>
<mx:TextInput y="306" width="434" id="professionTitle" maxChars="225" enabled="true" horizontalCenter="-121"/>
<mx:Text y="333" text="Community Involvement/Work" fontWeight="bold" horizontalCenter="-351"/>
<mx:Text y="355" text="Gift Skill:" fontWeight="bold" horizontalCenter="-415"/>
<mx:TextInput y="353" width="475" enabled="true" horizontalCenter="-142" id="giftSkill" maxChars="225"/>
<mx:Text y="381" text="Home Address:" fontWeight="bold" horizontalCenter="-397"/>
<mx:TextInput y="379" width="448" id="homeAddress" enabled="true" horizontalCenter="-128" maxChars="225"/>
<mx:Text y="406" text="Status:" fontWeight="bold" horizontalCenter="-420"/>
<mx:Text y="432" text="Date of Marriage:" fontWeight="bold" horizontalCenter="-391"/>
<mx:TextInput y="430" enabled="true" id="dateOfMarriage" horizontalCenter="-258" maxChars="225"/>
<mx:Text y="432" text="(If Married)" fontWeight="normal" fontStyle="italic" horizontalCenter="-144"/>
<mx:Text y="458" text="Tel./Cell Phone:" fontWeight="bold" horizontalCenter="-396"/>
<mx:TextInput y="456" width="436" id="cell" enabled="true" horizontalCenter="-122" maxChars="225"/>
<mx:Text y="484" text="SSS/GSIS No." fontWeight="bold" horizontalCenter="-402"/>
<mx:TextInput y="482" width="215" id="sss" enabled="true" maxChars="15" horizontalCenter="-243"/>
<mx:Label y="484" text="Blood Type" fontWeight="bold" horizontalCenter="-94"/>
<mx:TextInput y="482" width="154" id="bloodType" enabled="true" maxChars="15" horizontalCenter="19"/>
<mx:Text y="509" text="Height" fontWeight="bold" horizontalCenter="-421"/>
<mx:Text y="510" text="Weight" fontWeight="bold" horizontalCenter="-279"/>
<mx:TextInput y="508" id="weight" enabled="true" maxChars="15" horizontalCenter="-168"/>
<mx:Text y="510" text="Birthday" fontWeight="bold" horizontalCenter="-53"/>
<mx:Text y="536" text="TIN No." fontWeight="bold" horizontalCenter="-420"/>
<mx:TextInput y="534" id="tin" enabled="true" horizontalCenter="-311" maxChars="225"/>
<mx:Text y="536" text="Date of Baptism" fontWeight="bold" horizontalCenter="-174"/>
<mx:Text y="536" text="(If Baptized)" fontStyle="italic" horizontalCenter="32"/>
<mx:Text y="573" text="Annual Income:" fontWeight="bold" height="18" fontSize="13" horizontalCenter="-384"/>
<mx:RadioButton y="563" label="Below 10K" id="first" enabled="true" horizontalCenter="-276" groupName="annualIncome"/>
<mx:RadioButton y="593" label="76k-100k" id="fifth" enabled="true" horizontalCenter="-192" groupName="annualIncome"/>
<mx:RadioButton y="563" label="11k-20k" id="second" enabled="true" horizontalCenter="-195" selected="false" groupName="annualIncome"/>
<mx:RadioButton y="563" label="21k-40k" id="third" enabled="true" horizontalCenter="-116" selected="false" groupName="annualIncome"/>
<mx:RadioButton y="593" label="101k-above" id="sixth" enabled="true" horizontalCenter="-106" groupName="annualIncome"/>
<mx:RadioButton y="593" label="41k-75k" id="fourth" enabled="true" horizontalCenter="-280" groupName="annualIncome"/>
<mx:Text y="589" text="(The "k" = thousand)" horizontalCenter="-383" fontStyle="italic"/>
<mx:TextInput y="508" id="hayt" enabled="true" width="76" horizontalCenter="-356" maxChars="15"/>
<mx:Text text="In case of Emergency Please Notify" fontSize="12" fontWeight="bold" horizontalCenter="-326" y="621"/>
<mx:Text y="642" text="Name:" fontWeight="bold" horizontalCenter="-370"/>
<mx:TextInput y="640" id="EName" enabled="true" width="446" horizontalCenter="-125" maxChars="225"/>
<mx:Text y="668" text="Address:" fontWeight="bold" horizontalCenter="-363"/>
<mx:TextInput y="666" width="434" id="EAddress" enabled="true" horizontalCenter="-117" maxChars="225"/>
<mx:Text y="740" text="Endorsement/Signature of PASTOR" fontWeight="bold" fontSize="12" horizontalCenter="-298"/>
<mx:Text y="740" text="Signature of Member" fontWeight="bold" fontSize="12" width="208" horizontalCenter="55"/>
<mx:Text y="804" text="Endorsement/Signature of DMS" fontWeight="bold" fontSize="12" horizontalCenter="-310"/>
<mx:Text y="806" text="Confirmation of the BISHOP/PRESIDENT" fontWeight="bold" fontSize="12" horizontalCenter="88"/>
<mx:Text y="867.7" text="Reminders" fontSize="15" fontWeight="bold" horizontalCenter="-76"/>
<mx:Text y="899.25" text="Pastor/CMT shall verify each filled up membership form." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-86"/>
<mx:Text y="921.8" text="The pastor will endorse the forms to their respective DMS." fontWeight="bold" fontSize="12" textAlign="center" horizontalCenter="-78"/>
<mx:Text y="942.35" text="The donation for I.D. is 50.00php." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-62"/>
<mx:Text y="961.9" text="Get your receipts from the DMS as a whole." fontWeight="bold" textAlign="center" fontSize="12" horizontalCenter="-69"/>
<mx:Text y="980.35" text="Check carefully the neatness of I.D. pictures." fontWeight="bold" fontSize="12" textAlign="center" horizontalCenter="-64"/>
<mx:Text y="997.9" text="This form is to be completed by all CAMACOP members and workers." fontWeight="bold" fontSize="12" horizontalCenter="-83"/>
<mx:Spacer x="47" y="9"/>
<mx:Button y="1034" label="Submit" id="submit" enabled="true" horizontalCenter="-89" click = "sample1.send()"/>
<mx:DateField y="508" id="birthday" enabled="true" horizontalCenter="35" width="122"/>
<mx:DateField y="534" width="105" id="dateOfBaptism" enabled="true" horizontalCenter="-64"/>
<mx:RadioButtonGroup id="work"/>
<mx:RadioButton x="273" y="331" label="Private" groupName="work" width="80" id="prayvate" enabled="true"/>
<mx:RadioButton x="416" y="331" label="NGO" groupName="work" enabled="true" id="NGO"/>
<mx:RadioButton x="359" y="331" label="GO" groupName="work" enabled="true" id="GO"/>
<mx:RadioButtonGroup id="status"/>
<mx:RadioButton x="133" y="404" label="Married" groupName="status" id="Married"/>
<mx:RadioButton x="207" y="404" label="Single" groupName="status" id="Single"/>
<mx:RadioButton x="274" y="404" label="Widow" groupName="status" id="Widow"/>
<mx:RadioButton x="342" y="404" label="Widower" groupName="status" id="Widower"/>
<mx:HTTPService id="sample1" method="POST" url="http://localhost/frontPage-debug/add.php">
<mx:request xmlns="">
<dateToday>
{dateToday.text}
</dateToday>
<district>
{district.text}
</district>
<nameLocalChurch>
{nameLocalChurch.text}
</nameLocalChurch>
<addressLocalChurch>
{addressLocalChurch.text}
</addressLocalChurch>
<givenName>
{givenName.text}
</givenName>
<posInChurch>
{posInChurch.text}
</posInChurch>
<professionTitle>
{professionTitle.text}
</professionTitle>
<work>
{work.text}
</work>
<giftSkill>
{giftSkill.text} <!--THIS IS WHERE THE ERROR HAPPENS-->
</giftSkill>
<homeAddress>
{homeAddress.text}
</homeAddress>
<status>
{status.text} <!--THIS IS WHERE THE ERROR HAPPENS-->
</status>
<dateOfMarriage>
{dateOfMarriage.text}
</dateOfMarriage>
<cell>
{cell.text}
</cell>
<bloodType>
{bloodType.text}
</bloodType>
<sss>
{sss.text}
</sss>
<weight>
{weight.text}
</weight>
<birthday>
{birthday.text}
</birthday>
<tin>
{tin.text}
</tin>
<dateOfBaptism>
{dateOfBaptism.text}
</dateOfBaptism>
<annualIncome>
{annualIncome.text}
</annualIncome>
<EName>
{EName.text}
</EName>
<EAddress>
{EAddress.text}
</EAddress>
</mx:request>
</mx:HTTPService>
</mx:Application>
This is are the errors
1119: Access of possibly undefined property text through a reference with static type mx.controls:RadioButtonGroup.
1120: Access of undefined property annualIncome.Hi,
instead of
{status.text}
should be {status.selection.label} (status.selection is a RadioButton or null and after that you can get label property). It's better to set one of the variants in radioButtonGroup to selected and do not check null selection or selectedValue property.
It seems that {giftSkill.text} is ok, but {work.text} above it has the same problem as I've described above. -
How to deal with the situation when the database change into ms-sqlserver ?
Hi,dear all,
How to deal with the situation when the database change into ms-sqlserver or other database?
Now, i want to build a j2ee project with ORACLE ADF bc,but this project may be used in several diffrent databases for example oracle db,ms db,mysql and so on.however,if i have developer this project in jdeveloper and this project connection was config as a oracle database,and then,can this project be reused for other databases espasially including the model codes? if yes,how should i do?
all who know how to resolve this,tell me pls,thanks.
bruce Li,
China
Message was edited by:
user526724Hi Paulbin,
Do you want to supply a function-pointer to a DLL so it can call[back] your VI? Here's how it can be done with .NET, though, that solution requires a C compiler. A single "VI_to_function-reference" utility could handle all cases where the callback passes no parameters. Maybe someday somebody will share that dll.
Did you know that LabVIEW can use Events for some COM-signals change? See pic. (Note: DTR is not listed - - )
Another question is another function's prototype is WORD SetTestType(WORD comHandle, bool type1, bool type2, bool type3), I tried to use a boolean control and a Boolean to (0,1) node in labVIEW to pass parameters to CLF, I config the bool input value as U8(according to C++ bool type) and U32(according to WIN32 BOOL type), it dose not help, when I execute the VI, LabVIEW will be disappeare, it seems to be closed, I must start it again.
Could someone has similar experience on this points?
It's easy to crash LabVIEW misusing CLF - maybe there's another reason for the crash besides bool mis-match(?) Do you know which "Calling convention" is required? What type is comHandle? (where does comHandle come from?)
Cheers!
Message Edited by tbd on 03-23-2007 09:34 PM
Message Edited by tbd on 03-23-2007 09:35 PM
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
Attachments:
evt.jpg 7 KB -
Initial value and value in the database
Hello world ,
i want to add initial value with value in the database depend on the date
for example i have initial value for 30/09/2009
i and to all it with value in the database in 31/12/2009
take a look what i did
PROCEDURE pkd_prem IS
cursor gr_pkd_prem is select
SUM(DECODE(mark,'01',FM_mark,TM_mark) A,
SUM(DECODE(FMS,'01',LS,NS) b
from fr_treaty_profile ftp, fr_monthly_summary
where
(ftp.tpr_cgp_id = fr_monthly_summary.fms_cgp_id )
AND (ftp.tpr_cmp_id = fr_monthly_summary.fms_cmp_id )
AND (ftp.tpr_treaty_origin = fr_monthly_summary.fms_treaty_origin )
AND (ftp.tpr_uw_year = fr_monthly_summary.fms_uw_year )
AND (ftp.tpr_class = fr_monthly_summary.fms_class )
AND (ftp.tpr_type = fr_monthly_summary.fms_type )
AND (ftp.tpr_serial = fr_monthly_summary.fms_serial )
AND
(fr_monthly_summary.fms_treaty_origin=:BLK1.EO_ORIGIN) AND
(fr_monthly_summary.fms_uw_year=:BLK1.EO_UW_YEAR) AND
(fr_monthly_summary.fms_class=:BLK1.EO_CLASS) AND
(fr_monthly_summary.fms_treaty_type=:BLK1.EO_TYPE) AND
( fr_monthly_summary.fms_treaty_serial=:BLK1.EO_SERIAL)
AND (FMS_TYPE ='P')
AND FMS_SERIAL = '01'
AND (FMS_OFC_ID !='X')
and (FMS_YEAR =substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),7,4))
and (FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)) ;
---Initial value
cursor base is select EO_GR_BKD_PREM from FR_EN
where
EO_TREATY_ORIGIN=:BLK1.EO_ORIGIN AND
EO_UW_YEAR=:BLK1.EO_UW_YEAR AND
EO_CLASS=:BLK1.EO_CLASS AND
EO_TREATY_TYPE=:BLK1.EO_TYPE AND
EO_TREATY_SERIAL=:BLK1.EO_SERIAL AND
EO_YEAR=:BLK1.EO_YEAR;
A number(18,3);
B number(18,3);
v_base number(18,3);
BEGIN
open base;
open gr_pkd_prem;
fetch gr_pkd_prem into a,b;
fetch base into v_base;
:BLK1.EO_GR_BKD_PREM :=nvl(a,0)+ nvl(b,0)+ nvl(v_base,0);
close gr_pkd_prem;
close base;
END;
the proceudre is correct and the values come as i want
but here
FMS_PERIOD between substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2)-2 and substr(to_char(:BLK1.EO_TRNX_DATE,'DD/MM/YYYY'),4,2))
suppose i will add from 6 to 9
the value will come down to add with base value
but next time i want from 10 to 12
it will add value 10 to 12 with the base for just period 10 to 12
i want to keep adding
if i start from 6 to 9
then shoud be
add the value of 6 to 9 to 10 to 12
butlook ..
i created a form and let's say there is one field called Base ..
and i inert value on that field and saved .
then
i created cursor to fetch value from another table
that value which i fetched from another table must add to past value
take this scenario
i started with value 6
then i fetch by cursor value from 1/1/2010 to 31/3/2010 and that value = 33
first action
6+33
then
i fecth by using cursor from 1/6/2010 to 30/9/2010 and that value = 2
the result of first action must add with the last value which is 2
(6+33) from first action plus(+) 2 and display the result on the secreen -
Taking the datafile offline when the database is in NOARCHIVELOG mode
My question is when the database is in No Archive log mode i'm not able to take the datafile offline.
When i tried in my computer i have noticed fallowing.
case1:
SYS>alter database datafile 5 offline;
ERROR at line1;
ORA-01145:offline immediate disallowed unless media recovery enabled.
case 2:
SYS>alter database datafile 5 offline immediate;
ERROR at line 1;
ORA-00933:SQL command not properly ended
case3:
I have tried the command alter database datafile 6 offline drop; (in NOARCHIVELOG mode) and it is showing the same effect as alter database datafile 6 offline; ( in ARCHIVELOG mode).
*In the NOARCHIVELOG mode are we really dropping the datafile to take the datafile offline? Will you please tell me the effect of keyword drop.JohnWatson wrote:
You've marked your question answered - was that a mistake?
The answer is that you cannot directly take a datafile offline in noarchivelog mode. You must take the tablespace offline:
Hmm, are you certain about that? Perhaps I'm missing something.
SQL> select file_id, file_name, online_status, status from dba_data_files where tablespace_name = 'USERS';
FILE_ID FILE_NAME ONLINE_ STATUS
4 /u01/app/oracle/oradata/TEST/users01.dbf ONLINE AVAILABLE
SQL> select log_mode from v$database;
LOG_MODE
NOARCHIVELOG
SQL> alter database datafile 4 offline drop;
Database altered.
SQL> select file_id, file_name, online_status, status from dba_data_files where tablespace_name = 'USERS';
FILE_ID FILE_NAME ONLINE_ STATUS
4 /u01/app/oracle/oradata/TEST/users01.dbf RECOVER AVAILABLE
SQL> ALTER SYSTEM FLUSH BUFFER_CACHE; <-- may not have been necessary
System altered.
SQL> select count(*) from scott.emp;
select count(*) from scott.emp
ERROR at line 1:
ORA-00376: file 4 cannot be read at this time
ORA-01110: data file 4: '/u01/app/oracle/oradata/TEST/users01.dbf'
SQL> recover datafile 4;
Media recovery complete.
SQL> select file_id, file_name, online_status, status from dba_data_files where tablespace_name = 'USERS';
FILE_ID FILE_NAME ONLINE_ STATUS
4 /u01/app/oracle/oradata/TEST/users01.dbf OFFLINE AVAILABLE
SQL> alter database datafile 4 online;
Database altered.
SQL> select file_id, file_name, online_status, status from dba_data_files where tablespace_name = 'USERS';
FILE_ID FILE_NAME ONLINE_ STATUS
4 /u01/app/oracle/oradata/TEST/users01.dbf ONLINE AVAILABLE
SQL> select count(*) from scott.emp;
COUNT(*)
14
Also, please see the following link from the manual which discusses altering data file availability in noarchivelog mode.
Altering Datafile Availability -
Is there a way to obtain the text item's value when the mouse pointer at?
Hi,
Is there a way to obtain the text item's value when the mouse pointer at? Mouse pointer may be located somewhere out of current record and even out of current block.There is a when-mouse-over trigger and that works fine in client-server mode for Forms 5/6/6i, but that is less indicated when deployed using Application Server.
In that trigger you may write whatever code is necessary, restricted package procedures.
Still, I think, for your case, if you do not have to deal with a multi-record block, you should use the HINT property for that item and set_item_property with the HINT argument for that item in order to set the hint to the item's value - this should set_item_property should be called on the when-new-record-instance . -
Placing null values in the database
Hi
I'm using a PreparedStatement object to try to input a null value in the database. I'm using the following code :
pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition ) VALUES (?,?,?)");
pstmt.setString(1,"aDealName");
pstmt.setNull(2,Types.TIMESTAMP);
pstmt.setString(3,"aCondition");
pstmt.executeUpdate();
and I get the "SQL Data type out of range" error message.
Does anyone know what might be the problem?
Thanks for any help
LGSHi
Sorry for the lack of info.
I am using Microsoft Access 2000, the JDBC-ODBC driver v.4.00.6019
and my TableModel class is as follows:
public class MyTableModel2 extends AbstractTableModel
private Connection conn;
private Vector rows,columnHeads,firstColumn,columnTypes,columnWidths;
private Validation validate;
private String query;
private int numColumns;
String tableType;
String [] columnNamesFrontPage = {"Deal","Spread","Next Event Date","Closing Date"};
String [] columnNamesCommentsPage = {"Date","Input By","Spread","Comment"};
String [] columnNamesTimetable = {"Date","Event"};
String [] columnNamesConditionsTable = {"Date","Condition"};
private DBase2 db2;
private String tableName,primKeyColName;
public MyTableModel2 ()
{} //Empty Constructor
public MyTableModel2 ( Connection dbConn,String aQuery,String table)
conn = dbConn;
rows = new Vector();
columnHeads = new Vector();
query = aQuery;
tableType = table;
firstColumn = new Vector();
db2 = new DBase2 (dbConn);
columnTypes = new Vector();
columnWidths = new Vector();
validate = new Validation();
}//End of Constructor
public int getColumnCount ()
return columnHeads.size();
}//End of Method
public int getRowCount ()
return rows.size();
}//End of Method
public Object getValueAt(int aRow, int aColumn)
Vector row = (Vector)rows.elementAt(aRow);
return row.elementAt(aColumn);
}//End of Method
public String getColumnName (int column)
String columnName = "";
if(tableType == null)
columnName = columnHeads.get(column).toString();
else if (tableType == "FrontPage")
columnName = columnNamesFrontPage [column];
else if (tableType == "CommentsPage")
columnName = columnNamesCommentsPage [column];
else if (tableType == "Timetable")
columnName = columnNamesTimetable [column];
else if (tableType == "ConditionsTable")
columnName = columnNamesConditionsTable [column];
return columnName;
}//End of Method
public void query()
try {
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
tableName = rsmd.getTableName(1);
Integer i2;
boolean moreRecords = rs.next();
for (int i = 1; i <= rsmd.getColumnCount(); ++i)
if (i == 1)
primKeyColName = rsmd.getColumnName(i);
else
columnHeads.addElement(rsmd.getColumnName(i));
if (rsmd.getColumnTypeName(i).equals("DATETIME"))
i2 = new Integer (8);
else
int i1 = rsmd.getColumnDisplaySize(i);
i2 = new Integer (i1);
columnWidths.add(i2);
String colTypeName = rsmd.getColumnTypeName(i);
columnTypes.addElement(colTypeName);
//JOptionPane.showMessageDialog(null,"Column Width="+i2,"Column Types ",JOptionPane.INFORMATION_MESSAGE);
do {
rows.addElement( getNextRow (rs,rsmd));
while (rs.next() );
catch ( SQLException sqlex )
sqlex.printStackTrace();
}//End of Method
private Vector getNextRow( ResultSet rs, ResultSetMetaData rsmd )
throws SQLException
Vector currentRow = new Vector();
for ( int i = 1; i <= rsmd.getColumnCount(); ++i )
Object o = rs.getObject(i);
if (o == null)
String emptyCell = "";
currentRow.addElement(emptyCell);
else if(o.getClass().toString().equalsIgnoreCase("class java.sql.Timestamp") )
SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
String formatted = sdf.format(o);
currentRow.addElement(formatted);
else
if (i == 1)
firstColumn.addElement(o);
else
currentRow.addElement(o);
return currentRow;
}//End of Method
public void refresh ()
rows.clear();
firstColumn.clear();
try {
Statement statement = conn.createStatement();
ResultSet rs = statement.executeQuery(query);
ResultSetMetaData rsmd = rs.getMetaData();
boolean moreRecords = rs.next();
do {
rows.addElement( getNextRow (rs,rsmd));
while (rs.next() );
catch ( SQLException sqlex )
sqlex.printStackTrace();
this.fireTableDataChanged();
}//End of Method
public boolean isCellEditable (int row, int col)
return true;
}//End of Class
public void setValueAt(Object value, int row, int col)
String objToString = value.toString();
int columnWidth = Integer.parseInt(columnWidths.elementAt(col).toString());
if(objToString.length() > columnWidth)
validate.errorMessageDisplay("Maximum column width is "+columnWidth+" characters - Please retype","INPUT ERROR");
else if (columnTypes.elementAt(col).toString().equals("DATETIME") && validate.validDateInput(objToString) == false)
validate.errorMessageDisplay("Date is required in form dd/mm/yy - Please retype","INPUT ERROR");
else if (columnTypes.elementAt(col).toString().equals("DOUBLE") && validate.validNumberInput(objToString) == false)
validate.errorMessageDisplay("This column will accept numbers only - Please retype","INPUT ERROR");
else
//JOptionPane.showMessageDialog(null,columnTypes.elementAt(col).toString(),"Column Name ",JOptionPane.INFORMATION_MESSAGE);
Vector rowA = (Vector)rows.elementAt(row);
rowA.setElementAt(value,col);
fireTableCellUpdated(row, col);
String newInput = value.toString();
int id = Integer.parseInt(firstColumn.elementAt(row).toString());
String colName = columnHeads.elementAt(col).toString();
String query = "UPDATE "+tableName+" SET "+colName+" = '"+newInput+"' WHERE "+primKeyColName+" = "+id+"";
db2.modifyDatabase(query);
refresh();
}//End of Method The method in which I am using PreparedStatement is:
public void updateConditionsTable (String aDealName, String aCondition)
int result = 0;
try
pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
" VALUES (?,?,?)");
// pstmt = connection.prepareStatement("INSERT INTO Conditions (Deal,ConditionDate,Condition )"+
// " VALUES (?,?,?)");
pstmt.setString(1,aDealName);
pstmt.setNull(2,Types.INTEGER);
pstmt.setString(3,aCondition);
pstmt.executeUpdate();
catch (SQLException sqlex ) {
//sqlex.printStackTrace();
String output = "YOUR INPUT IS NOT VALID - PLEASE TRY AGAIN\n";
output = output + sqlex.toString();
JOptionPane.showMessageDialog(null,output,"SQL Error",JOptionPane.INFORMATION_MESSAGE);
//return result;
}//Closes Method Once again, thanks for any help -
Checkpoint frequency when the database is open.
Dear All,
I am facing a lot of problem with some checkpoint parameters.
FAST_START_IO_TARGET = value in what?
LOG_CHECKPOINT_INTERVAL = value in no. of OS blocks
LOG_CHECKPOINT_TIMEOUT = value in seconds
Almost every places (Documentation and our books) it is
mentioned that they are used only for instance recovery. Is it
true? If so, then we don't have any way to force checkpoint to
occur frequently when the database is running. Is there any way?
I think the last two parameters work also when the database is
running.
If multiple parameters used for checkpoint will oracle use FIFO
system or it will choose only the most aggressive parameter?
Please see the Backup&Recovery slide 2-12. It show the case of
instance recovery. As the most aggressive parameter
LOG_CHECKPOINT_INTERVAL is issuing checkpoint first. Will there
be any checkpoint at "C" or checkpoint will occur at any other
point again set by LOG_CHECKPOINT_INTERVAL ?
Please help me to solve this problem.
Have a nice time,
Tarek
BASE Ltd, DhakaThere is an execellent document available on metalink explaining
the details of the checkpoint mechanism and how to tune it.
Document's name is "Checkpoint Tuning and Troubleshooting Guide",
Doc Id is 147468.1.
That document explains the parameters you ask about and
tells you a helluva lot about checkpoints and how to get
them to do just as you want.
If you do not have access to Metalink, drop me a mail
notice at [email protected], and I'll send you
a copy via email.
Hope that helps.
All the best
Michael -
SAP Server has lost connection to the database!
Hi Gurus,
Can some please guide me on this " SAP Server has lost connection to the database! " what need to be check.
OS : AIX
DB : DB2
thanks
vamsiHello,
1)Check if the DB is running.Issue the following command @ the DB-level
db2 connect to <SID>.
2)Also check R3trans -d from the app. server and check for trans.log file for the error.
Hope it helps.
Regards,
Prasanna
Edited by: Kulkarni Prasanna on Jul 24, 2008 3:53 PM -
How to change the default password file's name and path when the database created?
how to change the default password file's name and path when the database created?
nullUsage: orapwd file=<fname> password=<password> entries=<users>
where
file - name of password file (mand),
password - password for SYS and INTERNAL (mand),
entries - maximum number of distinct DBA and OPERs (opt),
There are no spaces around the equal-to (=) character. -
Error while inserting BLOB value in the database
I am trying to insert a BLOB value in the database. This action results in the following exception:
java.sql.SQLException: ORA-22925: operation would exceed maximum size allowed for a LOB value
The method i am using is as follows:
public void insertBlob(Connection Con, StringBuffer Message)throws SQLException
String Query = "INSERT INTO MSGBLOCKS (MSGDB_ID, MSGBLOCKTYPE, MESSAGE) VALUES (20, 1 , ?)";
PreparedStatement PS = Con.prepareStatement(Query);
byte[] bytes = new String(Message).getBytes();
ByteArrayInputStream bi = new ByteArrayInputStream(bytes);
PS.setBinaryStream(1, bi, bytes.length);
PS.executeUpdate();
The manifest file of ojdbc14.jar being used is: 10.1.0.5.0 and I am using jdk 1.4.
Also the message being tried to insert is of 9 Kb only.
Any help would be greatly appreciated.
Thanks!!!Did you check if the Message is having only that small 9kb of data? also check the maximum allowed size for that column in the Oracle DB, the size can be restricted to 8Kb also.
Edited by: DynamicBasics on Jul 28, 2010 5:54 PM -
I just got the new macbook pro about 2 weeks ago, it has lion. When the new mountain lion comes this summer, can i just update it on my macbook pro since it isn't so old? And if i can update it, do i have to pay, or is it a free update?
I'm in the same position, the store said they didn't know of any new release, so i bought my macbook pro to find out about mountain lion. I really hope that i'm not going to pay for the upgrade. New to apple, also last month bought my Ipad 3, really thought that Airplay would have been on my book pro, nope, waste of time.........need that update to use it. Back i the box then, get the windows 7 ultimate pro back out until then.
-
How to make the LV front panel controls the current value through the programis set as the default value when the next time you open?
1110340051Try this: Re: How to make a VI remember the latest control value?
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
Maybe you are looking for
-
Using 23" Cinema Display and VGA to DVI adapter??
I have 4 computers (2 deskop PCs, 1 IBM thinkpad laptop and 1 MAC). I have a DVI switcher. 3 of my PCs work great. My IBM thinkpad (T23) has an old style DVI connector on it that I cannot use (I thought I could until I got the Apple Monitor). I have
-
How can I print double sided from my MacBook? The option is not highlighted, shazmina2
-
Hi When I try to open Garageband I get this message 'Instrument Library is Invalid' The program says is intialising, I cant find a valid instrument library. This is the first time I have tried to use this program on my new iMac. Can anyone help? Than
-
Why can't I update IOS to 5.1
when I try to update to IOS 5.1 I get a (The network connection can not be established) message.
-
Hi, i have created an Xref table 'AUX_MAIN.xref' with 3 coloumns in that ACC_ID,CON_ID and ADR_ID. whenever i try to insert a record in that table using xref:populateXRefRow1M() function i am getting error. when i insert a record for ADR_ID coloumn f