2 Queries for OCCI on WIN and Linux platform

Hi,
I got 2 questions on using OCCI.
1. [Linux] Is it possible to compile OCCI programs on Linux if I am using gcc 3.2?
2. [WIN XP] Recently, I installed the oracle client 10g with OCCI libs installed. I linked my program with ..\oci\lib\msvc\vc6\oraocci10.lib and copied the oraocci10.dll to my project folder so it will be used during execution. I am using VC6++(sp6). I managed to compile without any error. However, my program crashed with a call to createConnection() method. Can anyone help?
Could I be using the wrong DLL? How to check which dll I am using? The program is planned to run on Instant Client on other machines.

Hi,
thks for the reply.
no, i only have vc++ 6 installed.
i even tried to create a seperate folder with just the program and all the required dlls.
However, I found a 'sqlnet.log' file in the vc project folder. Why is it using BEQ protocol when it should be TCP? Is the dll using any registry entries instead of running in instant client mode?
Fatal NI connect error 12560, connecting to:
(DESCRIPTION=(ADDRESS=(PROTOCOL=BEQ)(PROGRAM=oracle)(ARGV0=oracleORCL)(ARGS='(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))'))(CONNECT_DATA=(SID=ORCL)(CID=(PROGRAM=H:\vcproj\trial\desc\Debug\desc.exe)(HOST=xFtfdjkw3)(USER=peter))))
VERSION INFORMATION:
     TNS for 32-bit Windows: Version 10.1.0.2.0 - Production
     Oracle Bequeath NT Protocol Adapter for 32-bit Windows: Version 10.1.0.2.0 - Production
Time: 27-APR-2004 13:59:54
Tracing not turned on.
Tns error struct:
ns main err code: 12560
TNS-12560: TNS:protocol adapter error
ns secondary err code: 0
nt main err code: 530
TNS-00530: Protocol adapter error
nt secondary err code: 126
nt OS err code: 0

