Interactive dynamic query reports
Hallo!
Please help me understand how to generate an interactive report based on the condition to the APEX 5. Basically, it must be based on the condition. Something like this:
If (: p2 > 2) select * from table1 otherwise select * from table2.
Thanks in advance!
2608792 wrote:
Please update your forum profile with a recognizable username instead of "2608792": Video tutorial how to change username available
Please help me understand how to generate an interactive report based on the condition to the APEX 5. Basically, it must be based on the condition. Something like this:
If (: p2 > 2) select * from table1 otherwise select * from table2.
Interactive reports require a projection of stable column. If the columns in table1 and table2 are identical so it can be implemented in a simple report using SQL:
select * from table1 where :p2 > 2 union all select * from table2 where :p2 <= 2
If the columns in the tables are different, then create several areas of the IR on the page (now possible in APEX 5.0) and conditionally restore using the required logic.
Tags: Database
Similar Questions
-
Dynamic SQL report on Oracle apex4.0
Hello world
I have two reports on a single page. One is the Interactive and another report. Sql based on the selection of the line (using the check box) in the interactive report, sql report should display the selected columns.
Note: the report must be loaded every time that a line is selected and without subjecting it to a button
Can someone please suggest?
I'm using oracle Apex4.0
Concerning
REDAI think that you are storing the values in the boxes. For example, your interactive report query looks like:
SELECT '"AS CHECKBOX, T.*.
OF UNE_TABLE Tand in 'Attributes of report', the CHECKBOX is displayed under "Standard report column.
* 1 a control list hidden input champ.*
It will store a selected values of list of checkboxes. If it is long enough, for example. 1000.
Let's say that the entry name is: P000_X_CHECK_LIST* 2. Create a dynamic Action *.
This dynamic action is supposed to fill the P000_X_CHECK_LIST with a list of values, separated by ': ' character.
These values will be an entry for the SQL report.Name: updated checklist
Event: change
Selection type: jQuery Selector
jQuery Selector: input: checkboxAction: Set
Set type: Expression JavaScript
function check_list() {}
var n = "";
$(":checked").each (function () {}
n = n + (n === « » ? ("': ': ') + $(this) .val ();
})
return n;
}
check_list();Selection type: item (s) - P000_X_CHECK_LIST
* 3. Set the query "SQL report" with this magic formula *.
AND SEARCHED_ITEM IN)
SELECT the item
FROM (SELECT REGEXP_SUBSTR (str, ' [^:] +', 1, LEVEL) point)
FROM (SELECT: P000_X_CHECK_LIST str)
THE DOUBLE)
CONNECT BY LEVEL<= length="" (regexp_replace="" (str,="" '[^:]+'))="" +="">=>
)for example:
SELECT O.*
OF SOME_OTHER_TABLE O
WHERE SEARCHED_ITEM IN)
SELECT the item
FROM (SELECT REGEXP_SUBSTR (str, ' [^:] +', 1, LEVEL) point)
FROM (SELECT *: P000_X_CHECK_LIST * str)
THE DOUBLE)
CONNECT BY LEVEL<= length="" (regexp_replace="" (str,="" '[^:]+'))="" +="">=>
)* 4. Adjust the dynamic Action: *.
Advanced: Event scope: 'live '.
* 5. Add real action more dynamic Action: *.
Action: update
Selection type: region
Region: The region of the "SQL report.Volia!
Best regards
Krzysztof -
I wonder why the dynamic value query is executed before the boot process? Logically, it makes sense to run after them.
For example, I test a stored procedure that is supposed to delete a record, and I'd like to create this test report should be deleted as part of the startup process before execution of the stored procedure call to delete this test record. Apparently the dynamic query of value not returns not the test report in as long as the query parameter to call the stored procedure under test, which makes me think that is executed before the startup process of design...
Please advise...
Thank you
Val
As this thread does no traction/attention of the team of SQL Developer for a while, I had to submit a request for formal improvement on metalink:
RE: 19834977 - IN THE UNIT TEST REQUEST TO ALLOW TO CHANGE THE ORDER OF EXECUTION OF THE START OF THE PROCESS
Thank you
Val
-
Sort on dynamic query problem!
Hello
I have a dynamic query written in pl/sql, when I check "Sort" for each field in the report attribute, error message resurrected as "ORA-01785: ORDER BY item must include the number of an expression in the SELECT list.
If I do not check sort, it works very well. In my applications, I need all the fields sorted by user, how do I solve this problem?
My query as below:
declare
Ask varchar2 (2000): = "select";
s_class varchar2 (1000);
cursor c1 is select * from demo_preference;
Start
for c1_val looping c1
If c1_val.login is not null then
query: query = | » ' || 'login ' | ',';
end if;
If c1_val.id is not null then
query: query = | » ' || 'id ' | ',';
end if;
.......
end loop;
query: = SUBSTR (query, 1, length (query)-1);
s_class: = ' (NVL (: P2_class, "%" |)) ''null%'') = ''%'' || "zero percent" OR
EXISTS (SELECT 1 FROM apex_collections WHERE collection_name = "P2CLASSCOL" AND class = c001))';
query: query = | » ' || ' from ming.reg_report_view1 where '.
|| ' ' || s_class;
Return (Query);
end;Maybe the internal column used when you clicked the sort is not indicated in the report. Try to use aliases when you build the query string, it might help apex internally to identify a column even if its order is changed to another user. After all, the order of the columns in the code is dynamic and I assume that even the number of displayed columns can vary that could sort on a column that is identified by a number not valid.
How about somewhere, displaying the report query so that you know what is the exact query processing, it could give you the best information on the problem.
If the problem persists, use a collection that is extracted these record using the same query string, then replace the report to view the collection and then set the sort column on. This way Summit could get confused about which columns are being sorted and it would just sort on a c001... C050 column as if it were a string (Yes problems with the number of sort columns when you do this).
-
Query/report asked for entry? in the Apex
Hello everyone, my name is John and I am asking for help with the following.
I am new to Apex, Oracle, PL/SQL, and SQL (as you can tell from my query below).
I have the basics of the Apex (to present reports, forms etc.).
I created this query on a view in SQL Developer, where it is asked for the start and end dates filter the report. which is what I want it to and returns the results I want.
Now, I want to create a report in the Apex where it asks him between the dates as it does in the request sent, when it's done I want to spend bipublisher to print pdf report.
I run this query as a report of totals already (without the line with WHERE clause query asking course.) in an apex application, gross is it.
I have it as interactive reports and can be filtered in this way dates of couse, but I want to learn how to create the report/query of type of user input in the Apex.
I read that I would need to use a "Block anonymous pl/sql with a" declare "and a process page?." " (confused gettting in variables "declare" and execute sections)
I looked at many samples and still haven't quite come down the blocks.
If you could point me in the right direction of where to go, or better still, if someone could show me coding on how to make this work in apex query/report (s)?
Learn slowly I suppose
I use APEX 3.1.2 on database 11g.
Thanks in advance for the help on this.
++++++++++++++++++++++++++++++++++++
-the truck view totals query-
Select
trucktotals.truck_number "truck number."
trucktotals. truck_type as "Type truck."
sum (trucktotals.end_miles - trucktotals.begin_miles) as "Total number of miles,"
sum (trucktotals.reg_hours + trucktotals.ot_hours) as 'Total hours. "
sum (trucktotals.total_net_tons) as 'Total tonnes. "
AVG (trucktotals.equip_rent) as "EQR P_HR' to 'trucktotals '.
where < strong > trucktotals.wage_date between to_date(:Start_date) and to_date(:end_date) < facilities >
Trucktotals.truck_number group, trucktotals.truck_type
order of trucktotals. Truck_Number - query end to view truck totals-+++
Published by: [email protected] on October 31, 2008 12:49
Published by: [email protected] on October 31, 2008 12:53
Published by: [email protected] on October 31, 2008 12:54Hi John,.
I am pleased that the information has helped.
About the pop up, you should try to avoid them if possible. You should really try to avoid if possible because most browsers have pop-up blockers. (I can ramble on about this topic for hours, but I'll leave it as one).
So how to avoid pop-ups in this situation? APEX can return conditionally regions. If you have a region "indicates the parameter" which has your in/thru date. which is always is evidence. Then put a condition on the report so that he sees only when the from and through date are entered (I think that I put an example above).
I would like to know how this happens.
M
-
How to dynamically change report style sheets in TestStand.
How to dynamically change report style sheets in TestStand.
-
Collection of the dynamic query
Hi All-
I'm trying to get the value of the collection through the dynamic query but I am facing some problem please let me know that I hurt.
Created a function like below to run the dynamic query to select statement
create or replace FUNCTION rfunGetColumnValue ( ColumnName VARCHAR2, TableName VARCHAR2, DefaultValue OUT VARCHAR2, Criteria VARCHAR2) RETURN VARCHAR2 IS ReturnValue VARCHAR2 (32767 byte) ; Stmt VARCHAR2 (32767 byte) ; BEGIN stmt := 'begin select '|| ColumnName || ' into :1 from table(:2) ' ||NVL ( Criteria, ' ') || ' Fetch First Row only ; EXCEPTION WHEN OTHERS THEN :2 := SQLERRM; end;' ; dbms_output.put_line (stmt) ; EXECUTE IMMEDIATE stmt USING OUT ReturnValue, OUT DefaultValue; --select Valueinto into Returnvalue from dual; RETURN ReturnValue; END;
Now, I created a folder in the Package
create or replace PACKAGE Collection_PKG is type Bank_rec is RECORD ( SNO NUMBER(10), BANKID NUMBER(5), BANKNAME VARCHAR2(50), BANKSC VARCHAR2(50), ADDEDIT varchar2(1), COMPID number(5), ISBULK number(1), ROWNO number(10), ERROR VARCHAR2(500) ); TYPE Bank_tbl IS TABLE OF Bank_rec; --type Bank_cur is ref cursor return Bank_rec; end Collection_PKG; end Collection_PKG; end Collec tion_PKG;
Now, when I'm Trying the code below
DECLARE V_EXECQUERYPARAM XMLTYPE:= XMLTYPE('<QueryParam> <BankXML> <Bank> <BankID>0</BankID> <BankSC><![CDATA[RCB]]></BankSC> <BankName><![CDATA[Royal challenger Bank]]></BankName> <IsBulk>0</IsBulk> <AddEdit>A</AddEdit> </Bank> </BankXML> </QueryParam>'); BEGIN Rspbanksave( v_SPParamList => V_EXECQUERYPARAM ); END;
create or replace PROCEDURE rspBankSave ( v_SPParamList XMLTYPE DEFAULT NULL) IS V_Addedit VARCHAR2 (1 CHAR) ; Bank_tbl Collection_PKG.BANK_TBL := Collection_PKG.BANK_TBL () ; BEGIN SELECT Row_number () OVER (ORDER BY 1), XT.BankID, XT.BankName, XT.BankSC, XT.AddEdit, v_CompID, XT.IsBulk, CAST (0 AS NUMBER (5)), CASE WHEN MBank.BankID IS NOT NULL THEN CASE WHEN XT.BankSC = MBank.BankSC AND XT.BankName = MBank.BankName THEN 'R104|Entry Already Exist,R114|Short Code Already Exist' WHEN XT.BankSC = MBank.BankSC THEN 'R114|Short Code Already Exist' WHEN XT.BankName = MBank.BankName THEN 'R104|Entry Already Exist' END ELSE NULL END Bulk collect INTO Bank_tbl FROM XMLTABLE ('//QueryParam/BankXML/Bank' PASSING v_SPParamList COLUMNS BankID NUMBER (5) PATH 'BankID', BankName VARCHAR2 ( 50) PATH 'BankName', BankSC VARCHAR2 ( 50) PATH 'BankSC', AddEdit VARCHAR2 ( 1) PATH 'AddEdit', IsBulk NUMBER (1) PATH 'IsBulk') XT LEFT JOIN MBank ON XT.BankID != MBank.BankID AND v_CompID = MBank.CompID AND (XT.BankSC = MBank.BankSC OR XT.BankName = MBank.BankName) ; v_TotalRowCount := SQL%ROWCOUNT; IF (v_TotalRowCount > 0) THEN BEGIN V_Addedit:=rfunGetColumnValue (ColumnName=> 'Upper(AddEdit)',TableName=>'table(Bank_tbl)',DefaultValue=>'',Criteria =>''); END; --SQL Code here END IF; END rspBankSave;
As I've suggested before:
To get the name of the table the column
and as others have:
Type global temporary Tables vs. table
If you give more context, more information about the bigger picture, more information about what you're trying to do and why you're going down the road you go down, you can return more useful information. But you seem reluctant to do.
For the moment, your recent posts seem to just raise the same type of question - why are you doing this?
The normal way to return data to a client is a refcursor.
It is the most effective way.
Not through collections that you seem to be put on the must-do approach.
-
Hello
I am trying to understand the procedure and on the inside, I have a dynamic query with where clause:
"Select."
tables
where 1 = 1
and instr (decode (nvl (' | nvl(pCATEG,'') |))) (("*"), "*", pb.categ, upper (' | nvl(pCATEG,'') |), pb.categ) > 0'
|| NVL(pEMP_GROUP_CODE,'') |
"and p.emp_group_code = g.emp_group_code';"
For it, clause make sense (parameter pEMP_GROUP_CODE is not connected to any condition, or I missed something)?
The procedure is works and connected to the application.
Please notify
Thank you
Daniel
Has been confused by "p.emp_group_code".
What you see is probably a lexical parameter, for example the value passed on s pEMP_GROUP_CODE a condition itself as 'and table.column = 'constant', which can be zero, so if you have a value, it adds a condition, otherwise just empty space and the condition is spared.
-
Need help tuninng a dynamic query
Hello
We have following question
Select s.* s bose_sites.registration_crm_serial_number
R2 bose_sites.registration_crm_serial_number left on join
s.serialnr = r2.shipserialnr
where s.shipserialnr is null
and (r2.serialnr = ' 052378332000138AE' or (s.serialnr =)
(( "052378332000138AE" and s.shipserialnr is null))
which takes about 40 seconds to execute with the values highlighted in bold being dynamic values
If anyone can help reduce the run time on this request.
There are indexes created on table
INDEX_NAME INDEX_TYPE
------------------------------ ---------------------------
IDX_REG_CRM_SER_NUM_CPC NORMAL
IDX_REG_CRM_SER_NUM_SHIPDATE NORMAL
IDX_REG_CRM_SER_NUM_PARENT_ID NORMAL
IDX_REG_CRM_SER_NUM_ID NORMAL
is it possible that we can capture a dynamic query using DBMS_SQLTUNE
all suggestions will be useful.
Hello
You have one table here
-------------------------------------------------------------------------------
Schema name: SYS
SQL ID: cf2875zz4q4nd
SQL text: select s.* bose_sites.registration_crm_serial_number s
R2 bose_sites.registration_crm_serial_number left on join
s.serialnr = r2.shipserialnr
where s.shipserialnr is null
and (r2.serialnr = '052378332000138AE' or (s.serialnr =
S.shipserialnr and "052378332000138AE" is null))
-------------------------------------------------------------------------------
then why don't you go for a simple query
HTH
-
HelloI use OBIEE 11.1.1.6.6.I have as guest
Date between: from and to
Country: USA, UK, IN...
Client: NAABB
Now could you please let me know how can I generate report from sub queries
-The host request-
SELECT count (*), RECEIVER_Cty_code of AAAAAAAA
"' where business_date > = 20 June 2013 ' and business_date < = 25 June 2013.
and MSG_IN_OUT_IND = 'SEND '.
and MSG_TYPE_CODE = '103 '.
and SENDER_Cty_code = 'En' (country prompt value)
and ADDL_REF_NO (sub ADDL_REF_NO query values)
RECEIVER_Cty_code group
order by 1 desc
-Void query-
Select distinct ADDL_REF_NO from AAAAAAAA
"' where business_date > = 20 June 2013 ' and business_date < = 25 July 2013."
and MSG_IN_OUT_IND = 'RECEIVE. '
and MSG_TYPE_CODE = '103 '.
and RECEIVER_Cty_code = 'En' (country prompt value)
and sender_Code = 'NAABB' (guest customer value)
order of the CSA 1
Could if it you please let me know how I can create report. First of all, I must select guest after that my sub query will run and get values.
Based on the values of query sub that I have to go to the main request. Main request. Give me the steps
Thank you
Gram
Hello
After setting the filter based on another analysis (query sub report) save the report and place them in the dashboard in the same way as the other reports.
create new section in the main report and make the report in section properties and query sub under type CSS Display: None. so that this report does not appear in the dashboard, but what ever the values you select in the guest of will reflected in the request from sub report reflected in the main report.
Note: Do not forget to protect the sub query report filter.
Select this option if useful/correct.
Thank you.
-
dynamic query for package does not work
Dear members,
I have problems with a package in the creation and analysis of a dynamic query in the WHERE clause. Here is an example of what I'm trying to do:
PROCEDURE test_status_proc)
wtd_cursor ON cur_type
date_1 IN date
date_2 IN DATE
status in VARCHAR2,
flag in VARCHAR2)
IS
status_sql VARCHAR2 (250): = NULL;
flag_sql Varchar2 (100): = NULL;
BEGIN
Status of the IF = 'A' THEN
lv_status_sql: = 'A ';
lv_flag_sql: = 'Y ';
END IF;
Status of the 'I' = IF THEN
lv_status_sql: = 'A ';
lv_flag_sql: = 'n';
END IF;
Status of the 'R' = IF THEN
lv_status_sql: = "R";
lv_flag_sql: ='* ';
END IF;
Status of the IF = n THEN
lv_status_sql: = 'n';
lv_flag_sql: ='* ';
END IF;
IF status_code = 'IRN' THEN
"lv_status_sql: = '('' N'','' R'');
lv_status_sql: = lv_status_sql | ' OR (s.status = s.flag = "A" AND "N")';
lv_usecalc_sql: ='* ';
END IF;
Status of the = IF'* ' THEN
lv_status_sql: ='* ';
lv_flag_sql: ='* ';
END IF;
OPEN FOR Test_cursor
SELECT * from test_status s
WHERE
s.Daytime BETWEEN date_1 AND date_2
S.status AND decode (lv_status_sql,'* ', s.status, lv_status_sql)
S.flag AND decode (lv_flag_sql,'* ', s.flag, lv_flag_sql);
The problem I have is especially with the condition 'IRN '. The suite WHERE the part of the clause looks like the following in the lv_status_sql, but the query returns all the values:
-(', 'R') OR (s.status = 'A' AND s.flag =' only)
Any help would be much appreciated.
Kind regardsdreporter wrote:
Thanks for your reply and I completely understand your frustration. The problem is sometimes it is very difficult to describe all of the problem due to several reasons. Please take a look at my last post to see if that makes sense.
If you really need SQL dynamic - true dynamic SQL which includes dealing with dynamic number of bind variables - then DBMS_SQL are an excellent interface to use.
You can generate the dynamic SQL statement based on the question of whether the filter criteria is null (do not use) or not null (use as a predicate). For example
if someParam10 is not null then // someParam10 needs to be used as a filter predicate dynamicSQL := dynamicSQL || ' and some_col_10 = :someParam10 '; end if;
This statement can then be analyzed using the DBMS_SQL interface. The binding of values uses the same logic that was used to create predicates. For example
if someParam10 is not null then // someParam10 is used and needs to be bound DBMS_SQL.Bind( myCursor, 'someParam10', someParam10 ); end if;
So, with this approach simplistic, you can easily create a dynamic SQL with variable predicates, dynamically bind these and run the slider.
Bind variables are used in the dynamic SQL statements, as there are very few threats of SQL injection. And the basic principles observed for shareable SQL creation - the same set of parameters not null to filter, will result in the same SQL statement, which allows the cursor within the Pool shared for this SQL statement to be reused.
So, technically, dynamic SQL is not a major problem (if used correctly). The major problem is that if really necessary to address the requirements of the business at hand.
The problem I have with many comments here want to use dynamic SQL statements, is that it is used as one would use a file i/o interface.
For file IO you want standard Open(), Read(), Write() and Close() calls. And you, the appellant, simply pass the name of the file and the data to write or to receive the data read.
Similarly, these posters want to use SQL to open a table and read and write the data column - and do it by calling simply (and dynamically) by specifying the name of the table and column. Approaches to dynamic SQL based on one such concept is wrong. And shows that much of the ignorance of what a RDBMS is and how to use an RDBMS.
-
Hi all;
Can u please help me on the following dynamic query code? I know that I'm missing the single quote around 2 dates, but could not understand where to put it! I tried to put 2 or 3 citations around 2 bind vars but in vain.
To create a dynamic query to simulate the following:
Select
EMPNO, ENAME, JOB, MGR, HIREDATE from emp where HIREDATE > = to_date('01/01/1981','MM/DD/YYYY') and DATERECRUTEMENT < = to_date('12/31/1982','MM/DD/YYYY');
dynamics of code:
declare
v_q varchar2 (4000);
Start
v_q: = "select ENAME, JOB, MGR, EMPNO, HIREDATE from emp;
V_q: = V_Q
|| ' where HIREDATE > = '
|| ' to_date (' |: P_DATE1 |) ',' ||''' MM/DD/YYYY "' | ' )'
|| "and HIREDATE < = '".
|| ' to_date (' |: P_DATE2 |) ',' ||''' MM/DD/YYYY "' | ' )';
-end of the sql
v_q: = v_q | « ; » ;
dbms_output.put_line ("East V_Q" |) V_Q);
end;
Thank you.
Zendeclare v_q varchar2(4000); v_rec emp%rowtype; v_cur sys_refcursor; begin v_q :='select EMPNO,ENAME,JOB,MGR,HIREDATE from emp '; V_q := V_Q || 'where HIREDATE >= to_date(:P_DATE1,''MM/DD/YYYY'') and HIREDATE <= to_date(:P_DATE2,''MM/DD/YYYY'')'; dbms_output.put_line ('V_Q is ' || V_Q); open v_cur for v_q using '01/01/1981', '12/31/1982'; loop fetch v_cur into v_rec.empno, v_rec.ename, v_rec.job, v_rec.mgr, v_rec.hiredate; exit when v_cur%notfound; dbms_output.put_line('empno = ' || v_rec.empno); dbms_output.put_line('ename = ' || v_rec.ename); dbms_output.put_line('job = ' || v_rec.job); dbms_output.put_line('mgr = ' || v_rec.mgr); dbms_output.put_line('hiredate = ' || to_char(v_rec.hiredate,'MM/DD/YYYY')); dbms_output.put_line('===================='); end loop; close v_cur; end; / V_Q is select EMPNO,ENAME,JOB,MGR,HIREDATE from emp where HIREDATE >= to_date(:P_DATE1,'MM/DD/YYYY') and HIREDATE <= to_date(:P_DATE2,'MM/DD/YYYY') empno = 7499 ename = ALLEN job = SALESMAN mgr = 7698 hiredate = 02/20/1981 ==================== empno = 7521 ename = WARD job = SALESMAN mgr = 7698 hiredate = 02/22/1981 ==================== empno = 7566 ename = JONES job = MANAGER mgr = 7839 hiredate = 04/02/1981 ==================== empno = 7654 ename = MARTIN job = SALESMAN mgr = 7698 hiredate = 09/28/1981 ==================== empno = 7698 ename = BLAKE job = MANAGER mgr = 7839 hiredate = 05/01/1981 ==================== empno = 7782 ename = CLARK job = MANAGER mgr = 7839 hiredate = 06/09/1981 ==================== empno = 7839 ename = KING job = PRESIDENT mgr = hiredate = 11/17/1981 ==================== empno = 7844 ename = TURNER job = SALESMAN mgr = 7698 hiredate = 09/08/1981 ==================== empno = 7900 ename = JAMES job = CLERK mgr = 7698 hiredate = 12/03/1981 ==================== empno = 7902 ename = FORD job = ANALYST mgr = 7566 hiredate = 12/03/1981 ==================== empno = 7934 ename = MILLER job = CLERK mgr = 7782 hiredate = 01/23/1982 ==================== PL/SQL procedure successfully completed. SQL>
SY.
-
30EA2 - UNIT TESTING - value dynamic query truncating dates time.
So I use the installation of SQL Developer Unit Testing (very nice by the by) for a bit now and just recently upgraded to the latest beta version (3.0.02.83). Looks like a bug has been introduced by which the dynamic query of value are truncate all time of all DATE data type information.
This causes sadness serious for my current test cases and for me since I have to go back to the previous beta version :)I noticed that, in the new 30EA2 parameter:
AddVMOption - Doracle.jdbc.mapDateToTimestamp = false
has been introduced by default in
[SQLDEveloper_install_dir]/sqldeveloper/bin/sqldeveloper.conf
Perhaps it has something to do with the behavior of incorrect date, try to remove the parameter and check again.
-
Hai I want dynamic query for framing
HORN must be updated using dynamic queryCREATE TABLE PI4 (COR varchar2(1),dep varchar2(3),cod_rc varchar2(2)) insert into pi4(dep,cod_rc) values('A01','5C') insert into pi4(dep,cod_rc) values('DAC','5L')
as below
sql_stament is that the variable must be set to above code.UPDATE PI4 SET PI4.COR = ’O’ WHERE PI4.DEP IN ('A01','A02','A03') OR ( PI4. dep IN ('DAC','FTS','G12') AND PI4.COD_RC = '5L' )
Pls help
SCheck below the code where the CO value is assigned dynamically to a p_cor variable
DECLARE v_sql_statement VARCHAR2(32767) := NULL; p_cor VARCHAR2(10) := 'O'; BEGIN v_sql_statement := 'UPDATE PI4 SET PI4.COR ='||p_cor||' WHERE (PI4.DEP IN (''A01'',''A02'',''A03'') OR (PI4. dep IN (''DAC'',''FTS'',''G12'') AND PI4.COD_RC = ''5L''))'; EXECUTE IMMEDIATE v_sql_statement; END;
If you do not need dynamic query to perform the update:
See the code below:
DECLARE p_cor VARCHAR2(10) := 'O'; BEGIN UPDATE PI4 SET PI4.COR =p_cor WHERE PI4.DEP IN ('A01','A02','A03') OR (PI4. dep IN ('DAC','FTS','G12') AND PI4.COD_RC = '5L')); END;
Published by: AP on July 27, 2010 03:39
Published by: AP on July 27, 2010 04:51: end tag code included
-
Hello, can someone tell if there is a limit on how long the query string can be "Shared Components\Report Queries\Edit Query report". Is there a limit of 4K? When I get back a query that is about 5K and when I hit "Test Report" button I get error:
ORA-06502: PL/SQL: digital or value error: character string buffer too small
If I cut the request less than 4 K, it seems to work.
GeorgeNormal fields in Word RTF are like this: , you just need to insert this manually, put the around="" your="" field="" that="" is="" coming="" into="" the="" rtf="" from=""?>
Thank you
Tony Miller
Webster, TX
Maybe you are looking for
-
I need help syncing iPhone 6 iPhone in iTunes.
-
When I go to c - span.org and try clicking on c-span, 1,2 or 3, I get a white screen instead of the video. On PBS.org when I try to tell a Frontline video I get a white screen but no video. This happens with several websites that show video. I have b
-
All the links and scroll controls on the top 1 inch of the active window do not respond. Down below this limit of 1 inch and all the links and scroll commands work. When will this be fixed?
-
Toshiba satellite pro m30 USB problem
I have toshiba satellite pro m30 and HP scanjet 4600 scanner.when I connect the scanner directly to the notebok with its ' original usb cable there is no problem. But if I connect the scanner to the laptop with a laptop usb extension cable cannot ini
-
I just got the latest adapters of goal for the F5 for B4 lenses - the B4S16PL and the LAFZP12PL. I have them sitting correctly, but they will not allow my lenses backfocus. What is the problem here?