How to use a SELECT QUERY using fdmAPI.executeDML in FDMEE Jython Script?
Hi,
Just the way we use DELETE and INSERT Statement using fdmAPI.executeDML, is there any way of executing a SELECT Statement and get the output in variables?
I would like to refrain from using import java.sql and enter the connection details in a script.I would like to rather use SELECT directly if possible. I want to read the TDATASEG.DATAKEY column and use it for some custom process in a custom table
Thanks!
Hi SH,
Somehow after upgrading to FDMEE 11.1.2.3.530, this is not working.
I get an error saying
while (RSTxnType.Next()):
Attribute Error: 'oracle.jdbc.driver.OracleResultSetImpl' object has no attribute 'Next'
Similar Messages
-
How to execute SQL SELECT QUERY using VB in FDMEE
Hi Experts,
We are struggling with converting some of the FDM VB Scripts to FDMEE. While in FDM it was possible to simply create a RS Object, it doesnt seem to work in FDMEE. Can you please help me with some code samples that will help me execute SELECT Query and taking the output of the Query to Appropriate Variables.
Also it seems that the Accelerators in erstwhile FDM are no longer available in FDMEE. So we have to re-write our entire code all over again
ThanksThere are plenty of code examples in the FDMEE guide and al of the API methods are documented for both Visual Basic and Jython. Personally, I think, if you are having to re-factor your code because you have migrated from FDM to FDMEE I would look at doing it in Jython not the VB API. Jython is the scripting language that will be the mainstream choice going forward and athough the VB API is present to ease the move from FDM to FDMEE I wouldn't be sure how long it will be supported and you therefore may have to perform another code migration not too far down the line. Jython is a very powerful and easy to use if you spend a bit of time familiarizing yourself with the syntax and also opens up the opportunity to leverage the myriad of Java classes out there. Also all of your import scripts have to be in Jython with no VB alternative.
One other piece of advice is do not try and replicate allyour old code line for line. Look at what you were trying to achieve, assess whether it is still relevant or can it be faciliated by the new extended out of the box constructs and functionality FDMEE offers over classic FDM. -
Friends,
I need to select some fields from two different tables which doesnot contain any field in common.How to Get this using a select query..
But there is a field X in table 1 which is equalient to eight char of another field y in table 2.I tried using offset but it is giving error.
Thanks in Advance
Regards
YaminiHello,
You can use a subquery
SELECT * FROM SFLIGHT AS F INTO WA_SFLIGHT
WHERE SEATSOCC < F~SEATSMAX
AND EXISTS ( SELECT * FROM SPFLI
WHERE CARRID = F~CARRID
AND CONNID = F~CONNID
AND CITYFROM = 'FRANKFURT'
AND CITYTO = 'NEW YORK' )
AND FLDATE BETWEEN '19990101' AND '19990331'.
WRITE: / WA_SFLIGHT-CARRID, WA_SFLIGHT-CONNID,
WA_SFLIGHT-FLDATE.
ENDSELECT.
or simply query the first table and then the second table with select endselect.
select * from table a.
select * from table b into output_table
where b-field1 eq a-field2.
endselect.
or read the data into one internal table loop at it and then query the other table.
Regards,
Shekhar Kulkarni -
What is the syntax for creating global temporary table using a select query
hii
I'm creating a global temporary table using a select query ..how to mention 'on commit preserve rows' that?
create global temporary table t1 as select * from trn_ordbase on commit preserve rows;
but this is invalid syntax,so how to mention on commit preserve rows in this???if i dont mention it ,by default its considering as on commit delete rows.
Please help me out of this problem.create global temporary table t1 as select * from trn_ordbase on commit preserve rows;You CANNOT use this syntax.
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/sqcmd.htm
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/glob_tab.gif
http://download-east.oracle.com/docs/cd/B19188_01/doc/B15917/cre_tabl.gif -
How to write the given query using 'ANY ' operator
Hi,
How to write the given query using 'ANY ' operator , I dont need to fetch to grade_master table twice in database, just need to fetch within the result set.
SELECT dsg_code,dsg_name,dsg_grade FROM designation_master WHERE dsg_orgn='&&Orgn' and dsg_ctry='&&ctry'
And dsg_loc ='&&loc' And dsg_oru = '&&oru' and dsg_grade in decode('&&radio_group',
1, SELECT grd_code FROM grade_master WHERE grd_osm_code in (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&Orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'),
2, SELECT grd_code FROM grade_master WHERE grd_osm_code > (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' and grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code),
3, SELECT grd_code FROM grade_master WHERE grd_osm_code < (Select grd_osm_code FROM grade_master WHERE grd_orgn='&&orgn' and grd_ctry='&&ctry' And grd_loc ='&&loc' And grd_oru = '&&oru' and grd_code ='&&emp_grade'))
thanks
rincyHi,
One thing I understood my your issue is you want to perform, execution of query once or fetch the results sets my minimizing the number of times executions of queries. It would be hard for us to check in this way, atleast provide some temporary data and some business rules. Only I can IN, >, < (queries logical conditons on inner query)
- Pavan Kumar N
- ORACLE OCP - 9i/10g
https://www.oracleinternals.blogspot.com -
Hi,
Please give me the Select query
I have to fetch EBELN,BUKRS,LIFNR,BSART,EKORG,EKGRP,WAERS,WKURS from EKKO and
EBELP,LGORT,MATKL ,WERKS,BEDNR,IDNLF,BPRME,NETPR from EKPO and
MENGE, SAKTO,AUFNR,ANLN1,GSBER,PS_PSP_PNR from EKKN and
LPEIN,EINDT,SLFDT, from EKET.
I have to fetch all the data into an single internal table(Mandatory) by a select query using Joins.
EKKO is having EBELN as primary key
EKPO is having EBELN,EBELP as primary key
EKKN is having EBELN,EBELP as primary key
EKET is having EBELN,EBELP as primary key
Can anybody Please give me the Select query.
With Regards
AjayHi ,
I am sending this sample coed for the Inner joins .Hope this will help you:
Inner joins using 3 tables
Try this :-
SELECT stpostlnr stpoidnrk mastmatnr maramtart stpo~menge
INTO CORRESPONDING FIELDS OF TABLE zmat1 FROM mast
JOIN stpo ON stpostlnr = maststlnr
JOIN mara ON maramatnr = mastmatnr
WHERE stpostlty = 'M' "AND stpoidnrk IN s_matnr
AND mast~werks = 1000.
Here s_matnr is a select-options on the selection-screen.
Or this.
Code:
Select single VbrkBukrs VbrkKunrg Vbrk~Vbeln
VbrkFkdat VbrkBstnk_Vf Vbrk~Zterm
Tvzbt~Vtext
VbakVbeln VbakBstdk
LikpVbeln Likplfdat Likp~Lfuhr
into w_vbrk
from vbrk
inner join Tvzbt on TvzbtZterm = VbrkZterm and
Tvzbt~Spras = sy-langu
Inner join Vbfa as SalesLnk
on SalesLnk~vbeln = pu_vbeln and
SalesLnk~vbtyp_v = c_order
inner join Vbak on VbakVbeln = SalesLnkVbelv
Inner join Vbfa as DeliveryLnk
on DeliveryLnk~vbeln = pu_vbeln and
DeliveryLnk~vbtyp_v = c_Delivery
inner join Likp on LikpVbeln = DeliveryLnkVbelv
where vbrk~vbeln = pu_Vbeln.
This code locates sales, delivery and payment terms info from a billing document number.
or
Here, this one also works fine :
select zfpcdcadivi zfpcdproforma zfpcdfactura zfpcdaniofactura
zfpcdmontousd zfpcdmontoap zfpcdebeln zfpcdinco1
zfpcdlifnr lfa1name1 zcdvsstatus zfpcdconint
into it_lista
from zfpcd inner join zcdvs
on zfpcdebeln = zcdvsebeln
and zfpcdproforma = zcdvsproforma
and zfpcdlifnr = zcdvslifnr
inner join lfa1
on zfpcdlifnr = lfa1lifnr
where zcdvs~status = '04'.
Also Here is another solution that just uses inner joins:
SELECT vbakvbeln vbfaerdat INTO (itab-vbeln, itab-wadat)
FROM ( vbak INNER JOIN vbap
ON vbapvbeln = vbakvbeln )
INNER JOIN vbfa ON vbakvbeln = vbfavbelv
WHERE vbak~kunnr = m_wm AND
vbak~vbtyp = 'C' AND
vbfa~erdat IN s_date AND
vbap~matnr = 'MZ1807F' AND
vbfaposnv = vbapposnr AND
vbfa~vbtyp_n = 'J'.
<REMOVED BY MODERATOR>
Cheers,
Chandra Sekhar.
Edited by: Alvaro Tejada Galindo on Apr 10, 2008 5:20 PM -
How to display a select query record in a tool tip?
hi,
How to display a select query record in a tool tip?
for example i have a report employee. when i move the mouse pointer over a employee name, the tool tip should display the respective department id, department name...of that employee name.
select dep_id, dep_name ....from department where employee.....Is it possible?
thanksDear Skud,
Yes its possible..select ''||ename||'' from emp
other wise you can use jQuery tooptip or some other JScript bundles.
Thanks and Regards
Maheswara -
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 -
How to use user defined function in select query using Toplink
Hi Friends
I am little bit of new in Toplink stuff... so please help me...
I have to database functions 1. encrypt and 2. decrypt.
I want to exceute the following sql query using toplink
select port, database, user_name, decrypt(encrypt('String which is to be encrypt ','password'),'password') from CONFIGURATION
can anyone tell me , how to write code in toplink which will give the about sql output.
thanks .....The "Specifying a Custom SQL String in a DatabaseQuery" section in the TopLink Developer's Guide may help... http://download-uk.oracle.com/docs/cd/B32110_01/web.1013/b28218/qrybas.htm#BCFHDHBG
-
How to use dynamic select query which queries from 3 different table.
Hi All,
I am new to Toplink, i would like to use a named query to select some of the columns from 3 different tables with dynamic where clause.
I have used the following lines. Please tell me how to get code for the dynamic where clause.
First try :
Vector objPersons = (Vector)session.executeQuery("findPersonByGlobalID",Person.class,vQueryArguments);
The above method is not returning the vector or collection.
Second Try:
ReadAllQuery query = new ReadAllQuery(Person.class);
query.useCollectionClass(LinkedList.class);
LinkedList person = (LinkedList) session.executeQuery(query);
The second try is returning the collection but, this fetches all the record from the table.
1. How to query for range of records?
2. How to query from multiple tables for some range. How to use dynamic range values ?
Please reply with your answers or some pointers would help.
Thanks and Regards,
Vijay.BHi,
Did you try using a SQLCall ? It might be able to satisfy you requirements .. :-
Employee employee = (Employee) session.executeSelectingCall(
new SQLCall("SELECT * FROM EMPLOYEE WHERE EMP_ID = 44")
);You can get more information here :-
http://www.oracle.com/technology/products/ias/toplink/doc/1013/MAIN/_html/qrybas004.htm
Regards,
Sandeep -
Dears,
I used select statement like
select rnn
pucustctycode
into table gt_zgrrnnh
from zgrrnnh
where rnn in s_rnn
and lrcdate gt gv_update
and deleteind eq space.
and
select rnn
pucustctycode
appending table gt_zgrrnnh
from zgrrnnh
where rnn in s_rnn
and lrcdate eq gv_update
and lrctime gt gv_uptime
and deleteind eq space.
in my program. and now i want to combinate them using just one select.
and the different select conditions is lrdate and lrtime. and the firest selections has no limit to lrtime, but just limit to lrdate.
Anyone could help me how to use select ............when ..........(...........or............)?
Thanks a lot.
Julie.Change your select query like this:
Select time also, u have to change your internal table Strucutre.
SELECT rnn
pucustctycode
lrctime
INTO TABLE gt_zgrrnnh
FROM zgrrnnh
WHERE rnn IN s_rnn
AND lrcdate GE gv_update
AND deleteind EQ space.
from this you will all the data irrespective of time , but you have time field in your internal table .
Now Loop at your internal table and delete those records whoes LRCTIME is less than GV_UPTIME.
This is one way, i am sure there can be many ways to do this.
One has to keep trying...
Let me know ,if you face further issue..
Regards,
Mayank -
Select query-using Union All display duplicate records.
Hello All Gurus-
I am using Oracle 9.i
When i use the following query to fetch the records based on BUILDNUMBERNAME and ASSIGNED_BUILD then i am getting duplicate records -
select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6'
Union All
select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6'
How can i use the order by on T1.ID ? When i use the Order by T1.ID then it throws some error.
Kindly help me in this :(
Thanks in advance.Sorry for not providing all of the details -
I am using Toad tool to run the query.
1-When i use the following query -
Select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6' order by T1.ID
Union All
select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6' order by T1.ID
ORA-00933: SQL command not properly ended.
2-If i am not using the T1.ID and run the following query
Select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1. ASSIGNED_BUILD like '1.4.5.6'
Union All
select T1.ID FROM Defect T1,statedef T2,repoproject T3
WHERE T1.STATE=T2.ID AND T1.repoproject = T3.dbid AND T3.name Like 'ABC' AND T1.BUILDNUMBERNAME like '1.4.5.6'
Then it is running fine but it is displaying the duplicate values like -
00089646
00087780
00089148
00090118
00090410
00088503
00080985
00084526
00087108
00087109
00087117
00088778
00086714
00079518
00087780
00089148
00090392
00090393
00090395
00090398
00090401
00090402
00090403
00090406
00090408
00088503
00080985
00084526
00087108
00087109
00087117
00088778
00086714
00079518 -
Executing Select query using JDBC Receiver Adapter
I created couple types in Oracle and also new function instead of procedure
Can I execute the above query using JDBC Receiver Adapter.
select *
from the ( select cast( apr.get_distribut('', '', '', 'hdfcgd', 'CAN') as dsrTable )
from dual );
If possible how my message structure should look like...Hi vikram,
If you use JDBC as Receiver Adapter you can only post the data to the data base I do no think so we can select the records from the data base.
If you use JDBC as Sender hope,we can the select query in the sender communication channel.
Hope I am clear.
Thanks and Regardds,
Chandu. -
Joining two tables having no common fields using one select query
Hi Experts,
How to join two tables which are NOT having any field in common using only one select query?
Your help will be appreciated.
Thank you.Identify a third table (or more tables) with common fields with your two tables, or change your question either removing JOIN or removing NO COMMON FIELDS, else you wont get many responses and will be left alone in outer space, as suggested by Thomas.
If you acturally require what you written, better execute two select and merge the two internal tables merging every record from first table with every record of second table, til no more memory is available.
Regards,
Raymond -
How to do linguistic sort query using Toplink API
Hi,
I want to write a Toplink query using linguistic sort like the following SQL,
SELECT * from emp_name
where ename LIKE 'müller%'
ORDER BY NLSSORT(ename, 'NLS_SORT=german')
I got two questions:
(1) how to implement "ORDER BY NLSSORT(name, 'NLS_SORT=german')" using Toplink API.
(2) I built linguistic index,
CREATE INDEX nls_index ON emp_name (NLSSORT(ename, 'NLS_SORT = german'));
But SQL plan shows that LIKE clause does not use index. I wonder how to enforce query with LIKE clause to use such linguistic index.
Thanks for your help in advance.
-EvanLooks like we can not do an exact word search using Java API.
Maybe you are looking for
-
MELODIC SQUEALING - MacBook Pro 17" Unibody (Mid-2009)
Hi, I bought my MBP 17" directly from Apple shortly after the Unibody laptops came out. I have a 3.06 GHz Intel Core 2 Duo with 4 GB of memory. I have been hearing this noise for quite some time, and I have searched for answers for quite some time, b
-
Guys Pls share your Experiences !
<p class="MsoNormal">[color="#0000ff" size="3">Hi Everyone, <p class="MsoNormal">[color="#0000ff" size="3"> <p class="MsoNormal">[color="#0000ff" size="3">I?recently bought the Sound Blaster X-FI Surround 5. sound card. When I installed the Installat
-
Dear All, I have the following program from GNome which scan and then cache then image in memory buffer and save as JPEG format. My question is how do I save it as tiff format using the same class BufferImage ? Please advise. import java.awt.*; impor
-
Reading DOM document text nodes
I have created a DOM document from a text string, which seems fine. The structure is something like: <BOOK> <BOOK_ID>1</BOOK_ID> <BOOK_NAME>Test Book 1</BOOK_NAME> <BOOK_DESC>This is a test book</BOOK_DESC> </BOOK>When I try to traverse t
-
Group Policy Prevent users to access DNS
Hello I have a problem with DNS in windows 2008R2. there is a policy prevent DNS resolving name to IP and I can ping any computer by IP put I cannot ping it by name although when I use "nslookup" on cmd the computer can see DNS server. Another proble