Insert a new record in the database table in between the records.
i va a database table which ve 100 records. but i want to insert my new record as 50th record. how i want to proceed?
thanks ,
velu.
V,
This is an odd request. Why?
Ignoring that, you can ATTEMPT to insert into the 50th position IF:
1) The DB table has just had the primary key index re-built/re-shuffled to GUARANTEE that it IS in primary key order
2) And the primary key of the new record is built so that it follows the 49th record
Regardless, once this table has activity against it, its sort order can/will get out of promary key order (with adds/changes/deletes).
But when you select data from it, you can use ORDER BY or an ABAP SORT to organzie the date as needed.
Again... not sure WHY you need a record in a particular physical position... who cares... it is a relational DB.
Similar Messages
-
BAPI to insert a new row in the MCHA table
Hi all,
I am in search of a BAPI to insert a new row in the MCHA table... with the fields of the materail, plant and batch values.
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.explore BAPI_BATCH_CREATE
-
BAPI to insert a new row in the AUSP table
Hi all,
I am in search of a BAPI to insert a new row in the AUSP table... with the fields of the object and
characteristic values.
Any inputs on this..is highly appreciable...
thanks in advance...
regards..
prathima.hi,
from best of my knowledge here is list of bapi through you can insert ausp table.
check it.
CLSE_SELECT_AUSP
CLVF_INSERT_AUSP
BAPI_CLASS_CREATE
C14K_AUSP_CHANGE_VALUE
CLSE_SELECT_AUSP
CLVF_UPDATE_AUSP
C14K_AUSP_ADD_UPD
BAPI_CLASS_CREATE
regards,
vipul -
Inserting a new row in a child table referencing an already existing parent
I have two tables PARENT & CHILD (one to many), both of which are populated at different times.
In our toplink mappings, parent contains a collection of child Domain Objects, & and child Domain object contains a one - one to parent.
How can I insert a new row in a child table with reference to an already existing row in parent?
When I fetch the parent Domain object and try to set it in the child Domain Object and use the unitOfWork.registerObject() it goes into a circular loop of selecting from 2 other tables.
Please suggest.Odd, have you disabled caching and indirection? (NoIdentityMap, dontUseIndirection, or alwaysRefresh/disableCacheHits). If so, then this could be the issue.
Otherwise please include the sample code you use to perform this, and verify that you do not have any unusual code in your set/get methods or in descriptor events. Also turn TopLink logging on and include a sample. Also ensure that you do not modify your objects until after registering them in the unit of work, and only modify the unit of work clones. -
ADF: any good examples on inserting a new record
Hi, I'm currently developing a
web based application (using jsp + struts on top of ADF)
and I've seen many many demos and viewlets on
how to create a page that reads a list of employees
or master-detail relationship of records.
However, when I try to make a page which can insert
a new record (ex. new employee, new department, etc),
I am baffled, because I couldn't find a good example
that showed me how to do it.
Has anyone have a good example?
thank you.Did you check the tutorials page?
For example:
http://otn.oracle.com/products/jdev/collateral/tutorials/9050/bizcomp_jsp_tut.html -
Can I insert a new text at the cursor's position In Formatted-Text-Edit?
Hi Everyone,
I am doing a task to enhance Formatted-Text-Edit,
The task's goal is: simultaneously edit/display text and image.
I decide to use Formatted-Text-Edit and Formatted-Text-View to realize the task.
In Formatted-Text-Edit, user can edit the text and input URL for image,
In Formatted-Text-View, the text and image can be displayed simultaneously.
I add a button "Insert Image" besides the Formatted-Text-Edit,
This is the key point:
When user click the button, I want to insert a new text(URL of the image) at the cursor's position in Formatted-Text-Edit,
But how can I get the cursor's position, and insert a new text at the cursor's position in FTE.
Can anyone give me some suggestion or solution?
Many thanks in advance.
Best Regards,
DerekI don't believe that you can get the cursor position yet with the FormattedTextEdit UI element. The best you could do currently is to place the insert at the end of the current text.
Note duplicate thread/question to;
Set cursor on the table column inherited with text edit UI element
Please don't double post your questions in the forum. -
How to insert a new row in the middle of an set of rows
Hi
How to insert a new row in the middle of an set of rows ? and How to Reset the line id after the new row added ?
Regards,
Sudhir B.Hai,
just try this,
Instead of using omatrix.Addrow(1,-1) use like
omatrix.AddRow( RowCount , Position)
RowCount
The number of rows to add (default is 1)
Position
The position of the new rows (0-based; default is -1, meaning append row to the end)
After adding rows in matrix For, sno.
for i=1 to omatrix.visualrowcount
otext=omatrix.getcellspecific("columnid",i) '--where columnid is the unique id of the sno column
otext.value=i
next i
Hope this helps you.
Thanks & Regards,
Parvatha Solai.N -
How to insert a new record to table with foreign key
I have 3 tables like this :
CREATE TABLE PERSON (
PK INTEGER NOT NULL,
NAME VARCHAR(10),
SSNUM INTEGER,
MGR INTEGER);
ALTER TABLE PERSON ADD CONSTRAINT PK_PERSON PRIMARY KEY (PK);
ALTER TABLE PERSON ADD CONSTRAINT FK_PERSON FOREIGN KEY (MGR) REFERENCES
PERSON (PK);
/* Tables
CREATE TABLE PROJECT (
PK INTEGER NOT NULL,
CODE_NAME INTEGER);
ALTER TABLE PROJECT ADD CONSTRAINT PK_PROJECT PRIMARY KEY (PK);
/* Tables
CREATE TABLE XREF (
PERSON INTEGER NOT NULL,
PROJECT INTEGER NOT NULL);
ALTER TABLE XREF ADD CONSTRAINT PK_XREF PRIMARY KEY (PERSON, PROJECT);
ALTER TABLE XREF ADD CONSTRAINT FK_XREF1 FOREIGN KEY (PERSON) REFERENCES
PERSON (PK);
ALTER TABLE XREF ADD CONSTRAINT FK_XREF2 FOREIGN KEY (PROJECT) REFERENCES
PROJECT (PK);
I do like the way of "ReverseTutoral" and the file .jdo here :
<?xml version="1.0" encoding="UTF-8"?>
<jdo>
<package name="reversetutorial">
<class name="Person" objectid-class="PersonId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="PERSON"/>
<field name="name">
<extension vendor-name="kodo" key="data-column"
value="NAME"/>
</field>
<field name="person">
<extension vendor-name="kodo" key="pk-data-column"
value="MGR"/>
</field>
<field name="persons">
<collection element-type="Person"/>
<extension vendor-name="kodo" key="inverse"
value="person"/>
<extension vendor-name="kodo" key="inverse-owner"
value="person"/>
</field>
<field name="pk" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PK"/>
</field>
<field name="ssnum">
<extension vendor-name="kodo" key="data-column"
value="SSNUM"/>
</field>
<field name="xrefs">
<collection element-type="Xref"/>
<extension vendor-name="kodo" key="inverse"
value="person"/>
<extension vendor-name="kodo" key="inverse-owner"
value="person"/>
</field>
</class>
<class name="Project" objectid-class="ProjectId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="PROJECT"/>
<field name="codeName">
<extension vendor-name="kodo" key="data-column"
value="CODE_NAME"/>
</field>
<field name="pk" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PK"/>
</field>
<field name="xrefs">
<collection element-type="Xref"/>
<extension vendor-name="kodo" key="inverse"
value="project"/>
<extension vendor-name="kodo" key="inverse-owner"
value="project"/>
</field>
</class>
<class name="Xref" objectid-class="XrefId">
<extension vendor-name="kodo" key="class-column" value="none"/>
<extension vendor-name="kodo" key="lock-column" value="none"/>
<extension vendor-name="kodo" key="table" value="XREF"/>
<field name="person">
<extension vendor-name="kodo" key="pk-data-column"
value="PERSON"/>
</field>
<field name="person2" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PERSON"/>
</field>
<field name="project">
<extension vendor-name="kodo" key="pk-data-column"
value="PROJECT"/>
</field>
<field name="project2" primary-key="true">
<extension vendor-name="kodo" key="data-column"
value="PROJECT"/>
</field>
</class>
</package>
</jdo>
Data of those tables are :
PERSON :
| PK | NAME | SSNUM | MGR |
| 1 | ABC | 1 | 1 |
| 2 | DEF | 5 | 1 |
PROJECT
| PK | CODE_NAME |
| 1 | 12 |
| 2 | 13 |
And now I want to add a new record into table XREF : insert into XREF
values (1,1);
public void createData() {
Xref xref = new Xref();
Person person = new Person(1);
Project project = new Project(1);
xref.setPerson(person);
xref.setProject(project);
person.getXrefs().add(xref);
person.getXrefs().add(xref);
pm.currentTransaction().begin();
pm.makePersistent(xref);
pm.currentTransaction().commit();
I don't know why Kodo automatically insert new record to table PERSON ->
confilct Primary Key. The errors are :
0 [main] INFO kodo.Runtime - Starting Kodo JDO version 2.4.1
(kodojdo-2.4.1-20030126-1556) with capabilities: [Enterprise Edition
Features, Standard Edition Features, Lite Edition Features, Evaluation
License, Query Extensions, Datacache Plug-in, Statement Batching, Global
Transactions, Developer Tools, Custom Database Dictionaries, Enterprise
Databases, Custom ClassMappings, Custom ResultObjectProviders]
41 [main] WARN kodo.Runtime - WARNING: Kodo JDO Evaluation expires in 29
days. Please contact [email protected] for information on extending
your evaluation period or purchasing a license.
1627 [main] INFO kodo.MetaData -
com.solarmetric.kodo.meta.JDOMetaDataParser@e28b9: parsing source:
file:/D:/AN/Test/classes/reversetutorial/reversetutorial.jdo
3092 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] open:
jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
3325 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ]
close:
com.solarmetric.datasource.PoolConnection@164dbd5[[requests=0;size=0;max=70;hits=0;created=0;redundant=0;overflow=0;new=0;leaked=0;unavailable=0]]
3335 [main] INFO jdbc.JDBC - [ C:23387093; T:19356985; D:10268916 ] close
connection
3648 [main] INFO jdbc.JDBC - Using dictionary class
"com.solarmetric.kodo.impl.jdbc.schema.dict.InterbaseDictionary" to
connect to "Firebird" (version "__WI-V6.2.972 Firebird 1.0.3)WI-V6.2.972
Firebird 1.0.3/tcp (annm)/P10") with JDBC driver "firebirdsql jca/jdbc
resource adapter" (version "0.1")
4032 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] open:
jdbc:firebirdsql:localhost/3050:D:/An/test/temp.gdb (sysdba)
4143 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
preparing statement <3098834>: INSERT INTO XREF(PERSON, PROJECT) VALUES
4224 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
executing statement <3098834>: [reused=1;params={(int)1,(int)1}]
4244 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
preparing statement <9090824>: INSERT INTO PERSON(MGR, NAME, PK, SSNUM)
VALUES (?, ?, ?, ?)
4315 [main] INFO jdbc.SQL - [ C:25657668; T:19356985; D:10268916 ]
executing statement <9090824>: [reused=1;params={null,null,(int)1,(int)0}]
4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
resultSetType or resultSetConcurrency changed
4598 [main] WARN jdbc.JDBC - java.sql.SQLWarning: java.sql.SQLWarning:
resultSetType or resultSetConcurrency changed
4598 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] begin
rollback
4608 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] end
rollback 10ms
4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ]
close:
com.solarmetric.datasource.PoolConnection@1878144[[requests=2;size=2;max=70;hits=0;created=2;redundant=0;overflow=0;new=2;leaked=0;unavailable=0]]
4628 [main] INFO jdbc.JDBC - [ C:25657668; T:19356985; D:10268916 ] close
connection
javax.jdo.JDOFatalDataStoreException:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
[PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
on table "PERSON" [code=335544665;state=null]
NestedThrowables:
com.solarmetric.kodo.impl.jdbc.sql.SQLExceptionWrapper:
[SQL=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (null, null, 1, 0)]
[PRE=INSERT INTO PERSON(MGR, NAME, PK, SSNUM) VALUES (?, ?, ?, ?)]
GDS Exception. violation of PRIMARY or UNIQUE KEY constraint "PK_PERSON"
on table "PERSON"
at
com.solarmetric.kodo.impl.jdbc.runtime.SQLExceptions.throwFatal(SQLExceptions.java:17)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:416)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
NestedThrowablesStackTrace:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. violation of PRIMARY
or UNIQUE KEY constraint "PK_PERSON" on table "PERSON"
at
org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:425)
at
org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
at org.firebirdsql.gds.GDSException: violation of PRIMARY or UNIQUE KEY
constraint "PK_PERSON" on table "PERSON
at org.firebirdsql.jgds.GDS_Impl.readStatusVector(GDS_Impl.java:1683)
at org.firebirdsql.jgds.GDS_Impl.receiveResponse(GDS_Impl.java:1636)
at org.firebirdsql.jgds.GDS_Impl.isc_dsql_execute2(GDS_Impl.java:865)
at
org.firebirdsql.jca.FBManagedConnection.executeStatement(FBManagedConnection.java:782)
at
org.firebirdsql.jdbc.FBConnection.executeStatement(FBConnection.java:1072)
at
org.firebirdsql.jdbc.FBPreparedStatement.internalExecute(FBPreparedStatement.java:420)
at
org.firebirdsql.jdbc.FBPreparedStatement.executeUpdate(FBPreparedStatement.java:136)
at
com.solarmetric.datasource.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:111)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatementNonBatch(SQLExecutionManagerImpl.java:542)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executePreparedStatement(SQLExecutionManagerImpl.java:511)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.executeInternal(SQLExecutionManagerImpl.java:405)
at
com.solarmetric.kodo.impl.jdbc.SQLExecutionManagerImpl.flush(SQLExecutionManagerImpl.java:272)
at
com.solarmetric.kodo.impl.jdbc.runtime.JDBCStoreManager.flush(JDBCStoreManager.java:411)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.flush(PersistenceManagerImpl.java:575)
at
com.solarmetric.kodo.runtime.PersistenceManagerImpl.commit(PersistenceManagerImpl.java:438)
at reversetutorial.Finder.createData(Finder.java:74)
at reversetutorial.Finder.main(Finder.java:141)
Exception in thread "main"First off, use the '-primaryKeyOnJoin true' flag when running the reverse
mapping tool so that you can get rid of that useless Xref class and have
a direct relation between Person and Project. See the documentation on
reverse mapping tool options here:
http://www.solarmetric.com/Software/Documentation/latest/docs/ref_guide_pc_reverse.html
But your real problem is that you are creating new objects, assigning
primary key values, and expecting them to represent existing objects.
That's not the way JDO works. If you want to set relations to existing
objects in JDO, you use the PM to look up those objects. If you try to
create new objects, JDO will assume you want to insert new records into
the DB, and you'll get PK conflicts like you see here.
There are several good books out on JDO; if you're just starting out with
it, they might save you a lot of time and help you master JDO quickly. -
Inserting a new record in a database
Hi,
In my program I have to add a new record in a database. The problem is that one of the column of the database is a MEDIUMBLOB, and I have to put into that column an array of byte ( that I can convert into an InputStream ).
How can I do?To insert Blob data (an array of byte called "data") I tryed the following code; the blob colomn is called "column2" and the table(called "myTable") has only another column ("column1"), a column of String:
InputStream inp = new ByteArrayInputStream(data);
stmt.executeUpdate("insert into myTable (column1)
values( ' value1' ); " );
ResultSet res = stmt.executeQuery("select column2 from myTable");
res.updateBlob("data", inp);The problem is that I have the following error:
Exception in thread "AWT-EventQueue-0" java.lang.AbstractMethodError: >com.mysql.jdbc.ResultSet.updateBlob(Ljava/lang/String;Ljava/io/InputStream;)V -
Insert a new record in the middle of a tabular form
Hi,
I have a tabular form.
Pressing "Add Row" button opens a new, empty row at the bottom of the page or - if I use pagination - jumps to the page with the last record and creates a new record there.
Is it possible to open a new line in the middle of the page ?
I mean: if I have 25 records, I am on the first page (records 1-10) and the cursor is in a field of the second record and I press the "Add Row" button there should be a new, empty second line with old second record in the third line,... the old ninth record now in line 10 and disappeared record ten ?
Any idea ?
Thanks,
HeinzHeinz,
You may investigate logic using UNIONs and a manual tabular form.
Something like:
--get all records above new row
select apex_item... column1
,apex_item... column2
from yourtable
where <logic to limit rows above new record>
union
--get the new row
select apex_item... column1
,apex_item... column2
from dual
where :REQUEST = 'ADDROW'
union
--get every row not in the top query
select apex_item... column1
,apex_item... column2
from yourtable
where <logic to pull all records not pulled above new record>
For this to work you'll need to add your own "Add Row" button and associate it with a branch. Notice the select between the two unions in the above query is a select against dual. This will be your new record when pressing your "Add Row" button (:REQUEST = 'ADDROW').
The following how-to link is a reference for some of the logic you'll need when creating a manual tabular form.
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
Good Luck,
Todd -
Error when inserting a new record (Ctrl+Down)
Hello,
[http://img402.imageshack.us/my.php?image=12846351.jpg]
Here the problem is : when i press Ctrl+Down (Insert new record), i enter data into all those fields, but i got an error
Cannot Insert Record ("ROGER"."NUME") cannot be null (roger is my username which i logged on). And i completed all fields
Also, when inserting data into fields, when i click on another field, it points me back automatically to the last completed field, then when i click again on the next field, i can enter data in that field. why the cursor cannot be on the next field when i first click there?
i changed the property of the items Required = No (but however, in the database cannot be null).
Please help if you can.
ThanksFor your other issue, with null fields on your forms.
have you ever tried to log those fields value into a log table?
A better and simple idea is:
Create a temp table, with four columns: seq, section, message, type
Where section is the column to condition any search you want to make
message is the column to write anything you want
type is the column which holds the tpe of the record, like info, debug, warn, etc.
then create a database procedure
this procedure must recieve the section, message, type and insert them into the log table and do commit.
in yiour pre-insert trigger [forms level] or in your when-button-pressed or even better on your on-commit trigger [forms level]
write the following code:
begin
database_procdure('MY_FORM_NAME', 'THE VALUES ARE: 1='||:1||' 2='||:2||' 3='||:3, 'INFO');
end;
After that you can do a select in your sql*plus with the following statement:
select *
from temp_table
where selction like 'MY_FORM_NAME';
then you can track if any of the values you think is null or has a value, in fact, has a value.
best regards,
Abdel Miranda
AEMS Global Group
Panama -
Import/insert data from XML into Oracle database tables?
Hi. (I am using JDeveloper 10.1.3.3.0 and Oracle 10g)
I have been able to export the data from one of my database tables by using a View Object and .writeXML.
Now, I want to take an xml file that is formatted in the same way as what is spit out by the writeXML and put that info in my database table. I followed online examples and have tried using .readXML like so:
Element element = XMLDoc.getDocumentElement();
vo.readXML(element, -1);
I know it is sort of working, because at first I got an error message that one of the required attributes was missing. So, I added that attribute to my xml file and ran my code. No errors. But, I checked my database, and the new records were not added.
Is there something I have done wrong? Or is there perhaps something I left out? I also noticed there were several versions of readXML like readFromXML. Which one should I use and how?
Thanks.KUBA, I changed my code to match your example:
DocumentBuilder db = DocumentBuilderFactory.newInstance().newDocumentBuilder();
File xmlFile = new File("C:/myfilehere.xml");
Document doc = db.parse(xmlFile);
Element element = doc.getDocumentElement();
vo.readXML(element, -1);
vo.getDBTransaction().commit();
I still get no errors, but my database table has no new records.
Any ideas why?
Thanks. -
Need to insert into NVARCHAR2 column in a database table
I need to insert into a table with column type NVARCHAR2(2000) in java.
Cant use normal setString on that column. How can I do this using PreparedStatement in Java?The scenario is:
I have to read a CSV file which contains a column in Urdu language, and show it on the JTable first.
Then I have to import the JTable contents into a database table.
Database Table structure is:
CREATE TABLE IMPORT_TMP (
ctype VARCHAR2(3),
urdu_name NVARCHAR2(2000)
);My java code which inserts into the database table is:
Vector dataVector = tableModel.getDataVector();
rowVector = (Vector) dataVector.get(row);
cType = "";
if (rowVector.get(INDEX_BANK) != null) {
cType = rowVector.get(INDEX_CTYPE).toString();
urduName = "";
if (rowVector.get(INDEX_URDU_NAME) != null) {
urduName = rowVector.get(INDEX_URDU_NAME).toString();
statementInsert.setString(1, cType);
statementInsert.setString(2, urduName);I also applied Renderer on the table column, my renderer class is:
public class LangFontRenderer extends JLabel implements TableCellRenderer {
private Font customFont;
public LangFontRenderer(Font font) {
super();
customFont = font;
System.out.println("font = " + font.getFontName());
this.setFont(font);
@Override
public Component getTableCellRendererComponent(JTable table,
Object value, boolean isSelected, boolean hasFocus, int row, int column) {
if (value != null) {
if (value instanceof String) {
setText((String) value);
return this;
return this;
@Override
public Font getFont() {
return customFont;
// overriding other methods for performance reasons only
@Override
public void invalidate() {
@Override
public boolean isOpaque() {
return true;
@Override
public void repaint() {
@Override
public void revalidate() {
@Override
public void validate() {
}I applied the renderer on the column as:
TableColumn col = IATable.getColumnModel().getColumn(INDEX_URDU_NAME);
LangFontRenderer langRenderer = new LangFontRenderer(new java.awt.Font("Urdu Naskh Asiatype", 0, 11));
col.setCellRenderer(langRenderer);It does not give any error but when i query on the database table it does not show the column data in Urdu language.
Also it does not show the correct value on JTable column, some un-identified symbols.
Furthermore when I open the CSV file in notepad, it shows the correct language in that column, as I have installed the Urdu language and font on my system. -
GRC 10.0 - Insert a new field on the RISK/OPPORTUNITY
Hello All,
I have an activity to enhance the component below, to insert a new field on there.
The problem is that I don't know how to make it integrated with the save activity.
Embebbed with this component, I have the componet parent grrm_wd_rnp as shown below:
This component is called by the component POWL_UI_COMP. This screen below shows how this initial screen looks like:
Anybody knows how to implement this? It's confusing working with too many standard components conecting each other.
Regards,
RicardoHeinz,
You may investigate logic using UNIONs and a manual tabular form.
Something like:
--get all records above new row
select apex_item... column1
,apex_item... column2
from yourtable
where <logic to limit rows above new record>
union
--get the new row
select apex_item... column1
,apex_item... column2
from dual
where :REQUEST = 'ADDROW'
union
--get every row not in the top query
select apex_item... column1
,apex_item... column2
from yourtable
where <logic to pull all records not pulled above new record>
For this to work you'll need to add your own "Add Row" button and associate it with a branch. Notice the select between the two unions in the above query is a select against dual. This will be your new record when pressing your "Add Row" button (:REQUEST = 'ADDROW').
The following how-to link is a reference for some of the logic you'll need when creating a manual tabular form.
http://www.oracle.com/technology/products/database/application_express/howtos/tabular_form.html#MANUAL
Good Luck,
Todd -
i have done insertion of 6 field in the database..which is working good(code is below)...Now i want to do stuff that when i insert 6 field in database, then a new record also has to be insert into the database, in that new record the following changes should be done.
1)if i insert field code no ex.. 20 is inserted into the database then the a new code no 120 should be generated and inserted into database (the new code no should be started with 1, then the orginal code no will come) ex.. 10=101, 11=111, 256=1256,257=1257. The bold part is orginal record entered by the user, and the new record isnot bold.
2)Percentage field is there,ex 12%, 13% etc values will come , it calculates the percentage of credit amount field values and insert that values into the debit amount field of new record.
In my following code the code no is displayed as code, debit amount is shown as DrAmount, credit amount is shown as CrAmount, percentage field is shown as pct.
conn.setAutoCommit(false);
PreparedStatement pstmt = conn.prepareStatement("INSERT INTO gl_mast VALUES (?, ?, ?, ?, ?, ?)");
for (int i=1; request.getParameter((i==1)?"code":("code_" +i)) != null; i++){
String Code1=request.getParameter((i==1)?"code":("code_" +i));
int Code=Integer.parseInt(request.getParameter((i==1)?"code":("code_" +i)));
pstmt.setInt(1,Code);
String Description=request.getParameter((i==1)?"Description":("Description_" +i));
pstmt.setString(2,Description);
float Dr_Amt =Float.parseFloat(request.getParameter((i==1)?"DrAmount":("DrAmount_" +i)));
pstmt.setFloat(3,Dr_Amt );
float Cr_Amt =Float.parseFloat(request.getParameter((i==1)?"CrAmount":("CrAmount_" +i)));
pstmt.setFloat(4,Cr_Amt);
String Type =request.getParameter((i==1)?"type":("type_" +i));
pstmt.setString(5,Type );
float Pct =Float.parseFloat(request.getParameter((i==1)?"pct":("pct_" +i)));
pstmt.setFloat(6,Pct);
pstmt.addBatch();
conn.commit();
conn.setAutoCommit(true);
pstmt.executeBatch();plz...look at my code and solved my prob....
thanxWhats Happening ..are u getting errors when u run thispage..what is the error..If I remember correctly...there was a similar post a couple of days ago from you....
for (int i=1; request.getParameter((i==1)?"code":("code_" +i)) != null; i++){what is the above line of code doing..U cannot access the value of i as u have done above...why dont u use two ifs..to check the values..within the for...
Maybe you are looking for
-
Switching off conditional build tags
I now have quite a few conditional build tags in my RH7 project and it's getting a bit difficult to see what's what in my topics as they are covered in coloured hash lines. Is it possible to switch off the view of individual tags? For various jobs I
-
Hi, I've the following message error dring invoice verification: Balance in transaction currency Message no. F5702 Diagnosis A balance has occurred in transaction currency 'EUR' with the following details: Exchange rate '00', amount '1,00' and curren
-
Line Item increment nos. in S Order
Dear Gurus, Ours is a Mechanical process industry, though most of the items are NORM items, many are BOMs (LUMF), here the main item is a Model no. and the sub items are the parts in it according to the customers' requirement. In a Sales Order if I e
-
Original and Transcoded (ProRes 422) Media
Hi all Can anyone explain to me what exactly is the point of having both original (say H264, for example) and transcoded media in a library? I fail to grasp the point since I am only interested in dealing with prores files. Thanks
-
Change effects/plug-ins on vocals during song?
Hi - am trying to work out if this is possible? So that additonal effects can come in and out on the vocal track during one song. Thanks in advance.