Procedure - Help needed
I would like to create a table (I don’t know the number of columns) whose values have to be picked from all the tables in the user_tables which are like ‘LINKED%’ .
There are around 600-700 tables in the DB whose name is like ‘LINKED%’
All these table have 5 common cols – IDENTIFIER,C_NAME,CODE,MEAN,VALIDATEX. In addition to this it has some few other extra cols which are not identical for all these tables. There are tables with only 5cols and also there are tables with 20cols(which includes this 5 common column )(other tables with variable cols but not less than 5common columns)
I would like create a procedure where I need to create a table in the runtime and populate this new table with values from all the 700 tables. The cols name of the new table will be known only during runtime.
Kindly help me in this..
Can I have some ideas how to do this in other ways…
Thanks a lot
set heading off feedback off pagesize 0 linesize 75
spool sa_test.sql
declare
v_table_name VARCHAR2(50);
v_sql_stmt VARCHAR2(2000);
v_counter NUMBER;
CURSOR c1 IS
SELECT table_name
FROM user_tables
WHERE table_name like 'CODED%'
ORDER BY table_name;
BEGIN
OPEN c1;
LOOP
FETCH c1 INTO v_table_name;
EXIT WHEN c1%NOTFOUND;
v_counter := 1;
IF v_counter = 1 THEN
v_sql_stmt := 'SELECT * from ' || v_table_name ||';';
ELSE
v_sql_stmt := v_table_name ;
END IF;
v_counter := v_counter + 1;
dbms_output.put_line (v_sql_stmt);
v_sql_stmt := null;
v_counter := 1;
END LOOP;
CLOSE c1;
END;
spool off
@sa_test.sql
This is sql script I'm using for retriving the values from all the tables .But I'm in need to create a table in a procedure, so that I can integrate the procedure in the Business Objects reports.
Similar Messages
-
SQL Server Stored procedure help needed
I want to write a stored procedure to get result like
this....how can i do?.
Result needed from stored procedure.......
lastname,firstname,logout_time,activity,score,pass/fail
Tables....
select activity_id
,login_time,logout_time,q_id,r_id,correct,activity
from activity_log
activity_log got multiple records....this is just dump all
the activity from test questions.
select user_id,firstname,lastname
from users
Queries inside the stored procedure.......
select b.lastname,b.firstname,
a.activity_id,a.login_time, a.logout_time
from activity_log a, users b
where a.activity_id = b.user_id
group by user_id,lastname,firstname,login_time,logout_time
select activity
from activity_log
where activity_id= 'a.activity_id' and activity is not NULL
select sum(convert(int,correct,1)) as score
from activity_log
where activity_id='a.activity_id'
if activity is C1
select r_id,correct
from activity_log
where q_id = '10' and activity_id = 'a.activity_id'
"Question 10 missed."
select r_id,correct
from activity_log
where q_id = '20' and activity_id = 'a.activity_id'
"Question 20 missed."
if score gt 50
pass
else
fail
end if
end if
if activity is C2
select r_id,correct
from activity_log
where q_id = '30' and activity_id = 'a.activity_id'
"Question 30 missed."
select r_id,correct
from activity_log
where q_id = '40' and activity_id = 'a.activity_id'
"Question 40 missed."
if score gt 50
pass
else
fail
end if
end ifThanks. Please see now...i updated my posting.
SQL Server 2000.
Please see my tables...
select activity_id
,login_time,logout_time,q_id,r_id,correct,activity
from activity_log
select user_id,firstname,lastname
from users -
Audigy 2 Zs Platinum Install Procedure help needed
Namaste all, this is my first post and I am new to Creative products, as I might be the only person in Nepal with the Platinum package! I have an Intel 95 chipset motherboard with that sucky Realtek soundchip, so my brother gave me this Creative product he got from the USA. It looks grand, but the Quick Start confused me, it says to do the install of hardware and then when Windows finds the new hardware to cancel, and then install the Creative software from CD.
Well, from expierence with other hardwares this is not so good a procedure, as u get unknown devices if something goes wrong with the software install, and I know the disk is almost 2 years old. So I downloaded all the updates for SB350 on this site (a whooping 85+ megabytes) and my question is this:
Which software do I install first, the old or the new? And it seems to me it would be better to have drivers there first, or should I not be second guessing the Creative Engineers?
Can anyone tell me what exactally what to do? There is a ton of softwares in the package I can see, and I am wondering what to do now to prevent problems later.
Well, thanks and I look forward to hanging out in the forum to learn about my cool new sound package.
Jigs in Kathmandukatman, yes i did, i can bring up mediasource from the creative volume icon in the status bar...player, organizer, Go! and Go! launcher. wow, way too much software...
So I am hoping the update makes all this stuff look better...does it's The Mediasource Go! is version 2.00.06 with a theme engine of V3.0.37...but the Organizer has an about screen that says Creative Media Source 2.02.05. I can't make sense of this but if I get the latest versions on this system at least I can evaluate and make some intelligent choices before i remove it
I really don't get the two icons, creative volume and Mediasource gO, on right click they both have almost the same choices!
Anyway, thanks for your help...what to do next? I am a freak about making sure all the drivers and software are the latest on my machines.
And now I found a hardware problem - or a user problem - how do you get line in 2 on the front of the dri've to work? Mine does not seem to....
thanks!
jigs -
Stored procedure help needed please!
dsds
hello ive an assignment due but ive hit a brick wall, would anyone be as kind to help me?
ShareTraders LTD is an online share brokerage which allows its customer to trade shares on the US stock market. Customers can either sell or buy shares – the sales price depends on the curently quoted prices in the share table. The below ERD
shows a section of their database that refers to their customers who trade shares online.
Funds are categorised into different categories.
Customers may limit their exposure to a particular category of fund.
Customers fund their share purchases through funds.
Customers may limit their exposure to a particular category of fund.
Shares are grouped into different categories.
Customer trades are tracked in their portfolios.
The shares that the customer’s trade are recorded in their portfolios.
Staff are authorised to change the share prices of particular categories of shares.
Staff are authorised to change the share prices of particular categories of shares.
TSQL à Stored procedure
Create a stored procedure (call it
Assign1) which will
insert a purchase of shares into the CustomerPortfolioTBL for a customer. The data that will be passed to the stored procedure is: the CustomerID, the ShareID, and the TransactionAmount.
The data for the other columns in the CustomerPortfolioTBL will be got as follows
TransactionID
à make sure that this column is an identity column which will automatically generate the next TransactionID.
TransactionType – this column will be filled by your sproc with the word “Purchase”.
SharePrice
à the price will be read from the share SellPrice column in the ShareTBl for that ShareID.
TransactionDate
à this column will be filled by your sproc with todays date
à use the GetDate() function.
Business Requirement
Customers are not allowed to purchase more than 5 times in the current month. Your sproc must therefore:-
Count the number of purchases the customer has made this month
à use the Month() and the GetDate() functions.
If the no of purchases is greater than or equal to 5 your sproc must send an error message of “Sorry
purchase is refused 5 purchases have been made this month”
Customers cannot spend over their exposure limit for a particular share category – get this from the CustomerExposureTBl. Your sproc must therefore:-
Read in to an internal variable the exposure limit from the CustomerExposureTBl for the inputted CustomerID.
Add up all the transaction amount of shares that the customer has purchases (TransactionType = purchase) for shares whose category is the same as the share
being purchased). Put this calculation into an internal variable.
Add up all the transaction amount of shares that the customer has sold (TransactionType = sale) for shares whose category is the same as the share being
purchased). Put this calculation into an internal variable.
iv)
If ((Total Purchases
of share in this category – Total Sales of share in this category) + TransactionAmount) is greater than exposure limit your sproc
must send an error message of “Sorry purchase is refused Exposure limit is breached”
Tables
http://tinypic.com/r/2nvqt88/8
This reads like you just want someone to do your homework for you. Could you post the following?
What have you written so far? Please include the code in your reply.
Where are you getting stuck specifically?
Mark as answer or vote as helpful if you find it useful | Igor -
Help Needed in Creating Java Class and Java Stored Procedures
Hi,
Can anyone tell how can i create Java Class, Java Source and Java Resource in Oracle Database.
I have seen the Documents. But i couldn't able to understand it correctly.
I will be helpful when i get some Examples for creating a Java Class, Java Source and Stored Procedures with Java with details.
Is that possible to Create a Java class in the oracle Database itself ?.
Where are the files located for the existing Java Class ?..
Help Needed Please.
Thanks,
Murali.vHi Murali,
Heres a thread which discussed uploading java source file instead of runnable code on to the database, which might be helpful :
Configure deployment to a database to upload the java file instead of class
The files for the java class you created in JDev project is located in the myworks folder in jdev, eg, <jdev_home>\jdev\mywork\Application1\Project1\src\project1
Hope this helps,
Sunil.. -
help needed for writing query
i have the following tables(with data) as mentioned below
FK*-foregin key (SUBJECTS)
FK**-foregin key (COMBINATION)
1)SUBJECTS(table name)
SUB_ID(NUMBER) SUB_CODE(VARCHAR2) SUB_NAME (VARCHAR2)
2 02 Computer Science
3 03 Physics
4 04 Chemistry
5 05 Mathematics
7 07 Commerce
8 08 Computer Applications
9 09 Biology
2)COMBINATION
COMB_ID(NUMBER) COMB_NAME(VARCHAR2) SUB_ID1(NUMBER(FK*)) SUB_ID2(NUMBER(FK*)) SUB_ID3(NUMBER(FK*)) SUBJ_ID4(NUMBER(FK*))
383 S1 9 4 2 3
384 S2 4 2 5 3
---------I actually designed the ABOVE table also like this
3) a)COMBINATION
COMB_ID(NUMBER) COMB_NAME(VARCHAR2)
383 S1
384 S2
b)COMBINATION_DET
COMBDET_ID(NUMBER) COMB_ID(FK**) SUB_ID(FK*)
1 383 9
2 383 4
3 383 2
4 383 3
5 384 4
6 384 2
7 384 5
8 384 3
Business rule: a combination consists of a maximum of 4 subjects (must contain)
and the user is less relevant to a COMB_NAME(name of combinations) but user need
the subjects contained in combinations
i need the following output
COMB_ID COMB_NAME SUBJECT1 SUBJECT2 SUBJECT3 SUBJECT4
383 S1 Biology Chemistry Computer Science Physics
384 S2 Chemistry Computer Science Mathematics Physics
or even this is enough(what i actually needed)
COMB_ID subjects
383 Biology,Chemistry,Computer Science,Physics
384 Chemistry,Computer Science,Mathematics,Physics
you can use any of the COMBINATION table(either (2) or (3))
and i want to know
1)which design is good in this case
(i think SUB_ID1,SUB_ID2,SUB_ID3,SUB_ID4 is not a
good method to link with same table but if 4 subjects only(and must) comes
detail table is not neccessary )
now i am achieving the result by program-coding in C# after getting the rows from oracle
i am using oracle 9i (also ODP.NET)
i want to know how can i get the result in the stored procedure itsef.
2)how it could be designed in any other way.
any help/suggestion is welcome
thanks for your time --PradeeshWell I forgot the table-alias, here now with:
SELECT C.COMB_ID
, C.COMB_NAME
, (SELECT SUB_NAME
FROM SUBJECTS
WHERE SUB_ID = C.SUB_ID1) AS SUBJECT_NAME1
, (SELECT SUB_NAME
FROM SUBJECTS
WHERE SUB_ID = C.SUB_ID2) AS SUBJECT_NAME2
, (SELECT SUB_NAME
FROM SUBJECTS
WHERE SUB_ID = C.SUB_ID3) AS SUBJECT_NAME3
, (SELECT SUB_NAME
FROM SUBJECTS
WHERE SUB_ID = C.SUB_ID4) AS SUBJECT_NAME4
FROM COMBINATION C;
As you need exactly 4 subjects, the columns-solution is just fine I would say. -
Urgent help needed, can I restore N900 Backup file...
i owned a N900 (now sold out)
before selling i took backup of contacts from backup restore option in application section
now i bought a N8 but i m not able to restore my contacts
1. is there any way to restore them in N8?
2. if not, can i convert them in TEXT or any readable format
urgent help needed
thanks in advanceThe backup procedures built into the phone are only designed for restoring to the same phone (ie: in case or data corruption, software update or repair etc.), they can't usually be used to restore to a phone with a different operating system.
You should have backed up with Ovi Suite before selling the N900, that would have been able to restore to the N8. -
PDFActions on xMII12. Help needed immediately???
Good Day everyone. I face a problem when trying to deploy PDFActions.jar file in xMII 12. The procedure i followed is ,
1) I created a file called catalog.xml from the PDFComponentCatalog.xml file which presents in xMII 11.5.
2) Then i created the PDFActions.jar file along with the xml file.
3) Used Custom Actions link in System Management and added PDFActions.jar file as the assembly file and iText.jar file as the dependency file. The upload was successful and i deployed without any error.
4) When i open workbench i can see a PDF action block on the left side without images, and when i try to add it to a sequence nothing happens. It is not getting added in sequence and i am not getting any error messages
Can anyone help me out on this?I guess you've been posting this issue for quite sometime now and inspite of getting hints I am not sure why you are coming up with your own steps to resolve the problem.
SAP note 1109054 has been mentioned probably a number of times before and I would advice you to open it up and read through , carefully , with a relaxed mind , no need to panic (read - Help needed immediately???).
The above mentioned note is for 12.0 SP2 so make sure you are on that version and because there have been no postings/notes for SP3 I would think the note would be applicable for SP3 as well.
If you face any issues after that then raise your doubts. -
I cannot configure yahoo small business after upgrading to Mavericks Help needed
Hi Guys,
it is as simple as that:
I cannot configure yahoo small business after upgrading to Mavericks Help needed
ThanksPlease read this whole message before doing anything.
This procedure is a diagnostic test. It’s unlikely to solve your problem. Don’t be disappointed when you find that nothing has changed after you complete it.
The purpose of the test is to determine whether the problem is caused by third-party software that loads automatically at startup or login, by a peripheral device, or by corruption of certain system caches.
Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards. Boot in safe mode and log in to the account with the problem. Note: If FileVault is enabled on some models, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
Safe mode is much slower to boot and run than normal, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin. Test while in safe mode. Same problem? After testing, reboot as usual (i.e., not in safe mode) and verify that you still have the problem. Post the results of the test. -
Changing DataSource Configuration using ConfigTool - Help Needed.
Hello Everyones,
I have an EP 7 which I have installed on a WAS ABAP + JAVA. The Data Soruce configuraion is in dataSourceConfiguration_abap.xml because of this I cannot create any new users in the Portal, can someone tell me how I can change this Config file using the ConfigTool and what procedure is to be used.
Thanks for your help,
John.
Message was edited by: John BraySee Changing DataSource Configuration using ConfigTool - Help Needed.
-
Troubleshooting help needed: My iMac keeps crashing and restarting with a notice: "Spinlock application timed out" What can I do?
Launch the Console application in any of the following ways:
☞ Enter the first few letters of its name into a Spotlight search. Select it in the results (it should be at the top.)
☞ In the Finder, select Go ▹ Utilities from the menu bar, or press the key combination shift-command-U. The application is in the folder that opens.
☞ Open LaunchPad. Click Utilities, then Console in the page that opens.
Select the most recent panic log under System Diagnostic Reports. Post the contents — the text, please, not a screenshot. In the interest of privacy, I suggest you edit out the “Anonymous UUID,” a long string of letters, numbers, and dashes in the header and body of the report, if it’s present (it may not be.) Please don't post shutdownStall, spin, or hang reports. -
Hi all help needed I have a canon 40D. I am thinking of buying a canon 6D.
But not sure that my lenses will work.
I have a 170mm/ 500mm APO Sigma.
A 10/20 ex Sigma HSM IF.
And a 180 APO Sigma Macro or do I have to scrap them and buy others.
ALL Help will be greatly received. Yours BRODIEIn short, I love it. I was going to buy the 5DMark III. After playing with it for a while at my local Fry's store where they put 5DMII, 5DMIII and 6D next to each other, using the same 24-105L lens, I decided to get the 6D and pocket the different for lens later.
I'm upgrading from the 30D. So I think you'll love it. It's a great camera. I have used 5DMII extensively before (borrowing from a close friend).
Funny thing is at first I don't really care about the GPS and Wifi much. I thought they're just marketing-gimmick. But once you have it, it is actually really fun and helpful. For example, I can place the 6D on a long "monopod", then use the app on the phone to control the camera to get some unique perspective on some scenes. It's fun and great. GPS is also nice for travel guy like me.
Weekend Travelers Blog | Eastern Sierra Fall Color Guide -
Help needed! Raid degraded again!
Hi!
Help needed! I hava made bootable RAID with two S-ATAII 250Gb HDD and its not working! Every now and then at bootup I get a message RAID -> DEGRADED... Must be seventh time! Rebuild takes its own time!
What am I doing wrong!
T: Ekku
K8N Neo4 Ultra
AMD 64 4200+
2 Gb RAM
2 x 250 Gb HDD (Maxtor)
nVidia RAID (in mb)
P.S. I wery SORRY with my poor language!I'm going to blame the nVRAID because I've seen issues with it in the past. If your motherboard has another non-nVidia RAID solution, use that instead. Using the nVidia SATA ports as BASE or JBOD is fine and dandy but RAIDing always had issues. It's not even a driver issue I think it's just instability. Latest drivers and even boxed drivers never helped. Granted, some will report success with their rig. But on a professional level I've seen nForce issues on different motherboards and different hard drives that had RAID disaster stories.
Good luck and if you don't have another RAID solution, my suggestion would be to buy a dedicated RAID controller card.
LPB -
HELP NEEDED WITH ADDAPTER-DVI TO VGA.
PLEASE ...HELP NEEDED WITH WIRING CROSS OVER....CAN YOU HELP WITH BACK OF PLUG CONNECTIONS...I SORTA UNDERSTAND THE PINOUTS BUT CANT MAKE AN EXACT MACH...WOULD LIKE TO BE 100% SURE...
......THIS ENSURES NO SMOKE!!!
THE CARD IS AN ATI RADEON RX9250-DUAL HEAD-.........ADDAPTER IS DVI(ANALOG)MALE TO VGA(ANALOG)FEMALE.
ANY HELP VERY MUCH APPRECIATED........ SEEMS YOU NEED TO BE ROCKET SCI TO ATTACH A BLOODY PICTURE...SO THIS HAS BEEN BIG WASTE OF FING TIME!Quote from: BOBHIGH on 17-December-05, 09:21:31
Get over it mate !
I find it easy t read CAPS...and if you dont like it ...DONT READ IT!
And why bother to reply...some people have nothing better to do.
Yes there chep and easy to come by...Ive already got a new one.
All I wanted was to make a diagram of whats inside the bloody thing...it was a simple question and required a simple answer.
NO NEED TO A WANKA !!
I feel a bann comming up.
Have you tryed Google ? really.. your question is inrelevant. No need to reply indeed.
Why do you come here asking this question anyway ? is it becouse you have a MSI gfx card ? and the adapter has nothing to do with this ?
You think you can come in here yelling.. thinking we have to put up with it and accept your style of posting. This is not a MSI tech center.. it's a user to user center.. Your question has nothing to do with MSI relavant things anyway's.
Google = your friend.
Quote from: BOBHIGH on 17-December-05, 09:21:31
it was a simple question and required a simple answer
Simple for who ? you (buying a new one) ? me ? we ? .really...........
Quote from: Dynamike on 16-December-05, 04:11:48
1: There are allot of diffrent types of those adapters.
If any of the mods have a problem about my reply.. please pm me. -
Help needed for grouping.
Hi,
Help needed .
I have an internal table having 6 .
Ex :
f1 f2 f3 f4 f5 f6
a aa 11 p1 10 10
a aa 12 p1 20 20
b aa 11 p2 30 30
b aa 12 p2 40 30
Now i want to sum the fields f5 and f6 individually and need to display based upon the fields f1 and f4.
To Display :
f1 f2 f3 f4 f5 f6
a aa 11 p1 30 30.
b aa 11 p2 70 60.
can anyone help me.How to do this..?
ThanksHere you go
DATA:
BEGIN OF cur_tab OCCURS 0,
f1 TYPE c,
f2(2) TYPE c,
f3(2) TYPE c,
f4(2) TYPE c,
f5(2) TYPE c,
f6(2) TYPE n,
END OF cur_tab.
DATA:
BEGIN OF sum_tab OCCURS 0,
f1 TYPE c,
f4(2) TYPE c,
f5 TYPE p,
f6 TYPE p,
END OF sum_tab.
DATA:
BEGIN OF final_tab OCCURS 0,
f1 TYPE c,
f2(2) TYPE c,
f3(2) TYPE c,
f4(2) TYPE c,
f5(5) TYPE c,
f6(5) TYPE c,
END OF final_tab.
START-OF-SELECTION.
cur_tab-f1 = 'a'.
cur_tab-f2 = 'aa'.
cur_tab-f3 = '11'.
cur_tab-f4 = 'p1'.
cur_tab-f5 = '10'.
cur_tab-f6 = '10'.
APPEND cur_tab.
cur_tab-f1 = 'a'.
cur_tab-f2 = 'aa'.
cur_tab-f3 = '11'.
cur_tab-f4 = 'p1'.
cur_tab-f5 = '20'.
cur_tab-f6 = '20'.
APPEND cur_tab.
cur_tab-f1 = 'b'.
cur_tab-f2 = 'aa'.
cur_tab-f3 = '11'.
cur_tab-f4 = 'p2'.
cur_tab-f5 = '30'.
cur_tab-f6 = '30'.
APPEND cur_tab.
cur_tab-f1 = 'b'.
cur_tab-f2 = 'aa'.
cur_tab-f3 = '11'.
cur_tab-f4 = 'p2'.
cur_tab-f5 = '40'.
cur_tab-f6 = '30'.
APPEND cur_tab.
LOOP AT cur_tab.
MOVE-CORRESPONDING cur_tab TO sum_tab.
COLLECT sum_tab.
ENDLOOP.
LOOP AT sum_tab.
READ TABLE cur_tab WITH KEY f1 = sum_tab-f1
f4 = sum_tab-f4.
IF sy-subrc NE 0.
WRITE:/ 'Something went very wrong'.
CONTINUE.
ENDIF.
MOVE-CORRESPONDING cur_tab TO final_tab.
MOVE-CORRESPONDING sum_tab TO final_tab.
APPEND final_tab.
ENDLOOP.
LOOP AT final_tab.
WRITE:/1 final_tab-f1,
AT 5 final_tab-f2,
AT 10 final_tab-f3,
AT 15 final_tab-f4,
AT 20 final_tab-f5,
AT 25 final_tab-f6.
ENDLOOP.
and the output
a aa 11 p1 30 30
b aa 11 p2 70 60
Maybe you are looking for
-
LIKE and Type in abap statements
Hello All , I have a question regarding the 'Like' and' Type' I have created a badi XXX , The method has a changing parameter 'A' which is referenced to a structure . The typing method I have mentioned in the method ( in the parameter list ) is TY
-
HI FRNDS, I HAVE A URGENT REQUIREMENT OF IS UTILITY, PLZ ANYONE COULD HELP ME . PLZ COULD U SEND ME INFORMATION ABOUT THAT . THANKS IN ADVANCE. VIJAY DWIVEDI
-
IPhoto 6 and Makernotes!!!!!
I'm dying to know. Has iPhoto 6 fixed the ridiculous load times for those with the unfortunate luck of having cameras that create large makernotes!? Please tell me if you know! I can't wait to actually have a photo program that works the way it shoul
-
We noticed that the files appear to go through, when we published to an FTP site. The GUI shows progress, and but when we later checked the server, the files were not there. As a test we deleted all files and directories off the server and started a
-
Prop_DevFamily "Spartan6" not recognised by Xilinx 11.5
I have a cRIO-9075 which I'm trying to get going with a couple of 9223 modules, using an example project I managed to find. I have Labview, FPGA and RT modules, all 2010 SP1, and NI-RIO 12.0 installed. I also have the Xilinx 11.5 Compilation tools in