Avatar of gbcbr
gbcbr
Flag for Cyprus

asked on 

String Symbol recognizing

I extract date from different tables with sql query:
From one table, where symbol inserts by trigger from another table it recognized well
 
"SELECT * FROM EURUSD where timest = ( select max( timest ) from EURUSD ) and rownum = 1 union all "
..........

                if (s.equals("EUR/USD")) {

                    symbol[0] = s;
                    openBid[0] = bpx;
                    timest[0] = tst;

...........

                    System.out.println("   Symbol  " + symbol[0] +
                                       "  openBid[0]  " + openBid[0] +
                                       "    timest[0]    " + timest[0]);

...........

CREATE TABLE "LIONFX"."EURUSD"
  (
    "ID"     NUMBER NOT NULL ENABLE,
    "SYMBOL" VARCHAR2(20 BYTE),
    "BIDPX" FLOAT(126),
    "ASKPX" FLOAT(126),
    "TIMEST" TIMESTAMP (0),

.............

 Symbol  EUR/USD  openBid[0]  1.34373    timest[0]    2011-10-07 12:09:53.0

Open in new window

from another table with default value in column symbol, it doesn't recognize symbol and doesn't create array.
 
CREATE TABLE "LIONFX"."EURUSD_BOT_BUY"
  (
    "BUY_PX" VARCHAR2(20 BYTE),
    "TS" TIMESTAMP (6) NOT NULL ENABLE,

Open in new window

for it's stance that I don't see this column in sql generated by sqldeveloper, but I see it in columns bookmark Symbol-column.tiff
 
"SELECT * FROM EURUSD_BOT_BUY where ts = ( select max( ts ) from EURUSD_BOT_BUY ) and rownum = 1 

............


            for (DataBuy data : dataList) {

                String s;
                Timestamp ts;
                String bot_buy;

                s = data.getSymbol();
                ts = data.getTs();
                bot_buy = data.getBuyPx();
                bb = Double.parseDouble(bot_buy);

                System.out.println("   Symbol  " + s + "   buy_px  " +
                                   bot_buy + "   bb   " + bb);


                if (s.equals("EUR/USD")) {

                    symbol[0] = s;
                    buy_px[0] = bb;
                    ts_buy[0] = ts;
......

                    System.out.println("   Symbol  " + symbol[0] +
                                       "    ts_buy[0]    " + ts_buy[0] +
                                       "   buy_px[0]  " + buy_px[0]);

......

   Symbol  EUR/USD  openBid[0]  1.34373    timest[0]    2011-10-07 12:09:53.0
   Symbol  EUR/USD   buy_px  1.34357   bb   1.34357
   Symbol  EUR/USD  openBid[0]  1.34371    timest[0]    2011-10-07 12:10:01.0
   Symbol  EUR/USD   buy_px  1.34357   bb   1.34357

Open in new window

JavaOracle Database

Avatar of undefined
Last Comment
gbcbr

8/22/2022 - Mon