Help with database column

I have a report with a column that come from table.
This column is a number and I need change the sign if a condition is true.
I try do this in a format trigger and in a trigger in Data Model (right clik mouse on this item Program Unit). But in both cases it say me when compile :
Err 903. A READ-ONLY VARIABLE USED IN OUT OR IN-OUT CONTEXT.
That mind that I cannot use this variable in this point. Also I try to change the Var and use a User Variable and change the value in the moment of read or print with similar results.
Any help wellcome.
Regards Everybody.

Why do you not use a database function which will have your businesslogic and will return the changes value.
Create function business1 (p_val in number) return number is
begin
<your logic here>
return(l_modified_value);
end;
in your report query just use the function.
select business1(<your_column> as "my alias" from .....
That should work
Marcos

Similar Messages

  • WebRowSet Problem  with database columns defined as TEXT??

    Hello,
    Can somebody help me on this subject. (http://forum.java.sun.com/thread.jspa?forumID=31&threadID=778586)
    I have the same problem with TEXT column when I try to populate the WebRowset.
    Thanks,
    Stephane

    OK,
    I change my postgresql driver for the lastest version (postgresql-8.2-506.jdbc3.jar) for JVM 1.5 and it's find...
    This driver support the javax.sql.
    St�phane
    Edited by: Borealis on Oct 15, 2007 12:43 PM

  • Help with database... plzzz

    Hi, I am trying to create a simple form in Java... What I am trying to do is enter a particular User ID and it should display all the information, regarding that userId... I am a starter.. Just trying to do some database stuffs.. I was wondering if anyone can help me with this without the help of JDBC.. thank you... So far I have created a form, textfield and buttons.. thats it..

    Thank for the help with the last problem, but now i am facing another one. The database and the forms works fine independently. But i cannot connect them, what i mean is if i click "insert" button to insert data into the database, the database window does not show up. i used the same code for the forms and it worked fine.. here is the code that i was using..
    private void xInsertRecordBtnMouseClicked(java.awt.event.MouseEvent evt) {                                             
            try
                this.setVisible(false);
                teamproject.EmployeeForm.class.newInstance().setVisible(true);
            } catch (InstantiationException ex)                                            
                Logger.getLogger(Main_Higher_Access.class.getName()).log(Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex)
                Logger.getLogger(Main_Higher_Access.class.getName()).log(Level.SEVERE, null, ex);
            }I wonder if there is any other way to import the data from the database into the form. or.. to show the database..
    i am getting the following errors....
    Exception in thread "AWT-EventQueue-0" Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 9.1 (Build b36-rc)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.Error Code: -4499
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:289)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:87)
            at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
            at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
            at teamproject.NewMasterDetailForm.initComponents(NewMasterDetailForm.java:29)
            at teamproject.NewMasterDetailForm.<init>(NewMasterDetailForm.java:14)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at java.lang.Class.newInstance0(Class.java:355)
            at java.lang.Class.newInstance(Class.java:308)
            at teamproject.Main_Higher_Access.xInsertRecordBtnMouseClicked(Main_Higher_Access.java:150)
            at teamproject.Main_Higher_Access.access$100(Main_Higher_Access.java:16)
            at teamproject.Main_Higher_Access$2.mouseClicked(Main_Higher_Access.java:52)
            at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
            at java.awt.Component.processMouseEvent(Component.java:6041)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
            at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
            at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:154)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
            ... 40 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
            at org.apache.derby.client.am.Connection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
            at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
            ... 44 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            at java.net.Socket.connect(Socket.java:519)
            at java.net.Socket.connect(Socket.java:469)
            at java.net.Socket.<init>(Socket.java:366)
            at java.net.Socket.<init>(Socket.java:179)
            at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            ... 50 more
    [TopLink Info]: 2007.12.05 12:04:07.281--ServerSession(16607409)--TopLink, version: Oracle TopLink Essentials - 9.1 (Build b36-rc)
    Exception in thread "AWT-EventQueue-0" Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 9.1 (Build b36-rc)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.Error Code: -4499
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:289)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:87)
            at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
            at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
            at teamproject.NewMasterDetailForm.initComponents(NewMasterDetailForm.java:29)
            at teamproject.NewMasterDetailForm.<init>(NewMasterDetailForm.java:14)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at java.lang.Class.newInstance0(Class.java:355)
            at java.lang.Class.newInstance(Class.java:308)
            at teamproject.Main_Higher_Access.xInsertRecordBtnMouseClicked(Main_Higher_Access.java:150)
            at teamproject.Main_Higher_Access.access$100(Main_Higher_Access.java:16)
            at teamproject.Main_Higher_Access$2.mouseClicked(Main_Higher_Access.java:52)
            at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
            at java.awt.Component.processMouseEvent(Component.java:6041)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
            at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
            at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:154)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
            ... 40 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
            at org.apache.derby.client.am.Connection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
            at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
            ... 44 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            at java.net.Socket.connect(Socket.java:519)
            at java.net.Socket.connect(Socket.java:469)
            at java.net.Socket.<init>(Socket.java:366)
            at java.net.Socket.<init>(Socket.java:179)
            at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            ... 50 more
    [TopLink Info]: 2007.12.05 12:05:01.921--ServerSession(16607409)--TopLink, version: Oracle TopLink Essentials - 9.1 (Build b36-rc)
    Exception in thread "AWT-EventQueue-0" Local Exception Stack:
    Exception [TOPLINK-4002] (Oracle TopLink Essentials - 9.1 (Build b36-rc)): oracle.toplink.essentials.exceptions.DatabaseException
    Internal Exception: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.Error Code: -4499
            at oracle.toplink.essentials.exceptions.DatabaseException.sqlException(DatabaseException.java:289)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:87)
            at oracle.toplink.essentials.sessions.DatasourceLogin.connectToDatasource(DatasourceLogin.java:170)
            at oracle.toplink.essentials.internal.sessions.DatabaseSessionImpl.loginAndDetectDatasource(DatabaseSessionImpl.java:537)
            at oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.login(EntityManagerFactoryProvider.java:206)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerSetupImpl.deploy(EntityManagerSetupImpl.java:212)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.getServerSession(EntityManagerFactoryImpl.java:78)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:111)
            at oracle.toplink.essentials.internal.ejb.cmp3.base.EntityManagerFactoryImpl.createEntityManagerImpl(EntityManagerFactoryImpl.java:105)
            at oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:76)
            at teamproject.NewMasterDetailForm.initComponents(NewMasterDetailForm.java:29)
            at teamproject.NewMasterDetailForm.<init>(NewMasterDetailForm.java:14)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
            at java.lang.Class.newInstance0(Class.java:355)
            at java.lang.Class.newInstance(Class.java:308)
            at teamproject.Main_Higher_Access.xInsertRecordBtnMouseClicked(Main_Higher_Access.java:150)
            at teamproject.Main_Higher_Access.access$100(Main_Higher_Access.java:16)
            at teamproject.Main_Higher_Access$2.mouseClicked(Main_Higher_Access.java:52)
            at java.awt.AWTEventMulticaster.mouseClicked(AWTEventMulticaster.java:253)
            at java.awt.Component.processMouseEvent(Component.java:6041)
            at javax.swing.JComponent.processMouseEvent(JComponent.java:3260)
            at java.awt.Component.processEvent(Component.java:5803)
            at java.awt.Container.processEvent(Container.java:2058)
            at java.awt.Component.dispatchEventImpl(Component.java:4410)
            at java.awt.Container.dispatchEventImpl(Container.java:2116)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4322)
            at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3995)
            at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3916)
            at java.awt.Container.dispatchEventImpl(Container.java:2102)
            at java.awt.Window.dispatchEventImpl(Window.java:2429)
            at java.awt.Component.dispatchEvent(Component.java:4240)
            at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
            at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:273)
            at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:183)
            at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:173)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:168)
            at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:160)
            at java.awt.EventDispatchThread.run(EventDispatchThread.java:121)
    Caused by: java.sql.SQLTransientConnectionException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.am.SQLExceptionFactory40.getSQLException(Unknown Source)
            at org.apache.derby.client.am.SqlException.getSQLException(Unknown Source)
            at org.apache.derby.jdbc.ClientDriver.connect(Unknown Source)
            at java.sql.DriverManager.getConnection(DriverManager.java:582)
            at java.sql.DriverManager.getConnection(DriverManager.java:154)
            at oracle.toplink.essentials.sessions.DefaultConnector.connect(DefaultConnector.java:85)
            ... 40 more
    Caused by: org.apache.derby.client.am.DisconnectException: java.net.ConnectException : Error connecting to server localhost on port 1527 with message Connection refused: connect.
            at org.apache.derby.client.net.NetAgent.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.newAgent_(Unknown Source)
            at org.apache.derby.client.am.Connection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection.<init>(Unknown Source)
            at org.apache.derby.client.net.NetConnection40.<init>(Unknown Source)
            at org.apache.derby.client.net.ClientJDBCObjectFactoryImpl40.newNetConnection(Unknown Source)
            ... 44 more
    Caused by: java.net.ConnectException: Connection refused: connect
            at java.net.PlainSocketImpl.socketConnect(Native Method)
            at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
            at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
            at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
            at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
            at java.net.Socket.connect(Socket.java:519)
            at java.net.Socket.connect(Socket.java:469)
            at java.net.Socket.<init>(Socket.java:366)
            at java.net.Socket.<init>(Socket.java:179)
            at org.apache.derby.client.net.OpenSocketAction.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)Edited by: saggu_baba on Dec 5, 2007 12:06 PM

  • Help with Databases

    Hey,
    I was recently approached by a friend to develop a system for his work. This system would require me to store information in a database that would be easy to access. However the only experience I have of coding with databases is with php and mySQL and I'm not quite sure how to move on to using Java.
    I'm a 2nd year software engineering student and I frequently use java in my projects but I never used it to store information in a database.
    Can someone point me in the right direction? Point me to a good ressource?
    Any help is appreciated,
    Thanks
    Seb

    Yes, start with a tutorial on JDBC:
    http://java.sun.com/docs/books/tutorial/jdbc/
    MySQL has a JDBC driver JAR you can download:
    http://www.mysql.com/products/connector/j/
    All the SQL you know ports right over.
    %

  • Help with calculated column formula- combine strings and convert to date

    In my list (SharePoint Server 2013) I have:
    'Invoiced Month' column, type of choice (strings with names of months- January, February, March..., December)
    'Year' column, single line of text (e.g. 2012, 2013, 2014)
    1. I need to create a calculated column which will return combined value of the columns above, but in DATE format e.g. 'Sep-2013' or '01-Sep-2013'.
    I then use that newly created calculated column to do this: http://iwillsharemypoint.blogspot.in/2012/03/sharepoint-list-view-of-current-month.html
    I am rubbish with formulas, can I have some help with my problem please?

    Hi,
    Use the formula, I have tested by creating Months column with choice, Year column as numeric and Calculated column as DateTime returned.
    =DATE(Year,IF([Months]="January", 1,IF([Months]="February",2,IF([Months]="March",3,IF([Months]="April",4,IF([Months]="May",5,IF([Months]="June",6,IF([Months]="July",7,IF([Months]="August",8,IF([Months]="September",9,IF([Months]="October",10,IF([Months]="November",11,12))))))))))),1)
    Before applying the formula few things need to be noted.
    DATE(YEAR, MONTH,DAY) will accepts three parameters all should be type numeric(integer).
    Create the Year column of type numeric
    Create the calculated column of type "DateTime" to return as date
    Please mark it answered, if your problem resolved or helpful.

  • Can anyone help with database driven design

    Hi,
    I would like to determine the best way to serve large amounts
    of text on an html page. I have manuals with lots of links that I
    want to add to a website. I would like to employ database driven
    web development in my design, would this be a good use for it? If
    so would you suggest php and what database?
    Thanks!
    Please forgive me for double posting, I posted this in the
    general forum but maybe should have done it here first?

    I would say it totally depends on the format that the manuals
    are in. If they're HTML than you can store them as BLOB's in mysql
    and you're life will be rather easy. You would need to parse the
    blob output for URLs but that's about it.
    However, if the manuals are in PDF than a database wouldn't
    help with the storage of the actual files, however you can use
    either XML or a DB (i.e. mysql) to store the metadata about that
    manual so that you can at least make the site searchable.
    A little more information about your data/website would
    probably be helpful.
    Aram

  • Please help with Database and JTable.

    The class listed below is for a JTable. The main in this class is for testing only, when complete main will reside elsewhere. I need to know how to make this JTable universal. How can I set it up so that when called in a main and passed parameters it will display the information contained in that users database?? Again it must be universal so no matter who uses it, it will perform the same on all database's.
    Here's the code:
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.table.*;
    public class DisplayTable extends JFrame{
    public DisplayTable() {
         JFrame jf = new JFrame("Window Title");
              jf.setSize(1100,700);
              jf.setLocation(25,50);
              jf.addWindowListener(new WindowAdapter(){
                   public void windowClosing(WindowEvent e){
                        System.exit(0);}
         TableModel tm = new AbstractTableModel(){
              String[][] data = { {"How to get database data??"}};
              String[] headers = {"How to get database headers??"};
              public int getRowCount() {return data.length;}
              public int getColumnCount() {return headers.length;}
              public Object getValueAt(int r, int c) {return data[r][c];}
              public String getColumnName(int c) {return headers[c];}
         JTable jt = new JTable(tm);
         JScrollPane jsp = new JScrollPane(jt);
              jf.getContentPane().add(jsp, BorderLayout.CENTER);
              jf.setVisible(true);
    public static void main(String args[]){
         DisplayTable dt = new DisplayTable(Database Parameters to be given here);

    You could generalize it, but it gets tricky to deal with the data types and if the JTable is editable because you would read the DB table data at run time. Using the ResultSetMetaData, you would be able to find the column type too. But, how can we cast an object at run-time?
    Below, I have provided an overview as of doing a read-only (all-strings version) of it. You may have some ideas from there.
    The database parameters that you pass to the constructor would tell the model where to connect and which DB table to read the data from. Couple of options:
    1. You can read the data in the constructor of DisplayTable into final variables and have the inner class (model) set its data and headers from those variables.
    Or
    2. Pull out the model as a separate class extending AbstractTableMode. Doing this, you can pass on the DB information to the model and have the model talk to the DB.
    And, I would use dynamic datastructures like Vector or List instead of arrays.
    You would have the following logic wherever you chose to talk to the DB:
    I am assuming that you are trying to read a complete DB table into your JTable (or may be you would pass a SELECT-query alongwith your DB information). Whatever may be the case, you would execute a select- to the DB and get a resultset back. Using that you would be able to get the ResultSetMetaData, which will give you the column count and column names. You may chose to use these column names as the header names for your JTable. With the column count you would query every row to get the object at each column.
    Here is a sample model:
    class MyModel extends AbstractTableModel {
        ArrayList columnNames = new ArrayList();
        ArrayList data = new ArrayList();
        MyModel(<DB Info>) {
            // Use the DB info and get the resultset
            ResultSetMetaData rsm = rs.getMetaData();
            int col = rsm.getColumnCount();
            for(int i=1; i<=col; i++) {
                columnNames.add(rsm.getColumnName(i));
            // Read the data
            while(rs.next()) {
                ArrayList row = new ArrayList();
                data.add(row);
                for(int j=1; j<=col; j++) {
                    // Here is the tricky part which I did not figure yet. For now, I am reading in all as Strings.
                    row.add(rs.getObject(j).toString());
        public String getColumnName(int c) {
            return (String)columnNames.get(c);
        public int getColumnCount() {
            return columnNames.size();
        public Object getValueAt(int r,int c) {
            ArrayList row = (ArrayList)data.get(r);
            return (String)row.get(c);
        public int getRowCount() {
            return data.size();
    }If you figured a way to handle run-time casting, please let us know.
    HTH.
    Vijay

  • Need help with complex column creation command

    Hello, all
    I need help with a complex column creation command and SQL anywhere help is not sufficient for it.
    Here is the situation:
    I need to write a generic DDL "alter table" command, which can add/modify columns without knowing in advance if they already exist in the destination table.
    Is there a command, which looks like:
    alter table "table1" add (on existing modify) column1 <datatype> <default> ?
    Thank you,
    Arcady

    Hi.
    I don't think this is supported in alter table command. But you can code that inside an if statement which queries systables & syscolumns. Your code should be something like that:
    if (select count(*) from sysobjects, syscolumns where sysobjects.id = syscolumns.id and sysobjects.name = 'some_table' and syscolumns.name = 'some_column') < 1
    begin
        alter table some_table add some_column numeric(12) not null
    end
    This is an example..
    Andreas.

  • Help with database autentication schemes

    Hi
    I am new to apex, especialy with database autentication schemes, and I need some help with creating login credentials for 3 types of users from a table in my database.
    Any help and guidance would be apriciated.
    Thanks in advance,
    Voislav

    What Oracle Version you are using?

  • Help with XHTML columns in IE6

    I'm having some problems with my columns in IE6. The math is
    all correct and it lays out perfectly fine in firefox as expected.
    For some reason IE6 seems to be doubling the numbers I assign as my
    margins. Can anyone give me a tip as to what's wrong here before I
    trash this whole idea and go with a old fashioned table.
    2 columns.
    15px left and right margins on the "left" column, 470px wide
    15px right margin on the "right"column, 455px wide

    Its an IE6 float/margin bug. If you add a margin in the same
    direction
    as the float IE6 will double it. Add display: inline; to the
    css styles,
    as below, to counter-act this problem.
    #left { margin: 0 15px; width: 470px; height: 100px; float:
    left;
    background: #f00; display: inline; }
    #right { margin: 0 15px 0 0; width: 455px; height: 100px;
    float: right;
    background: #666; display: inline; }
    quovadimus02 wrote:
    > I'm having some problems with my columns in IE6. The
    math is all correct and
    > it lays out perfectly fine in firefox as expected. For
    some reason IE6 seems
    > to be doubling the numbers I assign as my margins. Can
    anyone give me a tip as
    > to what's wrong here before I trash this whole idea and
    go with a old fashioned
    > table.
    >
    > 2 columns.
    > 15px left and right margins on the "left" column, 470px
    wide
    > 15px right margin on the "right"column, 455px wide
    >
    >
    >
    > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN"
    > "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    > <html xmlns="
    http://www.w3.org/1999/xhtml">
    > <head>
    > <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    > <title>Untitled Document</title>
    > <style type="text/css">
    > body { margin: 0; padding: 0; width: 970px; background:
    #e1e1e1; }
    > #wrap { padding: 10px 0; background: #fff; }
    > #left { margin: 0 15px; width: 470px; height: 100px;
    float: left; background:
    > #f00; }
    > #right { margin: 0 15px 0 0; width: 455px; height:
    100px; float: right;
    > background: #666; }
    > </style>
    > </head>
    > <body>
    > <div id="wrap">
    > <div id="right"></div>
    > <div id="left"></div>
    > <div style="clear: both;"></div>
    > </div>
    > </body>
    > </html>
    >

  • Need help with af:column and skinning

    Hallo,
    ADF Faces and skinning is in general a great opportunity to get projects done - thx for this.
    - I use a af:table with af:column with sortable="true".
    - This works great, but the customer want's to have the icon for sorting to the left side of the label.
    - I have created my own skin for this and can change the sorting icon, but I cannot place it to the left side of the label:
    af|column::sort-ascend-icon {
    content:url(/skins/espa/sort_ab_h.gif);
    Has anyone done this? Is this possible?
    Thx, Willi

    Looking at the source gives a clear picture - it can't be done.
    Now I am switching over to less comples jsf components and additional implementations.
    Thx, Willi

  • Help with CSS column display

    I have beaten my brains trying to get a third column to
    display correctly. After rereading several tutorials and helps in
    Dev Center, I am still stumped! Can you take a look at my code here
    http://www.mlundy.net/tigerswrestlingnew/lsTigersTemplate.html
    - CSS file is
    http://www.mlundy.net/tigerswrestlingnew/css/lsWrestling.css.
    The absolut wierdest thing just happened. After I uploaded it
    for you to see, it seems to display correctly! However, inside DW8,
    it still shows the sponsors div being pushed down below content.
    I'm very confused now! Can anyone give me a hand? Thanks.
    Mark

    quote:
    Originally posted by:
    mlundy
    I have beaten my brains trying to get a third column to
    display correctly. After rereading several tutorials and helps in
    Dev Center, I am still stumped! Can you take a look at my code here
    http://www.mlundy.net/tigerswrestlingnew/lsTigersTemplate.html
    - CSS file is
    http://www.mlundy.net/tigerswrestlingnew/css/lsWrestling.css
    The absolut wierdest thing just happened. After I uploaded it
    for you to see, it seems to display correctly! However, inside DW8,
    it still shows the sponsors div being pushed down below content.
    I'm very confused now! Can anyone give me a hand? Thanks.
    Mark
    Actually, it still does not work correctly. Because I have
    already applied a background image to the containing div, it
    appears correct. The sponsors div content actually still falls
    below the center, content div, instead of being top-aligned with
    the headlines and content divs.

  • Need help with custom column in BI Publisher

    Hi Guru's
    I have started working with BI Publisher Recently and need with below issue
    Can you please let me know how can i create a custom column like % based on two existing measures in the report
    I tried creating it in obiee report and used that SQL to create BI Publisher Report , but the result column in obiee is not working as expected in BI Publisher,
    can some one please help me with this
    Thanks a lot in advance.

    This column can be calculated in BIP RTF template. But if it is a column inside a FOR-loop
    then it may need to be calculated slightly different.
    Like I said, get the xml data and rtf then send it to me : [email protected]
    and will get it fixed for you.
    thanks
    Jorge

  • Please help with database connection issue

    Hi,
    I've created a few connections and pages with a few recodsets on my local computer and am connecting fine with the database. I've uploaded the database via phpmyadmin onto a remote server and uploaded all my pages to the website and have changed the database info, user name and password in the connections folder but when I try to load the file I get a message "no database selected". I've tried various things but no luck. I'm selecting the database name but something is missing. Any help would be appreciated.
    Derek

    A bit more info: Here is the connection script as its defined in Dreamweaver: <?php
    # FileName="Connection_php_mysql.htm"
    # Type="MYSQL"
    # HTTP="true"
    $hostname_karen_product = "localhost";
    $database_karen_product = "karen";
    $username_karen_product = "root";
    $password_karen_product = "root";
    $karen_product = mysql_pconnect($hostname_karen_product, $username_karen_product, $password_karen_product) or trigger_error(mysql_error(),E_USER_ERROR);
    ?>
    Where is says mysql_pconnect, I changed the $hostname_karen_product etc to 'localhost', 'username', 'the password for the database')
    Do i need to do something different at $database_karen_product?
    I'm basically new at this and confused as to how to alter this connection script.
    Thanks
    Derek

  • Help with database connection

    ok I am trying to use dreamweaver's database function to
    connect to a mysql database, i fill in the info and it gives me the
    following error:
    "an unidentified error has occurred"
    I know all the info i am putting in is correct as I am copy
    and pasting it directly out of my connection properties in navicat
    mysql editor which can connect to the database fine
    i tried connecting to multiple databases on multiple servers
    and every single one returned the exact same error
    I am using Dreamweaver CS3 for Mac OSx
    thx for any help
    -Ryan

    Have you gone under the Application folder and clicked on the
    plus (+) sign and created the connection to the database.
    Also, do you have username and password on the database? If
    so, you'll have to provide this information
    I don't use MAC or PHP a great deal. So my help can be rather
    limited. I'm just thinking about connection strings
    What web server are you using? MAke sure it's running and set
    up correctly. Test the server first and see if it's working. If so
    see what connections string Dreamweaver is providing. I know Apache
    had a few bugs with various version just Windows has had in the
    past, not sure how these work with OSX

Maybe you are looking for