Similar Messages

  • Resource for BO on Win and Linux

    Hi,
    I have a BusinessObjects project. Can you give me requirements resource for BO on Linux and Window??
    Thanks
    Duypm

    Hi Duypm,
    go to below
    http://help.sap.com/
    and SAP BusinessObjects -> All Products
    you will get all the BO product giudes
    Thanks,
    Praveen.

  • IndexOf - difference between Win and Linux encoding

    Hello folks, wondering if someone could put me on the right track over this little problem with porting a java app to Linux...
    I have a nice little program, developed on (the latest) JDK under windows which reads a custom file format, locates the second occurance of the substring 'PNG', ignores everything before the character before this PNG (hence the -1 below) and saves the remainder, which is now a bog-standard PNG image. The first 'PNG substring always occurs within the first 50 bytes (hence the 50 below) and the second around the 2kB mark. Here's the line that finds the location of the second 'PNG' in the file loaded into strFileContent:
    location = strFileContent.indexOf( "PNG", 50 )-1;All is well compiled and run on windows, say file 'test1.xyz' produces a value for location of 2076 and saves a nice PNG called 'test1.png'.
    When I haul it over to Linux (Ubuntu 9.04) and lo, location comes out as 1964 for the same file, and of course the file is no-longer a PNG because there are an extra 112 bytes on the front end. Running the windows compile of the code or a fresh Linux compile makes no difference.
    I'm suspecting Win and Linux Java count, perhaps, line endings or some such differently, perhaps have to check an encoding. I'd appreciate any pointers on correcting this to work on both platforms (ultimately I'm trying to appease a Mac user, but don't have a Mac to play with at the moment).
    Cheers,
    K.
    Ken

    phaethon2008 wrote:
    I'm suspecting Win and Linux Java count, perhaps, line endings or some such differently, perhaps have to check an encoding. I'd appreciate any pointers on correcting this to work on both platforms (ultimately I'm trying to appease a Mac user, but don't have a Mac to play with at the moment).The immediate cause of your problem is probably that Windows uses a 8bit encoding as the default (probably some ISO-8859-{noformat}*{noformat} variant or the Windows-bastardization of it), while Ubuntu uses UTF-8, which has a varying number of bytes per character.
    The much more important underlying problem is that you're trying to treat binary data as if it were text. A PNG image is not text. Handling binary data in Strings (or char[]) is a sure way to invite desaster.
    You must convert your code to handle InputStream/OutputStream/byte[] instead of Reader/Writer/String/char[].

  • ANN: ANN: XDK 10.1.0.2.0 for HP-UX64, AIX and LINUX Production Release

    XDK 10.1.0.2.0 production for HP-UX64, AIX and LINUX is ready to download on OTN:
    http://otn.oracle.com/tech/xml/xdk/software/production10g/index.html

    The error indicates that the password (or wallet) files oidpwdldap1 and oidpwdr<ORACLE_SID> do NOT exist under $ORACLE_HOME/ldap/admin or your $ORACLE_HOME and $PATH are set incorrectly (a bit unlikely).
    Assuming that the $ORACLE_HOME and $PATH are indeed set to correct values, if the 2 files mentioned above do not exist under $ORACLE_HOME/ldap/admin, then perform the below action plan:
    1. Set the ORACLE_HOME to INFRASTRUCTURE ORACLE_HOME
    2. set the PATH to $ORACLE_HOME/bin:$ORACLE_HOME/ldap/bin:$ORACLE_HOME/opmn/bin:$PATH
    3. Ensure that you are able to login to sqlplus as "ods" user.
    4. If you do NOT know the password of ods user, then reset the password.
    5. Run the below command and enter the ods password when prompted for it.
    oidpasswd create_wallet=true
    6. Voila! The Wallet files are created under $ORACLE_HOME/ldap/admin.
    HTH,
    Regards,
    Praveen
    Edited by: Praveen B K on Aug 28, 2009 3:20 AM

  • I have a license for LR 5 (Win) and also have the CC Photography membership. Can I install and use LR on Windows PC and MAC?

    I have a license for LR 5 (Win) and also have the CC Photography membership. Can I install and use LR on Windows PC and MAC?

    Cloud License allows 2 activations http://www.adobe.com/legal/licenses-terms.html
    -Install on a 2nd computer http://forums.adobe.com/thread/1452292?tstart=0
    -Windows or Mac does not matter... 2 on the same operating system, or 1 on each

  • Fonts in java apps for win and linux

    Hi everyone.
    i need to build an application mult-plataform, to run in windows and linux...
    but i don�t know waht font i must use...the default font that java takes doesn�t exist in linux (dialog)...
    waht font should i use in my app??
    thanx

    For going multi-platform it is easiest to stick to the logical fonts: Fonts named "Serif", "SansSerif", "Monospaced", "Dialog", and "DialogInput".
    These fonts are guaranteed to exist on any platform, although their implementations may be different. If you use others then you'll have to figure out how to deal with cross platform issues.
    Jeff

  • Filter the content on different queries for the same infoprovider and user

    Hello,
    We are trying to make the following security scenario in BI, and have
    problem with the analysis object concept to filter at query level.
    The idea is to permit to :
    - user A
      - to execute query Q1 and view information about sites 1,2,3
      - to execute query Q2 and view information about sites 4,5,6
    but for example for another user :
    - user B
      - to execute query Q1 and view information about site 1,3
      - to execute query Q2 and view information about site 5,6,7
    Q1 and Q2 are queries from the same infoprovider.
    The idea is to make an automatic generation of analysis objects based
    on the standard program : RSEC_GENERATE_AUTHORIZATIONS.
    During tests, we have faced a problem with the object 0TCTQUERY that we
    thought will permit us to filter at the query level, but unless we add
    the name on the query on a role in the S_RS_COMP authorization object,
    field RSZCOMPID, the query is not granted to the user.
    The fact that we use both authorization objects : one for the query
    definition, and another for the analysis authorization concept
    (S_RS_AUTH, field BIAUTH), has disastrous effect : all values given in
    the analysis objects are for all queries of an indicated infoprovider.
    With that system, it's then not possible to propose dynamically different
    views of the same data (ie from same infoprovider) based on the
    authorization concept unless using the technic of customer-exit variable,
    but with variable you will have a problem with old queries that doesn't
    have a variable and that will permit to see all data given in the new
    authorization objects.
    Is there exists another object to filter at the query level in the
    analysis objects ? If it's not the case, what is possible to do to reach
    our goal with the new authorization concept ?
    Thank you in advance for your help.
    Best regards,
    Gaël.

    The data is protected on infoprovider level and not on the query level,  so when two querys are build from the same Infoprovider then the authorizations are the same,
    To achieve what you want to do,  the querys must be built off different providers.   This can be achieved by placing the infoprovider in 2 differnt multiproviders and building the querys and authorizations seperatly on these.

  • Unable to download oracle 10g release 2 for windows 32 bit and linux

    unable to download the oracle 10g for windows and linux from the website given below. http://www.oracle.com/technology/software/products/database/oracle10g/index.html
    can any one help me out ?

    From that site, you need to click on a link and answer the questions on the next page. Click 'I agree' and, on the following page, you select the download you need.
    If that doesn;t work, you may need to review user settings, security, and knowledge base for your browser.

  • Platform change: Can I buy After Effects 7.0 (Mac)   AE 5.5 Upgrade (Win) and change platform to AE 5.5. Mac?

    I want to buy After Effects 7.0 (Mac)  + an upgrade version, which is unfortunately an AE 5.5 Upgrade (Win) version.
    Can I change the upgrade version to platform AE 5.5. Mac?
    Thanks in advance!
    TobiWebbbb

    no, unfortunately adobe only supports platform changes for current software, Order product | Platform, language swap
    you could upgrade to adobe cc (and get upgrade pricing) that would allow you to use on both mac and pc.

  • Absolute paths (win and linux)

    hy
    is there a solution to write absolute paths independent of operating system?
    I mean e.g. in windows instead of y:\\folder\file.name maybe y//folder/file.name?
    the methods in class File only give me \\ (fileSeparator) and ; (pathSeparator)
    (using java 1.4)
    big thx
    cheers

    Absolute paths, by their very nature, are platform-specific, so, no. For instance, what's the platform-independent way of referring to D:\ ? There isn't one, because not all platforms, and indeed not all installations of any platform, have a D: drive. The path " y//folder/file.name" makes no sense
    java.io.File.listRoots() returns an array of File objects representing the root volumes for your machine. For instance, it might return C:\, D:\, E:\ on your Windows box. That might be of some use to you. Or better yet, avoid absolute paths altogether, if you can.

  • Batch encode video for iPhone on Mac and Linux

    Hello everyone.
    This may look like SPAM or unsolicited ad, but let me say that I have no other interests that avoiding people hours of research and tries I did, the software is open source.
    That said, I finally managed to create a set of scripts to easily convert video from avi files or even mkv, to .mp4 files iTunes compliant that you can load on your iPhone.
    The great news about this, for us, non-english people, is that it takes subtitles and burn them into the movie, so you can watch your favorites divx movies with subtitles.
    This is mainly intended to run on Linux, but works nice on Mac OS X too.
    If you want more information about this, visit https://svn.tynsoe.org/projects/iencode

    Apple licensed ActiveSync from Microsoft for accessing an Exchange account via ActiveSync with the Exchange Server, which provides Push access for recieved messages, and over the air syncing for Exchange contacts and calendar events with the Exchange Server.
    ActiveSync must be enabled for your Exchange account at the Exchange Server.
    ActiveSync is also available with Snow Leopard on a Mac for accessing an Exchange account with the Mail.app and having Exchange contacts and calendar events with the Address Book and iCal.
    You won't need to connect your iPhone to iTunes or to your computer at work except for charging your iPhone.

  • Graphics bug on Win and Linux ?

    Hi all,I have a graphic problem. I have created a JFrame and I have added him a JPanel (1) that it has as Layout a BorderLayout. To this JPanel (1) I have added another JPanel (2) that it has as Layout a GridLayout and a JLabel that I have used as StatusBar.
    The problem is that when a window overlaps to the JPanel (1), the JPanel (2) is visualized to the initial state in which it had been created.After click on it returns to the actual state.
    I post you an image to make to understand better me.
    http://img176.imageshack.us/my.php?image=screenji3.gif
    Someone know how i can resolve this problem?
    Ps: sorry for my bad English.
    Message was edited by:
    JinKazama
    I have forgotten to say that use Java5

    package it.unibo.cs.CSameGame;
    import javax.swing.JFrame;
    import java.awt.Dimension;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.KeyEvent;
    import javax.swing.ButtonGroup;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JFileChooser;
    import javax.swing.JMenu;
    import javax.swing.JMenuItem;
    import javax.swing.JMenuBar;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JLabel;
    import javax.swing.JRadioButtonMenuItem;
    import javax.swing.JTextField;
    import javax.swing.JComboBox;
    import javax.swing.JButton;
    import javax.swing.KeyStroke;
    import javax.swing.UIManager;
    import java.awt.BorderLayout;
    import java.awt.GridBagLayout;
    import java.awt.GridBagConstraints;
    import java.awt.GridLayout;
    import java.awt.Insets;
    import java.io.IOException;
    import java.net.URL;
    import java.security.NoSuchAlgorithmException;
    import java.util.ArrayList;
    import javax.swing.JCheckBox;
    import java.awt.Toolkit;
    * @author Paolino Carmine
    * @author Statuto Riccardo
    public class Swingui {
    private JFrame FinestraPrincipale = null; // @jve:decl-index=0:visual-constraint="576,53"
    private JMenuBar BarraMenu = null;
    private JMenu Gioco = null;
    private JMenuItem NuovoGioco = null;
    private JMenu Impostazioni = null;
    private JMenu Aiuto = null;
    private JMenuItem About = null;
    private JMenuItem Help = null;
    private JMenuItem Esci = null;
    private JMenuItem CaricaMappa = null;
    private JMenuItem SalvaMappa = null;
    private JMenuItem Settings = null;
    private JFrame Preferenze = null; // @jve:decl-index=0:visual-constraint="10,10"
    private JLabel L_lbl = null;
    private JTextField L_txt = null;
    private JLabel H_lbl = null;
    private JTextField H_txt = null;
    private JLabel N_lbl = null;
    private JTextField N_txt = null;
    private JLabel Stile_lbl = null;
    private JComboBox Stile_cbox = null;
    private JButton Salva_btn = null;
    private static Game game; // @jve:decl-index=0:
    private int l;
    private int h;
    private int n;
    private int style;
    private JPanel PrefContentPane = null;
    private JPanel ContentPanePrincipale = null;
    private JLabel StatusBarLabel = null;
    private URL imageURL;
    private ImageIcon image;
    private JLabel piece;
    private JLabel Player_lbl = null;
    private JTextField Player_txt = null;
    private String player;
    private JMenu MenuTemi = null;
    private JRadioButtonMenuItem Standard = null;
    private JRadioButtonMenuItem Futurama = null;
    private String tema = "base";
    private JCheckBox NewGameAfterWinCB = null;
    private JRadioButtonMenuItem KillBill = null;
    private JPanel MainPanel = null;
    private GridLayout LayoutGriglia;
    private ArrayList<String> listaTipi = new ArrayList<String>();
    private boolean flag;
    * This method initializes FinestraPrincipale
    * @return javax.swing.JFrame
    private JFrame getFinestraPrincipale() {
         if (FinestraPrincipale == null) {
         try {
              FinestraPrincipale = new JFrame();
              FinestraPrincipale.setSize(new Dimension(374, 294)); // Generated
              FinestraPrincipale.setTitle("CSameGame"); // Generated
              FinestraPrincipale.setResizable(false);
              FinestraPrincipale
                   .setIconImage(Toolkit
                        .getDefaultToolkit()
                        .getImage(
                             getClass()
                                  .getResource(
                                       "/it/unibo/cs/CSameGame/icons/face-surprise.png")));
              FinestraPrincipale.setJMenuBar(getBarraMenu()); // Generated
              FinestraPrincipale.setContentPane(getMainPanel()); // Generated
              FinestraPrincipale
                   .setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return FinestraPrincipale;
    * This method initializes BarraMenu
    * @return javax.swing.JMenuBar
    private JMenuBar getBarraMenu() {
         if (BarraMenu == null) {
         try {
              BarraMenu = new JMenuBar();
              BarraMenu.add(getGioco()); // Generated
              BarraMenu.add(getImpostazioni()); // Generated
              BarraMenu.add(getAiuto()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return BarraMenu;
    * This method initializes Gioco
    * @return javax.swing.JMenu
    private JMenu getGioco() {
         if (Gioco == null) {
         try {
              Gioco = new JMenu();
              Gioco.setText("Gioco"); // Generated
              Gioco.setMnemonic(KeyEvent.VK_G);
              Gioco.add(getNuovoGioco()); // Generated
              Gioco.addSeparator();
              Gioco.add(getCaricaMappa()); // Generated
              Gioco.add(getSalvaMappa()); // Generated
              Gioco.addSeparator();
              Gioco.add(getEsci()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Gioco;
    * This method initializes NuovoGioco
    * @return javax.swing.JMenuItem
    private JMenuItem getNuovoGioco() {
         if (NuovoGioco == null) {
         try {
              URL iconURL = getClass().getResource("icons/new.png");
              Icon icon = new ImageIcon(iconURL);
              NuovoGioco = new JMenuItem("Nuovo gioco", icon);
              NuovoGioco.setMnemonic(KeyEvent.VK_N);
              NuovoGioco.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N,
                   ActionEvent.CTRL_MASK));
              NuovoGioco.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   flag=true;
                   newGame();
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return NuovoGioco;
    * This method initializes Impostazioni
    * @return javax.swing.JMenu
    private JMenu getImpostazioni() {
         if (Impostazioni == null) {
         try {
              Impostazioni = new JMenu();
              Impostazioni.setText("Impostazioni"); // Generated
              Impostazioni.setMnemonic(KeyEvent.VK_I);
              Impostazioni.add(getSettings()); // Generated
              Impostazioni.add(getMenuTemi());
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Impostazioni;
    * This method initializes Aiuto
    * @return javax.swing.JMenu
    private JMenu getAiuto() {
         if (Aiuto == null) {
         try {
              Aiuto = new JMenu();
              Aiuto.setText("Aiuto"); // Generated
              Aiuto.setMnemonic(KeyEvent.VK_A);
              Aiuto.add(getAbout()); // Generated
              Aiuto.add(getHelp()); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Aiuto;
    * This method initializes About
    * @return javax.swing.JMenuItem
    private JMenuItem getAbout() {
         if (About == null) {
         try {
              About = new JMenuItem();
              About.setText("Informazioni su..."); // Generated
              About.setMnemonic(KeyEvent.VK_I);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return About;
    * This method initializes Help
    * @return javax.swing.JMenuItem
    private JMenuItem getHelp() {
         if (Help == null) {
         try {
              URL iconURL = getClass().getResource("icons/help.png");
              Icon icon = new ImageIcon(iconURL);
              Help = new JMenuItem("Aiuto CSameGame", icon);
              Help.setMnemonic(KeyEvent.VK_A);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Help;
    * This method initializes Esci
    * @return javax.swing.JMenuItem
    private JMenuItem getEsci() {
         if (Esci == null) {
         try {
              URL iconURL = getClass().getResource("icons/exit.png");
              Icon icon = new ImageIcon(iconURL);
              Esci = new JMenuItem("Esci", icon);
              Esci.setMnemonic(KeyEvent.VK_E);
              Esci.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_Q,
                   ActionEvent.CTRL_MASK));
              Esci.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   System.exit(0);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Esci;
    * This method initializes CaricaMappa
    * @return javax.swing.JMenuItem
    private JMenuItem getCaricaMappa() {
         if (CaricaMappa == null) {
         try {
              URL iconURL = getClass().getResource("icons/open.png");
              Icon icon = new ImageIcon(iconURL);
              CaricaMappa = new JMenuItem("Carica partita...", icon);
              CaricaMappa.setMnemonic(KeyEvent.VK_C);
              CaricaMappa.setAccelerator(KeyStroke.getKeyStroke(
                   KeyEvent.VK_L, ActionEvent.CTRL_MASK));
              CaricaMappa.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFileChooser fc = new JFileChooser();
                   Filtro txtFiltro = new Filtro();
                   fc.setFileFilter(txtFiltro);
                   fc.addChoosableFileFilter(txtFiltro);
                   int scelta = fc.showOpenDialog(CaricaMappa);
                   try {
                   style = Stile_cbox.getSelectedIndex();
                   player = Player_txt.getText();
                   } catch (NullPointerException exception) {
                   player = "Anonimo";
                   if (scelta == JFileChooser.APPROVE_OPTION) {
                   try {
                        game = new Game(fc.getSelectedFile().getPath(),
                             style);
                        game.setPlayerName(player);
                        game.setPlayerScore();
                        StatusBarLabel.setText("Punteggio attuale: "
                             + game.getPlayerScore());
                        printSurface();
                        SalvaMappa.setEnabled(true);
                   } catch (IOException exception) {
                        exception.printStackTrace();
                   } catch (StringIndexOutOfBoundsException exception) {
                        JOptionPane.showMessageDialog(null,
                             "Il file della mappa � corrotto",
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
                   } catch (NoSuchAlgorithmException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
                   } catch (SecurityException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return CaricaMappa;
    * This method initializes SalvaMappa
    * @return javax.swing.JMenuItem
    private JMenuItem getSalvaMappa() {
         if (SalvaMappa == null) {
         try {
              URL iconURL = getClass().getResource("icons/save.png");
              Icon icon = new ImageIcon(iconURL);
              SalvaMappa = new JMenuItem("Salva partita...", icon);
              SalvaMappa.setMnemonic(KeyEvent.VK_S);
              SalvaMappa.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
                   ActionEvent.CTRL_MASK));
              SalvaMappa.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFileChooser fc = new JFileChooser();
                   Filtro txtFiltro = new Filtro();
                   fc.setFileFilter(txtFiltro);
                   fc.addChoosableFileFilter(txtFiltro);
                   int scelta = fc.showSaveDialog(SalvaMappa);
                   SurfaceParser map = new SurfaceParser("");
                   if (scelta == JFileChooser.APPROVE_OPTION) {
                   try {
                        map.saveMap(fc.getSelectedFile().getPath(),
                             game.getSurface(), game.getH(), game
                                  .getL(), game.getPlayerScore(),
                             style);
                   } catch (IOException exception) {
                        exception.printStackTrace();
                   } catch (NoSuchAlgorithmException exception) {
                        JOptionPane.showMessageDialog(null, exception
                             .toString().split(": ")[1],
                             "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return SalvaMappa;
    * This method initializes Settings
    * @return javax.swing.JMenuItem
    private JMenuItem getSettings() {
         if (Settings == null) {
         try {
              URL iconURL = getClass().getResource("icons/preferences.png");
              Icon icon = new ImageIcon(iconURL);
              Settings = new JMenuItem("Preferenze", icon);
              Settings.setMnemonic(KeyEvent.VK_P);
              Settings.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_P,
                   ActionEvent.CTRL_MASK));
              Settings.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
                   JFrame Preferenze = getPreferenze();
                   Preferenze.setVisible(true);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return Settings;
    * This method initializes jTable
    * @return javax.swing.JTable
    * This method initializes Preferenze
    * @return javax.swing.JFrame
    private JFrame getPreferenze() {
         if (Preferenze == null) {
         Preferenze = new JFrame("Preferenze");
         Preferenze.setSize(new Dimension(530, 250));
         Preferenze.setResizable(false); // Generated
         Preferenze.setContentPane(getJContentPane()); // Generated
         return Preferenze;
    * This method initializes L_txt
    * @return javax.swing.JTextField
    private JTextField getL_txt() {
         if (L_txt == null) {
         L_txt = new JTextField("15");
         return L_txt;
    * This method initializes H_txt
    * @return javax.swing.JTextField
    private JTextField getH_txt() {
         if (H_txt == null) {
         H_txt = new JTextField("10");
         return H_txt;
    * This method initializes N_txt
    * @return javax.swing.JTextField
    private JTextField getN_txt() {
         if (N_txt == null) {
         N_txt = new JTextField("3");
         return N_txt;
    * This method initializes Stile_cbox
    * @return javax.swing.JComboBox
    private JComboBox getStile_cbox() {
         if (Stile_cbox == null) {
         String[] style = { "Standard", "Continous", "Megashift", "Shifter" };
         Stile_cbox = new JComboBox(style);
         return Stile_cbox;
    * This method initializes Salva_btn
    * @return javax.swing.JButton
    private JButton getSalva_btn() {
         if (Salva_btn == null) {
         Salva_btn = new JButton();
         Salva_btn.setText("Salva");
         Salva_btn.addActionListener(new ActionListener() {
              private Game fakegame;
              public void actionPerformed(ActionEvent e) {
              Preferenze.setVisible(false);
              try {
                   l = Integer.parseInt(L_txt.getText());
                   h = Integer.parseInt(H_txt.getText());
                   n = Integer.parseInt(N_txt.getText());
                   style = Stile_cbox.getSelectedIndex();
                   player = Player_txt.getText();
                   fakegame = new Game(l, h, n, style);
                   fakegame.setPlayerName(player);
              } catch (Exception expt) {
                   JOptionPane.showMessageDialog(null, expt.toString()
                        .split(": ")[1], "Aiaiai...",
                        JOptionPane.ERROR_MESSAGE);
                   getPreferenze();
                   Preferenze.setVisible(true);
         return Salva_btn;
    * This method initializes jContentPane
    * @return javax.swing.JPanel
    private JPanel getJContentPane() {
         if (PrefContentPane == null) {
         try {
              GridBagConstraints gridBagConstraints32 = new GridBagConstraints();
              gridBagConstraints32.gridx = 0;
              gridBagConstraints32.gridy = 5;
              Player_lbl = new JLabel();
              Player_lbl.setText("Nome giocatore");
              Stile_lbl = new JLabel();
              Stile_lbl.setText("Stile di gioco");
              N_lbl = new JLabel();
              N_lbl.setText("Numero di tipi di pedine");
              H_lbl = new JLabel();
              H_lbl.setText("Altezza griglia");
              L_lbl = new JLabel();
              L_lbl.setText("Larghezza griglia");
              GridBagConstraints gridBagConstraints41 = new GridBagConstraints();
              gridBagConstraints41.insets = new Insets(35, 10, 2, 10);
              gridBagConstraints41.fill = GridBagConstraints.NONE;
              gridBagConstraints41.gridy = 0;
              gridBagConstraints41.weightx = 1.0;
              gridBagConstraints41.anchor = GridBagConstraints.SOUTH;
              gridBagConstraints41.gridx = 1;
              gridBagConstraints41.ipadx = 90;
              GridBagConstraints gridBagConstraints31 = new GridBagConstraints();
              gridBagConstraints31.insets = new Insets(5, 10, 5, 10);
              gridBagConstraints31.gridx = 0;
              gridBagConstraints31.fill = GridBagConstraints.HORIZONTAL;
              gridBagConstraints31.anchor = GridBagConstraints.SOUTHWEST;
              gridBagConstraints31.gridy = 0;
              GridBagConstraints gridBagConstraints6 = new GridBagConstraints();
              gridBagConstraints6.fill = GridBagConstraints.VERTICAL; // Generated
              gridBagConstraints6.gridx = 1; // Generated
              gridBagConstraints6.gridy = 4; // Generated
              gridBagConstraints6.weightx = 1.0; // Generated
              GridBagConstraints gridBagConstraints5 = new GridBagConstraints();
              gridBagConstraints5.gridx = 1; // Generated
              gridBagConstraints5.anchor = GridBagConstraints.EAST; // Generated
              gridBagConstraints5.ipadx = 0; // Generated
              gridBagConstraints5.insets = new Insets(15, 0, 35, 20); // Generated
              gridBagConstraints5.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints5.gridy = 7; // Generated
              GridBagConstraints gridBagConstraints4 = new GridBagConstraints();
              gridBagConstraints4.gridx = 0; // Generated
              gridBagConstraints4.anchor = GridBagConstraints.WEST; // Generated
              gridBagConstraints4.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints4.fill = GridBagConstraints.HORIZONTAL; // Generated
              gridBagConstraints4.gridy = 4; // Generated
              GridBagConstraints gridBagConstraints3 = new GridBagConstraints();
              gridBagConstraints3.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints3.gridy = 3; // Generated
              gridBagConstraints3.weightx = 1.0; // Generated
              gridBagConstraints3.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints3.ipadx = 90; // Generated
              gridBagConstraints3.anchor = GridBagConstraints.CENTER; // Generated
              gridBagConstraints3.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints21 = new GridBagConstraints();
              gridBagConstraints21.gridx = 0; // Generated
              gridBagConstraints21.anchor = GridBagConstraints.WEST; // Generated
              gridBagConstraints21.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints21.fill = GridBagConstraints.BOTH; // Generated
              gridBagConstraints21.gridy = 3; // Generated
              GridBagConstraints gridBagConstraints11 = new GridBagConstraints();
              gridBagConstraints11.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints11.gridy = 2; // Generated
              gridBagConstraints11.weightx = 1.0; // Generated
              gridBagConstraints11.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints11.ipadx = 90; // Generated
              gridBagConstraints11.anchor = GridBagConstraints.CENTER; // Generated
              gridBagConstraints11.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints2 = new GridBagConstraints();
              gridBagConstraints2.gridx = 0; // Generated
              gridBagConstraints2.insets = new Insets(5, 10, 5, 10); // Generated
              gridBagConstraints2.fill = GridBagConstraints.BOTH; // Generated
              gridBagConstraints2.gridy = 2; // Generated
              GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
              gridBagConstraints1.fill = GridBagConstraints.NONE; // Generated
              gridBagConstraints1.gridy = 1; // Generated
              gridBagConstraints1.weightx = 1.0; // Generated
              gridBagConstraints1.gridheight = 1; // Generated
              gridBagConstraints1.insets = new Insets(2, 10, 2, 10); // Generated
              gridBagConstraints1.ipadx = 90; // Generated
              gridBagConstraints1.anchor = GridBagConstraints.SOUTH; // Generated
              gridBagConstraints1.gridx = 1; // Generated
              GridBagConstraints gridBagConstraints = new GridBagConstraints();
              gridBagConstraints.gridx = 0; // Generated
              gridBagConstraints.anchor = GridBagConstraints.SOUTH; // Generated
              gridBagConstraints.gridheight = 1; // Generated
              gridBagConstraints.ipadx = 0; // Generated
              gridBagConstraints.insets = new Insets(0, 10, 5, 10); // Generated
              gridBagConstraints.fill = GridBagConstraints.HORIZONTAL; // Generated
              gridBagConstraints.ipady = 0; // Generated
              gridBagConstraints.gridwidth = 1; // Generated
              gridBagConstraints.gridy = 1; // Generated
              PrefContentPane = new JPanel();
              PrefContentPane.setLayout(new GridBagLayout()); // Generated
              PrefContentPane.add(L_lbl, gridBagConstraints);
              PrefContentPane.add(getL_txt(), gridBagConstraints1);
              PrefContentPane.add(H_lbl, gridBagConstraints2);
              PrefContentPane.add(getH_txt(), gridBagConstraints11);
              PrefContentPane.add(N_lbl, gridBagConstraints21);
              PrefContentPane.add(getN_txt(), gridBagConstraints3);
              PrefContentPane.add(Stile_lbl, gridBagConstraints4);
              PrefContentPane.add(getSalva_btn(), gridBagConstraints5);
              PrefContentPane.add(getStile_cbox(), gridBagConstraints6);
              PrefContentPane.add(Player_lbl, gridBagConstraints31);
              PrefContentPane.add(getPlayer_txt(), gridBagConstraints41);
              PrefContentPane.add(getNewGameAfterWinCB(),
                   gridBagConstraints32);
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return PrefContentPane;
    * This method initializes Player_txt
    * @return javax.swing.JTextField
    private JTextField getPlayer_txt() {
         if (Player_txt == null) {
         Player_txt = new JTextField("Anonimo");
         return Player_txt;
    * This method initializes MenuTemi
    * @return javax.swing.JMenu
    private JMenu getMenuTemi() {
         if (MenuTemi == null) {
         MenuTemi = new JMenu();
         MenuTemi.setText("Cambia tema");
         ButtonGroup group = new ButtonGroup();
         MenuTemi.add(getStandard());
         group.add(Standard);
         MenuTemi.add(getFuturama());
         group.add(Futurama);
         MenuTemi.add(getKillBill());
         group.add(KillBill);
         return MenuTemi;
    * This method initializes Standard
    * @return javax.swing.JMenuItem
    private JRadioButtonMenuItem getStandard() {
         if (Standard == null) {
         Standard = new JRadioButtonMenuItem("Base", true);
         Standard.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              tema = "base";
              if (game != null){
                   createLista();
                   printSurface();
         return Standard;
    * This method initializes Futurama
    * @return javax.swing.JMenuItem
    private JRadioButtonMenuItem getFuturama() {
         if (Futurama == null) {
         Futurama = new JRadioButtonMenuItem("Futurama");
         Futurama.addActionListener(new ActionListener() {
              public void actionPerformed(ActionEvent e) {
              tema = "futurama";
              if (game != null){
                   createLista();
                   printSurface();
         return Futurama;
    * This method initializes NewGameAfterWinCB
    * @return javax.swing.JCheckBox
    private JCheckBox getNewGameAfterWinCB() {
         if (NewGameAfterWinCB == null) {
         NewGameAfterWinCB = new JCheckBox(
              "Inizia automaticamente un nuovo gioco alla fine della partita",
              true);
         return NewGameAfterWinCB;
    * This method initializes KillBill
    * @return javax.swing.JRadioButtonMenuItem
    private JRadioButtonMenuItem getKillBill() {
         if (KillBill == null) {
         KillBill = new JRadioButtonMenuItem("Kill Bill");
         KillBill.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent e) {
              tema = "killbill";
              if (game != null){
                   createLista();
                   printSurface();
         return KillBill;
    * This method initializes MainPanel
    * @return javax.swing.JPanel
    private JPanel getMainPanel() {
         if (MainPanel == null) {
         try {
              StatusBarLabel = new JLabel();
              StatusBarLabel.setText("Avvia un nuovo gioco!"); // Generated
              MainPanel = new JPanel();
              MainPanel.setLayout(new BorderLayout()); // Generated
              MainPanel.add(StatusBarLabel, BorderLayout.SOUTH); // Generated
         } catch (java.lang.Throwable e) {
              // TODO: Something
         return MainPanel;
    public static void main(String[] args) {
         try {
         // Set System L&F
         UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
         } catch (Exception e) {
         e.printStackTrace();
         new Swingui();
    private Swingui() {
         JFrame FinestraPrincipale = getFinestraPrincipale();
         FinestraPrincipale.setVisible(true);
         SalvaMappa.setEnabled(false);
    private void printSurface() {
         ContentPanePrincipale = null;
         ContentPanePrincipale = new JPanel();
         LayoutGriglia = new GridLayout(game.getH(), game.getL());
         ContentPanePrincipale.setLayout(LayoutGriglia);
         makeMatrice();
         MainPanel.add(ContentPanePrincipale, BorderLayout.CENTER);
         ContentPanePrincipale
              .addMouseListener(new java.awt.event.MouseAdapter() {
              public void mouseClicked(java.awt.event.MouseEvent evt) {
                   int x = evt.getX() / 38;
                   int y = (game.getH() - evt.getY() / 38) - 1;
                   try {
                   game.move(x, y);
                   StatusBarLabel.setText("Punteggio attuale: "
                        + game.getPlayerScore());
                   } catch (RuntimeException e) {
                   StatusBarLabel.setText(e.toString().split(": ")[1]);
                   printSurface();
                   if (game.isEnded()) {
                   StatusBarLabel
                        .setText("Nessuna mossa disponibile!");
                   if (game.getPlayerName().equals("Anonimo")
                        || game.getPlayerName().equals("")) {
                        String in = JOptionPane.showInputDialog(
                             "Inserisci il tuo nome", "Anonimo");
                        if (in == null || in.equals(""))
                        in = "Anonimo";
                        game.setPlayerName(in);
                        JOptionPane.showMessageDialog(null,
                             "Complimenti, " + game.getPlayerName()
                                  + "! Il tuo punteggio �: "
                                  + game.getPlayerScore(),
                             "Grande!",
                             JOptionPane.INFORMATION_MESSAGE);
                   } else {
                        JOptionPane.showMessageDialog(null,
                             "Complimenti, " + game.getPlayerName()
                                  + "! Il tuo punteggio �: "
                                  + game.getPlayerScore(),
                             "Grande!",
                             JOptionPane.INFORMATION_MESSAGE);
                   try {
                        if (NewGameAfterWinCB.isSelected()){
                        flag=true;
                        newGame();
                        else
                        ContentPanePrincipale.setVisible(false);
                   } catch (NullPointerException exptz) {
                        flag=true;
                        newGame();
         FinestraPrincipale.pack();
    private void newGame() {
         try {
         l = Integer.parseInt(L_txt.getText());
         h = Integer.parseInt(H_txt.getText());
         n = Integer.parseInt(N_txt.getText());
         style = Stile_cbox.getSelectedIndex();
         player = Player_txt.getText();
         } catch (Exception e) {
         l = 15;
         h = 10;
         n = 3;
         style = 0;
         player = "Anonimo";
         try {
         game = new Game(l, h, n, style);
         game.setPlayerName(player);
         } catch (IndexOutOfBoundsException e) {
         JOptionPane.showMessageDialog(null, e.toString().split(": ")[1],
              "Aiaiai...", JOptionPane.ERROR_MESSAGE);
         printSurface();
         StatusBarLabel.setText("Punteggio attuale: " + game.getPlayerScore());
         SalvaMappa.setEnabled(true);
    private void makeMatrice() {
         if (flag) {
         createLista();
         flag = false;
         for (int y = game.getH() - 1; y >= 0; y--) {
         for (int x = 0; x < game.getL(); x++) {
              char type = game.getSurface()[x][y].getType();
              imageURL = getClass().getResource(returnPath(type));
              image = new ImageIcon(imageURL);
              piece = new JLabel(image);
              ContentPanePrincipale.add(piece);
    private void createLista() {
         listaTipi=new ArrayList<String>();
         int i = 0;
         if (n == 0)
         n = 20;
         for (int y = game.getH() - 1; y >= 0; y--) {
         for (int x = 0; x < game.getL(); x++) {
              if (i < n) {
              if (game.getSurface()[x][y].getType() != '.') {
                   if (notInLista(game.getSurface()[x][y].getType())) {
                   int j = i + 1;
                   String type = game.getSurface()[x][y].getType()
                        + " " + "images/" + tema + "/" + j + ".png";
                   listaTipi.add(type);
                   i++;
              } else
              break;
         if (i > n)
              break;
    private boolean notInLista(char type) {
         if (listaTipi == null)
         return true;
         for (int k = 0; k < listaTipi.size(); k++) {
         if (type == listaTipi.get(k).split(" ")[0].charAt(0))
              return false;
         return true;
    private String returnPath(char type) {
         for (int k = 0; k < listaTipi.size(); k++) {
         if (type == listaTipi.get(k).split(" ")[0].charAt(0)) {
              String path = listaTipi.get(k).split(" ")[1];
              return path;
         return "images/empty.png";
    Message was edited by:
    JinKazama
    On Mac this class work perfectly

  • Preferences under the user home in win and linux

    hi,
    how can i save my looger-file under the user home and not in the registry usw.? under my user home in windows i see lots of .PROGRAMNAME directorys! is there any class for using that?

    Preferences or log files? Your title says "preferences" and your text says "looger" (which I'm assuming is just a typo).
    If you want to store user-specific data (aka preferences), then use the new java.util.preferences classes and use the user context.
    If you want to store files (like log files) in the user's directory, then use the System property DrClap suggested to get the directory name.

  • Odd incompatibility between 10g2 for windows 32-bit and Linux 64-bit

    Hi.
    When we run the following SQL under windows, it works as expected.
    drop table TRANS;
    drop table TRANS_PAT_LEVEL;
    drop table TRANS_DAY_LEVEL;
    create table TEST1.TRANS (ID NUMBER(22), QTYDISPENSED NUMBER(22), TRANSACTIONDATEDIFF NUMBER(22),FMYPRODUCT NUMBER(22));
    create table TEST1.TRANS_PAT_LEVEL (ID NUMBER(22), FMYPRODUCT NUMBER(22), LASTMYPRODUCTUSE NUMBER(22),ELIGIBLERET NUMBER(22));
    create table TEST1.TRANS_DAY_LEVEL (DAYID NUMBER(22) not null, UNITS NUMBER(22));
    UPDATE TRANS_DAY_LEVEL SET UNITS =((SELECT SUM(QTYDISPENSED) FROM (SELECT T.QTYDISPENSED, T.TRANSACTIONDATEDIFF DIFF FROM TRANS T, TRANS_PAT_LEVEL TPL WHERE T.FMYPRODUCT=1 AND T.ID = TPL.ID AND TPL.ELIGIBLERET = 1 AND LASTMYPRODUCTUSE>=DAYID ) WHERE DIFF = TRANS_DAY_LEVEL.DAYID)) WHERE DAYID>=0 AND DAYID<=365;
    But when we run it under Linux (Redhat 4.3 x86_64) , we see the following error with the last command:
    SQL> UPDATE TRANS_DAY_LEVEL SET UNITS =((SELECT SUM(QTYDISPENSED) FROM (SELECT T.QTYDISPENSED, T.TRANSACTIONDATEDIFF DIFF FROM TRANS T, TRANS_PAT_LEVEL TPL WHERE T.FMYPRODUCT=1 AND T.ID = TPL.ID AND TPL.ELIGIBLERET = 1 AND LASTMYPRODUCTUSE>=DAYID ) WHERE DIFF = TRANS_DAY_LEVEL.DAYID)) WHERE DAYID>=0 AND DAYID<=365
    ERROR at line 1:
    ORA-00904: "DAYID": invalid identifier
    We have also seen an incompatibility regarding case sensitive column names being created by the JDBC under linux, where under windows the same tables all have case-insensitive column names.
    Any help here?

    Hi,
    exception is expected behavior since inline views [can not be correlated|http://forums.oracle.com/forums/thread.jspa?messageID=3403285&#3403285] in Oracle (yet). Successful execution of such query means a bug in that Oracle release.

  • Queries for current Qtr and prior quarter

    If I select one date in dashboard prompt in one column I want to display current quarter revenue and prior Qtr revenue.
    Could anyone give me the queries for the current Qtr and prior Qtr?
    So I will going to use presentation variable from the dashboard prompts

    obiee-date-expressions-reference
    Date Calculation OBIEE Expression Explanation :
    First Day of the Previous Year
    TIMESTAMPADD( SQL_TSI_YEAR , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD removes a year from the returned date for the First Day of the Previous Year.
    First Day of the Current Year
    TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This calculation returns the first day of the year by deducting one less than the total number of days in the year.
    First Day of the Next Year
    TIMESTAMPADD( SQL_TSI_YEAR , 1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD adds a year to the date returned which will give the first day of the next year.
    First Day of the Previous Month
    TIMESTAMPADD(SQL_TSI_MONTH, -1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD then subtracts one month from the first day of the Current Month arriving to the First Day of the previous month.
    First Day of the Current Month
    TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This expression gets the current day of the month and subtracts one less than the current day to arrive at the first day of the month.
    First Day of the Next Month
    TIMESTAMPADD(SQL_TSI_MONTH, 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD then adds one month from the first day of the Current Month arriving to the First Day of the next month.
    First Day of Current Quarter
    TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( CURRENT_DATE) * -(1) + 1, CURRENT_DATE) This was included to show the calculations discussed above can be used with other functions. This is the same expression as the one that returns the first day of the current month except this one uses the DAY_OF_QUARTER property to return the first day of the current quarter.
    Last Day of the Previous Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the Current Month. The second TIMESTAMPADD subtracts a month to arrive at the first day of the previous month.
    Last Day of Current Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD finds the first day of the current Month. The second TIMESTAMPADD adds one month to the date to arrive at the first day of the next month. The final TIMESTAMPADD subtracts one day from the returned date to arrive at the last day of the Current Month.
    Last Day of the Next Month
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 2, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD finds the first day of the current Month. The second TIMESTAMPADD adds two months to the date to arrive at the first day of month after next. The final TIMESTAMPADD subtracts one day from the returned date to arrive at the last day of the Next Month.
    Last Day of Previous Year
    TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1,
    CURRENT_DATE)) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD subtracts one day to arrive at December 31st of the previous year.
    Last Day of Current Year
    TIMESTAMPADD(SQL_TSI_YEAR, 1, TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD deducts one day to arrive at December 31 of the previous year. The third TIMESTAMPADD adds a single year to the date to arrive at December 31 of the Current Year.
    Last Day of the Next Year
    TIMESTAMPADD(SQL_TSI_YEAR, 2, TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) From right to left the first TIMESTAMPADD returns the first day of the current year. The second TIMESTAMPADD deducts one day to arrive at December 31 of the previous year. The third TIMESTAMPADD adds 2 years to the date to arrive at December 31 of the Next Year.
    Last Day of Current Quarter
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_QUARTER , 1, TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( CURRENT_DATE) * -(1) + 1, CURRENT_DATE))) Demonstrated using Quarters. From right to left the first TIMESTAMPADD returns the first day of the Current Quarter. The second TIMESTAMPADD returns the first day of the next quarter. The final TIMESTAMPADD subtracts a single day from the date to arrive at the last day of the Current Quarter.
    Number of days between First Day of Year and Last Day of Current Month TIMESTAMPDIFF(SQL_TSI_DAY, CAST('2010/01/01 00:00:00' AS DATE), TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_MONTH , 1, TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( CURRENT_DATE) * -(1) + 1, CURRENT_DATE)))) For simplicity I hard coded the January 1, 2010 date and CAST it to a date. I could have used the First Day of the Current Year calculation but didn’t want to over clutter the example. The second part of the TIMESTAMPDIFF uses Last Day of the Current Month calculation to force the TIMESTAMPDIFF to calculate the number of days between the first day of the year and the last day of the current month.
    =============
    FYI, let say some example,
    Last day of previous Quarter:
    "GPC_DataMart"."GPC_DataMart"."dbo"."LQ_Position"."Business_Date"=TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAY_OF_QUARTER( "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Last month last day:
    "GPC_DataMart"."GPC_DataMart"."dbo"."LM_Position"."Business_Date"=
    TIMESTAMPADD( SQL_TSI_DAY , -(1), TIMESTAMPADD( SQL_TSI_DAY , DAYOFMONTH( "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Last year Last day
    "GPC_DataMart"."GPC_DataMart"."dbo"."LY_Position"."Business_Date"=
    TIMESTAMPADD( SQL_TSI_DAY , -1, TIMESTAMPADD( SQL_TSI_DAY , EXTRACT( DAY_OF_YEAR FROM "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date") * -(1) + 1, "GPC_DataMart"."GPC_DataMart"."dbo"."MT_BUSINESS_DATE"."Business_Date"))
    Thanks and Regards,
    Deva
    http://obieeelegant.blogspot.com/2011/06/obiee-date-expressions-reference.html

Maybe you are looking for

  • Wrongly payroll run for one employee, who left company several month ago

    Hi all, There is one case. One employee left company several months ago and his payroll data was also determined in the system. But the month payroll run included this guy not correctly. And also there are not any change found for his info type data

  • [Workaround available] Some ttc fonts not shown in Libreoffice

    This is a prolonged (for more than 1 years maybe) issue for me: My LibreOffice installation does not recognize any ttc fonts. (And I cannot bear this anymore for some reason) ttc fonts are merely a comination of two or more ttf fonts. I have installe

  • Deployment very slow since moving to OWB 10.1.0.4.0 on new server

    We recently moved our OWB development from a Windows box running OWB 10.1.0.2.0 client/10.1.0.1.0 repository to a Linux box running OWB 10.1.0.4.0 client & repository. The other change was from using separate schemas for the design and runtime reposi

  • Business group decision

    My company has been divided in to two parts as of 2010. Now i am suppose to create the same setups for the separated company as the cost for purchasing the software was shared. So are we suppose to do the setups again on different business group. wha

  • Passing resource bundle key to outputText i18n

    I have a dataTable with an outputText, the dataTable variable has a property which returns a resource bundle key. The following is what I am doing: <h:dataTable      id="menu"      value="#{myBean.rowItems}"      var="row">      <h:column>