Making Qery from Database View
Hi
I am using SAP B1 2007 B PL10
The problem is -
I have created one db view. when i am running the qry (select * from view where DocDate > [%0]) from Query Generator its not it is throwing error. If I remove the user input ([%0]) then its working fine.
Regards
Indrajit
If you want the system ask you for a parameter you should use a Select statement with a table known by the system. It may be a system or a user defined table. The system does not know your view.
But the system uses this table only for showing the existing values and for the prepare phase. So such a select may be inside a comment, and you can use the entered value for anything! So you can try something like this:
Declare @dd datetime
Set @dd/*SELECT T0.[DocDate] FROM ORDR T0 WHERE T0.[DocDate]*/ ='[%0]'
select * from view where DocDate > @dd
Similar Messages
-
CMP Entity Bean from dataBase views
Hi forum,
I Have to migrate an existing application to JEE (with EJB3).
In this application there are a lot of dataBase views.
I'm new in EJB3 and I don't know how to structure cleanly entity beans (Specially when it are created from dataBase views).
My problem is that for each query made from the same dataBase view I almost have to create a new entity bean with a different @Id.
What can I do to to avoid it?
I had thought to genrate a new @Id (attribute not persistent) but I think is not possible. It's right ?
Someone can help me ?
Thanks"CMP provides you with database independence and less coding efforts."
BMP is not database dependent, unless you invoke database specific things in your SQL (something I do not do). CMP on the otherhand is inherently appserver specific (which was it's goal when BEA, IBM, et al. came up with it), and still limits your design possibilities. See this thread for an example:
http://forum.java.sun.com/thread.jsp?forum=13&thread=318785
As for less coding effort, that is a relative statment. Yes a simple CMP bean requires less coding to develop the first time. I personally view a few lines of SQL to load and store the data as being fairly trivial. But that needs to be offset with the problems inherent in using appserver specific CMP implementations.
As an example, try mapping WebSphere CMP to a pre-existing database without using IBM's IDE. It's an incredible pain in the ass since WebSphere does not come with a "meet-in-the-middle" solution. Any J2EE developer that has had the experience of working with different appservers (especially if they have had to port an app, as I have) can attest to the complications that arise with each implementation.
A BMP bean, written with non-DB-specific SQL, is the most portable, most flexible approach to EntityBeans. Yes, it requires the developer to be able to write some SQL, which should not take a significant amout of time. WRT queries, you have to write them, either SQL, EQL, or some appserver specific format.
As an aside, the use of code generators to simplify the creation of EJBs lends itself well to BMP. By using a (or writing your own) code generator, you can mitigate the annoying SQL bugs that creep up early in development. -
How to retrive data from database views or projection views
how to retrive data from database views or projection views
Hi chintam,
1. Very simple
2. Just like normal select statement.
3. Select * from VIEWNAME.
4. (Instead of the tablename, we just have to give the viewname)
regards,
amit m. -
How to select value from database view with * in wher clause
Hi ,
I ahve a database view with some fields.
Now my requirement is to serach a single row on the basis of process type.
Process type can have values like ZBA,ZBC,ZBD,ZBE or similarly anything starting with ZB.
Now i know that starting two letters will be ZB , but dont knwo the last letter.
So how should i use select query for the same?
Should i use like operator for the same?
regards
PGhi,
u can use character '%'.sample code like this
SELECT reltype
instid_a
catid_a
instid_b
FROM /dbm/ord_docflow
INTO TABLE it_link
FOR ALL ENTRIES IN it_pnwtyh
WHERE instid_a = it_pnwtyh-instid_a AND
instid_b LIKE 'QMSM%' AND
typeid_a = 'BUS2400' AND
typeid_b = 'BUS2400' AND
catid_a = 'BO' AND
catid_b = 'BO' AND
reltype = 'VONA'.
this is similar to using* while we fetch values from table.in the above code only i no QMSM rest values not sure,so used QMSM% -
Memory leak pulling in data from database view or database table
Post Author: Thang Nguyen
CA Forum: Data Integration
Hi,
I'm experiencing memory leaks when using DI to load from a database view or table. I have seen the issue on 11.7.2.0 and 11.7.2.2 and was wondering if anyone else has seen it.
You can see the row count in the monitor tab going up, but with every 1000 rows it pulls in the al_engine process consumes more and more memory until it gets to 2GB and crashes with an unknown error.
Simlir behaviour is seen in the validation transform when doing and "IN" to another table, and with table comparisons.
I've got a webex with support tomorrow as they don't seem to belive that this happening and just want to get a heads up if anyone else was seeing this problem.
ThanksPost Author: tambol
CA Forum: Data Integration
HI,
i am experiencing similar error :
Unknown error in transform <AIView4>.
i am using older version of BO. how could i possibly fix this without upgrading to newest version?
please don't be too techincal when explaining...new here
thanks a lot! -
How to read records from Database view
Hi folks,
well...let me know, y im getting error as : V_T52EL is not defined in the ABAP dictionary as Table , Projection view or Database view.
But actually here this View Type is : Maitenance View.
SELECT KOART
from V_T52EL
where ENDDA GE SY-DATUM AND
SYMKO EQ T030-BWMOD.
plz let me know..guys.
Regards,
KumarHello,
Maitenace View reocird can be viewed only through Tcode SM30
Vasanth -
Replication from Database Views
Hi,
We have a requirement to replicate data from a Database View in ECC to HANA.Is there any SLT DMIS version that supports data replication from Views? Replication should work from: ECC-->SLT-->HANAHi,
this is supported with DMIS2011 SP6:
-Support Views for initial load and / or replication (view must contain key fields of original table)
Views can be database or projection views.
Best,
Tobias -
Change display text in discoverer from database view
Hello,
I just wondered if it possible to do the following:
Create a discoverer report using e.g. person type field. In the database view the value required for this would be "Full-time" however when the user sees the value in the discoverer report the value is displayed as Employee type 1?
Can you change the text of a value a user sees in discoverer form what it is pulled out of the view as?
Please advise
Thank you
SarahHi Sarah
Yes you can do this. It is done as a calculation like this:
CASE
WHEN Person_Type = 'Full-time' THEN 'Employee type 1'
WHEN Person_Type = 'Part-time' THEN 'Employee type 2'
ELSE Person_type
END
You would call this calculation Employee Type and display it it in the report instead of Person Type.
Best wishes
Michael -
Creating Entitybeans from Database-Views with Sun Applicationserver 8.1
Hello,
I�m implementing a databaseapplication with J2EE and Sun AppServer 8.1. Now I actually don�t want to use the database-tables directly. Instead I want to use views, because then the structure of the underlying table doesn�t matter. Only the view needs to be modified.
Is it possible to use Entitybeans with views? Or is it only possible to use EJBs with tables?
If it is possible please be so kind to give an example or explain how. I tried the capture-schema - Approach but there are no views in the capturefile. Please help!
Thank you!
GregorYou should be able to use views with EJBs, but as you correctly realized, you need to get them into your dbschema file first. Try specifying the view names as parameters to the table arguments in the capture schema tool, or try the UI for schema capture in NetBeans or Studio.
-
is it the same to get the values from view and table?
plz help me with example...Yes its the same:
SELECT * FROM <view / table> INTO TABLE ITAB WHERE <condition>.
Provided the ITAB is having view / table structure.
Thanks -
hi,
i have problem in my select query where i am trying to fetch datas from database view.
it takes huge time to process and finally results in run time errors.
help me.
ganesh.For ex: assume that u r creating DB view (say zdbview) for VBAP and MARA.
Select only required fields from two tables when creating the view.
SE38 code:
Data: itab like zdbview occurs 1 with header line.
select * from zdbview into table itab.
loop at itab.
write: / itab-vbeln, itab-matnr, itab-zmwng, itab-mbrsh, itab-mtart.
endloop.
Hope it helps. -
Hi forum,
I Have to migrate an existing application to JEE (with EJB3).
In this application there are a lot of dataBase views.
I'm new in EJB3 and I don't know how to structure cleanly entity beans (Specially when it are created from dataBase views).
My problem is that for each query made from the same dataBase view I almost have to create a new entity bean with a different @Id.
What can I do to to avoid it?
I had thought to genrate a new @Id (attribute not persistent) but I think is not possible. It's right ?
Someone can help me ?
ThanksHello Kenny,
The view can be treated the same as a table, it just needs to have some field or set of fields that can uniquely identify rows for it to be able to map to an Entity. Unless the view has rows that are exact duplicates, in the worst case you can use the entire row as the primary key.
Best Regards,
Chris -
Determine if database view column is foreign key in underlying table
Hi,
I have posted this same question to the General Database Discussions and JDBC forums.
I am using Oracle database 10g (10.1.0.4.0 - 64 bit production) standard edition on Red Hat Enterprise Linux AS release 3, JDK 1.4.2 and the latest Oracle JDBC (thin) driver.
We have a java GUI application that is a front-end for our database. Some of the data entry screens display data from database views. If a column in the view is a foreign key in the underlying table, we want to display a combo-box with the valid values so that the user can choose a correct value.
Is there some way to know whether a column in a view is a foreign key in the view's underlying table?
Thanks,
Avi.I take that back.. I did figure something out for ya.. After reading some elses post I wrote this code... but its time to go home... I believe this will show you all the constraints and constraint types for the underlying tables of all the views for a user. You can mess with it and get it to return only FK (constraint_type = 'R') and only for a single view if ya like... The all_dependencies data dictionary view is the key to this whole operation...
select con.table_name, ucc.column_name, con.constraint_name, con.constraint_type
from all_constraints con, all_cons_columns ucc
where con.owner = user and
con.owner = ucc.owner and
con.table_name = ucc.table_name and
con.table_name in
(SELECT referenced_name
FROM all_dependencies
WHERE referenced_owner = USER
AND referenced_type = 'TABLE'
AND type = 'VIEW'); -
View links in oracle ADF/query featching from Database
Please any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname Loc
15 i1 support 50000 11 5 5 IT sss
15 i1 support 50000 11 3 3 Account sss
16 i2 support 8000 10 5 5 IT sss
16 i2 support 8000 10 3 3 Account sss
16 i2 support 8000 10 3 3 Software sss
16 i2 support 8000 10 4 4 Operation sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1 support 50000 11
Deptno dname Loc
5 IT sss
3 Account sss
This is second row:
Empno ename job Salary Comm
16 i2 support 8000 10
Deptno dname Loc
5 IT sss
3 Account sss
2 Software sss
4 Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanksPlease any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname Loc
15 i1 support 50000 11 5 5 IT sss
15 i1 support 50000 11 3 3 Account sss
16 i2 support 8000 10 5 5 IT sss
16 i2 support 8000 10 3 3 Account sss
16 i2 support 8000 10 3 3 Software sss
16 i2 support 8000 10 4 4 Operation sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1 support 50000 11
Deptno dname Loc
5 IT sss
3 Account sss
This is second row:
Empno ename job Salary Comm
16 i2 support 8000 10
Deptno dname Loc
5 IT sss
3 Account sss
2 Software sss
4 Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanks -
SQL query or view used internally by Discoverer Open Workbook from Database
Hi Experts,
I am involved in developing a web application wherein I have to display the 'All Workbooks' similiar functionality in the 'Open Workbook from Database' dialog box of Discoverer. Can anybody provide me with the background query or view that Discoverer uses to retrieve this data for workbook listing? Please let me know if my question is confusing and requires more details.
Thanks
ThomasHi,
If you just need the list of workbooks then you need to use the EUL_DOCUMENT table:
SELECT u.User_Name Owner_Name
*,Doc.Doc_Name Workbook_Name*
*,Doc.Doc_Updated_Date Last_Update_Date*
FROM Eul_Us.Eul5_Documents Doc
*,Eul_Us.Eul5_Eul_Users Own_Usr*
*,Fnd_User u*
WHERE Own_Usr.Eu_Id = Doc.Doc_Eu_Id AND
To_Char(u.User_Id(+)) = Substr(Own_Usr.Eu_Username
*,2*
*,10);*
If you want the exact same list then you need to do the above along with the sharing :
SELECT DISTINCT
case when instr(disco_docs.doc_created_by,'#')=0 then disco_docs.doc_created_by
when instr(disco_docs.doc_created_by,'#')>0 and instr(disco_docs.doc_created_by,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_docs.doc_created_by,2,5))
else NULL
end "Workbook Owner/Creator",
disco_docs.doc_name "Workbook Name",
disco_docs.Doc_Updated_Date "Last Update Date",
case when instr(disco_users.eu_username,'#')=0 then disco_users.eu_username
when instr(disco_users.eu_username,'#')>0 and instr(disco_users.eu_username,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_users.eu_username,2,5))
else (select resp.responsibility_name from fnd_responsibility_tl resp where resp.responsibility_id=substr(disco_users.eu_username,2,5))
end as "Shared Name / Responsibility"
FROM
eul_us.eul5_documents disco_docs,
eul_us.eul5_access_privs disco_shares,
eul_us.eul5_eul_users disco_users
WHERE
disco_docs.doc_id = disco_shares.gd_doc_id (+)
and disco_users.eu_username(+) NOT IN ('EUL5', 'PUBLIC')
AND disco_users.eu_id(+) = disco_shares.ap_eu_id;
* Change the EUL_US to your discoverer schema...
Then you will need to compare the current user with the sharing list or creator
Good luck
Tamir
Maybe you are looking for
-
Photoshop CS4: Could not complete your request because of a program error.
Hello, I find myself in an interesting dilemma. I've had CS4 for a bunch of years now and have loved it. Unfortunately, my MacBook Pro's hard drive crashed a month or so back. Luckily, I have been using an external hard drive to back up my computer,
-
How to configure Sender IDOC adapter
Hi could someone pls guide me on the steps that i need to take to configure IDOC sender adapter.. Are the steps for Sender and Receiver IDOC adapter same other than the fact that sender idoc adapter doesn't need a sender communication channel. Regard
-
Can't Drag & Drop Songs into Playlists
I am astounded that this appears to be such a wide spread issue and there do not seem to be any useful responses to the issue. I have always been able to drag music from my iTunes library into playlists I have already created. Now the playlists I pre
-
Can I use the built in camera to broadcast my face while I am chatting on the internet - particularly if the other person does not have a MAC? If so, how? Really don't understand computers, so if I can, please use the least technical language possibl
-
Please it's the only video we have!