procedure that will dynamically build the query data and table Medallion
Hi people,I write a procedure that dynamically build the query data and insert in the table "dq_summary".
enforcement procedure with success and data not inserted into the table 'dq_summary '.
I have thin problem in code attached below
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOR rep IN cur_di_attr
LOOP
dbms_output.put_line ('d: ');
BEGIN
EXECUTE IMMEDIATE 'SELECT table_name FROM ' || sum_tab || ' WHERE id = ' || rep.attribute_id INTO rep_tab;
dbms_output.put_line ('rep_tab: '||rep_tab);
run_query := run_query || ' ' || rep_tab || ' WHERE ' || nvl(wh_cond, '1 = 1');
EXECUTE IMMEDIATE run_query INTO end_rslt;
EXECUTE IMMEDIATE 'UPDATE dq_summary SET ' || prop || '_' || p_code || ' = ' || end_rslt || ' WHERE attribute_id = ' || rep.attribute_id;
dbms_output.put_line ('e: ');
dbms_output.put_line ('rep_tab: '||rep_tab);
dbms_output.put_line ('end_rslt: '||end_rslt);
dbms_output.put_line ('f: ');
EXCEPTION
WHEN no_data_found THEN
rep_tab := '';
sum_tab := '';
END;
END LOOP;
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------but in the procedure below must be run several times
create or replace
PROCEDURE DQ_REPORT_PROC
AS
prop di_proposition.pro_name%type;
col_var VARCHAR2(100);
p_code dq_parameter.para_code%type;
sum_tab di_proposition.summary_table%type;
run_query dq_parameter.run_query%type;
wh_cond dq_parameter.where_cond%type;
end_rslt VARCHAR2(20);
rep_tab VARCHAR2(50);
v_error_msg VARCHAR2(200);
v_error_code VARCHAR2(200);
v_object_name VARCHAR2(50) DEFAULT 'DQ_REPORT_PROC';
v_iss_no VARCHAR2(20) DEFAULT NULL;
CURSOR cur_di_prop IS
SELECT upper(replace(replace(pro_name, ' '),'-')) pro_name
FROM di_proposition;
CURSOR cur_di_para IS
SELECT upper(para_code) para_code, run_query, where_cond
FROM dq_parameter;
CURSOR cur_di_attr IS
SELECT attribute_id
FROM dq_summary;
BEGIN
DELETE FROM dq_summary;
INSERT INTO dq_summary (attribute_id, entity_name, attribute_name, data_champ)
SELECT a.attribute_id, b.entity_name, a.attribute_name, a.data_champ
FROM di_attribute_master a, di_entity_master b
WHERE a.entity_id = b.entity_id;
FOR c_prop IN cur_di_prop
LOOP
prop := c_prop.pro_name;
BEGIN
SELECT distinct SUBSTR(column_name, 1, INSTR(column_name, '_')-1), summary_table
INTO col_var, sum_tab
FROM user_tab_cols a, di_proposition b
WHERE a.table_name = 'DQ_SUMMARY'
AND upper(replace(replace(b.pro_name, ' '),'-')) = prop
AND SUBSTR(a.column_name, 1, INSTR(a.column_name, '_')-1) = upper(replace(replace(b.pro_name, ' '),'-'))
AND upper(b.status) = 'Y';
dbms_output.put_line ('col_var: '||col_var);
dbms_output.put_line ('sum_tab: '||sum_tab);
EXCEPTION
WHEN no_data_found THEN
col_var := '';
sum_tab := '';
END;
dbms_output.put_line ('a: ');
FOR para IN cur_di_para
LOOP
dbms_output.put_line ('b: ');
p_code := para.para_code;
run_query := para.run_query;
wh_cond := para.where_cond;
dbms_output.put_line ('c: ');
FOR rep IN cur_di_attr
LOOP
dbms_output.put_line ('d: ');
BEGIN
EXECUTE IMMEDIATE 'SELECT table_name FROM ' || sum_tab || ' WHERE id = ' || rep.attribute_id INTO rep_tab;
dbms_output.put_line ('rep_tab: '||rep_tab);
run_query := run_query || ' ' || rep_tab || ' WHERE ' || nvl(wh_cond, '1 = 1');
EXECUTE IMMEDIATE run_query INTO end_rslt;
EXECUTE IMMEDIATE 'UPDATE dq_summary SET ' || prop || '_' || p_code || ' = ' || end_rslt || ' WHERE attribute_id = ' || rep.attribute_id;
dbms_output.put_line ('e: ');
dbms_output.put_line ('rep_tab: '||rep_tab);
dbms_output.put_line ('end_rslt: '||end_rslt);
dbms_output.put_line ('f: ');
EXCEPTION
WHEN no_data_found THEN
rep_tab := '';
sum_tab := '';
END;
END LOOP;
END LOOP;
END LOOP;
COMMIT;
EXCEPTION
WHEN OTHERS THEN
v_error_msg := SQLERRM;
v_error_code := SQLCODE;
TRACKER_LOG_EXECEPTION(v_iss_no, v_object_name, CURRENT_TIMESTAMP, v_error_msg, v_error_code);
COMMIT;
END DQ_REPORT_PROC;
Published by: BluShadow on February 7, 2012 12:04addition of {noformat}
{noformat} tags. Please read {message:id=9360002} and learn to do this yourself in future.
903830 wrote:
I write a procedure that dynamically build the query data and insert in the table "dq_summary".
enforcement procedure with success and data not inserted into the table 'dq_summary '.
I'm sorry. But there is no kind of say that way. The code is undesirable. The approach is wrong. This will not happen. This will cause the fragmentation of memory in the shared Pool. This will lead to another session being impossible to analyze the sliders because of the fragmented memory.
Not only that. The underlying data model is questionable.
All this seems a candidate perfect as an example of how NOT to design and code and use Oracle.
Tags: Database
Similar Questions
-
I'm looking for a software that will speed up the startup time and when I use etc.
I'm looking for a software that will speed up the startup time and when I use the computer for a while, it is slow going on the Web site? do I need a registry cleaner? Please notify. I have two computers with xp and vista.
The only thing that's really going to "speed up" your computer is a faster processor, more ram and a faster internet connection. Everything else is really a waste of money (IMHO)
-
I'm taking a picture of waveforms and the units of the scale accordingly. I have a picture of the sensitivities that the user can change and do this in my "EUs Scaling" under VI. I would use just of "LAS scale voltage to EU VI LabView", but the sensitivity of my sensors will vary depending on the way through. I can't much the back wave of construction. I think I'm scaling of values of y in my sub VI correctly. The sub VI is inside a loop of acquisition data and after reading MX DAQ. The sub VI is "Scaling had 32ch".
In addition, when you use DAQ MX create channel he wants to channel names to a string of nouns that are delimited by commas. How do I take a string array and comma delimit them into one string?
They are here in 2009.
-
Build the query to select date with status
Hi guys,.
Grateful if you can advise me on how to build the query on below scenario:
Table A
Date
11.44.39.000000000 12-OCT-14 AM ASIA/SINGAPORE
11.44.35.000000000 16-SEP-14 AM ASIA/SINGAPORE
11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE
The result of the query:
Date Status
11.44.39.000000000 12-OCT-14 AM ASIA / SINGAPORE inactive
11.44.35.000000000 16-SEP-14 active AM ASIA/SINGAPORE
11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE inactive
Basically, the logic, I wanted is
Active principles: today date or max (date) < sysdate
Otherwise will be inactive
And there is 1 active date in time.
Thanks in advance
Hello
2753165 wrote:
Hi guys,.
Grateful if you can advise me on how to build the query on below scenario:
Table A
Date
11.44.39.000000000 12-OCT-14 AM ASIA/SINGAPORE
11.44.35.000000000 16-SEP-14 AM ASIA/SINGAPORE
11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE
The result of the query:
Date Status
11.44.39.000000000 12-OCT-14 AM ASIA / SINGAPORE inactive
11.44.35.000000000 16-SEP-14 active AM ASIA/SINGAPORE
11.44.42.000000000 22-SEP-14 AM ASIA/SINGAPORE inactive
Basically, the logic, I wanted is
Active principles: today date or max (date)<>
Otherwise will be inactive
And there is 1 active date in time.
Thanks in advance
Sorry, we don't know what you want.
Are you saying that 1 row (maximum) can be assigned status = 'Active' and if 2 or more lines are eligible, the last of them will be called 'Active'?
If so:
CASE
WHEN tmstmp<=>=>
OR ROW_NUMBER () OVER (PARTITION BY CASE
WHEN tmstmp<=>=>
THEN "could be."
ANOTHER 'No Way'
END
ORDER BY tmstmp DESC
) = 1
THEN "active."
ELSE 'inactive '.
END
If you would care to post CREATE TABLE and instructions INSERT for some samples, so I could test it.
DATE is not a very good name for a column, especially if the column is a TIMESTAMP, not a DATE. I called the TMSTMP instead of the DATE column.
-
Why will not erase the working data.
I have been a loyal Firefox user and have never had a problem until now. I've always used clear data to erase history. I know the procedure and how to do it. Recently it has stopped working. It allows to erase all data, as it is called. Now after that it gives me the "deleted data" signal, everything is still there. I tried to uninstall and reinstall Firefox, but it made no difference. What should I do? Thank you.
This is the problem:
Once to help clear the private data with history checked: when you go to the Home tab and slide to the story, all entries are still there?
A user reported that this can be caused by activating the hidden settings in Android Developer. Here's where you who goes offshore:
Android menu > settings > options developer
Then uncheck the "do not keep activities."
If this isn't the problem, could describe you more in detail?
-
How will I know that my bios is up to date and if not how can I update
How will I know that my bios is up to date and if not how can I update
For any questions about the Bios, contact the manufacturer of your computer if Vista was preinstalled, or the manufacturer of the motherboard if you have built your own system...
BIOS issues outside of these Forums.
See you soon. Mick Murphy - Microsoft partner
-
Hi Experts,
JDeveloper 12.1.3.0.0
I have a VO based on entity object. With a column of the VO is transient attribute (I created).
I need to call a stored procedure for each row in the transitional attribute and display the data in the form of af: table. As well as other attributes.
So can anyone suggest how can I achieve this?
Thank you
AR
I think that you need a stored function (which returns the value) in this case, is not?
Take a look at:
https://docs.Oracle.com/CD/B31017_01/Web.1013/b25947/bcadvgen005.htm
and search for:
Invoking stored function with only Arguments in
call your function in the Get attribute and return value accessor...
-
Is it possible to make a reflection of the image that will change with the image?
I believe that a dynamic object will solve your problem.
Place your original image to a new file as a smart object and do the same for reflection (made by processing, reducing the opacity and introduce a slight blur horizontal) on its own layer, then:
by double clicking on the smart object in the layers panel and return to the original image, any change in the original and save, automatically update the vertical image and its reflection.
-
I can't get the automatic updates on my samsung jack sgh-i616.
"Connection to the update server is not available. "Check your data connection settings and make sure that the device date and time are correct.
RESULT CODE: 80072ee7
-It is a windows mobile 6.1
Thank you very much! = DAs a guide.
This error code translates ERROR_INTERNET_CANNOT_CONNECT.
You may encounter temporary connection related errors when you use Windows Update or Microsoft Update to install updates
http://support.Microsoft.com/kb/836941Harold Horne / TaurArian [MVP] 2005-2011. The information has been provided * being * with no guarantee or warranty.
-
I bought an annual individual license for Illustrator and also one for Photoshop + Lightroom, now, I realized that I need Acrobat Pro and need to buy another individual license that will cost me the 3 together over the whole creative cloud option that includes all applications. Can I Exchange my 2 subscriptions for the rather creative cloud and pay only the difference?
Single update for all http://forums.adobe.com/thread/1235382 clouds can help
-
I bought the software for Adobe photoshop lightroom 5 Office depot, I have the serial number to download that will work in the United Kingdom if I sell it to someone out there
If you have a serial number US and that the person has an ID Adobe UK I don't think it will work... but you'll have to ask Adobe (it is an open forum, not the Adobe support)
Chat/phone: Mon - Fri 05:00-19:00 (US Pacific Time)<=== note="" days="" and="">===>
Don't forget to stay signed with your Adobe ID before accessing the link below
Creative cloud support (all creative cloud customer service problems)
http://helpx.Adobe.com/x-productkb/global/service-CCM.html
Read also the transfer (sale of your software) https://forums.adobe.com/thread/1355892
-
How to force the Photos up-to-date original jpeg file after you have added the GPS data and rotation
Hello
Pictures has the ability to add GPS data to an image file, but stores the GPS data in a catalog instead of the actual image file. The same seems to apply to the rotation of the image. Is there a way to force the Photos up-to-date the actual image file?
The only solution I have found so far is to export images updated, remove them from the library of Photos and re - import. This process, however, replaces the original creation date with the date of the export in the file. (i.e. a photo taken in 2007 with a creation date of 2007 will now have the date it has been exported photos as a creation date.)
The reason why I want to update the original file, it is that I use Google Photos automatically create albums using the content of the image, the GPS data and dates. The backup utility Google downloads the file Master Original therefore excludes files and changes to images in the photos.
I use the photo Version 1.5 (370.42.0)
Thank you.
The same seems to apply to the rotation of the image. Is there a way to force the Photos up-to-date the actual image file?
No, Photos will never alter the original image file.
You can export the photo with the GPS and reimport with file > export and activate "include location information:
Or use a tool to add location data before importing photos to Photos. I use Jetphoto Studio.
-
Toshiba Satellite L50 - B of the Bios date and time to reboot
Hello.
I have Toshiba Satellite L50 - B for more than a year. I upgraded the RAM to 8 GB and it works fine. But the last 10 days of the BIOS date and time keeps restarting by default whenever I turned off or in hibernation laptop. My battery is dead, but I'm not, it reloads all the time and restart the BIOS after that I have unplug the phone charger. I think that the CMOS battery is dead, but when I open the laptop there is no CMOS battery. Someone told me that this model has a kind of Flash for the time of the bios chip. How can I fix it?Get a new battery and will be all good.
-
Dell Inspiron5100 WinXP SP3.
Due to malware, I had to FORMAT my HD and re-install Windows XP OEM disc. I also reinstalled WIN DVD4 from the OEM disc that came with the laptop.
Check SYSTEM/DeviceMGR/material indicates a problem with the drive, but: it won't READ a DVD or burn a CD (which she has done before)
Can't update anything of QSI as they were absorbed by COREL years. No support available for WINDVD4
When you try to run WINDVD4 with a DVD in the drive, I get a Popup of WINDVD screen that says:
CREATE OVERLAY FAILED-Please lower your color depth or screen resolution and try again. Of course, it worked fine with the reg settings in the past, now Ive tried even lower TWO the RES SCREEN and color at least registered but still does not work
It WILL play CDs of music (mp3s)
Found the following material etc.
Provider: Microsoft Corp.
File version: 5.1.2600.5512 (xpsp 080413-2108
Driver date: 01/07/2001
Driver version: 5.1.2535
Driver files
C\windows\system32\DRIVERS\cdrom.sys
"" "" \DRIVERS\imapi.sys
«"\DRIVERS\redbook.sys «»
«"«\system32\ c:\windows\system32\storprop.dll»»»
I installed and ran but it won't play MICROSOFT 'FIXIT' DVDs just run from WINDVD4 and still does not.
FIXIT now brings me HERE
It seems that FORMAT/reinstall has missed something the will allow the CD PLAYER of .1BURN and 2. READ the DVD, but allows you to PLAY CDs
From: * e-mail address is removed from the privacy *.
To: * e-mail address is removed from the privacy *.
Date: Tuesday, May 17, 2011 08:30:29-0700
Subject: QSI SBW 242 CDRW/DVD not play DVD or BURN a CD (music CD will PLAY) [AFTER the HD FORMAT and re - install}ResponseHello
1. are you able to read any type of file .doc or .txt of DVD?
After following all the steps (including the update of the MP9 for Media Player [MP] 11) below
I can get the drive to DISPLAY all the data from the DVD (Master & Commander 'movie)
on-screen MP11. He plays (automatically) the intro (ONLY) from the DVD music (as when you put it in a DVD player, forward to press PLAY) MP11 shows all of the content and all the files on the DVD and SEEMS ready to play, but pressing on PLAY don't either not anything.
2 , what exactly happens when you try to burn the CD? You get the error message?
Not nothing... He's here
3. How do you try to burn CDs?
MediaPlayer, selection of a track list, made a list of titles, and then click BURN... nothing happens
4 have you tried to play the DVD content in ? windows media player
I had not before, but now I have. Previously it was default to my SELECTION WIN DVD4 as the DVD player (I think I've EVER SEEN the WINDVD format/start page on the front screen - it wasn't the default front DVD player either but don't remember what program PLAYS the DVD, he ' comes of "). Now, go back and see 1. above for MP11 more details.
Try to update the drivers of CD-RW/DVD drive and check. Also update the graphics driver.
I did the entire bottom.
1. click on Start, click Control Panel, and then double-click System.
2 click on the hardware tab, and then click Device Manager.
If you are prompted for an administrator password or for confirmation, type the password, or click continue.3 right-click on the CD-RW/DVD drive, and then select set to update driver.
He asks if I have an OEM driver and / disk... NO.. I run the program through...
"Hardware update Wiz can not find a better match the software installed"
4. right click on the graphics card and select Update driver. »
There is no "graphics card" on the material. This machine has integrated graphics using a part of the main memory (or other) to run the video section:
I find:
AUDIO, VIDEO and GAME controllers (announcement)
Audio codecs
Audio drivers
Legacy video capture device
Media control devices
Audio Sigma
Video codecs
All this seem normal but above I see YELLOW TWO warnings under 'OTHER DEVICES '.
?! Ethernet controller "drivers for this divide (code28) is not installed.
?! VIDEO CONTROLLER (VGA Compatible) I didn't HAVE NO IDEA if THIS if APPLIES OR NOT
Device type - other devices
MFG-unknown
Location PCI bus, device 0, function 0. "Drivers for this device are not installed, CODE28 to reinstall the driver."
Has been through the usual (request for drive... Laughing out loud. Impossible to beat")
See also:
How to troubleshoot common problems that occur when a Windows XP-based computer cannot read a CD or DVD
http://support.Microsoft.com/kb/321641
Did yesterday. It installed/ran "MR. Microsoft Fixit' with the result:
"Question: media in the CD-RW/DVD drive is not readable" CLICKED top DIFFICULTY... and after computer "worked" on this subject awhile, he says STATUS: fixed. St ill did not. MP9 introduced the format of the DVD player but don't seem to read anything other then showing a list:
UNKNOWN
Title 1
Title2
Title 3 etc., but could not do anything with this list.
He appeared a box asking if I wanted to update my MP9... sure why not so I shut everything down and uninstalled 9 and installed Media player 11.
Go BACK to # 1. now once again. This is where I am. MP11 shows all DVD data, the chart "the Album/DVD cover, all"titles"on the DVD, AND play the track audio 'intro' DVD but will not actually READ the DVD. "
So far it's PROGRESS. We are at a point where it SEEMS at least that we are ready to PLAY and MP can SEE all the info on the DVD.
I see many people on other sites of the same question: Player does not work after FORMAT operating system and reinstall of WIN (and in my case: WinXP SP3 and WIN DVD4 of OEM disc)
Thanks a lot for your help so far... I hope that we can get to the next step and get the reader of CD-RW/DVD on 'PLAY '.
-
How will I know "the size of a table special VS size of RAM"
Hi all
How will I know "the size of a table special VS size of RAM"?
I should know because I want to understand what join method to use.
Please correct me if my attempt to catch the truth is crazy.
Thanks in advance.
You can get the size of a table of DBA_SEGMENTS. I'm sure you can get the amount of RAM of other tables of data dictionary as well if you can define precisely what memory segment you are interested in (e.g. CMS?) PGA? The amount of physical RAM on the box? The size of the buffer cache? The amount of virtual memory available?)
That being said, comparing the two is not as significant. You, as a developer, are generally not in the business of choosing a join method. It's the job of the optimizer. And the optimizer takes into account a range of data that you have not begun to ask about yet. The size of the table is not even particularly relevant for calculations - the optimizer the amount of data operations are back, the relative size of the data on each side of the join, the availability of indexes, etc. are all much more important than the raw size of the table (but the raw size of the array is a factor in the assessment of the amount of data that is returned).
Justin
Maybe you are looking for
-
When I opened a pop-up Pogo game I don't see some of the areas of the game. The window itself is big enough, but I don't get the whole game.
-
Satellite L655-13V - battery does not charge
I have laptop Satellite L655-13V and the battery does not charge while I plugged the AC/DC adapter.and give me this status: "plugged in, not charging."And when I connect the battery only work on computer, and when I connect the AC/DC adapter only wit
-
Peripheral Bluetooth doesn't work does not correctly
I have a new IdeaPad Y550P and am slot that Win7 Ultimate 64-bit. I installed a Microsoft Wireless (Bluetooth) keyboard and mouse. They work fine for awhile and then the IdeaPad abandons the connection. Get and install another MS Bluetooth keyboard /
-
WksSS.exe error Help!
I know that the support ends for my system but I need help as I can get it! When you try to open any Micro flexible spreadsheet file I get the following message is displayed. C:\PROGRA~1\MICROS~3\wksSS.exe NTVDM CPU has met an illegel statement. CS:
-
Microsoft Visual C++ 2010 SP1 x 64 redistributable "Installation failed"
I tried to install the redistributable adequate to get AVG Free to work for a while now, because it keeps failing when you try to install this redistributable, so I try to install it myself, but I am facing this problem every time. I tried to install