IN Operator Query
Hi all,
I have table origin which contains city name,which is of datatype varchar2;
Am running the query on oracle 10g
WITH t
AS
SELECT 'BANGALORE,BELLARY,SIRSI,HUBLI' colnm
FROM dual
select colnm from tand am getting output as
BANGALORE,BELLARY,SIRSI,HUBLIBut the desired output to be displayed in singe quotes for each of the city
Expected Output
'BANGALORE','BELLARY','SIRSI','HUBLI'Please suggest a approach to acheive the desired result. Is this possible to acheive the result by using collections???
Regards,
Achyut
Another way can be to use CHR function to give you single quote which can be concatenated to rest of string:
WITH t
AS (SELECT CHR (39)
|| 'BANGALORE'
|| CHR (39)
|| ','
|| CHR (39)
|| 'BELLARY'
|| CHR (39)
|| ','
|| CHR (39)
|| 'SIRSI'
|| CHR (39)
|| ','
|| CHR (39)
|| 'HUBLI'
|| CHR (39)
COLUMNS
FROM DUAL)
SELECT *
FROM t;Result:
Columns
'BANGALORE','BELLARY','SIRSI','HUBLI'
Similar Messages
-
i want example
about like operator
AND N.user_je_category_name LIKE'PAS_%'
and i want to said
AND N.user_je_category_name LIKE'PAS_%' and 'BS_'%
HOW MAKE THATHi,
Usama Hashem wrote:
THANX FOR U BUT HOW USE GROUP BY IN THIS QUERY What makes you think there's anything wrong with it?
Are you getting an error message? If so, post the error message.
Are you getting the wrong results? If so, describe.
Whenever you post any code, format it to show the extent of major sections (sub-queries, nested functions, nested anything, multi-part concats, ...
Whenever there's a lot of code between a '(' and its matching ')', put them on separate lines, indent them the same amount, and indent everything in between them at least that much.
Type these 6 characters:
{code}
(all small letters, inside curly brackets) before and after sections of formatted text.
The longer the code is, the more important it is to do this.
It looks like you're doing something like this:
Select sum (debt) debt
, sum (credit) credit
from (
Select ( SUM (l.ENTERED_DR)
- SUM (l.ENTERED_CR)
) Debt,
SUM (l.ENTERED_CR)
- SUM (l.ENTERED_CR) Credit
from gl_code_combinations M,
where ...
AND H.DEFAULT_EFFECTIVE_DATE BETWEEN :FROM_DATE AND :TO_DATE
AND ( N.user_je_category_name NOT LIKE 'PAS_%'
AND N.user_je_category_name NOT LIKE 'WS_%'
OR N.user_je_category_name LIKE 'RE_%'
GROUP BY M.SEGMENT2
, ( M.segment1 || '.'
|| M.segment2 || '.'
|| M. segment3 || '.'
|| M.segment4 || '.'
|| M. segment5 || '.'
|| M.segment6
-- Need ) here?That is, the main query is based on an in-line view.
The only columns in that in-line view are debt and credit.
If you want to reference columns like segment1, segemnt2, ... in the main query, then you have to include them in the SELECT clause of the in-line view.
(Since the in-line view is a UNION, remember to include them in both SELECT clauses.)
Table alias M is only defined inside each branch of the UNION. In the main query, you'll reference the columns as segment1, segment2, ...
The following two items may be giving you the right results now, but even if so, they are accidents waiting to happen, and should be fixed.
(1) What is the data type of gl_je_headers.default_effective_date?
If it's a DATE then only compare it to other DATEs. Unfortunately, bind variables can't be DATEs, so you'll have to do something like:
... AND H.DEFAULT_EFFECTIVE_DATE BETWEEN TO_DATE (:FROM_DATE, 'DD-MON-YYYY')
AND TO_DATE (:TO_DATE, 'DD-MON-YYYY')(2) Never mix AND and OR.
You probably need another layer of parentheses somewhere around:
... AND ( N.user_je_category_name NOT LIKE 'PAS_%'
AND N.user_je_category_name NOT LIKE 'WS_%'
OR N.user_je_category_name LIKE 'RE_%'
)Maybe
... AND ( ( N.user_je_category_name NOT LIKE 'PAS_%'
AND N.user_je_category_name NOT LIKE 'WS_%'
OR N.user_je_category_name LIKE 'RE_%'
)It looks like credit will always be 0 (or NULL) in the first branch of the UNION. Is that what you meant? -
Hi,
when i give morethan 1000 cahtracters in the In squery it will give the error
Eg:
select * from table_name where field1 in ( ' 1,2,........');
is any solution for this
ThanksOracle will ignore the indexes ... if you are using OR operator.I'm not sure I agree. It is trivial to show Oracle can use index for... IN (a, b) OR IN (c, d) ...and has been able to for many versions e.g.
Oracle8i Enterprise Edition Release 8.1.7.3.0 - Production
With the Partitioning option
JServer Release 8.1.7.3.0 - Production
SQL> SET AUTOTRACE ON EXPLAIN;
SQL> SELECT id
2 FROM account
3 WHERE id IN ('1', '2')
4 OR id IN ('3', '4');
ID
1
2
4
Execution Plan
0 SELECT STATEMENT Optimizer=CHOOSE (Cost=2 Card=6 Bytes=36)
1 0 INLIST ITERATOR
2 1 INDEX (RANGE SCAN) OF 'AC_ID' (NON-UNIQUE) (Cost=2 Card=6 Bytes=36)
SQL> It is of course possible that extended IN lists affect the calculation of selectivity on the column and bring into question whether it is more efficient to use the index. -
Hi
I would like to extract data with criteria between 'J09' and 'J18'. These are hierarichical disease codes. Therefore you can have J091 to J189. This is my query below.
Select * from inpatient_table
where Diagnosis_code like 'J[09-18]%';
the query doesnt pull the right results. Any help would be greatly appreciated.
Regards
SivaHi Siva,
I havent got any like expressions to work with this so far but if your not particular about using like expressions, the following should help:
create table #temp
text varchar(10)
--J091
--J189
insert #temp select 'J089abc'
insert #temp select 'J091abc'
insert #temp select 'J112abc'
insert #temp select 'J121abc'
insert #temp select 'J134abc'
insert #temp select 'J088abc'
insert #temp select 'J189abc'
insert #temp select 'J190abc'
insert #temp select 'J291abc'
select *
from #temp
where cast (right(left(text,4),3) as int) between 91 and 189
Let me know in case of any queries
Thanks, Jay <If the post was helpful mark as 'Helpful and if the post answered your query, mark as 'Answered'> -
Hi All,
I am using Siebel Query operaion in one of the workflow steps, where I want to query on BC for multiple field value.
For eg: I have Field values for Row_Id is 333-X and 334-Y , I want to Query on BC and want to return records with Row_id 333-X and 334-Y.
I used search expression to build query,but no use.
[Id] = '333-X' OR [Id] = '334-Y'
Expedite a response.
Thanks in advance.If you are using the "Query" method of the BS "EAI Siebel Adapter" in your WF
then you can set the user prop on the Input Integration Object that you use.
Integration Object User Prop:
Name: ViewMode
Value: All
Axel -
Operator query fail silently if multiple srids are in indexed table
i use an
SDO_ANYINTERACT
on an indexed table. By error (mine) I inserted data with another srid. All SDO_ANYINTERACT deliver 'FALSE'. May I suggest to raise exception in these cases. I dont like silent failure.
I have another suggestion. For pointclouds oracle creates a trigger like this:
CREATE OR REPLACE TRIGGER MDTNPC_FA15_4_TR$ BEFORE DELETE OR UPDATE ON ALS.POINTCLOUD FOR EACH ROW
BEGIN IF DELETING THEN MDSYS.SDOTNPC.DEL_BLKTAB_ROWS(:old.PC.blk_table, :old.PC.pc_id); ELSIF UPDATING THEN MDSYS.SDOTNPC.DEL_BLKTAB_ROWS(:old.PC.blk_table, :old.PC.pc_id); END IF; END;
basically this means: on update -> delete.
May I suggest you raise an exception instead of simply deleting ALL associated records? If one wants to alter the tolerance on a pointcloud with f.e. 2 billion records ... guess what ...Can you give more details on your first case with different SRIDs.I have POINTCLOUD_${SRID} and ssPOINTCLOUD_BLK_${SRID} tables.
On creating a pointcloud for SRID 25832 I accidentally used the wrong block table for SRID 25833. There is a $$ spatial index on the extent column. So the insert was done due to SDO_PC_PKG.create_pc...
Maybe the index in the block table is set something like "NOVALIDATE/DISABLED/..." within this procedure (I cant look into it of course). So the check you mentioned doesnt hit. -
With using the Union oper. query
Hi Team
I have table like A and B
A table Structure
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
B table Structure
C1-----C2
R11----R8
my output is like below
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
R11----R8----------null
i can use the Union all condition i don't want to use the
union all condition who? plz help
select c1,c2,c3
union
select c1,c2;870003 wrote:
Hi Team
I have table like A and B
A table Structure
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
B table Structure
C1-----C2
R11----R8
my output is like below
C1-------C2-------C3
R1-------R2--------R3
R4-------R5---------R6
R11----R8----------null
i can use the Union all condition i don't want to use the
union all condition who? plz helpWhy don't you want to use union all, because that is exactly what you are trying to achieve? -
Delete query is taking too much time...
Hi All,
Below delete query is taking at least 1hrs. !!!!
DELETE aux_current_link aux
WHERE EXISTS (
SELECT *
FROM link_trans_cons link2
WHERE aux.tr_leu_id = link2.tr_leu_id
AND aux.kind_of_link = link2.kind_of_link
AND link2.TYPE = 'H');
table aux_current_link has record - 284279 and has 6 normal index.
pls help me.
SubirNot even close to enough information.
Look here to see if you can tune the operation.
When your query takes too long ...
But for a delete you need to understand that the indexes need to be maintained, you have 6 of them, that requires effort. ALSO, foreign keys need to be checked to make sure you don't violate any enabled foreign keys (so maybe you need an index on a table where a column from this table you deleting from is being referenced).
If you are deleting a HIGH percentage of the table you may be better off doing a create table as select ....query to keep all rows from your table....then drop your current table, rename the new one you made, and add all the indexes to it.
Otherwise, once you've tuned the operation (query), assuming it can be tuned, it's going to take as long as it needs to take.....
Message was edited by:
Tubby -
How to define multiple jca operations in one db adapter wsdl
When I create a partnerlink in the designer, click on the adapter service, choosing db adapter, it will automatically generate a wsdl with the specifying service name and operation name(query name).
But the generated wsdl has only one operation(query). How do I add multiple operations(queries) to the wsdl using the designer? The mapping generated from the query is pretty complex, I don't think I can do it manually.
Thanks, JennyFor an outbound operation, you can select multiple operations (insert or update, delete, select), but using the wizard you can only create one read query operation.
(You will also get a 'queryByExample' operation in every outbound wsdl too).
Using the command line WSDLGenerator, you can point it at a TopLink project and it will generate one operation for every named query in the project, plus a number of other operations.
To access the command line tool, see orabpel/samples/tutorials/122.DBAdapter/misc/WSDLGenerator. -
Automatic DOP take more time to execute query
We upgraded database to oracle 11gR2. While testing Automatic DOP feature with our existing query it takes more time than with parallel.
Note: No constrains or Index created on table to gain performance while loading data (5000records / sec)
Os : Sun Solaris 64bit
CPU = 8
RAM = 7456M
Default parameter settings:
parallel_degree_policy string MANUAL
parallel_degree_limit string CPU
parallel_threads_per_cpu integer 2
arallel_degree_limit string CPU
cpu_count integer 8
parallel_threads_per_cpu integer 2
resource_manager_cpu_allocation integer 8
Query:
SELECT COUNT(*)
from (
SELECT
/*+ FIRST_ROWS(50), PARALLEL */
Query gets executed in 22minutes : execution plan
COUNT(*)
9600
Elapsed: 00:22:10.71
Execution Plan
Plan hash value: 3765539975
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart| Pstop |
| 0 | SELECT STATEMENT | | 1 | 21 | 2164K (1)| 07:12:52 | | |
| 1 | SORT AGGREGATE | | 1 | 21 | | | | |
| 2 | PARTITION RANGE OR| | 89030 | 1825K| 2164K (1)| 07:12:52 |KEY(OR)|KEY(OR)|
|* 3 | TABLE ACCESS FULL| SUBSCRIBER_EVENT | 89030 | 1825K| 2164K (1)| 07:12:52 |KEY(OR)|KEY(OR)|Automatic DOP Query: parameters set
alter session set PARALLEL_DEGREE_POLICY = limited;
alter session force parallel query ;Query:
SELECT COUNT(*)
from (
SELECT /*+ FIRST_ROWS(50), PARALLEL*/
This query takes more than 2hrs to execute
COUNT(*)
9600
Elapsed: 02:07:48.81
Execution Plan
Plan hash value: 127536830
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | Pstart|Pstop | TQ |IN-OUT| PQ Distrib |
| 0 | SELECT STATEMENT | | 1 | 21 | 150K (1)| 00:30:01 | | | | | |
| 1 | SORT AGGREGATE | | 1 | 21 | | | | | | | |
| 2 | PX COORDINATOR | | | | | | | | | | |
| 3 | PX SEND QC (RANDOM) | :TQ10000 | 1 | 21 | | | | | Q1,00 | P->S | QC (RAND) |
| 4 | SORT AGGREGATE | | 1 | 21 | | | | | Q1,00 | PCWP | |
| 5 | PX BLOCK ITERATOR | | 89030 | 1825K| 150K (1)| 00:30:01 |KEY(OR)|KEY(OR)| Q1,00 | PCWC | |
|* 6 | TABLE ACCESS FULL| SUBSCRIBER_EVENT | 89030 | 1825K| 150K (1)| 00:30:01 |KEY(OR)|KEY(OR)| Q1,00 | PCWP | |
Note
- automatic DOP: Computed Degree of Parallelism is 16 because of degree limitcan some one help us to find out where we did wrong or any pointer will really helpful to resolve an issue.
Edited by: Sachin B on May 11, 2010 4:05 AMGenerated AWR report for ADOP
Foreground Wait Events DB/Inst: HDB/hdb Snaps: 158-161
-> s - second, ms - millisecond - 1000th of a second
-> Only events with Total Wait Time (s) >= .001 are shown
-> ordered by wait time desc, waits desc (idle events last)
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % DB
Event Waits -outs Time (s) (ms) /txn time
direct path read 522,173 0 125,051 239 628.4 99.3
db file sequential read 663 0 156 235 0.8 .1
log file sync 165 0 117 712 0.2 .1
Disk file operations I/O 267 0 63 236 0.3 .1
db file scattered read 251 0 36 145 0.3 .0
control file sequential re 217 0 32 149 0.3 .0
library cache load lock 2 0 10 4797 0.0 .0
cursor: pin S wait on X 3 0 9 3149 0.0 .0
read by other session 5 0 2 429 0.0 .0
kfk: async disk IO 613,170 0 2 0 737.9 .0
sort segment request 1 100 1 1007 0.0 .0
os thread startup 16 0 1 43 0.0 .0
direct path write temp 1 0 1 527 0.0 .0
latch free 51 0 0 2 0.1 .0
kksfbc child completion 1 100 0 59 0.0 .0
latch: cache buffers chain 19 0 0 2 0.0 .0
latch: shared pool 36 0 0 1 0.0 .0
PX Deq: Slave Session Stat 21 0 0 1 0.0 .0
library cache: mutex X 45 0 0 1 0.1 .0
CSS initialization 2 0 0 6 0.0 .0
enq: KO - fast object chec 1 0 0 11 0.0 .0
buffer busy waits 3 0 0 1 0.0 .0
cursor: pin S 9 0 0 0 0.0 .0
CSS operation: action 2 0 0 1 0.0 .0
direct path write 1 0 0 2 0.0 .0
jobq slave wait 17,554 100 8,942 509 21.1
PX Deq: Execute Reply 4,060 95 7,870 1938 4.9
SQL*Net message from clien 96 0 5,756 59962 0.1
PX Deq: Execution Msg 618 56 712 1152 0.7
KSV master wait 11 0 0 2 0.0
PX Deq: Join ACK 16 0 0 1 0.0
PX Deq: Parse Reply 14 0 0 1 0.0
Background Wait Events DB/Inst: HDB/hdb Snaps: 158-161
-> ordered by wait time desc, waits desc (idle events last)
-> Only events with Total Wait Time (s) >= .001 are shown
-> %Timeouts: value of 0 indicates value was < .5%. Value of null is truly 0
Avg
%Time Total Wait wait Waits % bg
Event Waits -outs Time (s) (ms) /txn time
control file sequential re 6,249 0 2,375 380 7.5 55.6
control file parallel writ 2,003 0 744 371 2.4 17.4
db file parallel write 1,604 0 503 313 1.9 11.8
log file parallel write 861 0 320 371 1.0 7.5
db file sequential read 363 0 151 415 0.4 3.5
db file scattered read 152 0 64 421 0.2 1.5
Disk file operations I/O 276 0 21 77 0.3 .5
os thread startup 316 0 15 48 0.4 .4
ADR block file read 24 0 11 450 0.0 .3
rdbms ipc reply 17 12 7 403 0.0 .2
Data file init write 6 0 6 1016 0.0 .1
direct path write 21 0 6 287 0.0 .1
log file sync 7 0 6 796 0.0 .1
ADR block file write 10 0 4 414 0.0 .1
enq: JS - queue lock 1 0 3 2535 0.0 .1
ASM file metadata operatio 1,801 0 2 1 2.2 .0
db file parallel read 30 0 1 40 0.0 .0
kfk: async disk IO 955 0 1 1 1.1 .0
db file single write 1 0 0 415 0.0 .0
reliable message 10 0 0 23 0.0 .0
latch: shared pool 75 0 0 2 0.1 .0
latch: call allocation 26 0 0 2 0.0 .0
CSS initialization 7 0 0 6 0.0 .0
asynch descriptor resize 352 100 0 0 0.4 .0
undo segment extension 2 100 0 5 0.0 .0
CSS operation: action 9 0 0 1 0.0 .0
CSS operation: query 42 0 0 0 0.1 .0
latch: parallel query allo 4 0 0 0 0.0 .0
rdbms ipc message 37,948 97 104,599 2756 45.7
DIAG idle wait 16,762 100 16,927 1010 20.2
ASM background timer 1,724 0 8,467 4912 2.1
shared server idle wait 282 100 8,465 30019 0.3
pmon timer 3,123 90 8,465 2711 3.8
wait for unread message on 8,381 100 8,465 1010 10.1
dispatcher timer 141 100 8,463 60019 0.2
Streams AQ: qmn coordinato 604 50 8,462 14010 0.7
Streams AQ: qmn slave idle 304 0 8,462 27836 0.4
smon timer 35 71 8,382 239496 0.0
Space Manager: slave idle 1,621 99 8,083 4986 2.0
PX Idle Wait 2,392 99 4,739 1981 2.9
class slave wait 46 0 623 13546 0.1
KSV master wait 2 0 0 27 0.0
SQL*Net message from clien 7 0 0 1 0.0
Wait Event Histogram DB/Inst: HDB/hdb Snaps: 158-161
-> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
-> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
-> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
-> Ordered by Event (idle events last)
% of Waits
Total
Event Waits <1ms <2ms <4ms <8ms <16ms <32ms <=1s >1s
ADR block file read 24 100.0
ADR block file write 10 100.0
ADR file lock 12 100.0
ASM file metadata operatio 1812 99.0 .3 .4 .2 .1
CSS initialization 9 100.0
CSS operation: action 11 90.9 9.1
CSS operation: query 54 100.0
Data file init write 6 16.7 16.7 16.7 50.0
Disk file operations I/O 533 88.7 2.6 .6 1.5 .2 6.4
PX Deq: Signal ACK EXT 4 100.0
PX Deq: Signal ACK RSG 2 100.0
PX Deq: Slave Session Stat 21 42.9 28.6 28.6
SQL*Net break/reset to cli 6 100.0
SQL*Net message to client 102 100.0
SQL*Net more data to clien 4 100.0
asynch descriptor resize 527 100.0
buffer busy waits 4 75.0 25.0
control file parallel writ 2003 9.3 .5 .0 .1 90.0
control file sequential re 6466 10.6 .0 .0 .0 .1 .2 89.0
cursor: pin S 9 100.0
cursor: pin S wait on X 3 33.3 33.3 33.3
db file parallel read 30 6.7 30.0 63.3
db file parallel write 1604 7.4 .1 .6 16.5 75.5
db file scattered read 403 3.7 .2 2.5 13.6 14.9 3.5 61.5
db file sequential read 1017 12.3 .8 2.3 7.3 6.6 2.0 68.8
db file single write 1 100.0
direct path read 522.2 2.2 2.1 .1 .0 1.8 17.9 75.9
direct path write 22 4.5 4.5 90.9
direct path write temp 1 100.0
enq: JS - queue lock 1 100.0
enq: KO - fast object chec 1 100.0
enq: PS - contention 1 100.0
kfk: async disk IO 614.1 100.0 .0
kksfbc child completion 1 100.0
latch free 58 46.6 27.6 15.5 10.3
latch: cache buffers chain 19 36.8 10.5 52.6
latch: call allocation 26 76.9 11.5 7.7 3.8
latch: parallel query allo 4 100.0
latch: shared pool 111 44.1 28.8 27.0
library cache load lock 2 100.0
library cache: mutex X 45 84.4 8.9 4.4 2.2
log file parallel write 861 10.0 .1 .1 89.5 .2
log file sync 172 6.4 90.1 3.5
os thread startup 332 100.0
rdbms ipc reply 18 72.2 11.1 16.7
read by other session 5 100.0
reliable message 11 81.8 9.1 9.1
sort segment request 1 100.0
undo segment extension 2 50.0 50.0
ASM background timer 1724 .8 .6 .1 .6 97.9
DIAG idle wait 16.8K 100.0
KSV master wait 13 7.7 23.1 61.5 7.7
PX Deq: Execute Reply 4060 .4 .0 .0 .1 3.4 96.0
PX Deq: Execution Msg 617 34.7 1.5 2.4 1.5 1.5 .2 .8 57.5
PX Deq: Join ACK 16 93.8 6.3
PX Deq: Parse Reply 14 71.4 7.1 14.3 7.1
PX Idle Wait 2384 .0 .6 99.3
SQL*Net message from clien 103 82.5 1.0 1.9 1.0 13.6
Space Manager: slave idle 1621 .2 99.8
Streams AQ: qmn coordinato 604 50.0 50.0
Wait Event Histogram DB/Inst: HDB/hdb Snaps: 158-161
-> Units for Total Waits column: K is 1000, M is 1000000, G is 1000000000
-> % of Waits: value of .0 indicates value was <.05%; value of null is truly 0
-> % of Waits: column heading of <=1s is truly <1024ms, >1s is truly >=1024ms
-> Ordered by Event (idle events last)Edited by: Sachin B on May 11, 2010 4:52 AM -
Hello
I'm very new to using Datasets and Datatables so forgive my ignorance; I have extensively searched through the forums but am having problems working out the best way forward. I have two Datatables in an application which are derived from an SQL Data Connection
using stored SQL queries. The two tables are dtIncrementComplianceManagers and dtIncrementCompliance.
At run time, I need the application loop through the rows of dtIncrementComplianceManagers and each time create a new datatable which contains all the rows in dtIncrementCompliance that share the ManagerEmail field with the current row in dtIncrementComplianceManagers .
This would be used to compose an email to the manager regarding their staff and the application would then move on to the next manager.
As an SQL query it would look like this
SELECT A.*
FROM dtIncrementComplianceas A, dtIncrementComplianceManagers as B
WHERE A.ManagerEmail = B.ManagerEmail
I'm not sure how to user a query of the existing datatables to populate a new table. This is where it would be located:
Public Sub RunManagerEmails()
Me.DtIncrementComplianceManagersTableAdapter.Fill(Me.HRRecruitmentDataSet.dtIncrementComplianceManagers)
Me.DtIncrementComplianceTableAdapter.Fill(Me.HRRecruitmentDataSet.dtIncrementCompliance)
For Each Row As DataRow In HRRecruitmentDataSet.dtIncrementComplianceManagers.Rows
<-----NEW CODE TO GO HERE---->
Next Row
End Sub
Any help would be much appreciated.Hello Leo,
>>I'm not sure how to user a query of the existing datatables to populate a new table. This is where it would be located
You could use LINQ to DataSet which has a similar syntax with SQL query:
LINQ to DataSet
In your case, you could perform a JOIN operation:
Query Expression Syntax Examples: Join Operators (LINQ to DataSet)
For storing the result to a new datatable, you could use the CopyToDataTable:
https://msdn.microsoft.com/en-us/library/bb386921(v=vs.110).aspx
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Problem in update operation for duet enterprise 1.0 from SharePoint end.
Hi Everyone, I have developed a sap netweaver duet enterprise 1.0 to send the data from sap to share point and from share point to sap. The problem is that I am able to test the data successfully from duet system in sap for all the operations Query, Read & Update and I am getting the required output.
But from share point end when they are hitting the data for Query, Read & Update operations the query and read operations are successful but the update operation is getting failed. I unable to trigger the break point for update operation. I have checked the log but in that i am getting BULK READ status.
Can anyone help me out in resolving this issue.
Thanks in advance
Regards
SrinuHi Binson,
I want to ristrict the crude operation (create, update etc) by giving roles in backend system. i am able to apply restriction at sharepoint end but i don't want that. i want SAP role based security.
So i want, according to given roles in backend system user is able to do operations at sharepoint.
Thanks & Regards
Virender Solanki -
Vendor Code 1317 Query execution was interrupted MySQL
An Error was encountered performing the requested operation:
Query execution was interrupted
Vendor Code 1317
Is this a network issue?
A database issue?
This is intermittent, for a period I can query tables then I try a new query or click on a different table, and the error appears.
Anyone else experience this?
Version 2.1.1.64.45
Java Platform 1.6.0_11Hi Guys,
I couldn't initially replicate.
But when I downloaded the driver version you are using (mysql-connector-java-5.1.13-bin.jar) it happened straight away.
Example: select * from information_schema.tables
second execution > Query execution was interruptedI have no issues (with my limited testing) using the documented JDBC driver (mysql-connector-java-5.0.4-bin.jar)
http://downloads.mysql.com/archives/mysql-connector-java-5.0/mysql-connector-java-5.0.4.zip
We don't upgrade/test/support the latest version of each JDBC driver, only when we see a benefit.
This goes for JTDS for SQL Server and Sybase and the other third party JDBC drivers.
Appreciate that this is not easy to find or obvious.
Heres the list of JDBC versions.
http://download.oracle.com/docs/cd/E15846_01/doc.21/e15222/intro.htm#CHDIEGDD
Hope this helps.
Dermot
SQL Developer Team. -
Hi,
We are trying to convert some old sql code to using Hierarchical queries, but am finding that the connect by expression is causing some errors for us. I have tried to follow the managedEmployees example from the web site but am not getting the parameters set correctly and keep getting the error below. I have attached our old code as well as the new code using Toplink. Please let me know if you see any issues with this.
Also, we have wrapped the Expression and ReadAllQuery classes with our own classes which is why we're not invoking those directly in the code below.
Thanks for the help,
Mark
Old SQL
DataExpression where = new DataExpression().get("organizationId").notNull();
String extraSQL = new String("");
extraSQL += " START WITH organization_id = " + orgId + " ";
extraSQL += " CONNECT BY PRIOR organization_id = parent_id ";
where.appendSQL(extraSQL);
Hierarchical query using Toplink
DataReadAllQuery raq = new DataReadAllQuery(Organization.class);
// Specify a START WITH expression
DataExpression startExpr = new DataExpression().get("organizationId").equal(orgId);
// Specifies a CONNECT BY expression
DataExpression connectBy = new DataExpression().get("organizationId").equal(new DataExpression().get("parentId"));
// Specifies an ORDER SIBLINGS BY vector
Vector order = new Vector();
raq.setHierarchicalQueryClause(startExpr, connectBy, order);
return QueryEngine.readAll(raq);
Error
TopLink Warning]: 2005.08.04 06:28:19.765--ServerSession(16237341)--Exception [TOPLINK-6073] (Oracle TopLink - 10g Developer Preview 3 (10.1.3.0 ) (Build 041116)): oracle.toplink.exceptions.QueryException
Exception Description: Malformed expression in query. Attempting to print an object reference into an SQL statement for query key [
Relation operator =
Query Key organizationId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}
Query Key parentId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}].
Query: ReadAllQuery(mil.usmc.mol.organization.Organization)
Aug 4, 2005 6:28:19 PM mil.usmc.mol.persistence.QueryEngine executeQuery
SEVERE: Error performing query. Nested exception is:
Exception Description: Malformed expression in query. Attempting to print an object reference into an SQL statement for query key [
Relation operator =
Query Key organizationId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}
Query Key parentId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}].
Query: ReadAllQuery(mil.usmc.mol.organization.Organization)I've modified it to call the toplink classes directly, but still get the same error..
ReadAllQuery raq = new ReadAllQuery(Organization.class);
ExpressionBuilder expressionBuilder = raq.getExpressionBuilder();
Expression startExpr = expressionBuilder.get("organizationId").equal(orgId);
Expression connectBy = expressionBuilder.get("organizationId").equal(expressionBuilder.get("parentId"));
Vector order = new Vector();
raq.setHierarchicalQueryClause(startExpr, connectBy, order);
SessionManager manager = SessionManager.getManager();
Session session = manager.getSession("DEFAULT");
UnitOfWork uow = session.acquireUnitOfWork();
return (Collection) uow.executeQuery(raq);
[TopLink Info]: 2005.08.05 11:09:32.090--ServerSession(16237341)--TopLink, version: Oracle TopLink - 10g Developer Preview 3 (10.1.3.0 ) (Build 041116)
[TopLink Info]: 2005.08.05 11:09:34.200--ServerSession(16237341)--DEFAULT login successful
[TopLink Warning]: 2005.08.05 11:09:34.262--UnitOfWork(20039836)--Exception [TOPLINK-6073] (Oracle TopLink - 10g Developer Preview 3 (10.1.3.0 ) (Build 041116)): oracle.toplink.exceptions.QueryException
Exception Description: Malformed expression in query. Attempting to print an object reference into an SQL statement for query key [
Relation operator =
Query Key organizationId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}
Query Key parentId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}].
Query: ReadAllQuery(mil.usmc.mol.organization.Organization)
Local Exception Stack:
Exception [TOPLINK-6073] (Oracle TopLink - 10g Developer Preview 3 (10.1.3.0 ) (Build 041116)): oracle.toplink.exceptions.QueryException
Exception Description: Malformed expression in query. Attempting to print an object reference into an SQL statement for query key [
Relation operator =
Query Key organizationId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}
Query Key parentId
Base mil.usmc.mol.organization.Organization{DatabaseTable(t0)=DatabaseTable(ORGANIZATIONS)}].
Query: ReadAllQuery(mil.usmc.mol.organization.Organization) -
TOPLINK-6119 ERROR for the following query,
any ideas as how to modify or make the query work? thanks,
Query:
====
ReadAllQuery query5 = new ReadAllQuery();
query5.setReferenceClass( Instrument.class );
query5.setSelectionCriteria( new ExpressionBuilder().get( "shortName" ).equal( shortName ) );
query5.addBatchReadAttribute( query5.getExpressionBuilder().anyOf( "customFields" )
.get( "stringValue" ).equal( "XYZ987" ) );
Exception stack
===========
Database exception: Exception [TOPLINK-6119] (Oracle TopLink - 10g Release 3 (10.1.3.3.0) (Build 070620)): oracle.toplink.exceptions.QueryException
Exception Description: The join expression
Relation operator =
Query Key stringValue
Query Key customFields
Base QUERY OBJECT
Constant XYZ987 is not valid, or for a mapping type that does not support joining.
Query: ReadAllQuery(com.integral.finance.instrument.Instrument).
at com.integral.persistence.PersistenceFactory.handleException(PersistenceFactory.java:793)
at oracle.toplink.publicinterface.Session.handleException(Session.java:1951)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1021)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:950)
at com.integral.finance.instrument.test.InstrumentCustomFieldPTestC.testInstrument(InstrumentCustomFieldPTestC.java:588)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at junit.framework.TestCase.runTest(TestCase.java:154)
at junit.framework.TestCase.runBare(TestCase.java:127)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at junit.textui.TestRunner.doRun(TestRunner.java:116)
at com.intellij.rt.execution.junit.IdeaTestRunner.doRun(IdeaTestRunner.java:69)
at junit.textui.TestRunner.doRun(TestRunner.java:109)
at com.intellij.rt.execution.junit.IdeaTestRunner.startRunnerWithArgs(IdeaTestRunner.java:24)
at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:118)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)Hello,
Your are adding a selection criteria through the addBatchReadAttribute api which isn't allowed. It is expecting only a query key type expression.
Try:
ReadAllQuery query5 = new ReadAllQuery();
query5.setReferenceClass( Instrument.class );
ExpressionBuilder exb = query5.getExpressionBuilder();
Expression batchExpression = exb.anyOf( "customFields" );
Expression expression = exb.get( "shortName" ).equal( shortName );
expression = expression.and( batchExpression.get( "stringValue" ).equal ("XYZ987") );
query5.setSelectionCriteria( expression );
query5.addBatchReadAttribute( batchExpression );This will return all Instrument objects with the require shortName and having a customField with the stringName of "XYZ987". It will use batching to return all referenced customFields (not just the ones with a stringName of "XYZ987").
Best Regards,
Chris
Maybe you are looking for
-
While making Subform Flowed-WesternText there is an error
Hello Buddies, I am using LiveCycle Designer7.1.I have included two filds in a subform which i made flowed-WesternText but when i preview it two fields are overlapping one over the error in the report pallete i found the like "Invalid layout attribut
-
What exactly is the appId in getApplicationPolicy() ?
I need some explanation what exactly appid is in the following method: http://docs.oracle.com/cd/E12839_01/apirefs.1111/e14650/oracle/security/jps/service/policystore/PolicyStore.html#getApplicationPolicy_java_lang_String_ ApplicationPolicy getApplic
-
Exception while initializing services.
Error: C:\Endeca\apps\Discover\control>initialize_services.bat Setting EAC provisioning and performing initial setup... [09.24.13 08:40:16] INFO: Checking definition from AppConfig.xml against existin g EAC provisioning. [09.24.13 08:40:16] INFO: Set
-
How can I make several videos play from one player much like Presentation widget
Is there a way to have several videos, in thumbnails, play through one player similar to the manner which Presentation dosplays selections from image thumbnails? Greg
-
Divide Result in decimal or float
Hi, Here i am doing division calculation for two int values. payroll occbeddays result 2168 2969 0 But i want the result as 0.73 How can i got this? @temp_STATSCAL AVGPAYROLL is money datatype. INSERT INTO @temp_STATSCAL (FACI