Need help to create the package
Table AColumn1 Column2
2B
1 b
3A
4 B
Table B (aggregate of table A)
Column1 Column2
A 3
B 1
Table C is new data for Table A and Table A.column1 = Table B.column1
Column1 Column2
1 C
2 C
3 C
4 D
I need to make a package that aggregates data in table C, update existing records in Table B, and insert records in Table B. The result should look like this:
Table A
Column1 Column2
A 0 (3-3)
B 0 (1-1)
A q
D 1
Hello
Assuming that the same id (like 'A', 'B',...) never occurs in table_b and table_c (which is the case in your test data):
WITH a_summary AS
(
SELECT column2 AS id
, COUNT (*) AS cnt
FROM table_a
GROUP BY column2
)
, b_c_summary as
(
SELECT column1 AS id
, COLUMN2 AS cnt
FROM table_b
--
UNION ALL
--
SELECT column2 AS id
, COUNT (*) AS cnt
FROM table_c
GROUP BY column2
)
SELECT bc.id AS column1
, bc.cnt - NVL (a,cnt, 0) AS column2
FROM b_c_summary bc
LEFT OUTER JOIN a_summary a ON bc.id = a.id
;
If there is an overlap between b and c, you have to change b_c_summary; It may involve a FULL OUTER JOIN instead of UNION all. If so, after a new series of sample data (CREATE TABLE and INSERT statements) and the results desired from these data.
As Anurag said, you don't need a package or any kind of PL/SQL to get these results, but you can use a query like this in a package, if you want.
Published by: Frank Kulash, December 10, 2009 10:46
If you need to change table_b, you can use a query like this as a subquery in a MERGE statement, as Beijing says.
Tags: Database
Similar Questions
-
Need help with creating a Package in the same way
Hi all
I have script for the file package. It's good work, but I need the package on the same path instead of on desktop with file name.
As if the work of the file xyz.idd in D:\ Projects\Today\
I need same location (D:\ Projects\Today\) with the name of the folder as file name (xyz)
Can you change the code, I tried to change but it does not work.
var to = new File ("~/Desktop/package_folder/");
flag of the var = Folder (to) .create ();
var copyingFonts = true;
var copyingLinkedGraphics = true;
var copyingProfiles = true;
var updatingGraphics = true;
var includingHiddenLayers = true;
var ignorePreflightErrors = true;
var creatingReport = true;
var versionComments = 'comment ';
var forceSave = true;
If (flag = true) {}
() app.activeDocument.packageForPrint
TO
copyingFonts,
copyingLinkedGraphics,
copyingProfiles,
updatingGraphics,
includingHiddenLayers,
ignorePreflightErrors,
creatingReport,
versionComments,
forceSave
);
}Thanks in advance
Kind regards
Siva
myDocument var = app.activeDocument;
var myDocName = myDocument.name;
Temp=myDocName.replace(/\.indd/g,""); "
var myFileNme = temp.toString ();
var myDocument.filePath = myFolder.
var to = new file (MyFolder + "/" + myFileNme + "/");
flag of the var = Folder (to) .create ();
var copyingFonts = true;
var copyingLinkedGraphics = true;
var copyingProfiles = true;
var updatingGraphics = true;
var includingHiddenLayers = true;
var ignorePreflightErrors = true;
var creatingReport = true;
var versionComments = 'comment ';
var forceSave = true;
If (flag = true) {}
() app.activeDocument.packageForPrint
TO
copyingFonts,
copyingLinkedGraphics,
copyingProfiles,
updatingGraphics,
includingHiddenLayers,
ignorePreflightErrors,
creatingReport,
versionComments,
forceSave
);
}Mi_D
-
need help to create the insert statement
I have customer_priv of table which has 4 columns (login, privilize_id, adate, added_by)
the stmt insert like "insert into customer_priv values('JDOE',951.sysdate,admin);
I have 100 users and for each user, I need to add to the 15 privilize_id
I have the list of connections and roles, what is the best way to create a massive insert for all those users statement and
any help is very appreciated
Thank youuser11984714 wrote:
Thanks FrankI get the below now.what Miss. Also is it possible to reel in a file insert rather directly the data.am I missing values?
Sorry, I don't understand what you want.
You say you want to write something in a HOLD file instead of insert? Of course, you can do it. Change the INSERT statement in a SELECT statement and add commands to the COIL.SQL > @c:\insert_many.sql
33 old: SELECT ' & 1' priv_id, 'admin', sysdate)
33 News: SELECT sysdate, "BNELSON", "admin", priv_id)Of all_priv_id
*
ERROR on line 34:
ORA-00923: THE KEYWORD not found where expected
Thank youPublished by: user11984714 on August 9, 2010 18:40
Sorry, there was a typing error in my previous post.
Remove the ')' the end of theSELECT '&1', privilze_id, SYSDATE, 'admin')
I hope that you have more problems, but if you do, post your code, even if you think that you just copied it from this site.
-
Need help to create the calendar...
I have a project, and in this project, I have a script. However, when I go to create a calendar, the dialog box does not display my script. Without a script, there is no way to create a schedule, so I'm stuck. The sample project works as expected and I can see the scripts inside but Adobe Story does not see my script, when I created a new calendar. My script is not well and I can access/modify if necessary but I can't create a schedule for it. Would appreciate suggestions.
ED
Hello
Schedules can be created scripts for Film or television. You must have permissions to modify the script (which, it seems, you have). My guess would be that you are trying to create the AV script planning or more columns. It is not possible currently.
Kind regards
Sunny
-
need help to create the exe in our test project
We create a web test in VS2010, we need to know if there is a way that we can create an Exe from our test document (it's like a script something), so that other people can run it without using visual studio.please I would like to know how to do this. Thank you!
Just a thought. Have you tried Iexpress by right click on the shortcut to the program or the .exe, and then selecting the option "Run As Administrator"? Perform, even if your user name is an administrator.
Have you tried a more specific Forum for help?
Visual Studio forum
http://social.msdn.Microsoft.com/forums/en-us/category/VisualStudio, vsarch, vsdbg, vstest, vstfs, vsdata, vsappdev, visualbasic, visualcsharp, end -
Need help to create the shape that people have to go to a page
Hello
I am trying to create a form that people would have to complete and submit to access a specific page. The info they need to go to an e-mail address. Does anyone have the simplest solution for this? It should not be stored in a database simply go to an e-mail. Any help would be appreciated. I am not great with the backend of things.
Thanks for getting back to me. What I have is a pricing page. The feedback form is so that we can see who views or interested in the services. We don't want people who fill out this form in order to see it. I created simple contact forms that are sent to an email and directed to another page. The problem I have is trying to find a way where I hope that if the same person comes back they will not have to fill out the form again. I don't know if they will fill and create a login/username that could be a possible solution, but I try to make it simple. I'm just starting to learn PHP/XML (which I copied from other sources) and wrote my own. Maybe create a cookie which is verified once the page is loaded? I don't know how do either if... I'm a front-end "designer" and much of this is Greek to me.
-
Need help to create the logo graphic text saved as a PDF. (Beginner)
I use Photoshop CC 2015.
I want to create a logo using the part of a chart in a PDF (no copyright issues).
The chart in PDF document looks like Word of the text with a rectangular colored background. I think the word was created with the help of a police and a couple of letters have been adjusted by the designer to make it better. I just want to use the word itself for my logo, but I don't know how to extract the information.
Once I extracted the image I want to save it as an SVG file so I can use the Glyphter online services to convert it to a font that I can use the Apple Motion 5 for inclusion in an intro scene.
Export as SVG option will work to allow me to use Glyphter?
Guidance have really enjoyed.
Hi there must be many ways to do this, including just draw your screenshot in Illustrator. If you are comfortable with the tool pen which is by far the most accurate way to do it, but its also very long. What I did was to use your perforated CAP and make a selection by using the magnetic lasso tool by using the default settings. This tool works very well for this kind of thing.
Then in the palette drawn convert selection to path.
What you have now is a quick alternative and dirty to the use of the pen tool. Indeed I had to change the path above
with the pen tool to get the bend on some of the correct letters. Typographers spend days to address these
forms so that they are fair, so, as you can see above the contours are not perfect, but it comes down to how
a lot of time, you have to spend.
Then, you convert the path to a selection. In Photoshop, go to select change smooth and use smoothing 2px
in an attempt to get out of the irregular bumps or the strangeness of the track.
Create a transparent layer and fill the section "" with black.
With the layer selected, go to export as and select SVG and you will get a SVG file. I don't know if
It works with the Glyphter, but I downloaded what I've done here, so you can try it for yourself.
Hope this works for you
Terri
-
Need help to create the sequential LIST of IP
Dear friends...
Please help meet the following requirement:
Table IP_POOL
USER NAME NOT NULL VARCHAR2 (30)
STATIC_IP VARCHAR2 (4000)
LASTOCT VARCHAR2 (4000)
MASK VARCHAR2 (4000)
NOFIP NUMBER
The sample lines
username, static_ip, lastoct, mask, nofip
insert into ip_pool values ('ABC@a', ' 10.56.16.0', '0', ' 29 ", 8);
insert into ip_pool values ('DEF@a', ' 10.63.254.84', '84', '30', 4);
Desired output:
ABC@a, 10.56.16.0
ABC@a, 10.56.16.1
ABC@a, 10.56.16.2
ABC@a, 10.56.16.3
ABC@a, 10.56.16.0
ABC@a, 10.56.16.0
ABC@a, 10.56.16.0
ABC@a, 10.56.16.0
DEF@a, 10.63.254.84
DEF@a, 10.63.254.85
DEF@a, 10.63.254.86
DEF@a, 10.63.254.87
Thanks in advance please.
Ashwin
Try this
Select the user name
static_ip
lastoct
mask
nofip
regexp_replace (static_ip '(\.) [^.] *$', '\1' || TO_CHAR (lastoct + (level - 1))) new_static_ip
of ip_pool
connect
by level<=>=>
and prior username = username
and prior sys_guid() is not null;
-
Hi, I recently bought numbers in order to create a commercial newspaper. I'm the pen and paper. I need help to create a formula. A purchase column; Determines if the entry price column is subtracted from the price of output column (buy) or subtracted from (Sell) entry exit. Thank you for your help
Hi B',.
Buying and selling in column B
Price of entry in column c.
Exit in column D price
Formula (and outcome) in column E
If the column will B always contained 'Buy' or 'Sell', it works. It is default to a calculation of 'sell' if sale or has been specified.
E2: = IF (B = "Buy", D - C, C - D)
If you want to delay the calculation until the amounts entered in C and D, use this version:
E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, C - D) ")
If you want to delay the calculation until all three ducks are on a line (B contains buy or sell, C and D contain both data), use this version:
E2: = IF (OR (LEN (C) < 1, LEN (D) < 1,"", IF (B = "Buy", D - C, IF(B="Sell",C-D,) "" ")))
Third version used in this table.
Kind regards
Barry
-
Why we need to create the package instead of procedure or function in Oracle
Hello
Recently, I attended an interview, they asked,
why we must create the package instead of procedure or function in oracle. Is a specific advantage, if we create together.
I'm not sure. can u tell me please someone.
Thank you and best regards,
Sanjeev.Hello
A part of the oracle documentation.
What is a PL/SQL Package?
A package is a schema object which includes subroutines, variables, and logically related PL/SQL types. Packages have two parts: a specification (spec) and a body. Sometimes, the body is unnecessary. The specification is the interface to the package. It declares the types, variables, constants, exceptions, cursors, and subprograms that can be referenced from outside the package. The body defines queries for the sliders and the code for the subprogrammes.Benefits of the PL/SQL Packages
Packages have a long history in software engineering, offering important characteristics for a reliable, maintainable, and reusable code, often in team for large systems development efforts.Modularity
Packages allow you to logically encapsulate Associates types, elements, and subroutines in a module named PL/SQL. Each package is easy to understand, and the interfaces between packages are simple, clear and well defined. This facilitates the development of applications.
Easier application design
When you design an application, all you need initially is the interface information in the package specification. You can code and compile a spec without his body. Stored subprograms that reference the package can then be compiled as well. You should not set the package body entirely until you are ready to complete the application.
Information masking
With packages, you can specify which types, elements, and subprogrammes are (and accessible) public or private (hidden and inaccessible). For example, if a package contains four subprogrammes, three can be public and one private. The package hides the implementation of the subprogramme private so that only the package (not your application) is affected if the application changes. This simplifies maintenance and improvement. Also, by hiding the implementation details of the users, you protect the integrity of the packaging.
Feature added
Sliders and packed public variables persist for the lifetime of a session. They can be shared by all the subprogrammes that are running in the environment. They allow you to manage data in any of the transactions without storing in the database.
Best performance
When you call a subprogram packaged for the first time, the whole package is loaded into memory. Subsequent calls to related subprograms in package require no disk i/o.
Packets stop cascading dependencies and avoid an unnecessary recompilation. For example, if you change the body of a packaged function, Oracle does not recompile other routines that call the function; These routines only depend on parameters and return value that are declared in the specification, so they are recompiled only if the specification changes.
-
I need help on creating reports on the intranet.
I need help on creating reports on the intranet.
My level: Beginner cf.
Y at - it a book for report design? And structures for reports?
------------------------------------------------requirements
my form needs one
· Date of the box you want. (from and to).
· Option button to choose the csv and html
· Run and throw out the results in a tabular format. (grids, cell)
How many cfm pages do need me for this? E.g. display, action.
What called what?
What else do I need?
I suggest that you put your project on hold for a little everything and get and read the chapters appropriate Web Application Construction Kit of Ben Forta. You can learn more about it here - http://www.forta.com/books/0321223675/. Once you have the concepts down, you will have a much more concentrated idea on what to do.
-
Need help to diagnose the regular system analysis on iMac - processors maxed out
I need help to identify the cause of a problem that occurs at least 2 - 3 times per day using my iMac (27-inch, mid 2010) running 10.11.5.
I will use my iMac and then all at once things will start to really trolling. To the point of being completely unusable. Even if I'm able to move my cursor, then click to drag the windows around the screen nothing does really.
I have iStat menus running so that can see graphics in my menu bar that all 4 cores are completely overfished. Occasionally, I was fast enough to launch the activity monitor to try to see what applications / services are responsible for, the use of % CPU column is completely empty of values, so I can't identify the culprits in a reliable way. I try to keep that column sorted by % CPU use in the hope that he could reveal something and normally it's the kernel_task who is up there.
I use a Wacom Bamboo dated Tablet (MTE - 450 has) instead of a mouse, and at one point, I was convinced the pilot of PenTabletDrive it is based on was to blame. I contacted Wacom on this subject, and although there is no known issues they pointed out that although the latest drivers will allow me to use the tablet that they no longer support older devices. I was wondering if there was a problem of communication between the device and a driver that is no longer supported. I installed the latest driver supported for my tablet, but the problems persist.
It may be interesting to note that, when my computer is in this semi-frozen state, I am able to launch the window enough force and quit all open applications leaving me with only the Finder. I guess that means that there are none of my apps running and it is probably one of the services. If I restart the Finder system grinds to a completely enclosed holt.
I hope someone can let me know what I can find in the Console or elsewhere to help me finally zero in on what is to blame. I can share a log if that helps.
Thank you in advance!
Information that might be useful:
Kept by I tend to be running: Adobe InDesign, Photoshop, Acrobat (all CC 2015), Mail, Safari with several tabs & Dropbox sync constantly.
Download and run EtreCheck, created by one of his own assistants here in CSA. It is a diagnostic tool that is very useful for us to find problems. It will also give us additional specifications on your Mac. After his execution after the logfile here. It will never contain any personal information.
-
Need help to remove the zeros on the right
Hello.
I need help to replace the zeros in the string.
I have a string which is the output of the network packet. There are a few trailing zeros in the package.
I don't see them in normal mode, but the size of the string tells me that it's bigger then it looks like.
When I pass in hexadecimal mode, you can see zeros.
I tried to use the find/replace function allows you to search for 0 and replace it with an empty string constant. But, for some reason any, that he took no zeros.
I need to stop the string that follows * 69.
Show your code. You won't find and replace with all zeroes. These 00 in hex mode they are null characters. (not printable byte with a value of zero). You need search and replace on that character. (replace string should look like 00, when it is set to display the hexadecimal code.
-
Need help to identify the type of object in the loop of pl/sql
Hello
I need help to identify the Type of object declared beneath a procedure as shown below:
I need to pass the parameter to the procedure as a TYPE of OBJECT and also refer to variables of Type Object in a loop
create or replace type TEST_VALIDATION_REC is RECORD (order_num varchar2 (30),)
number of inventory_item_id
reserved_YN varchar2 (1).
error_flag varchar2 (1).
Error_message varchar2 (2000)
);
CREATE OR REPLACE TYPE VALD_TBL AS VARRAY (10000) OF TEST_VALIDATION_REC;
PROCEDURE ADD_TO_ORD)
p_lot_number_list IN VALD_TBL,
p_ord_number IN Varchar2,
p_user_id in NUMBER: = fnd_profile.value ('USER_ID'),-change 1.10
p_responsibility_id in NUMBERS: = fnd_profile.value ('RESP_ID'),-change 1.10
p_application_id IN VARCHAR2: = 'PO',-change 1.10
x_error_flag OUT Varchar2,
x_error_msg OUT Varchar2
)
In the above procedure, I had the VALD_TBL. Is it OK?
And how in the loop if the records if I use:
FOR indx1 IN 1.p_lot_number_list. COUNTY
LOOP
BEGIN
SELECT
inventory_item_id
IN
ln_item_id
Of
dummy_lot_tab
WHERE
lot_number = p_lot_number_list (indx1); - > how direct the item here?
EXCEPTION
WHILE OTHERS THEN
ln_item_id: = NULL;
END;
Records are PL/SQL objects. They are not the SQL objects. You can create a SQL TYPE (schema level) as a collection (variable-tables only, tables nested).
So therefore your first statement is syntactically incorrect
CREATE OR REPLACE TYPE TEST_VALIDATION_REC IS RECORD (order_num VARCHAR2(30), inventory_item_id NUMBER, reserved_YN VARCHAR2(1), error_flag VARCHAR2(1), Error_message VARCHAR2(2000) );
You must put in an anonymous PL/SQL block or the stored procedure
DECLARE TYPE test_validation_rec IS RECORD ( order_num VARCHAR2(30), inventory_item_id NUMBER, reserved_YN VARCHAR2(1), error_flag VARCHAR2(1), error_message VARCHAR2(2000) ); TYPE vald_tbl iS VARRAY(10000) OF test_validation_rec; lv_tbl vald_tbl; BEGIN lv_tbl := vald_tbl(); -- insert your code here END;
-
. Hello everyone, I need help with creating a dynamic region in jdeveloper 11.1.2.3 version
What JDK you are using?
You are probably using an old version of the JDK, that class while compiled under JDK 1.7.0
For example, work with the correct version, and it will be fine...
Maybe you are looking for
-
In previous versions of Firefox, when I open a new empty tab by CTRL-T or by clicking on the 'more' button on the tab bar, Firefox would focus on the new tab. This is not the case with Firefox 11, but I liked this behavior and want to get it back. It
-
Value problem of features for the INF with the winpk filter installation.
Hello I use an inf to my driver installation using properties of LAN, but I am facing the following problems during the installation of my driver with the installation of the winpk filter: All these changes are made with windows 2008 R2 64-bit Server
-
DC 5750: disk crash on HP dc 5750
Hello I just had a hard drive crash so I don't have access to the backup partition. I installed a new hard drive and installed Windows Xp Pro (which was the original operating system). Now, I have all the drivers installed audio device, Ethernet cont
-
Of countless updates always stored - suppressible?
I am just crossing and cleaning house. Firstly the cause, I had to install a "partition" I thought, it's called because my computer crashed, and then everyone told me that it is a Goner, I knew how to operate again and successfully did everything on
-
I forgot the password of hotmail and cannot reset it
I forgot the password of hotmail and cannot reset the password. What can I do? I made another account on live.com. I want my old account.