build sql [message #202490] |
Fri, 10 November 2006 00:47 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
i have a table say - rule_component
which has two columns
1.db_table
2.from_clause
The two columns contains tables for example
db_table
------------
emp
dept
bonus
emp
def
from_clause
----------------
emp,dept,bonus,dept,emp,abc
My requirement
i want to find the duplicate tables in both the from_clause and db_table column
and populate in my from clause which are unique to both the columns
say example
select ......
from emp,dept,bonus,abc,def --like this
i am using forms6i with oracle 9i as database.
|
|
|
Re: build sql [message #202513 is a reply to message #202490] |
Fri, 10 November 2006 02:35 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
Sorry, I can't understand your requirement.
Can you provide a clearer explanation of what you want.
An example showing the data that you have and the results that you expect would be useful. (Don't forget the table creation scripts);
|
|
|
|
Re: build sql [message #202528 is a reply to message #202490] |
Fri, 10 November 2006 03:42 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
SQL> descr sswms_rule_components;
Name Null? Type
----------------------------------------- -------- ---------------------
RULE_COMPONENT_ID NOT NULL NUMBER
RULE_COMPONENT_CODE NOT NULL VARCHAR2(30)
RULE_COMPONENT_NAME NOT NULL VARCHAR2(100)
ENABLED_FLAG NOT NULL VARCHAR2(1)
DB_TABLE VARCHAR2 (100)
DB_COLUMN VARCHAR2 (100)
DB_FUNCTION VARCHAR2(100)
WHERE_CLAUSE VARCHAR2 (2000)
FROM_CLAUSE VARCHAR2 (2000)
The table contains the following data
db_table
--------------------------------
sswms_shipment_lines
wsh_carrier_ship_method --- the data inside the db_table column is a table
db_column
--------------------------------
Ship to
Carrier_id
Where_clause
-----------------------------
Oe_order_headers_all.header_id = sswms_shipment_lines.order_header_id
From_clause
-------------------------
Oe_order_headers_all, sswms_shipment_lines -- the data inside the From_clause is a table
Now my requirement is to build a dynamic sql in forms 6i.when I click the build sql it should update the sql
So --- I have to write a procedure --
Select db_table || . || db_column || ‘’ || group_key
---group_key is an alias
From db_table, From_clause
--- Here the logic should be
1. I should remove the commas from the “FROM_CLAUSE” and check for duplicate values
2. i should check for duplicate values for the “DB_TABLE “ column
3. I should compare both the FROM_CLAUSE and DB_TABLE for DUPLICATE VALUES
4. After doing this I should add the result to the “FROM” in the select statement
|
|
|
|
|
|
|
Re: build sql [message #202559 is a reply to message #202548] |
Fri, 10 November 2006 06:28 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
JRowbottom
Messages: 5933 Registered: June 2006 Location: Sunny North Yorkshire, ho...
|
Senior Member |
|
|
For someone who is asking us to spend our spare time providing help, you have a remarkably poor attitude.
|
|
|
Re: build sql [message #202565 is a reply to message #202548] |
Fri, 10 November 2006 06:56 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
Instead of suggesting where to put the message you could have given some valuable suggestions.even it is wrongly posted the moderator will take care of putting it in the right place.Stop commenting about the questions asked.
|
|
|
|
Re: build sql [message #202571 is a reply to message #202565] |
Fri, 10 November 2006 07:26 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
sudharshan wrote on Fri, 10 November 2006 13:56 | Instead of suggesting where to put the message you could have given some valuable suggestions.even it is wrongly posted the moderator will take care of putting it in the right place.Stop commenting about the questions asked.
|
Well, that's the spirit.
I somehow don't expect too many valuable answers to this thread anymore, so maybe it was wise of you to post it on Oracle Forums as well.
Make sure you treat the people over there likewise...
|
|
|
Re: build sql [message #202580 is a reply to message #202565] |
Fri, 10 November 2006 07:44 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
Hi
by no means i asked particulary you to answer my question nor i demanded an answer from you.
I had a problem which i have not come across so i requested the forum to give me some valuable suggstions.
when next time i post a question i will say
My dearest and loving brother and sister
-- i think this sounds polite
sudharshan
|
|
|
Re: build sql [message #202582 is a reply to message #202580] |
Fri, 10 November 2006 07:52 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
![](/forum/images/custom_avatars/43055.jpg) |
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
Someone has been busy and this thread is very close to be shut down.
@op: it is you who are asking advice. You should have read the forum posting guidelines (TIPS&TRICKS), one thread per subject in one forum. But you chose to ignore them. You have absolutely no reason to have a short fuse. Sarcasm won't help you either.
MHE
[Updated on: Fri, 10 November 2006 07:57] Report message to a moderator
|
|
|
|
Re: build sql [message #202590 is a reply to message #202580] |
Fri, 10 November 2006 08:17 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
sudharshan
Messages: 48 Registered: November 2006
|
Member |
|
|
hi
It involves both oracle forms and plsql so i posted it.
i am sorry i didnt read that tips and tricks but it is the moderator duty who has to tell me dont put messages on two places. i dont want any unknown person to advise me to put the message in so called forum.
No suggestion for the problem then dont post messages .please do stop with it.
Empty vessels make more noise.
sudharshan
|
|
|
|