Strange results in table
Hi,
I have a customer table with many fields. Two of them are production order no
and batch no.
When I´m using SE11 and type in a batch no, I get about 2 entries per batch no.
If I now use a production order number of the found items for the batch number,
and do the selection with these numbers, I don´t get any result!
The same is happening in the debugger... I´m using the value of the production
order number found by using the batch number, but I´m not getting any result...
The field type is char30, so I have tried to fill the number up with leading zeros.
Still no result!
What can be the problem here?
Thank you!
Michael
so do you mena that there is a conversion routine alpha assigned to this custom data element of char 30 ?
I assume you mentioned about the conversion exit for data element of standard sap field for prod order, right ?
If no conversion routine is assigned to your custom data element, and this custom table is updated via custom program, chances are very high that the content is not filled from the beginning of the field..
it can be form somewhere in the middle of the field..or so..thats why u are not getting when yoy try to read for prod order.
best way is to doselect to a table and in debugging mode,
try to do offset like prodno0(12), prodno10(12)...prodno+18(12)/... etc and see which positions are occupied by the conent ..
Similar Messages
-
Strange result from insert into...select query
Hello guys,
I need your preciuos help for a question maybe simple, but that I can't explain by myself!
I have a query of "insert into...select" that, as I have explained in the title, returns a strange result. In facts, If I execute ONLY the SELECT statement the query returns the expected result (so 2 rows); instead If I execute the entire statement, that is the "insert into...select", the query returns 0 rows inserted!!
Following an example of the query:
INSERT
INTO TITOLI_ORI
COD_TITOLO_RICCONS ,
D_ESTRAZIONE ,
COD_SOCIETA ,
COD_PIANO_CONTABILE ,
COD_CONTO_CONTABILE ,
COD_RUBRICATO_STATISTICO_1 ,
COD_NDG ,
NUM_ESEGUITO ,
CUR_IMPORTO_RICCONS ,
CUR_IMPORTO_BICO ,
FLG_MODIFICATO ,
CUR_NON_ASSEGNATO ,
FLG_QUOTATO ,
COD_CATEG ,
TIP_COPERTURA ,
TIPTAS_TITOLO
SELECT NEWID,
'28-feb-2111',
COD_SOCIETA,
COD_PIANO_CONTABILE,
COD_CONTO_CONTABILE,
COD_RUBRICATO_STATISTICO_1,
COD_NDG,
NUM_ESEGUITO,
CUR_VAL_IMPEGNI,
'ABC' as CUR_IMPORTO_BICO,
0 as FLG_MODIFICATO,
NULL as CUR_NON_ASSEGNATO,
FLG_QUOTATO,
COD_CATEG,
TIP_COPERTURA,
TIP_TASSO
FROM
(SELECT S.COD_SOC AS COD_SOCIETA,
S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
TRC.COD_NDG AS COD_NDG,
TRC.COD_ESEG AS NUM_ESEGUITO,
CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
TRC.TIP_QUOTAZ AS FLG_QUOTATO,
TRC.COD_CAT_TIT AS COD_CATEG,
TIP_COP AS TIP_COPERTURA,
T.TIP_TASSO AS TIP_TASSO
FROM S_SLD_CNTB S
INNER JOIN
(SELECT DISTINCT COD_SOC,
TIP_PIANO_CNTB,
COD_CONTO_CNTB,
COD_RUBR_STAT ,
COD_INTER_TIT AS COD_INTER
FROM S_COLLEG_CONTO_CNTB_TIT
WHERE COD_SOC = 'ME'
) CCC
ON S.COD_SOC = CCC.COD_SOC
AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
INNER JOIN S_TIT_RICCONS TRC
ON CCC.COD_INTER = TRC.COD_INTER_TIT
AND CCC.COD_SOC = TRC.COD_SOC
AND TRC.COD_RAGGR_IAS = RTRIM('VALUE1 ')
AND TRC.COD_RAGGR_IAS NOT IN ('VALUE2')
AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('VALUE3')
AND TRC.DES_MOV_TIT = RTRIM('VALUE4 ')
AND TRC.COD_CAT_TIT = RTRIM('VALUE4 ')
AND TRC.COD_INTER_TIT = RTRIM('VALUE5')
AND '28-feb-2011' = TRC.DAT_RIF
LEFT JOIN S_TIT T
ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
AND T.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = T.DAT_RIF
INNER JOIN S_ANAG_SOGG AG
ON TRC.COD_NDG = AG.COD_NDG
AND AG.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = AG.DAT_RIF
WHERE S.DAT_RIF = '28-feb-2011'
AND (S.FLG_ANULL_BICO = 0
OR S.FLG_ANULL_BICO IS NULL)
AND S.COD_SOC = 'V6'
AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
AND S.TIP_PIANO_CNTB = 'V7'
AND TRC.IMP_PLUS_MINUS_VAL < 0
AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('VALUE8 '))
Thanks a lotRight, I have executed this steps:
- I have changed the query with the select count(*)
- Changed the insert into with the select count(*)
- Executed the insert into
These are the result:
SQL> select count(*) from TITOLI_ORI2;
COUNT(*)
1
BUT:
SQL> select * from TITOLI_ORI2;
A
0
The insert into that I've modified is this:
INSERT INTO bsc.TITOLI_ORI2
select count(*)
FROM
(SELECT bsc.NEWID,
TO_DATE('28-feb-2111','DD-MON-YYYY') as data,
COD_SOCIETA,
COD_PIANO_CONTABILE,
COD_CONTO_CONTABILE,
COD_RUBRICATO_STATISTICO_1,
COD_NDG,
NUM_ESEGUITO,
CUR_VAL_IMPEGNI,
'ABC' AS CUR_IMPORTO_BICO,
0 AS FLG_MODIFICATO,
NULL CUR_NON_ASSEGNATO,
FLG_QUOTATO,
COD_CATEG,
TIP_COPERTURA,
TIP_TASSO
FROM
(SELECT S.COD_SOC AS COD_SOCIETA,
S.TIP_PIANO_CNTB AS COD_PIANO_CONTABILE,
S.COD_CONTO_CNTB AS COD_CONTO_CONTABILE,
S.COD_RUBR_STAT AS COD_RUBRICATO_STATISTICO_1,
TRC.COD_RAGGR_IAS AS COD_RAGGRUPPAMENTO_IAS,
TRC.COD_NDG AS COD_NDG,
TRC.COD_ESEG AS NUM_ESEGUITO,
CAST((TRC.IMP_PLUS_MINUS_VAL/TRC.IMP_CAMB) AS FLOAT) AS CUR_VAL_IMPEGNI,
TRC.TIP_QUOTAZ AS FLG_QUOTATO,
TRC.COD_CAT_TIT AS COD_CATEG,
TIP_COP AS TIP_COPERTURA,
T.TIP_TASSO AS TIP_TASSO
FROM bsc.S_SLD_CNTB S
INNER JOIN
(SELECT DISTINCT COD_SOC,
TIP_PIANO_CNTB,
COD_CONTO_CNTB,
COD_RUBR_STAT ,
COD_INTER_TIT AS COD_INTER
FROM bsc.S_COLLEG_CONTO_CNTB_TIT
WHERE COD_SOC = 'ME'
) CCC
ON S.COD_SOC = CCC.COD_SOC
AND S.TIP_PIANO_CNTB = CCC.TIP_PIANO_CNTB
AND S.COD_CONTO_CNTB = CCC.COD_CONTO_CNTB
AND S.COD_RUBR_STAT = CCC.COD_RUBR_STAT
INNER JOIN bsc.S_TIT_RICCONS TRC
ON CCC.COD_INTER = TRC.COD_INTER_TIT
AND CCC.COD_SOC = TRC.COD_SOC
AND TRC.COD_RAGGR_IAS = RTRIM('HFT ')
AND TRC.COD_RAGGR_IAS NOT IN ('GPO')
AND TRC.DES_TIP_SLD_TIT_RICCONS IN ('DISPONIBILI')
AND TRC.DES_MOV_TIT = RTRIM('CONSEGNARE ')
AND TRC.COD_CAT_TIT = RTRIM('OBBLIGAZIONE ')
AND TRC.COD_INTER_TIT = RTRIM('334058')
AND '28-feb-2011' = TRC.DAT_RIF
LEFT JOIN bsc.S_TIT T
ON T.COD_INTER_TIT = TRC.COD_INTER_TIT
AND T.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = T.DAT_RIF
INNER JOIN bsc.S_ANAG_SOGG AG
ON TRC.COD_NDG = AG.COD_NDG
AND AG.COD_SOC = TRC.COD_SOC
AND '28-feb-2011' = AG.DAT_RIF
WHERE S.DAT_RIF = '28-feb-2011'
AND (S.FLG_ANULL_BICO = 0
OR S.FLG_ANULL_BICO IS NULL)
AND S.COD_SOC = 'ME'
AND LENGTH(RTRIM(S.COD_CONTO_CNTB)) = 10
AND S.TIP_PIANO_CNTB = 'IS'
AND TRC.IMP_PLUS_MINUS_VAL < 0
AND SUBSTR(S.COD_CONTO_CNTB,1,7) IN (RTRIM('P044C11 '))
Another time the strange result returns!!
And I've created the table TITOLI_ORI2 as create table TITOLI_ORI2 (a number); to contain the number result of the query. -
Help - count function returns strange results
hi everyone,
here's my scenario: i'm trying to get the NUMBER OF REPORTS and NUMBER OF
IMAGES GROUP BY MONTH from the two tables below.
REPORT
reportid(*primary key)
date
IMAGE
reportid(*foreign key referring to report's table)
image
sample output:
MONTH NO.OF REPORTS NO. OF IMAGES
feb 01 10 9
mar 01 12 8
my SQL goes like this:
select to_char(date, 'month-yy'),
count(REPORT.reportid), count(IMAGE.reportid)
from REPORT, IMAGE
where REPORT.reportid = IMAGE.reportid
group by to_char(date, 'month-yy')
the above sql yielded strange results, number of images is equal to the number of reports, which is of course wrong! as one report may or may not contain one or more image.
i dont know what's wrong with the above statement, but if i were to group it
by REPORTID and DAY rather than MONTH, then amazingly it works! what's
wrong with the count, why does it give me the same result if i group by
MONTH.
can anyone shed some light on this?try using the following example:
Table TEST_REPORT
RPTID RPTDATE
1 02-JAN-01
3 02-JAN-01
2 02-JAN-01
5 11-FEB-01
6 11-FEB-01
7 11-FEB-01
Table TEST_IMAGE
RPTID IM
1 1
2 1
3 1
SQL:
select to_char(rptdate,'MON-YYYY'),
sum(decode(a.rptid,null,0,1)) report_cnt,
sum(decode(b.rptid,null,0,1)) image_cnt
from test_report a, test_image b
where a.rptid = b.rptid(+)
group by to_char(rptdate,'MON-YYYY');
<BLOCKQUOTE><font size="1" face="Verdana, Arial, Helvetica">quote:</font><HR>Originally posted by skcedric:
hi everyone,
here's my scenario: i'm trying to get the NUMBER OF REPORTS and NUMBER OF
IMAGES GROUP BY MONTH from the two tables below.
REPORT
reportid(*primary key)
date
IMAGE
reportid(*foreign key referring to report's table)
image
sample output:
MONTH NO.OF REPORTS NO. OF IMAGES
feb 01 10 9
mar 01 12 8
my SQL goes like this:
select to_char(date, 'month-yy'),
count(REPORT.reportid), count(IMAGE.reportid)
from REPORT, IMAGE
where REPORT.reportid = IMAGE.reportid
group by to_char(date, 'month-yy')
the above sql yielded strange results, number of images is equal to the number of reports, which is of course wrong! as one report may or may not contain one or more image.
i dont know what's wrong with the above statement, but if i were to group it
by REPORTID and DAY rather than MONTH, then amazingly it works! what's
wrong with the count, why does it give me the same result if i group by
MONTH.
can anyone shed some light on this? <HR></BLOCKQUOTE>
null -
Strange results with Insert statement having select query
Hi all,
I am facing a strange issue with Insert statement based on a select query having multiple joins.
DB- Oracle 10g
Following is the layout of my query -
Insert into Table X
Select distinct Col1, Col2, Col3, Col4, Function(Col 5) from Table A, B
where trunc(updated_date) > = trunc(sysdate-3)
and join conditions for A, B
Union
Select Col1, Col2, Col3, Col4, Function(Col 5) from Table C, D
trunc(updated_date) > = trunc(sysdate-3)
and join conditions for C, D
Union
.... till 4 unions. all tables are residing in the local Database and not having records more than 50,000.
If I execute above insert in a DBMS job, it results into suppose 50 records where as if I execute the select query it gives 56 records.
We observed following things-
a) no issue with size of tablespace
b) no error while inserting
c) since query takes lot of time so we have not used Cursor and PLSQL block for inserting.
d) this discrepancy in number of records happens frequently but not everytime.
e) examined the records left out from the insert, there we couldn't find any specific pattern.
f) there is no constraint on the table X in which we are trying to insert. Also tables A, B, C....
I went through this thread -SQL insert with select statement having strange results but mainly users are having either DB Links or comparison of literal dates, in my case there is none.
Can somebody explain why is the discrepancy and what is the solution for it.
Or atleast some pointers how to proceed with the analysis.
Edited by: Pramod Verma on Mar 5, 2013 4:59 AM
Updated query and added more details>
Since I am using Trunc() in the where clause so timing should not matter much. Also I manually ruled out records which were updated after the job run.
>
The first rule of troubleshooting is to not let your personal opinion get in the way of finding out what is wrong.
Actually this code, and the process it represents, is the most likely CAUSE of the problem.
>
where trunc(updated_date) > = trunc(sysdate-3)
>
You CANNOT reliably use columns like UPDATED_DATE to select records for processing. Your process is flawed.
The value of that column is NOT the date/time that the data was actually committed; it is the date/time that the row was populated.
If you insert a row into a table right now, using SYSDATE (8am on 3/5/2013) and don't commit that row until April your process will NEVER see that 3/5/2013 date until April.
Here is the more typical scenario that I see all the time.
1. Data is inserted/updated all day long on 3/4/2013.
2. A column, for example UPDATED_DATE is given a value of SYSDATE (3/4/2013) in a query or by a trigger on the table.
3. The insert/update query takes place at 11:55 PM - so the SYSDATE values are for THE DAY THE QUERY BEGAN
4. The data pull begins at 12:05 am (on 3/5/2013 - just after midnight)
5. The transaction is COMMITTED at 12:10 AM (on 3/5/2013); 5 minutes after the data pull began.
That data extract in step 4 will NEVER see those records! They DO NOT EXIST when the data pull query is executed since they haven't been committed.
Even worse, the next nights data pull will not see them either! That is because the next pull will pull data for 3/5/2013 but those records have a date of 3/4/2013. They will never get processed.
>
Job timing is 4am and 10pm EST
>
Another wrinkle is when data is inserted/updated from different timezones and the UPDATED_DATE value is from the CLIENT pc or server. Then you can get even more data missed since the client dates may be hours different than the server date used for the data pull process.
DO NOT try to use UPDATED_DATE type columns to do delta extraction or you can have this issue. -
Hi, the code below maps some objects to a key and then buts that key in to a linked list. When I compile and run this program I get a strange result can you help me please(note that more code is involved)
public class Subsets {
//Vector v = new Vector();
Properties ht = new Properties();
LinkedList ll = new LinkedList();
ArrayList al1, al2, al3, al4, al5, al6, al7, al8;
String key = null;
String key2;
int intKey;
//Card cd[];
ArrayList newArr = null;
//Card vectArray[];
//Card cd1[], cd2[], cd3[], cd4[], cd5[], cd6[], cd7[], cd8[];
public ArrayList permutations(Hand dk, Hand comp){
for (int f=0; f < dk.getCardCount(); f++){
key = String.valueOf(dk.getCard(f).getValue());
al1 = new ArrayList();
al1.add(dk.getCard(f));
ll.add(ht.put(key,al1));
for (int s=f+1; s < dk.getCardCount(); s++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue());
al2 = new ArrayList();
al2.add(dk.getCard(f));
al2.add(dk.getCard(s));
ll.add(ht.put(key, al2));
//v.addElement(ht.put(key,cd2));
for (int t=s+1; t < dk.getCardCount(); t++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue());
al3 = new ArrayList();
al3.add(dk.getCard(f));
al3.add(dk.getCard(s));
al3.add(dk.getCard(t));
ll.add(ht.put(key,al3));
//v.addElement(ht.put(key,cd3));
for (int a=t+1; a < dk.getCardCount(); a++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue()+dk.getCard(a).getValue());
al4 = new ArrayList();
al4.add(dk.getCard(f));
al4.add(dk.getCard(s));
al4.add(dk.getCard(t));
al4.add(dk.getCard(a));
ll.add(ht.put(key,al4));
//v.addElement(ht.put(key,cd4));
for (int b=a+1; b < dk.getCardCount(); b++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue()+dk.getCard(a).getValue()+dk.getCard(b).getValue());
al5 = new ArrayList();
al5.add(dk.getCard(f));
al5.add(dk.getCard(s));
al5.add(dk.getCard(t));
al5.add(dk.getCard(a));
al5.add(dk.getCard(b));
ll.add(ht.put(key,al5));
//v.addElement(ht.put(key,cd5));
for (int c=b+1; c < dk.getCardCount(); c++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue()+dk.getCard(a).getValue()+dk.getCard(b).getValue()+dk.getCard(c).getValue());
al6 = new ArrayList();
al6.add(dk.getCard(f));
al6.add(dk.getCard(s));
al6.add(dk.getCard(t));
al6.add(dk.getCard(a));
al6.add(dk.getCard(b));
al6.add(dk.getCard(c));
ll.add(ht.put(key,al6));
//v.addElement(ht.put(key,cd6));
for (int d=c+1; d < dk.getCardCount(); d++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue()+dk.getCard(a).getValue()+dk.getCard(b).getValue()+dk.getCard(c).getValue()+dk.getCard(d).getValue());
al7 = new ArrayList();
al7.add(dk.getCard(f));
al7.add(dk.getCard(s));
al7.add(dk.getCard(t));
al7.add(dk.getCard(a));
al7.add(dk.getCard(b));
al7.add(dk.getCard(c));
al7.add(dk.getCard(d));
ll.add(ht.put(key,al7));
//v.addElement(ht.put(key,cd7));
for (int e=d+1; e < dk.getCardCount(); e++){
key = String.valueOf(dk.getCard(f).getValue()+dk.getCard(s).getValue()+dk.getCard(t).getValue()+dk.getCard(a).getValue()+dk.getCard(b).getValue()+dk.getCard(c).getValue()+dk.getCard(d).getValue()+dk.getCard(e).getValue());
al8 = new ArrayList();
al8.add(dk.getCard(f));
al8.add(dk.getCard(s));
al8.add(dk.getCard(t));
al8.add(dk.getCard(a));
al8.add(dk.getCard(b));
al8.add(dk.getCard(c));
al8.add(dk.getCard(d));
al8.add(dk.getCard(e));
ll.add(ht.put(key,al8));
//v.addElement(ht.put(key,cd8));
Iterator itr = ll.iterator();
first:{
while(itr.hasNext()){
// key2 = String.valueOf(itr.next());
//System.out.println("key2 : "+key2);
System.out.println("size "+ll.size());
System.out.println("next "+itr.next());
// intKey = Integer.parseInt(key2);
//for(int j=comp.getCardCount()-1; j>=0;j++){
// if(intKey == comp.getCard(j).getValue()){
// newArr = (ArrayList)ht.get(key2);
// break first;
if(!itr.hasNext()){
newArr = null;
newArr = (ArrayList)ht.get(key2);
return newArr;
the result that I get is as follows
Cards on the table are:
0. 6 of Hearts
1. 7 of Hearts
2. 4 of Spades
3. Jack of Spades
4. 7 of Spades
Its r's turn
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next [6 of Hearts, 7 of Hearts, 4 of Spades, Jack of Spades]
size 31
next [6 of Hearts, 7 of Hearts, 4 of Spades]
size 31
next null
size 31
next [6 of Hearts, 7 of Hearts, Jack of Spades]
size 31
next [6 of Hearts, 7 of Hearts]
size 31
next null
size 31
next null
size 31
next null
size 31
next null
size 31
next [6 of Hearts, 4 of Spades, Jack of Spades]
size 31
next null
size 31
next null
size 31
next [6 of Hearts, Jack of Spades]
size 31
next null
size 31
next null
size 31
next [7 of Hearts, 4 of Spades, Jack of Spades]
size 31
next [7 of Hearts, 4 of Spades]
size 31
next null
size 31
next [7 of Hearts, Jack of Spades]
size 31
next [7 of Hearts]
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:320)
at Subsets.permutations(Subsets.java:124)
at PlayScopa.computerTurn(PlayScopa.java:273)
at PlayScopa.scopaPlay(PlayScopa.java:133)
at PlayScopa.scopaStart(PlayScopa.java:89)
at MainApp.main(MainApp.java:29)
[u9zuh /home/stud3/csc99/u9zuh]$
why are there gaps here
not the for loops are as follows
for(){
......for(){
.............for(){
.....................etc.....It's telling you exactly where the problem is:
Exception in thread "main" java.lang.NullPointerException
at java.util.Hashtable.get(Hashtable.java:320)
at Subsets.permutations(Subsets.java:124)
at PlayScopa.computerTurn(PlayScopa.java:273)
at PlayScopa.scopaPlay(PlayScopa.java:133)
at PlayScopa.scopaStart(PlayScopa.java:89)
at MainApp.main(MainApp.java:29)
What code is at line 124 of Subsets?
When you figure out what line that is (use your IDE - Control-G often lets you type in a line number) look at the variables used on that line and see which one(s) hasn't been assigned a value. -
Problem with store ResultSet and show result in table
Hi, I'm kind of new in ADF, I need to store ResultSet and show result in table-component. I have two problems:
1) I get my ResultSet by calling callStoredProcedure(...) and this returns actually ref_cursor as ResultSet.
When I try to println() contains of this result set in this method - it works OK (commented part),
but when I want to println() somewhere else (eg. in retrieveRefCursor() method) it doesn't work.
The problem is that the scrollability of the ResultSet is lost - it becomes a TYPE_FORWARD_ONLY ResultSet.
Is there any way to store data from ref_cursor for a long time?
2) My second problem is "store any result set and show this data in table". I have tried use method storeNewResultSet() but
without result (table contains only "No rows yet" and everything seems to be OK - no exception, no warning, no error...).
I have tried to call this method with ResultSet from select on dbs (without resultSet as ref_cursor ) - no result with createRowFromResultSet(),
storeNewResultSet(), setUserDataForCollection()...
I've tried a lot of ways to do this, but it doesn't work. I really don't know how to make it so it can work.
Thanks for your help.
ADF BC, JDev 11.1.1.0
This is my code from ViewObjectImpl
package tp.model ;
import com.sun.jmx.mbeanserver.MetaData ;
import java.sql.CallableStatement ;
import java.sql.Connection ;
import java.sql.PreparedStatement ;
import java.sql.ResultSet ;
import java.sql.ResultSetMetaData ;
import java.sql.SQLException ;
import java.sql.Statement ;
import java.sql.Types ;
import oracle.jbo.JboException ;
import oracle.jbo.server.SQLBuilder ;
import oracle.jbo.server.ViewObjectImpl ;
import oracle.jbo.server.ViewRowImpl ;
import oracle.jbo.server.ViewRowSetImpl ;
import oracle.jdbc.OracleCallableStatement ;
import oracle.jdbc.OracleConnection ;
import oracle.jdbc.OracleTypes ;
public class Profiles1ViewImpl extends ViewObjectImpl {
private static final String SQL_STM = "begin Pkg_profile.get_profile_list(?,?,?,?);end;" ;
public Profiles1ViewImpl () {
/* 0. */
protected void create () {
getViewDef ().setQuery ( null ) ;
getViewDef ().setSelectClause ( null ) ;
setQuery ( null ) ;
public Connection getCurrentConnection () throws SQLException {
// Note that we never execute this statement, so no commit really happens
Connection conn = null ;
PreparedStatement st = getDBTransaction ().createPreparedStatement ( "commit" , 1 ) ;
conn = st.getConnection () ;
st.close () ;
return conn ;
/* 1. */
protected void executeQueryForCollection ( Object qc , Object[] params , int numUserParams ) {
storeNewResultSet ( qc , retrieveRefCursor ( qc , params ) ) ;
// callStoredProcedure ( qc , SQL_STM ) ;
super.executeQueryForCollection ( qc , params , numUserParams ) ;
/* 2. */
private ResultSet retrieveRefCursor ( Object qc , Object[] params ) {
ResultSet rs = null ;
rs = callStoredProcedure ( qc , SQL_STM ) ;
return rs ;
/* 3. */
public ResultSet callStoredProcedure ( Object qc , String stmt ) {
CallableStatement st = null ;
ResultSet refCurResultSet = null ;
try {
st = getDBTransaction ().createCallableStatement ( stmt , 0 ) ; // call
st.setObject ( 1 , 571 ) ; //set id of my record to 571
st.registerOutParameter ( 2 , OracleTypes.CURSOR ) ; // my ref_cursor
st.registerOutParameter ( 3 , Types.NUMERIC ) ;
st.registerOutParameter ( 4 , Types.VARCHAR ) ;
st.execute () ; //executeUpdate
System.out.println ( "Numeric " + st.getObject ( 3 ) ) ;
System.out.println ( "Varchar " + st.getObject ( 4 ) ) ;
refCurResultSet = ( ResultSet ) st.getObject ( 2 ) ; //set Cursoru to ResultSet
// setUserDataForCollection(qc, refCurResultSet); //don't work
// createRowFromResultSet ( qc , refCurResultSet ) ; //don't work
/* this works but only one-time call - so my resultSet(cursor) really have a data
while ( refCurResultSet.next () ) {
String nameProfile = refCurResultSet.getString ( 2 ) ;
System.out.println ( "Name profile: " + nameProfile ) ;
return refCurResultSet ;
} catch ( SQLException e ) {
System.out.println ( "sql ex " + e ) ;
throw new JboException ( e ) ;
} finally {
if ( st != null ) {
try {
st.close () ; // 7. Close the statement
} catch ( SQLException e ) {
System.out.println ( "sql exx2 " + e ) ;
/* 4. Store a new result set in the query-collection-private user-data context */
private void storeNewResultSet ( Object qc , ResultSet rs ) {
ResultSet existingRs = getResultSet ( qc ) ;
// If this query collection is getting reused, close out any previous rowset
if ( existingRs != null ) {
try {
existingRs.close () ;
} catch ( SQLException s ) {
System.out.println ( "sql err " + s ) ;
setUserDataForCollection ( qc , rs ) ; //should store my result set
hasNextForCollection ( qc ) ; // Prime the pump with the first row.
/* 5. Retrieve the result set wrapper from the query-collection user-data */
private ResultSet getResultSet ( Object qc ) {
return ( ResultSet ) getUserDataForCollection ( qc ) ;
// createRowFromResultSet - overridden for custom java data source support - also doesn't work
protected ViewRowImpl createRowFromResultSet ( Object qc , ResultSet resultSet ) {
ViewRowImpl value = super.createRowFromResultSet ( qc , resultSet ) ;
return value ;
}Hi I have the same problem like you ...
My SQL Definition:
CREATE OR REPLACE TYPE RMSPRD.NB_TAB_STOREDATA is table of NB_STOREDATA_REC
CREATE OR REPLACE TYPE RMSPRD.NB_STOREDATA_REC AS OBJECT (
v_title VARCHAR2(100),
v_store VARCHAR2(50),
v_sales NUMBER(20,4),
v_cost NUMBER(20,4),
v_units NUMBER(12,4),
v_margin NUMBER(6,2),
v_ly_sales NUMBER(20,4),
v_ly_cost NUMBER(20,4),
v_ly_units NUMBER(12,4),
v_ly_margin NUMBER(6,2),
v_sales_variance NUMBER(6,2)
CREATE OR REPLACE PACKAGE RMSPRD.NB_SALES_DATA
AS
v_sales_format_tab nb_tab_storedata;
FUNCTION sales_data_by_format_gen (
key_value IN VARCHAR2,
l_to_date IN DATE DEFAULT SYSDATE-1,
l_from_date IN DATE DEFAULT TRUNC (SYSDATE, 'YYYY')
RETURN nb_tab_storedata;
I have a PLSQL function .. that will return table ..
when i use this in sql developer it is working fine....
select * from table (NB_SALES_DATA.sales_data_by_format_gen('TSC',
'05-Aug-2012',
'01-Aug-2012') )
it returning table format record.
I am not able to call from VO object. ...
Hope you can help me .. please tell me step by step process...
protected Object callStoredFunction(int sqlReturnType, String stmt,
Object[] bindVars) {
System.out.println("--> 1");
CallableStatement st = null;
try {
st = getDBTransaction().createCallableStatement("begin ? := " +"NB_SALES_DATA.sales_data_by_format_gen('TSC','05-Aug-2012','01-Aug-2012') ; end;", 0);
System.out.println("--> 2");
st.executeUpdate();
System.out.println("--> 3");
return st.getObject(1);
catch (SQLException e) {
e.printStackTrace();
throw new JboException(e); -
Strange symbols appear on my desktop, producing even stranger results!
Strange symbols appear on my desktop, producing even stranger results!
These symbols are for short cuts. could be a command to move text insertion point to beginning of document or if you have been in system preferences keyboard and clicked on the modifier key and set one of the options it would be for setting cap lock. Don't know why you are showing a screen shot of it. Have you clicked on it. Have you been doing any work with documents. You could go to disk utilities and repair permissions or do an pram reset. Command/Option?P/R while holding down the power button for three chimes and release.
-
Strange result about regular expressions
Hello everybody,
I write these codes to try regular expressions in Java, but there are some strang results. I read the reference like Sun Java Tutorials. however, I cann't find the problem.
Environnement:
WindowsXP Home + NetBeans IDE 5.0 + JDK 1.5
Input String:
"I write these codes to try regular expressions in Java, but it doesn't work. I read some reference like Sun Java Tutorials. Then, always cann't find the problem. Could you help me? Thanks."
My codes:
public static void main(String[] args) throws Exception, IOException {
P.rintln("Let's go!");
Date start = new Date();
if(args.length != 1) {
P.rintln("Input Error! Input format: java javaclass [directory path]");
System.exit(0);
StringBuffer sb = new StringBuffer();
String input = TextFile.read(args[0]);
sb = addSectionEelement(input, "re");
P.rintln(sb.toString());
P.rintln("Ok, it's over");
Date end = new Date();
System.out.println("It spends " + (end.getTime() - start.getTime()) + " ms.");
public static StringBuffer addSectionEelement(String input, String regex) {
Matcher m = Pattern.compile(regex).matcher(input);
StringBuffer sb = new StringBuffer();
int count = 0;
while(m.find()) {
count++;
P.rintln(m.group());
P.rintln("Found " + count + " fois.");
return sb;
Output:
run:
Let's go!
Found 0 fois.
Ok, it's over
It spends 16 ms.
BUILD SUCCESSFUL (total time: 0 seconds)
However if I change the Bold line by
sb = addSectionEelement(input, "r");
The resultats become:
run:
Let's go!
r
r
r
r
r
r
r
r
r
r
r
Found 11 fois.
Ok, it's over
It spends 15 ms.
BUILD SUCCESSFUL (total time: 0 seconds)
I have no idea about it. And you?
ThanksHi guys,
I re-examine the codes. In fact, it's the problem of encodings of the input file.
See u -
Hi guys,
Sorry to ask such a simple question but I can't seem to work out why Im get strange results when I do the following:
double t = 1564654654 / 1000000000;
System.out.println(t);The result I get is 1.0 but I should get 1.564654654
Any help would be great
Many thanks
AlexWhen you divide an int by an int, you get an int. Then you assign the int value to a double.
Either use the cast as posted previously, or use a decimal point with one of the numbers (which will cause Java to handle it as a double.) -
How to insert the select query result into table?
How to insert the select query result into table?
SELECT top 20 creation_time
,last_execution_time
,total_physical_reads
,total_logical_reads
,total_logical_writes
, execution_count
, total_worker_time
, total_elapsed_time
, total_elapsed_time / execution_count avg_elapsed_time
,SUBSTRING(st.text, (qs.statement_start_offset/2) + 1,
((CASE statement_end_offset
WHEN -1 THEN DATALENGTH(st.text)
ELSE qs.statement_end_offset END
- qs.statement_start_offset)/2) + 1) AS statement_text
FROM sys.dm_exec_query_stats AS qs
CROSS APPLY sys.dm_exec_sql_text(qs.sql_handle) st
ORDER BY total_elapsed_time / execution_count DESC;
Thanks,
Tirumala1. SELECT INTO
Below method will create table when data is inserted from one table to another table. Its useful when you need exactly same datatype as source table.
Use AdventureWorks2008R2;
Go
---Insert data using SELECT INTO
SELECT AddressLine1, City
INTO BothellAddresses
FROM Person.Address
where City = 'Bothell';
GO
---VERIFY DATA
Select AddressLine1, City
FROM BothellAddresses
---DROP TABLE
DROP TABLE BothellAddresses
GO
2. INSERT INTO SELECT
Below method will need table to be created prior to inserting data. Its really useful when table is already created and you want insert data from
another table.
Use AdventureWorks2008R2;
Go
---Create Table
CREATE TABLE BothellAddresses (AddressLine1 NVARCHAR(60), City NVARCHAR(30))
---Insert into above table using SELECT
INSERT INTO BothellAddresses(AddressLine1, City)
SELECT AddressLine1, City
FROM Person.Address
where City = 'Bothell';
---VERIFY DATA
Select AddressLine1, City
FROM BothellAddresses
---DROP TABLE
DROP TABLE BothellAddresses
GO
Regards,
Vishal Patel
Blog: http://vspatel.co.uk
Site: http://lehrity.com -
Strange result for outer join with rownum
I'm using rownum in join condition of left outer join query but i'm getting strange results.
Query is:
Select * from table1 left outer join table2 on table1.id = table2.id or rownum=1
Data in table1 is
id
7
8
9
Data in table2 is
id
10
11
12
Result of above query in Oracle 9.2.0.1 is
table1.id table2.id
7 10
7 11
7 12
8 10
8 11
8 12
9 10
9 11
9 12
Even if change is rownum related condition to like rownum >2 even than i'm getting same result.
In case of inner join, the above condition gives results as required.
Can anybody explain the result or is it a bug?could you please explain why you are using rownum.
You may have a look at the following link explaining rownum and you should understand why you got this result, keep in mind that you are using an OR condition.
http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/sql_elements6a.htm#4295 -
Strange Results keying out Green Screen Using Keylight
Hi,
I'm keying out a green screen using keylight. When I look at the view "Status" in keylight I notice a strange result that I can't seem to resolve. Inside the solid area of the matte (the actor) his pants and shoes area are filled with tiny light green dots. They seem to be causing distortion on my final render.
No matter what adjustments I make to the matte I can't seem to get rid of these. I've attached a few small GIFs to show the issue.
Is there anyway to remove these dots so they are "solid" within the matte or a way to color correct them inside the solid area of the matte in the final result?
Any advise would be greatly appreciated.
Regards,That's what the Despot options in the Screen Matte section are for. Alternative options include Minimax, Simple Chocker or third-party plug-ins like Re:Fill from RevisionFX. Also make good use of the various rollback options to control your Alpha levels.
Mylenium -
Dvd burning from idvd with strange results
I have made a short 5 minute movie in FCP and exported it to QuickTime as I have done numerous times before. I created a menu in IDVD and then dragged QT file in. Everything looks great and plays on screen great. Then I burn the DVD. Once done I put it on TV via a different DVD player and it plays however about a minute into the video on the top of the screen I see part of another image. It almost looks like part of my G4 background screen (which is a picture) has somehow leaked through and gotten burned onto this dvd. Anyhow, I thought it was a bad DVD so burned another (TDK 8x DVD-r). Same thing happened again. Even when I put this burned DVD on my G-4 and play it I still have weird image. I went back and checked the movie again in FCP and then re-exported to QT as a self contained movie and did the whole IDVD thing all over again. Still has the weird image leaking through. By the way, before burning I did play the QT file through QT and that plays perfect! It also plays perfect through FCP. I am concerned it could be my drive. Any suggestions or hints.
Well I discovered the problem previously posted by me concerning dvd burning with strange results. I found the exact spot in the burned dvd where the video had the other image appear along the top and then went to FCP and found the exact spot on it. Lo and behold on FCP at that exact spot in the video a "marker" had been inserted. I cleared all markers and re-exported and burned again in idvd and everything works perfectly. So apparently the marker insert in FCP caused all the problems.
-
Strange results when receiving mail sent form mail.app
Hi all,
I've searched these forums for an answer to this problem but I didn't find anything that seemed to fit the bill.
I'm using the latest version of mail.app 2 with updates applied running in 10.4.3.
I'm using Gmail as my mail server but have the same problem with other email servers I have tried.
When I send mail to my work account (based on an exchange server) I'm getting some strange results. I'm using Windows 2000 and Outlook 2003 at work.
When I send an (new) email with an attachment then all text that I write below the attachment in the email, when received through exchange at work, becomes an attachment its self. If this is a plain text email then the attachment is a text file, if it's a rich text email then the attachment becomes a webdocument (HTM). This is not the desired result!
Similarly, if I reply to or forward an email, any text below new text I type into those emails becomes an attachment rather than an actual reply (with that attachment either a text file or a webdocument as stated above).
My question therefore is how can this be corrected. It's rather annoying to have half my message cut off if I put an attachment half way through the email I am composing (I guess i could attach it to the end below all text and signature). Equally frustrating is having replied or forwarded text appear in an attachment.
Thanks in anticipation.
Adam
Powerbook 12" Mac OS X (10.4.3)Hi all,
Picture of what I describe above, thought it might help clarify what the issue is:
Many thanks
Adam
Powerbook 12" Mac OS X (10.4.3)
Message was edited by: adamsquire -
Strange result using Oracle Text
Hello, I am receiving a strange exception with this sql query
SELECT * FROM gob_attachment
WHERE CONTAINS (gob_a_document, 'java') > 0
It's giving me
ORA-29902: error in executing ODCIIndexStart() routine
ORA-20000: Oracle Text error:
ORA-00942: table or view does not exist
29902. 00000 - "error in executing ODCIIndexStart() routine"
*Cause: The execution of ODCIIndexStart routine caused an error.
*Action: Examine the error messages produced by the indextype code and
take appropriate action.
After some googling I've disovered that problem could be in index, but I looked at the table and index seems ok to me.
Create script for index is looking like this
CREATE INDEX FTSI_GOB_A_DOCUMENT ON GOB_ATTACHMENT (GOB_A_DOCUMENT) INDEXTYPE IS CTXSYS.CONTEXT;
Only thing which is strange to me is that when I look to Edit Table in Table properties in SQL Developer I can see that Operational Status of index is FAILED. Does anyone know what does it mean?Maybe DB rights?
Edited by: 918345 on 2.3.2012 1:40
Edited by: 918345 on 2.3.2012 1:44No, I don't see any message related to this matter in there. I also tried to recreate the index and now the query is working, but it's not returning any results.
So I did this
drop index blob_index
create index blob_index on docs_mixedmedia(doc_contents) indextype is ctxsys.context
I've also discovered that we are storing unsupported datatype(DOCX), because it's supported from version 11 and we are running on 10g, could this lead to empty result of queries?
Maybe you are looking for
-
Photoshop CC won't start downloading.
I have already purchased Adobe Creative Cloud Photography, and I am verified. When I try to download Photoshop CC or Lightroom, the download won't even start even thought it says its downloading.
-
Sdk 3b Remote Objects not working with java 1.6.29
So I am not sure if this is java specific or if there is anything in Flex I can do. I am working on a project that communicates with the java back end via the AMF channels / Consumer objects and Remote Objects. Usking SDK 3b In Java 1.6.26 and java 1
-
Defective X230 - what should I do now?
Hello, Two weeks ago I bought a new X230 from Germany's Lenovo online shop. It arrived on Thursday, and my initial experience is, to put it mildly, frustrating. While customizing the system I chose the 3-year onsite next-business-day + accidental dam
-
Single Record Form: fields display with the wrong width
I'm laying out fields on a single record form and notice that the width of the fields displayed when I run the form is less than the width I specify on the "Edit Page Item" page. Here are 3 examples: field 1: Display as=text, Width=100, Maximum Width
-
To print transfer order by range
Hi, I had 20 transfer order created and I would like to kick off the printing by selection on screen from TO#1 to TO#20. Is it possible to do so in LT31? There is a program, RLVSDR40 but it does not have any TCODE linked to it. Is there a standard TC