What are Lexical Parameters.How They are used in Reports 6i
Answers were Sorted based on User's Feedback
Answer / jini
you have to write a query like this to replace the
tablename and column name
select &ename,&sal
from &emp
but make sure emp is a table and ename,sal are columns
| Is This Answer Correct ? | 33 Yes | 10 No |
1.Lexical Parameters are placeholders for text that you
embed in a SELECT statement. You can use lexical
references to replace the clauses appearing after SELECT,
FROM, WHERE, GROUP BY, ORDER BY, HAVING, CONNECT BY, and
START WITH.
You cannot make lexical references in a PL/SQL statement.
You can, however, use a bind reference in PL/SQL to set the
value of a parameter that is then referenced lexically in
SQL.
example:
we can use (&)lexical parameter in where cluse and inside
from clause and group by clause i enclose the query used in
reports 6i.
select
decode (UPPER(:p_order_by),'CUSTOMER',NULL,
types.cust_trx_type_id ) dummy_id_inv,
decode (UPPER
(:p_order_by),'CUSTOMER',NULL,types.name)
dummy_type_inv,
ps.trx_number
invnum ,
types.name
invoice_type_inv,
ps.amount_adjusted
amount_adjusted_inv,
ps.amount_applied
amount_applied_inv,
ps.amount_credited
amount_credited_inv,
ps.gl_date
gl_date_inv,
&lp_bal_segment
bal_segment_value_inv,
&lp_query_show_bill cons_billing_number,
from ra_cust_trx_types_all types,
hz_cust_accounts cust_acct,
hz_parties party,
&lp_ar_payment_schedules_all ps,
&lp_table_show_bill
&lp_ra_customer_trx_all trx,
hz_cust_site_uses_all site,
hz_cust_acct_sites_all addr,
hz_party_sites party_site,
hz_locations loc,
&lp_ra_cust_trx_gl_dist_all gld,
where TRUNC(ps.gl_date) <= :p_as_of_date
and ps.customer_trx_id+0 = trx.customer_trx_id
and ps.customer_id = cust_acct.cust_account_id
and cust_acct.party_id = party.party_id
&lp_customer_name_low1
&lp_customer_name_high1
&lp_customer_number_low1
&lp_customer_number_high1
and ps.cust_trx_type_id = types.cust_trx_type_id
and nvl(ps.org_id,-99) = nvl(types.org_id,-99)
&lp_invoice_type_low
&lp_invoice_type_high
and ps.customer_site_use_id+0 = site.site_use_id+)
and site.cust_acct_site_id = addr.cust_acct_site_id(+)
and addr.party_site_id = party_site.party_site_id(+)
and loc.location_id (+) = party_site.location_id
and ps.gl_date_closed > :P_AS_OF_DATE
&lp_curr_code
and ps.customer_trx_id+0 = gld.customer_trx_id
and gld.account_class = 'REC'
and gld.latest_rec_flag = 'Y'
and gld.code_combination_id = cc.code_combination_id
&lp_bal_segment_low
&lp_bal_segment_high
&lp_where_show_bill
&P_ORG_WHERE_CTT
&P_ORG_WHERE_PS
&P_ORG_WHERE_ADDR
&P_ORG_WHERE_GLD
| Is This Answer Correct ? | 27 Yes | 11 No |
When do we use triggers?
how many columns can be used for creating index? : Sql dba
How is Oracle 10g helpful when compared to oracle 9i and what is grid computing
how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba
What does sign mean sql?
What are the conditions an underlying table must satisfy before a cursor can be used by a positioned update or delete statement? : Transact sql
what is log shipping? : Sql dba
What is difference between a PROCEDURE & FUNCTION ?
How to select the Nth maximum salary from Table Emp in Oracle SQL Plus ?
How do you get all records from 2 tables. Which join do you use?
What are the difference between Functions/Stored Procs and Triggers and where are they used.
Is sql a microsoft product?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)