Custom on-the-fly SQL statement
Is it possible to build the dynamic SQL statement in the DB adapter on the fly?You can do bulk collect and return the collection of pl/sql procedure.
Prasanna-
Tags: Fusion Middleware
Similar Questions
-
Hello
I have a question about using the option 'on the fly' and ' "retain the memory and displays most recent result" "option. As I undertood the support of NEITHER and Teststand documentation, the option 'on the fly' allow you to present your results during the execution of your test. It also allows the RAM used remain constant because after each step, the ResultList should be released.
So. It is the theory. In practice, I increased my RAM used regardless of the settings I use. Because I use tests which are conducted for several days, the collection of results makes the RAM increases so much that Teststand cling or works really very slowly, if it is not crashing...
I did a few tests (see attachment). By setting different options, I run my test why SequencialModel for 1 minute and measure the RAM before and after execution. (the first time just before I have that on the "OK" button of the dialog information of the object to be measured, the second time just after I put an end to the hand in the execution of the test). Between each test, I restart Teststand. I measure the RAM using Windows Task Manager.
My PC is a Win XP SP2 and I use Teststand 4.1.1 (but the problem still exists Teststand 3.5...)
Test 1:
'on the fly of statement' option NOT selected
the "keep memory and only the last results display" option is NOT selected
Report type is ASCII and all results must be reported
Task Manager:
Used RAM at the beginning: 651 MB
Used RAM after a minut: 716 MB (+ 65 MB!)
#Results: 31420
==> + 2, 12 MB/result
Test 2:
'on the fly of statement' option selected
the "keep memory and only the last results display" option is NOT selected
Report type is ASCII and all results must be reported
Used RAM at the beginning: 646 MB
Used RAM after a minut: 681 MB (+ 35 MB!)
#Results: 4969
==> + 7, 21Mo/result
Test 3:
'on the fly of statement' option selected
the "keep the memory and display only the most recent results" option selected
Report type is ASCII and all results must be reported
Used RAM at the beginning: 662 MB
Used RAM after a minut: 681 MB (+ 19 MB!)
#Results: 4969
==> + 3, 24MO/result
Conclusion:
Selected by the "on the fly report" with or without the option "Maintain the memory and display only the most recent results", the RAM used by each result is greater than if you do not select the option "on the fly report." Also probably Teststand generates the report at run time, but independent more important on the parameters of the RAM option is ALWAYS increasing.
So is this a bug or is this a feature?
Does anyone have experience with the "on the fly report?
Bye,.
Risotto
Hi Norbert,.
Thanks, thanks and thanks again! It was the solution!
If you set "on the fly report" + "keep memory and only display last results" AND activate 'Throw results or disable results when not required by model' then the behavior of the RAM used is as you explained: it begins to increase, but after some time remain constant.
With her so I have a solution, very well!
Only comments in support OR in general this option seems to be implemented in Teststand for several years (Teststand 2.0 can be?) and I spent weeks already on the search for a solution to this problem of memory. OK, maybe I was really long to understand how do, but on the other side I spend so much time reading of the documentation, speaking with the support of NOR and the support OR so past time send me examples and documentation. I think for a question like how to manage reports and the memory of test which are lasting several days, support should be able to give me an answer and it must be clear in the documentation how to make the adjustment.
In any case, I'm happy you could have help me. Thank you once again!
Risotto
-
Run the second sql statement only if the first sql statement is set to zero.
Hey guys I seem to have a mental block here. I have two sql statements. I would like to than the second to run only if the first sql statement is set to zero. I know that I can use PLsql but I would really like to see if I can do this with sql upward. Your answers are very much appreciated.
This is the first sql
second sql statementSelect ft.fund_code, ft.orgn_code, ft.acct_code, ft.amount, fb.owner_pidm, ft.prog_code from ftrbremb fb , ftcractg ft where fb.doc_code = 'TR000038' and fb.ftpbport_id = ft.ftpbport_id
How can I combine these two statements together so that when the first is null the second run. As a bonus, I want to get just the first line as well.Select ft.fund_code, ft.orgn_code, ft.acct_code, ft.amount, fb.owner_pidm, ft.prog_code from ftrbremb fb , ftcractg ft, ftprexps fx where fb.doc_code = 'TR000038' --and fb.ftpbport_id = ft.ftpbport_id and fx.ftrbremb_id = fb.id and ft.ftprexps_id = fx.id;
Any help would be greatly appreciated. I tried to accomplish with the case statement but it dosent everything seems to work for me.
Thank youMiguel,
the idea is simple: join the two queries (via the union of all) and to change the second part as to return only the rows if the first query returns no rows by changing the NOT EXISTS (first request). Hope I made it clear... ;)
-
How to see all passed to the db sql statements?
Is it possible to configure Jdevloper (11.1.1.4) in a way so that it shows all the sql statements in the console?
THX in advance
You have restarted your WLS instance in debug mode?
-
execute the dynamic sql statement
Hi all
CREATE TABLE XX_OFFICE_USER_IMP ( ID NUMBER, OFFICE VARCHAR2(10 BYTE), USER_NAME VARCHAR2(10 BYTE), BANK_ACCOUNT_ID NUMBER, TRANSFERED NUMBER )
Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (421,'0000','F0000',10029,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (422,'0000','F0000',10031,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (423,'0000','F0000',10033,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (424,'0000','F0000',10036,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (425,'0000','F0000',10037,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (426,'0000','F0000',10039,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (427,'0000','F0000',10041,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (428,'0000','F0000',10046,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (429,'0000','F0000',10048,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (430,'0000','F0000',10067,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (431,'0000','F0000',10072,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (432,'0000','F0000',10087,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (433,'0000','F0000',10092,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (434,'0000','F0000',10008,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (435,'0000','F0000',10012,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (436,'0000','F0000',10013,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (437,'0000','F0000',10014,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (438,'0000','F0000',10017,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (439,'0000','F0000',10019,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (440,'0000','F0000',10024,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (441,'0000','F0000',10025,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (442,'0000','F0000',10001,null); Insert into xx_office_user_imp (ID,OFFICE,USER_NAME,BANK_ACCOUNT_ID,TRANSFERED) values (443,'0000','F0000',10002,null);
CREATE TABLE XXBG_CASIER_CASH ( CASHIER VARCHAR2(32 BYTE), BANK_ACCOUNT_ID NUMBER(38,0) )
After execute the PL/SQL block I get the message:declare v_exe_grant varchar2(32767 char); begin for i in (select * from xx_office_user_imp where office = '0000') loop insert into XXBG_CASIER_CASH values (i.user_name, i.bank_account_id); v_exe_grant := 'create user ' || i.user_name || ' identified by ' || i.user_name || ';' || 'GRANT create session to ' || i.user_name || ';' || 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_USER TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.dFND_DESCR_FLEX_COL_USAGE_TL TO ' || i.user_name || ';' || 'GRANT select on apps.fnd_descr_flex_column_usages to ' || i.user_name || ';' || 'GRANT select on apps.fnd_descriptive_flexs to ' || i.user_name || ';' || 'GRANT select on apps.fnd_descriptive_flexs_tl to ' || i.user_name || ';' || 'GRANT select on ce.ce_statement_headers to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.fnd_doc_sequence_assignments TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.CE_STATEMENT_HEADERS_S TO ' || i.user_name || ';' || 'GRANT EXECUTE ON APPS.XXBG_GET_NEXTVAL TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT select on apps.CE_BANK_ACCOUNTS to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.CE_BANK_BRANCHES_V TO ' || i.user_name || ';' || 'GRANT SELECT ON CE.XXBG_CASIER_CASH TO ' || i.user_name || ';' || 'GRANT EXECUTE ON APPS.XXBG_ST TO ' || i.user_name || ';' || 'GRANT select on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.ce_transaction_codes TO ' || i.user_name || ';' || 'GRANT select on ce.ce_statement_lines_s to ' || i.user_name || ';' || 'GRANT SELECT ON CE.XXBG_CE_STATEMENT_LINES_DET_SQ TO ' || i.user_name || ';' || 'GRANT select on apps.xx_pko_lines to ' || i.user_name || ';' || 'GRANT SELECT ON apps.xx_rko_lines TO ' || i.user_name || ';' || 'GRANT select on apps.XX_INVOICE_RELATIONS_CASH to ' || i.user_name || ';' || 'GRANT select on APPS.PO_VENDOR_SITES_ALL to ' || i.user_name || ';' || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE_S to ' || i.user_name || ';' || 'GRANT select on ap.AP_INVOICE_LINES_INTERFACE to ' || i.user_name || ';' || 'GRANT select on APPS.ap_distribution_set_lines_all to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE_S TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_DISTRIBUTION_SETS_ALL TO ' || i.user_name || ';' || 'GRANT select on apps.ce_lookups to ' || i.user_name || ';' || 'GRANT select on ar.HZ_CUST_SITE_USES_ALL to ' || i.user_name || ';' || 'GRANT select on ar.HZ_LOCATIONS to ' || i.user_name || ';' || 'GRANT select on ar.HZ_PARTIES to ' || i.user_name || ';' || 'GRANT select on ar.HZ_PARTY_SITES to ' || i.user_name || ';' || 'GRANT SELECT ON AR.HZ_CUST_ACCT_SITES_ALL TO ' || i.user_name || ';' || 'GRANT SELECT ON AR.HZ_CUST_ACCOUNTS TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_CLAIMS_V TO ' || i.user_name || ';' || 'GRANT select on apps.xxbg_insis_agents_v to ' || i.user_name || ';' || 'GRANT select on ce.xxbg_cash_doc_types to ' || i.user_name || ';' || 'GRANT select on AP.AP_BANK_ACCOUNTS_ALL to ' || i.user_name || ';' || 'GRANT SELECT ON AP.AP_BANK_BRANCHES TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.FND_DESCR_FLEX_CONTEXTS_TL TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_SUPPLIERS to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.per_employees_x TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.fnd_doc_seq_categories_ap_v TO ' || i.user_name || ';' || 'GRANT SELECT ON APPS.AP_LC_INVOICE_TYPES_V to ' || i.user_name || ';' || 'GRANT SELECT ON ce.xxbg_ce_statement_lines_sq to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_STATEMENT_HEADERS_CASH to ' || i.user_name || ';' || 'GRANT SELECT ON APPS.XXBG_INSIS_POLICY_V TO ' || i.user_name || ';' || 'GRANT insert ON ce.ce_statement_lines to ' || i.user_name || ';' || 'GRANT INSERT ON CE.XXBG_CE_STATEMENT_LINES_DETAIL TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.AP_INVOICES_INTERFACE TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.AP_INVOICE_LINES_INTERFACE TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.XX_RKO_LINES TO ' || i.user_name || ';' || 'GRANT INSERT ON APPS.XX_PKO_LINES TO ' || i.user_name || ';' || 'GRANT delete on ce.xxbg_ce_statement_lines_detail to ' || i.user_name || ';' || 'GRANT update on ce.XXBG_CE_STATEMENT_LINES_DETAIL to ' || i.user_name || ';' || 'GRANT DELETE ON CE.CE_STATEMENT_LINES TO ' || i.user_name || ';' || 'GRANT INSERT ON CE.CE_STATEMENT_HEADERS TO ' || i.user_name || ';' || 'GRANT update on CE.CE_STATEMENT_HEADERS to ' || i.user_name || ';' || 'GRANT update on ce.CE_STATEMENT_LINES to ' || i.user_name || ';' || 'GRANT select on apps.XX_AGENTS_NO_V to ' || i.user_name || ';' ; execute immediate v_exe_grant; update xx_office_user_imp set transfered = 1 where id = i.id ; v_exe_grant := ''; end loop; end; /
Any ideas? I think I call correct immediate execution.Error report: ORA-00911: invalid character ORA-06512: at line 79 00911. 00000 - "invalid character" *Cause: identifiers may not start with any ASCII character other than letters and numbers. $#_ are also allowed after the first character. Identifiers enclosed by doublequotes may contain any character other than a doublequote. Alternative quotes (q'#...#') cannot use spaces, tabs, or carriage returns as delimiters. For all other contexts, consult the SQL Language Reference Manual. *Action:
DB version: 11g
Unfortunately I can't provide you the sql code of the other tables to create their... Maybe you should try without all budgets... :)
Thanks in advance,
Bahchevanov.
Edited by: bahchevanov on 11 October 2012 06:14Bahchevanov wrote:
Any ideas?Sure. EXECUTE IMMEDIATE executes a unique statement when you try to run the job. So use:
execute immediate 'create user ' || i.user_name || ' identified by ' || i.user_name; execute immediate 'GRANT create session to ' || i.user_name; execute immediate 'GRANT select on apps.XXBG_CE_STATEMENT_HEADERS_CASH to ' || i.user_name; . . .
SY.
-
Use of ROWID in the Update SQL statement
Hi all
I have an update statement that uses the rowid column to make the selection on the target table. Since a rowid represents the physical location of a row on disc, we know that this reference may change when various activities are conducted on the line of database/table/etc...
Here is an example of the statement I post:
UPDATE tabA outertab SET col1 = 'value '.
WHERE EXISTS (SELECT 1 FROM tabA innertab WHERE outertab.) ROWID = outertab. ROWID AND...)
Of course, the inner query is more complicated and uses other tables etc. but for the purposes of the example we don't need to include the details.
My question is: what help rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?
In response to the question that will follow this post: 'why don't you just use a PK', we would like to avoid to maintain a PK on the table that we are talking about very large volumes of data and we do not want to have to appeal to a sequence, if we can avoid when we insert the data. If however there is a risk that this Update statement may fail, or update lines badly, then we might have to use a PK.
I know there are a lot of discussions about this, but I havnt been able to find one that someone answered with any kind of confidence or clarity, any help would be appreciated.
Thank you
Keith
Edited by: Turtle on March 5, 2009 05:24When using rowid in a single statement SQL as a reference of a subquery in the outer statement is there a risk that outdoor activities can change the rowid and these changes be reflected in the session database that my query is executed which causes an incompatibility between the clause SQL internally and externally?
No, it's safe to use rowid in this query type. Docs
A line assigned ROWID remains unchanged, unless the line is exported and imported using the import and export utilities. When you delete a row in a table, then commit the transaction enclosing, rowid of the deleted row can be attributed to a line inserted in a subsequent operation.
-
Plans of multiple executions for the same SQL statement
Dear experts,
awrsqrpt. SQL shows several plans for a single SQL statement executions. How is it possible that a single SQL statement will be several Plans of executions within the AWR report.
Here is the output of the awrsqrpt for your reference.
Your contribution is very much appreciated.WORKLOAD REPOSITORY SQL Report Snapshot Period Summary DB Name DB Id Instance Inst Num Release RAC Host ------------ ----------- ------------ -------- ----------- --- ------------ TESTDB 2157605839 TESTDB1 1 10.2.0.3.0 YES testhost1 Snap Id Snap Time Sessions Curs/Sess --------- ------------------- -------- --------- Begin Snap: 32541 11-Oct-08 21:00:13 248 141.1 End Snap: 32542 11-Oct-08 21:15:06 245 143.4 Elapsed: 14.88 (mins) DB Time: 12.18 (mins) SQL Summary DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 Elapsed SQL Id Time (ms) ------------- ---------- 51szt7b736bmg 25,131 Module: SQL*Plus UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND TEST_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 ) ------------------------------------------------------------- SQL ID: 51szt7b736bmg DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> 1st Capture and Last Capture Snap IDs refer to Snapshot IDs witin the snapshot range -> UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL,0) + NVL(AC... Plan Hash Total Elapsed 1st Capture Last Capture # Value Time(ms) Executions Snap ID Snap ID --- ---------------- ---------------- ------------- ------------- -------------- 1 2960830398 25,131 1 32542 32542 2 3834848140 0 0 32542 32542 ------------------------------------------------------------- Plan 1(PHV: 2960830398) ----------------------- Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 Stat Name Statement Per Execution % Snap ---------------------------------------- ---------- -------------- ------- Elapsed Time (ms) 25,131 25,130.7 3.4 CPU Time (ms) 23,270 23,270.2 3.9 Executions 1 N/A N/A Buffer Gets 2,626,166 2,626,166.0 14.6 Disk Reads 305 305.0 0.3 Parse Calls 1 1.0 0.0 Rows 371,735 371,735.0 N/A User I/O Wait Time (ms) 564 N/A N/A Cluster Wait Time (ms) 0 N/A N/A Application Wait Time (ms) 0 N/A N/A Concurrency Wait Time (ms) 0 N/A N/A Invalidations 0 N/A N/A Version Count 2 N/A N/A Sharable Mem(KB) 26 N/A N/A ------------------------------------------------------------- Execution Plan ------------------------------------------------------------------------------------------------ | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | ------------------------------------------------------------------------------------------------ | 0 | UPDATE STATEMENT | | | | 1110 (100)| | | 1 | UPDATE | TEST | | | | | | 2 | TABLE ACCESS FULL | TEST | 116K| 2740K| 1110 (2)| 00:00:14 | | 3 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 5 (0)| 00:00:01 | | 4 | INDEX RANGE SCAN | ACCT_DT_ACC_IDX | 1 | | 4 (0)| 00:00:01 | ------------------------------------------------------------------------------------------------ Plan 2(PHV: 3834848140) ----------------------- Plan Statistics DB/Inst: TESTDB/TESTDB1 Snaps: 32541-32542 -> % Total DB Time is the Elapsed Time of the SQL statement divided into the Total Database Time multiplied by 100 Stat Name Statement Per Execution % Snap ---------------------------------------- ---------- -------------- ------- Elapsed Time (ms) 0 N/A 0.0 CPU Time (ms) 0 N/A 0.0 Executions 0 N/A N/A Buffer Gets 0 N/A 0.0 Disk Reads 0 N/A 0.0 Parse Calls 0 N/A 0.0 Rows 0 N/A N/A User I/O Wait Time (ms) 0 N/A N/A Cluster Wait Time (ms) 0 N/A N/A Application Wait Time (ms) 0 N/A N/A Concurrency Wait Time (ms) 0 N/A N/A Invalidations 0 N/A N/A Version Count 2 N/A N/A Sharable Mem(KB) 26 N/A N/A ------------------------------------------------------------- Execution Plan --------------------------------------------------------------------------------------------- | Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time | --------------------------------------------------------------------------------------------- | 0 | UPDATE STATEMENT | | | | 2 (100)| | | 1 | UPDATE | TEST | | | | | | 2 | TABLE ACCESS BY INDEX ROWID| TEST | 1 | 28 | 2 (0)| 00:00:01 | | 3 | INDEX RANGE SCAN | TEST_DT_IND | 1 | | 1 (0)| 00:00:01 | | 4 | TABLE ACCESS BY INDEX ROWID| ACCT | 1 | 26 | 4 (0)| 00:00:01 | | 5 | INDEX RANGE SCAN | INDX_ACCT_DT | 1 | | 3 (0)| 00:00:01 | --------------------------------------------------------------------------------------------- Full SQL Text SQL ID SQL Text ------------ ----------------------------------------------------------------- 51szt7b736bm UPDATE TEST SET TEST_TRN_DAY_CL = (SELECT (NVL(ACCT_CR_BAL, 0) + NVL(ACCT_DR_BAL, 0)) FROM ACCT WHERE ACCT_TRN_DT = (:B1 ) AND PB RN_ACC_NB = ACCT_ACC_NB(+)) WHERE TEST_BATCH_DT = (:B1 )
Thank you for taking your time to answer my question.
ConcerningOracle Lover3 wrote:
How will I know (from Plan 1 and Plan 2) whose execution plan chose for the current run?Since you're already on 10.2, you can identify the actual execution plan by checking in V$ SESSION SQL_ID and SQL_CHILD_NUMBER column. This can be used to identify the plan in V$ SQL_PLAN (columns SQL_ID and CHILD_NUMBER) and in 10g, you can use the convenient DBMS_XPLAN. Function DISPLAY_CURSOR for the information of the real plan using these two parameters.
Kind regards
RandolfOracle related blog stuff:
http://Oracle-Randolf.blogspot.com/SQLTools ++ for Oracle (Open source Oracle GUI for Windows):
http://www.sqltools-plusplus.org:7676 /.
http://sourceforge.NET/projects/SQLT-pp/ -
Save a custom on-the-fly Web site.
How should be done on the registration of the details of a Web site that a user has built on the fly.
For example: a user can choose the number of rows and columns, and in every facet, they add a control.
Once the user has "built" Web site by using the controls on the Web site, what is the best way to save all this information?
I could intercept the JSP source and save to file system - or I'll better save a description of the Web site to an xml file and creating a JSP file whenever the user requests the page again?See a Page flow in a loading by program area however, it is really sad, MDS would have been perfect for that.
~ Simon
-
encoding for spaces in the url in an in the report sql statement
1. what function or process use to code for empty spaces in a url link in a report?
I need to link a report to a 2nd report and pass 5 variables. I think I need to do by integrating my own url in the sql code for the report, given that the standard State is defined for only 3 variables to pass.
One of my variables as partner_firm has spaces, so how do I encode this in the query. Currently I have the following (simplified...).
Select partner_firm,
distinct_events County (separate event),
"< a href =" f? p = 18509:4: & SESSION. : NO:4:P4_PARTNER_FIRM, P4_QUARTER, P4_CATEGORY, P4_PRODUCT_CATEGORY, P4_EVENT:' |
partner_firm |
2 c & P3_QUARTER.%2C & P3_CATEGORY.%2C & P3_PRODUCT_CATEGORY.%2C & P3_EVENT. » >' ||
Count (distinct Lower (attendee_email)). '< /a >' distinct_attendees
of all_events...
but partner_firm spaces that are returned. I think there's the way that I can code for this?
Thank you
StephenOf course there are:
Select apex_util.url_encode ('http://ww.oracle.com/') of doubleGreetings,
Roel
http://roelhartman.blogspot.com/
You can reward this response in marking it as useful or Correct ;-) -
For the CASE of the Oracle SQL statement problem
Follwing query run without any problem in oracle 12 c.
SELECT
BOX to_number (sysdate ' on()
WHEN 6 THEN to_char(sysdate,'ww')+1
WHEN 2 THEN to_char(sysdate,'ww')+1
ELSE to_char(sysdate,'ww')+ 1 END
FROM dual
But the request fails below. Only change is WHEN 6 THEN to_char (sysdate 'ww') + 2
SELECT
BOX to_number (sysdate ' on()
WHEN 6 THEN to_char(sysdate,'ww')+2
WHEN 2 THEN to_char(sysdate,'ww')+1
ELSE to_char(sysdate,'ww')+ 1 END
FROM dual
Data fault is ORA-01722 invalid number
Hello
Try below.
SELECT
CASE to_number (to_char(sysdate,'D'))
WHEN 6 THEN to_char (sysdate, "ww") + 2
WHEN 2 THEN to_char (sysdate, "ww") + 1
END of ANOTHER to_char (sysdate, "ww") + 1
OF the double
-
Hi, I want to know what updates occur during the night, so I can run it through a plan to explain and try to tune them (11.2). I have not any auditIve looked in v$ _sql_plan, but can't make much sense of it. Is there an easy way to find out what went?
Thank you very much
Adam
885842 wrote:
Hi, I want to know what updates occur during the night, so I can run it through a plan to explain and try to tune them (11.2). I have not any audit
Ive looked in v$ _sql_plan, but can't make much sense of it. Is there an easy way to find out what went?
Thank you very much
Adam
REDO contains any DML history.
Dbms_logmnr can provide details for any & all the UPDATE instructions
-
Can I use dbadapter for enter the SQL on the fly?
I'm tired of creating so many links of sponsors adapter db for minor variations of sql statements. I was hoping "custom sql" would allow me to enter the SQL on the fly or in charge of parameters to fill in the runtime. However, it seems to me that it runs only the hard-coded statement, that I entered when the partner link was generated. When I added invoke for the service, I noticed he sought an input variable. I assigned a sql statement on the fly before calling, but he did nothing.
Does anyone have a solution? Maybe I'm looking a phatom solution that does not exist.
Thank you!When you create an SQL statement with the custom sql option, you can use? or # as placeholders for parameters. Each placeholder will have an associated element in the schema that is created for the sql statement. It is my experience that the values passed in via string parameters are treated as string literals, it is as if they are wrapped in single quotes.
I tested it by implementing a custom sql statement: "select? applications. " I spent as the value of the "Name" parameter and received a set of results containing several lines containing 'name '. Meaning of the statement that was executed was "select 'Name' applications '.
So you can get it works one way limited, if you represent the injected apostrophes, but I don't think that you will be able to spend in the entire sql statements. Which is probably a good thing that you may be exposed to sql injection attacks.
-
Get the SQL statement error programmatically
Hello
error SQL in the FORMS, you can display the erroneous SQL statement pressing (shift) (Ctrl) E on the screen. Is there a way to get the text of the SQL statement in a PL/SQL function for logging purposes?
I get the error using SQLERRM, it's not a problem. But how can I get the SQL text of the statement?
Thanks and regards,
Sascha
Sascha,
You should be able to use the: SYSTEM. System LAST_QUERY variable forms.
Craig...
-
FDM generated SQL statement in the log file?
Hello everyone, hopefully a simple question:When you perform an import using FDM, I know that behind the scenes of a SQL SELECT statement statement composed and performed on the database server. My question: the actual SQL statement is retained in a newspaper somewhere (so that we can see it?) In our case, it's an Oracle DB server and we use the ERPI adapter; not sure if it's relevant. We would like to enter this SQL statement and use it as a starting point for other things.
Thanks in advance for anything you can offer.
The statement SQL is not written in the journal of the adapter. The only things that are registered are what show in the file card log if you enable loggin to the adapter source ERPi in action 'Get Data'.
-
Word key missing in to_number conversion in the SQL statement select error
ORA-00905: lack keyword for the below SQL statement error. It should be of to_number (m.EQUIP_SUB_CLASS_ID, '9999')
between 3800 and the 3699 where Clause. Is that what I miss in the SQL below?
SELECT M.EQUIP_NO,M.EQUIP_CLASS_ID, M.EQUIP_DESCR,M.ORG_ID from MAMIS.EQUIP M where M.EQUIP_NO in ( SELECT M.EQUIP_NO from MAMIS.EQUIP M, MAMIS.ORG O where upper(M.ORG_ID) like upper(O.ORG_ID) and length(replace(translate(M.EQUIP_SUB_CLASS_ID, '0123456789', '000000000'), '0')) is null and upper(M.fleet_status) like 'ACTIVE' and upper(M.ORG_ID) not like 'NA' and to_number(m.EQUIP_SUB_CLASS_ID , '9999') between 3699 and 3800 )
Hello
I don't see obvious errors.
Whenever you have a problem, please post a full test script that people can run to recreate the problem and test their ideas. Include CREATE TABLE and INSERT statements for all of the tables involved and the results desired from these data. Format your code so people can read and understand.
See the FAQ forum {message identifier: = 9360002}I saw a couple of things you need to know about Oracle, but none of them would cause an error "Missing key word".
There is no point in using the LIKE operator if you do use wildcards. For example
upper (M.fleet_status) like 'ACTIVE'
is slower than, but otherwise equivalent to
upper (M.fleet_status) = 'ACTIVE'
What are you trying to do here?
length ( replace ( translate ( M.EQUIP_SUB_CLASS_ID , '0123456789' , '000000000' ) , '0' ) ) is null
Want to see if m.equip_sub_class_id consists only of numbers, from ' 0 'to 9'?
If so, you can simply sayTRANSLATE ( m.equip_sub_class_id , 'X0123456789' , 'X' ) IS NULL
Depending on your front end, you may need a sem, i-colon (;) the end of your query.
Maybe you are looking for
-
other devices (yellow question mark) ethernet controller. docking station
I have 2 laptops, two T2400 MPC. A laptop works fine in the MPC TransPort station. My newly re-installed windows XP laptop has no internet connection LAN when it is docked. the material found continues to rise, there is no driver for the docking
-
Error code: 66A (impossible to install the security update)
It will not install updated security, every time that start us PC, update downloads, but will not be installed. 66A error code is displayed, apparently unknown error.
-
"Messages of Instruction FTR" rule, by default, it does no alarm. I have configured alarm e-mail action. But I would like to configure the e-mail recipient to send the alert to different users based on the name of RDF statement. Any ideas how can I c
-
I'm spending some old HP/3Com switches for some new Dell PowerConnect 62xx and 55xx switches v1910. The EPS and the 55xx all have a function of 'YES' where I can specify that the first six characters of my IP phone manufacturer mac address so that t
-
Restore permanently deleted the folder
Hi, I am on Windows 7. I accidentally deleted pemanently my save game folder the Sims 3 to My Documents in the c: directory. Is any way to restore it? I'm so desperate, I tried using many file recovery programs but cannot find the savegame folder. I