Using variables as table names. Ideas for alternative designs
Hi,
I am designing an application which uses synonyms to pull information from 'client' DBs via DB Links. The synonyms are created with a DB_ID in the name (example: CUSTOMER_100, CUSTOMER_200... where 100 and 200 are DB IDs from 2 separate client DBs.
I have a procedure which selects data from the synonym based on what DB_ID is passed to the procedure. I want to be able to run this one procedure for any DB_ID that is entered. I am now aware I cannot use variable names for table names and using EXECUTE IMMEDIATE doesnt seem to fit for what I am trying to do.
Does anybody have any suggestions or re-design options I could use to achieve this generic procedure that will select from a certain synonym based on the DB info input parameters? Thanks.
CREATE OR REPLACE PROCEDURE CUSTOMER_TEST(p_host IN VARCHAR2, p_db_name IN VARCHAR2, p_schema IN VARCHAR)
IS
v_hostname VARCHAR2 (50) := UPPER (p_host);
v_instance VARCHAR2 (50) := UPPER (p_db_name);
v_schema VARCHAR2 (50) := UPPER (p_schema);
v_db_id NUMBER;
v_synonym VARCHAR2(50);
CURSOR insert_customer
IS
SELECT
c.customer_fname,
c.customer_lname
FROM v_synonym_name c;
BEGIN
-- GET DB_ID BASED ON INPUT PARAMETERS
select d.db_id
into v_db_id
from t_mv_db_accounts ac,
t_mv_db_instances i,
t_mv_dbs d,
t_mv_hosts h
where ac.db_ID = d.db_ID
and i.db_ID = d.db_ID
and i.HOST_ID = h.host_id
and upper(H.HOST_NAME) = v_hostname
and upper(D.DB_NAME) = v_instance
and upper(Ac.ACCOUNT_NAME) = v_schema;
--APPEND DB_ID TO THE SYNOYNM NAME
v_synonym := 'CUSTOMER_'||v_db_id;
FOR cust_rec IN insert_customer
LOOP
INSERT INTO CUSTOMER_RESULTS (First_Name, Last_Name)
VALUES (cust_rec.customer_fname, cust_rec.customer_lname);
END LOOP;
COMMIT;
END;
Rgs,
Rob
Hi
rules engine style with table that holds the logic or code SQL directly in the procedure and IF THEN ELSE with db_id. Latter is better because SQL is native and objects are checked every time procedure is compiled.
James showed the simplest way but this rather complex way gives you more flexibility between instances if ever needed.
CREATE TABLE synonym_dml(db_id number not null primary key, sql_text clob)
INSERT INTO synonym_dml VALUES (100, 'INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100')
INSERT INTO synonym_dml VALUES (200, 'INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200')
set serveroutput on size unlimited
create or replace
PROCEDURE Execute_Synonym_Dml(p_host VARCHAR2, p_db_name VARCHAR2, p_schema VARCHAR) IS
BEGIN
FOR r IN (
SELECT sql_text FROM synonym_dml
-- WHERE db_id IN (
-- SELECT d.db_id
-- FROM t_mv_db_accounts ac, t_mv_db_instances i, t_mv_dbs d, t_mv_hosts h
-- WHERE ac.db_id = d.db_id
-- AND i.db_id = d.db_id
-- AND i.host_id = h.host_id
-- AND upper(h.host_name) = p_hostname
-- AND upper(d.db_name) = p_instance
-- AND upper(ac.account_name) = p_schema
LOOP
DBMS_OUTPUT.PUT_LINE('-- executing immediately ' || r.sql_text);
--EXECUTE IMMEDIATE r.sql_text;
END LOOP;
END;
create or replace
PROCEDURE Execute_Synonym_Dml_Too(p_host VARCHAR2, p_db_name VARCHAR2, p_schema VARCHAR) IS
PROCEDURE DB_ID_100 IS
BEGIN
DBMS_OUTPUT.PUT_LINE('-- executing DB_ID_100');
--INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100;
END;
PROCEDURE DB_ID_200 IS
BEGIN
DBMS_OUTPUT.PUT_LINE('-- executing DB_ID_200');
--INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200;
END;
BEGIN
FOR r IN (
SELECT 100 db_id FROM dual
-- SELECT d.db_id
-- FROM t_mv_db_accounts ac, t_mv_db_instances i, t_mv_dbs d, t_mv_hosts h
-- WHERE ac.db_id = d.db_id
-- AND i.db_id = d.db_id
-- AND i.host_id = h.host_id
-- AND upper(h.host_name) = p_hostname
-- AND upper(d.db_name) = p_instance
-- AND upper(ac.account_name) = p_schema
LOOP
IF (r.db_id = 100) THEN
DB_ID_100;
ELSIF (r.db_id = 200) THEN
DB_ID_200;
ELSE
RAISE_APPLICATION_ERROR(-20001, 'Unknown DB_ID ' || r.db_id);
END IF;
END LOOP;
END;
EXECUTE Execute_Synonym_Dml('demo','demo','demo');
EXECUTE Execute_Synonym_Dml_Too('demo','demo','demo');
DROP TABLE synonym_dml PURGE
DROP PROCEDURE Execute_Synonym_Dml
table SYNONYM_DML created.
1 rows inserted.
1 rows inserted.
PROCEDURE EXECUTE_SYNONYM_DML compiled
PROCEDURE EXECUTE_SYNONYM_DML_TOO compiled
anonymous block completed
-- executing immediately INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer100
-- executing immediately INSERT INTO customer_results (first_name, last_name) SELECT customer_fname,customer_lname FROM customer200
anonymous block completed
-- executing DB_ID_100
table SYNONYM_DML dropped.
procedure EXECUTE_SYNONYM_DML dropped.
Similar Messages
-
Using variable as table name in pl/sql query - Is possible?
I am relatively new to PL/SQL and I am trying to create a function that accepts a table name and a rowid as arguments and returns a comma-delimited record string of the values of the table/rowid being passed. The problem is , I cannot code a select stmt as follows
SELECT * FROM v_table_name
WHERE rowid = v_row_id
in PL/SQL. There must be a easy way to approach this.
Thanks for any and all advice.
GCI don't understand the use of the concat symbol along with the commas and field namesYou just need (if you really need it) to create variable which contains you column separated by comma:
Simple example (in the second case separate variables are used to create
the list of columns):
SQL> declare
2 rc sys_refcursor;
3 cols varchar2(200) := 'ename, empno, sal';
4 tab varchar2(30) := 'emp';
5 begin
6 open rc for 'select ' || cols || ' from ' || tab;
7 close rc;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL> declare
2 rc sys_refcursor;
3
4 ename_col varchar2(10) := 'ename';
5
6 empno_col varchar2(10) := 'empno';
7
8 sal_col varchar2(10) := 'sal';
9
10 tab varchar2(30) := 'emp';
11
12 begin
13
14 open rc for 'select ' || ename_col || ',' || empno_col || ',' || sal_col ||
15 ' from ' || tab;
16
17 close rc;
18 end;
19 /
PL/SQL procedure successfully completed.Rgds. -
Use Of Numeric Table Names For Performance
Just a question if anyone has any experience using numeric table names(ie... 100, 200, 300... etc) instead of the typical naming conventions (ie... data_user_statistics, statsUser etc....) in their databases.
I had a database admin advise me that by using the short numerical names, you could potentially see a measurable gain in performance. Not sure how much that would be on a smaller 30-50 table database. I would think however, that if the database is heavily utilized, that you would see some performance gains. Just curious if anyone had any thoughts on this.user10887160 wrote:
Just a question if anyone has any experience using numeric table names(ie... 100, 200, 300... etc) instead of the typical naming conventions (ie... data_user_statistics, statsUser etc....) in their databases.
I had a database admin advise me that by using the short numerical names, you could potentially see a measurable gain in performance. Not sure how much that would be on a smaller 30-50 table database. I would think however, that if the database is heavily utilized, that you would see some performance gains. Just curious if anyone had any thoughts on this.Does your admin suggest the same for columns ?
Imagine having to work out the (otherwise obvious) error in something like:
select
"100"."302",
"200"."707"
from
"100",
"200"
where
"100"."305" = 104395
and "200"."709"="100"."303"
;(And I have seen it in a production system - except the tables started with a "T" and the columns with a "C" - and it was a complete pain in the backside to do performance trouble-shooting.)
Regards
Jonathan Lewis
http://jonathanlewis.wordpress.com
http://www.jlcomp.demon.co.uk
To post code, statspack/AWR report, execution plans or trace files, start and end the section with the tag {noformat}{noformat} (lowercase, curly brackets, no spaces) so that the text appears in fixed format.
"Science is more than a body of knowledge; it is a way of thinking"
Carl Sagan -
Field and table names requested for BAPI_INCOMINGINVOICE_CREATE
Hi all,
The following data is being hardcoded in BAPI_INCOMINGINVOICE_CREATE functional module for testing the functioning of this bapi. Now kindly suggest me how to make this BAPI useful for all PO's. the following data is being passed into BAPI for generation of invoice. Kindly provide technical names along with table names for the following fields.
HEADERDATA
INVOICE_IND X
DOC_TYPE RE
DOC_DATE 24.07.2007
PSTNG_DATE 24.07.2007
REF_DOC_NO 5000000940
COMP_CODE ACW
CURRENCY INR
GROSS_AMOUNT 33,750.0000
CALC_TAX_IND X
BLINE_DATE 24.07.2007
iTEM DATA
INVOICE_DOC_ITEM 000001
PO_NUMBER 10070100
PO_ITEM 00001
TAX_CODE V0
ITEM_AMOUNT 33,750.0000
SHEET_NO 1000002022
ITEM_TEXT SDFDS
SHEET_ITEM 0000000001
Thanx in advance.
KrishnaHi I have taken particular PO and Executed the code. It is generating the Invoice Document No. Now it want to remove all the Hardcoding. Code i have used is as follows. How do i remove the hardcoding ?? send meif sample code is available???
Internal table declaration *
DATA: gt_headerdata TYPE STANDARD TABLE OF bapi_incinv_create_header
INITIAL SIZE 0,
gt_itemdata TYPE STANDARD TABLE OF bapi_incinv_create_item
INITIAL SIZE 0,
gt_accountingdata TYPE STANDARD TABLE OF bapi_incinv_create_account
INITIAL SIZE 0,
gt_return TYPE STANDARD TABLE OF bapiret2
INITIAL SIZE 0.
DATA: gs_headerdata LIKE bapi_incinv_create_header.
DATA: gs_itemdata LIKE bapi_incinv_create_item.
DATA: gs_accountingdata TYPE bapi_incinv_create_account.
DATA: gs_return TYPE bapiret2.
DATA: l_date TYPE sy-datum.
l_date = sy-datum - 15.
Error flag *
DATA: l_errflag(1) TYPE c.
Build Invoice header
Document Type (Invoice)
gs_headerdata-invoice_ind = 'X'.
gs_headerdata-doc_type = 51.
Document Date
gs_headerdata-doc_date = l_date.
Posting Date
gs_headerdata-pstng_date = l_date.
Reference Document No
gs_headerdata-ref_doc_no = 323348.
gs_headerdata-gross_amount = 31.
Currency
gs_headerdata-currency = 'USD'.
Company Code
gs_headerdata-comp_code = 'D3'.
Baseline Date
gs_headerdata-bline_date = l_date.
**Tax Indicator
*gs_headerdata-calc_tax_ind = 'X'.
Build order item(s) - Only 1 is used in this example
Document Item
gs_itemdata-invoice_doc_item = 000001.
Purchase Order Number
gs_itemdata-po_number = 3700000011.
Purchase Order Item
gs_itemdata-po_item = 00010.
Quantity
gs_itemdata-quantity = 31.
gs_itemdata-po_unit = 'Z00'.
Item Amount
gs_itemdata-item_amount = 31.
gs_itemdata-tax_code = 'O0'.
gs_itemdata-taxjurcode = '0100000000'.
APPEND gs_itemdata TO gt_itemdata.
Document Item
*gs_itemdata-invoice_doc_item = '00002'.
Purchase Order Number
*gs_itemdata-po_number = '4700000158'.
Purchase Order Item
*gs_itemdata-po_item ='00020' .
Quantity
*gs_itemdata-quantity = '5'.
*gs_itemdata-po_unit = 'Z00'.
Item Amount
*gs_itemdata-item_amount = '5'.
*gs_itemdata-tax_code = 'O0'.
*gs_itemdata-taxjurcode = '0100000000'.
*APPEND gs_itemdata TO gt_itemdata.
Accounting Data
***gs_accountingdata-costcenter = 'DUMMY CCTR'.
*gs_accountingdata-invoice_doc_item = '00001'.
*gs_accountingdata-xunpl = 'X'.
*gs_accountingdata-tax_code = 'O0'.
*gs_accountingdata-taxjurcode = '0100000000'.
*gs_accountingdata-ITEM_AMOUNT = 100.
*gs_accountingdata-gl_account = '0003805101'.
*APPEND gs_accountingdata TO gt_accountingdata.
*CLEAR :gs_accountingdata.
*Call the BAPI to Create the Return Order
data: gv_INVOICE type BAPI_INCINV_FLD-INV_DOC_NO,
gv_YEAR type BAPI_INCINV_FLD-FISC_YEAR.
CALL FUNCTION 'BAPI_INCOMINGINVOICE_CREATE'
EXPORTING
headerdata = gs_headerdata
IMPORTING
INVOICEDOCNUMBER = gv_INVOICE
FISCALYEAR = gv_YEAR
TABLES
return = gt_return
itemdata = gt_itemdata.
accountingdata = gt_accountingdata.
PERFORM error.
Check and write Return table
FORM error.
LEAVE TO LIST-PROCESSING.
CLEAR l_errflag.
LOOP AT gt_return INTO gs_return.
WRITE: / gs_return-type, gs_return-message(200).
IF gs_return-type = 'E'.
l_errflag = 'X'.
ENDIF.
ENDLOOP.
PERFORM commit.
ENDFORM. " ERROR INPUT
No errors - Commit
FORM commit.
IF l_errflag IS INITIAL.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
ENDIF.
ENDFORM. " COMMIT INPUT
Thanks in advance
Krishnasri -
Using a derived table name in a select ...
In SQL or PL/SQL am I able to use the derived value of a colu,n (which holds a table name) to run an SQL.
Basically I want to perform a "select count(*) from table" where table is a list of tables held in another, eg all_tables.
EG:
all_tables has
TABLE1
TABLE2
TABLE3
and I want to get
TABLE1 100
TABLE2 50
TABLE3 110
ThanksSQL> ed
Wrote file afiedt.buf
1 declare
2 cursor cur_tables is
3 select table_name
4 from user_tables;
5 v_cnt NUMBER;
6 begin
7 for t in cur_tables
8 loop
9 execute immediate 'select count(*) from '||t.table_name into v_cnt;
10 dbms_output.put_line('Table: '||t.table_name||' ('||v_cnt||')');
11 end loop;
12* end;
SQL> /
Table: PRE_MAP_LOG (150935)
Table: LOG_SRC (126)
Table: SRC_LOOKUP (10)
Table: T (1)
Table: MYDONORS (22)
Table: CHANGE_LOG (347)
Table: CHANGE_VARCHAR2 (461)
Table: DO_MAP_LOG (50)
Table: CHANGE_DATE (96)
Table: CHANGE_NUMBER (561)
PL/SQL procedure successfully completed. -
Variable as table name in update statement
Hi everyone,
I am trying to update a table whose name is based on bind variables in the form and is unknown until runtime. However, I haven't been able to find a way to do this. I'm currently trying the FORMS_DDL built-in, but no success here either. Has anyone ever done this?
DECLARE
matrix_temp_table VARCHAR2(50);
BEGIN
matrix_temp_table := 'TEMP_'||:mgmt_matrix_master.div_idkey||'_'||TO_CHAR(:mgmt_matrix_master.dept_idkey);
FORMS_DDL('UPDATE '||matrix_temp_table||' SET create_date = :mgmt_matrix_master.create_date');
END;You're right, issuing the statement using the table name itself only works outside of FORMS_DDL. After trudging through the documentation it seems the best way to accomplish what I am trying to do is by using the EXEC_SQL package. But, once again, I cant get this to work either. It seems to me what I am trying to do is a fairly simple thing, but apparently not. I'm now trying to use this code, but the table still isn't being updated.
PROCEDURE update_matrix_temp_table IS
matrix_temp_table VARCHAR2(50);
update_connid EXEC_SQL.ConnType;
update_cursor EXEC_SQL.CursType;
ignore PLS_INTEGER;
BEGIN
matrix_temp_table := 'TEMP_'||:mgmt_matrix_master.div_idkey;
update_connid := EXEC_SQL.CURR_CONNECTION;
update_cursor := EXEC_SQL.OPEN_CURSOR(update_connid);
EXEC_SQL.PARSE(update_connid, update_cursor, 'UPDATE '||matrix_temp_table||' SET emp_no = '||:mgmt_matrix_master.emp_no);
ignore := EXEC_SQL.EXECUTE(update_connid, update_cursor);
EXEC_SQL.PARSE(update_connid, update_cursor, 'COMMIT');
ignore := EXEC_SQL.EXECUTE(update_connid, update_cursor);
EXEC_SQL.CLOSE_CURSOR(update_cursor);
EXCEPTION
WHEN EXEC_SQL.PACKAGE_ERROR THEN
IF EXEC_SQL.LAST_ERROR_CODE(update_connid) != 0 THEN
Message('ERROR (source: ' ||TO_CHAR(EXEC_SQL.LAST_ERROR_CODE(update_connid))|| '): ' ||EXEC_SQL.LAST_ERROR_MESG(update_connid));
END IF;
END; -
How to use full qualified table names in RPD
Hi,
We are implementing the BI Financial Analytics, we have a requirement to use diffrent user accounts for DAC , ETL and OBIEE
DAC, ETL we are using user as XXOBI
For OBIEE RPD we have to use user with read only access such as XXOBI_APP
How can i make the changed to BI server / RPD to use full qualified names.
I have tried to select the Full Qualified table name property in Oracle Datawarehouse connection pool setting.
If i enable that all my sql query is showing tables as catalog.dbo.w_party_d ( my tables in physical layer showing under catalaog -> dbo -> all tables and joins)
Any help in this is appreciated.
Thanks
Kriskmangamuri wrote:
Hi,
We are implementing the BI Financial Analytics, we have a requirement to use diffrent user accounts for DAC , ETL and OBIEE
DAC, ETL we are using user as XXOBI
For OBIEE RPD we have to use user with read only access such as XXOBI_APP
How can i make the changed to BI server / RPD to use full qualified names.
I have tried to select the Full Qualified table name property in Oracle Datawarehouse connection pool setting.
If i enable that all my sql query is showing tables as catalog.dbo.w_party_d ( my tables in physical layer showing under catalaog -> dbo -> all tables and joins)
Any help in this is appreciated.
Thanks
KrisAre you saying you just need to access the database using different accounts? If that is the case, why dont you just update the connection pool settings like username and password with XXOBI_APP account which you are supposed to be using for OBIEE? -
Use variables inside MovieClip names to call them in ASP 3.
This line of code works fine for me:
this.helpB1Btns.helpB1B3.alpha = 0.3;
But I wonder how can I use variables instead of numbers ( 1 and 3 ) above??
I mean for example:
var i:int = 1;
var j:int = 3;
this["helpB"+i+"Btns.helpB"+i+"B"+j+".alpha"] = 0.3; //Error
["helpB"+i+"Btns.helpB"+i+"B"+j+".alpha"] = 0.3; //Error
this["helpB"+i+"Btns"].["helpB"+i+"B"+j+".alpha"] = 0.3; //Error
For instance, this code works fine:
this["helpB"+i+"Btns"].alpha = 0.3;
(this.helpB1Btns.alpha = 0.3;)
But I have no idea to code this:
this.helpB1Btns.helpB1B3.alpha = 0.3;
I appreciate your help or any refference I could learn this fundamentally?
yours,
Aliahhhhhhh......I was only one DOT wrong and trying different methods for HALF AN HOUR!! lol
I wish Flash was more intelligent to correct such small mistakes!!
Thank you SO MUCH for your reply -
CRM Table Names needed - For CRM Account, Contacts & Activity
Hi,
I liked to know "Table Names" for the following entities are stored in SAP CRM System
(a.) CRM Accounts
(b.) CRM Contacts
(c.) CRM Activity
Thanks,
PrembabuCheck the list of CRM Tables;
BUT000 : BP: General data - Contains Business Partner Number, Partner Category, Partner Type, First Name, Last Name etc.
BUT020 BP: Addresses
BUT050 BP relationships/role definitions: General data - Contains Relationship, Partner Number (PARTNER1), Relationship Category
BUT051 BP Relationship: Contact Person Relationship Similar to
BUT050 additionally contains Contact Person's Address data
BUT0BK Business Partner: Bank Data & Details BP Number, Bank Key, Bank Country Key, Bank Account Number
BNKA Bank Master Data
BUT100 BP: Roles
ADR2 Telephone Numbers (Business Address Services)
ADR6 SMTP Numbers (Business Address Services) - Contains Email Id of the BP.
ADRC Addresses (Business Address Services) - BP's Complete Address Details- City, Country, Post Code, District,
Street, Title No Etc
TSAD3T Table containing the Title text against a Title No.
COMM_PRODUCT Master Table for Product
CRMM_BUAG Master table for Business Agreement
CRMM_BUAG_H Header Data for Business Agreement such as Tax Category, Tax Characteristic, Form key, Business Agreement Class. Data in this table correspond to ISU
CRMD_OPPORT_H OPPORTUNITY HEADER DATA
CRMD_ORDERADM_H Contains the Header Information for a Business Transaction.
Note:
1. It doesn't store the Business Partner responsible for the transaction. To get the Partner No, link it with
CRM_ORDER_INDEX.
2. This table can be used for search based on the Object Id(Business Transaction No).
CRMD_OPPORT_H OPPORTUNITY HEADER DATA
CRMD_CUSTOMER_H Additional Site Details at the Header Level of a Business Transaction
CRMC_PROC_TYPE Master table Business Transaction Type
CRMC_PARTNER_FCT Definition of Partner Functions
SCPRIOT Priorities for Activities with priority text.
CRMC_PROC_TYPE_T Text for a transaction type
CRMC_ACT_OBJ_T Objective Number and Text for Activities
TJ30T All the status code and text
CRMC_PR_ASSIGN : Transaction Type and its Transaction Type Object.
IBIB : Installed Base/Ibase
IBIN : Installed Base Components
Activities:
CRMD_ACTIVITY_H Activity Header table
CRMD_ACTIVITY_I Activity Reporting: Activity Line Item Extension
CRMD_TM_ACTIVITY Activity reference
Lead:
CRMD_LEAD_H Lead Header table
Opportunity:
CRMD_OPPORT_H Opportunity Header table
Reward points if it helps. -
Table name reqd for Component materials (showing under me23n)
Hi all,
Im working on PO report for the type Sub-contract Order.So i want to pick up the material and quantity from the components which is available in item detail->Material tab under me23n.
I want the table name to get the fields of those materials then to join field with the PO number or some related field.
****In me23n...it showing the structure name of MDPM..(its actually coming from the BOM creation).
Pls post ur comments with relevant details.
thanks & regards
sankar.Hi,
me23n uses ekpo & ekko tables
Reward with points if found useful.
Archana -
Urgent ...Table name Require for appraisal competency
Hi All,
can some one help me to sort out this issue.
how can i know where the appraisal competency information is storing(i mean table names).
i mean when appraiser enter the competency for his appraise.
Thanks.
Edited by: user627525 on Mar 17, 2009 4:35 AMOr try this query is you want a rating that gives u a number 0-5 for performance rating. I did this query a while ago. it also gives rating for the last 3-4 years. HR also wanted the rating rounded off. so i included that but i am sure u dont need it
select distinct peo.person_id
,AK.AK_RATING "Final 2005/6"
,AK_DATE
,AC.AC_RATING "Final 2006/7"
,AC.AC_Date
,AF_Rating "Final 2007/8"
,AF_DATE
,nvl(to_char(AG.AG_Rating),'Not Yet Reviewed') "Current Rating 1st 6 mnths"
,nvl(to_char(AR.AR_RATING),'Not Yet Reviewed') "Current Rating 2nd 6 mnths"
,AG_DATE
from hr.per_all_people_f peo,
hr.per_all_assignments_f paa
,(SELECT DISTINCT peo.person_id AK_person_id
,pr.performance_rating AK_rating
, pr.review_date AK_date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.review_date = (select pr1.review_date
from apps.per_performance_reviews pr1
where pr1.person_id = peo.person_id
and pr1.review_date between '01-May-2006' and '31-Oct-2006' ) )AK
,(SELECT DISTINCT peo.person_id AP_person_id
, case when pr.performance_rating <= 0.5 then '0'
when pr.performance_rating > 0.5 and pr.performance_rating <= 1.5 then '1'
when pr.performance_rating > 1.5 and pr.performance_rating <= 2.5 then '2'
when pr.performance_rating > 2.5 and pr.performance_rating <= 3.5 then '3'
when pr.performance_rating > 3.5 and pr.performance_rating <= 4.5 then '4'
when pr.performance_rating > 4.5 and pr.performance_rating <= 5 then '5'
when pr.performance_rating = 9 then '9'
end ROUNDED_RATING
,pr.review_date AP_date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.review_date = (select pr1.review_date
from apps.per_performance_reviews pr1
where pr1.person_id = peo.person_id
and pr1.review_date between '01-May-2006' and '31-Oct-2006' ) )AP
,(SELECT DISTINCT peo.person_id AC_person_id
,pr.performance_rating AC_rating
, pr.review_date AC_date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.review_date = (select pr1.review_date
from apps.per_performance_reviews pr1
where pr1.person_id = peo.person_id
and pr1.review_date between '01-May-2007' and '31-Oct-2007' ) )AC
,(SELECT DISTINCT peo.person_id AA_person_id
, case when pr.performance_rating <= 0.5 then '0'
when pr.performance_rating > 0.5 and pr.performance_rating <= 1.5 then '1'
when pr.performance_rating > 1.5 and pr.performance_rating <= 2.5 then '2'
when pr.performance_rating > 2.5 and pr.performance_rating <= 3.5 then '3'
when pr.performance_rating > 3.5 and pr.performance_rating <= 4.5 then '4'
when pr.performance_rating > 4.5 and pr.performance_rating <= 5 then '5'
when pr.performance_rating = 9 then '9'
end ROUNDED_RATING
, pr.review_date AA_date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.review_date = (select pr1.review_date
from apps.per_performance_reviews pr1
where pr1.person_id = peo.person_id
and pr1.review_date between '01-May-2007' and '31-Oct-2007' ) )AA
,(SELECT pr.person_id AF_Person_Id,
pr.performance_rating AF_Rating,
pr.review_date AF_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-May-2008' and '31-Oct-2008' )AF
,(SELECT pr.person_id AB_Person_Id
, case when pr.performance_rating <= 0.5 then '0'
when pr.performance_rating > 0.5 and pr.performance_rating <= 1.5 then '1'
when pr.performance_rating > 1.5 and pr.performance_rating <= 2.5 then '2'
when pr.performance_rating > 2.5 and pr.performance_rating <= 3.5 then '3'
when pr.performance_rating > 3.5 and pr.performance_rating <= 4.5 then '4'
when pr.performance_rating > 4.5 and pr.performance_rating <= 5 then '5'
when pr.performance_rating = 9 then '9'
end ROUNDED_RATING
,pr.review_date AB_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-May-2008' and '31-Oct-2008' )AB
,(SELECT pr.person_id AG_Person_Id,
pr.performance_rating AG_Rating,
pr.review_date AG_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-Nov-2008' and '30-Apr-2009' )AG
,(SELECT pr.person_id AQ_Person_Id
, case when pr.performance_rating <= 0.5 then '0'
when pr.performance_rating > 0.5 and pr.performance_rating <= 1.5 then '1'
when pr.performance_rating > 1.5 and pr.performance_rating <= 2.5 then '2'
when pr.performance_rating > 2.5 and pr.performance_rating <= 3.5 then '3'
when pr.performance_rating > 3.5 and pr.performance_rating <= 4.5 then '4'
when pr.performance_rating > 4.5 and pr.performance_rating <= 5 then '5'
when pr.performance_rating = 9 then '9'
end ROUNDED_RATING
,pr.review_date AQ_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-Nov-2008' and '30-Apr-2009' )AQ
,(SELECT pr.person_id AR_Person_Id,
nvl(pr.performance_rating,0) AR_Rating,
pr.review_date AR_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-May-2009' and '31-Oct-2009' )AR
,(SELECT pr.person_id AU_Person_Id
, case when pr.performance_rating <= 0.5 then '0'
when pr.performance_rating > 0.5 and pr.performance_rating <= 1.5 then '1'
when pr.performance_rating > 1.5 and pr.performance_rating <= 2.5 then '2'
when pr.performance_rating > 2.5 and pr.performance_rating <= 3.5 then '3'
when pr.performance_rating > 3.5 and pr.performance_rating <= 4.5 then '4'
when pr.performance_rating > 4.5 and pr.performance_rating <= 5 then '5'
when pr.performance_rating = 9 then '9'
end ROUNDED_RATING
,pr.review_date AU_Date
FROM apps.per_performance_reviews pr,
hr.per_all_people_f peo
WHERE pr.person_id = peo.person_id
and pr.REVIEW_DATE between '01-May-2009' and '31-Oct-2009' )AU
where peo.person_id = paa.person_id
and trunc(sysdate) between peo.effective_start_date and peo.effective_end_date
and trunc(sysdate) between paa.effective_start_date and paa.effective_end_date
AND peo.CURRENT_EMPLOYEE_FLAG = 'Y'
AND paa.PRIMARY_FLAG = 'Y'
AND paa.ORGANIZATION_ID != 1301
AND peo.EMPLOYEE_NUMBER != '0000001'
AND peo.BUSINESS_GROUP_ID = '82'
and AC.AC_person_id(+) = peo.person_id
AND AF.AF_PERSON_ID(+) = PEO.PERSON_ID
and AG.AG_PERSON_ID(+) = PEO.PERSON_ID
and AK.AK_PERSON_ID(+) = peo.person_id
AND AA.AA_PERSON_ID(+) = PEO.PERSON_ID
AND AB.AB_PERSON_ID(+) = PEO.PERSON_ID
and AP.AP_PERSON_ID(+) = PEO.PERSON_ID
and AR.AR_PERSON_ID(+) = PEO.PERSON_ID
and AQ.AQ_PERSON_ID(+) = PEO.PERSON_ID
and AU.AU_PERSON_ID(+) = PEO.PERSON_ID
order by peo.person_id -- , pr.review_date desc -
Table name reqd for batches and unrestricted stocks records
Hi friends,
I required table name of which having consolidated stocks with batch wise.
****reports avialable in T.Code:MMBE (here it displays the batches and unrestricted stocks by storage location wise)....
These details,i want to see in tables.
MCHA : will list only materials,plant and batche details.
MARD: will display Storage location data for material with total quantity.
LIke these, i want to view the table batches and unrestircted stock details of each material.
Pls, post ur comments and answer as much as possible.
Thanks & regards
sankar.Got answered from other forum
thanks -
Using variables in table constaraints
Hi,
I am facing problem in using global variables in table constraints. It is giving error "911 : 42000 : java.sql.SQLException: ORA-00911: invalid character".Since I was not able to use project variable s,I have used global variables.
following is the code
insert into DEV_TGT.E$_TEST_TGT
ERR_TYPE,
ERR_MESS,
CHECK_DATE,
ORIGIN,
CONS_NAME,
CONS_TYPE,
C1,
C2
select
'F',
sysdate,
'(161666)TEST_2.TEST_TO_TETS_TGT',
'CHK',
'CK',
C1,
C2
from DEV_TGT.I$_TEST_TGT TEST_TGT
where not (
TEST_TGT.C1=#GLOBAL.V_LOAD_ID
)Hi,
Did you refreshed or Assigned that variable before using in interface ?
Flow :-
Assgin/Refresh Variable -> interface (with contrsaint using variable)
Also,
If constarint is not an integer please use quotes ( '#GLOBAL.V_LOAD_ID' )
Regards,
Rathish
Edited by: Rathish on Sep 24, 2009 5:44 PM -
Tables name & linkages for Delivery qty,Order qty,Inv Qty
Hi,
can any one tell me where can I find delivery qty, ordered qty, Invoice qty for a PO i.e for a given PO number how can I find the above quantities.
thanksHi,
If you are looking to get the Order quantity, delivered quantity(Goods received) and invoiced quantity (Invoice Receipt - IR), get them from following tables.
EKPO for PO items (it will have PO item details)
EKBE for GR (Goods Receipt) quantity and invoiced quantity. Use the transaction type (VGABE) 1 to get the GR quantities and 2 for IR quantities.. don't forget to subtract the reversed GR quantities using the movement type while calculating the total GR quantity for item (See what movement type being used in your system for GR reversal).
Hope this helps.
Regards,
Nagaraju Chidurupalli. -
Urgent: Table name needed for Real estate
Hi Experts,
i have a query relating to the real estate module.
I want a table name that holds the (VIOROO-rsobjtype) Reservation object type field and (VIBPOBJREL-Partner) Partner field. These fields are contained in 2 different tables.
Can you help me out here. This is an Very urgent requirement.
Points will be awarded.
Thanks in advance.Hi,
Just do like this to know about your tables,
go to se11,
give table name as DD03L(which is a table for table fields),
display,
excute,
under the field name input u can VIOROO and VIBPOBJREL
then excute, u can get the table names for your fields.
seshu.
Maybe you are looking for
-
How movement type will be determined in Delivery without reference order
hi gurus, i want to know what movement type will be determined in delivery type LO(Without reference of order) . i think in a normal delivery with referance to sales order movement type will be taken from the sales order schedule lines. Incase of de
-
I have been trying to understand some issues in my internet connections. If I do a traceroute to say, netflix.com I and get this rather long response: The 10.0.1.1 is my airport and I can ping it successfully. the 10.126.20.1 appears to be in my rout
-
OS authentication in Oracle 10g via jdbc:oracle:oci
I'm very much a newbie to Java / JDBC and I am trying, but failing, to connect with the database using OS authentication via jdbc, and hoping someone may help. My questions are: 1. Is OS authentication supported for jdbc:oracle:oci with Oracle 10g ?
-
HP Photosmart install lost content in other programs!!
I installed an HP photosmart C4100 and found that all my Firefox bookmarks are gone, all the data from my Palm and Address book is gone and all the content from iTunes is gone. Additionally all the content from iPhoto has been moved into the HP photo
-
Hi, I was working on a PDF writing comments using Adobe Reader on a Mac. I clicked save and got a 'cannot save' message. I then clicked save as instead, Reader froze and my PDF disappeared. The only version saved has only my first comment. Does A