Home » SQL & PL/SQL » SQL & PL/SQL » Regarding append a 2 digit value to product value (merged)
Regarding append a 2 digit value to product value (merged) [message #279516] Thu, 08 November 2007 19:17 Go to next message
kirank05
Messages: 6
Registered: August 2007
Location: Hyderabad
Junior Member
Hi all,

Actually i am using cursor to selecting columns in batch table like this
SELECT
lower(content_type)
,lower(product_category)
,title
,url
,image
,default_item
,item_created_dt_part1
,item_created_dt_part2
,id -- seuquence generated
FROM content_batch
order by
lower(content_type)
,lower(product_category)
,item_created_dt_part1
,item_created_dt_part2
,id

For this batch table there is no product_name only product_category values from 1 to 15 in the order they are created.the priority of assigning 1 thru 15 will be decided by item_created_dt_part1,item_created_dt_part2,id

based on the if condition,while loading into the key table(weekly_content) append a 2 digit number value to product_category from batchtable(content_batch) in the order you insert into the key table and insert into product_name column

product_category column is in key table not in batch table..

if product_category='jewellery' then
product_name='jewellery01 --we need to generate for 1 to 15...

can you please help me in this

Thanks in advance
Re: Regarding to append a 2 digit number value to product_category column [message #279552 is a reply to message #279516] Fri, 09 November 2007 00:26 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Read and follow OraFAQ Forum Guide, especially "How to format your post?" section.
Make sure that lines of code do not exceed 80 characters when you format. Use the "Preview Message" button.
Always post your Oracle version (4 decimals).

Regards
Michel
Re: Regarding append a 2 digit value to product value [message #279569 is a reply to message #279516] Fri, 09 November 2007 01:24 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost.
Tags are between [] not <>

Regards
Michel

[Updated on: Fri, 09 November 2007 01:27]

Report message to a moderator

Re: Regarding append a 2 digit value to product value [message #279571 is a reply to message #279516] Fri, 09 November 2007 01:30 Go to previous messageGo to next message
Michel Cadot
Messages: 64152
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
I don't understand the question.
Maybe this will help:
SQL> select 'jewellery'||to_char(level,'fm00') cat from dual connect by level <= 15;
CAT
------------
jewellery01
jewellery02
jewellery03
jewellery04
jewellery05
jewellery06
jewellery07
jewellery08
jewellery09
jewellery10
jewellery11
jewellery12
jewellery13
jewellery14
jewellery15

15 rows selected.

Regards
Michel
Re: Regarding append a 2 digit value to product value (merged) [message #279573 is a reply to message #279516] Fri, 09 November 2007 01:48 Go to previous message
rajavu1
Messages: 1574
Registered: May 2005
Location: Bangalore , India
Senior Member

The question is not at all clear on
1. source and destination tables
2. the restriction of id from 1 to 15 only

The search on Analytic function may give you a good start.
Otherwise try to explain the question in detail with data if possible .

Thumbs Up
Rajuvan


Previous Topic: Return data from select table or View
Next Topic: bad bind variables while creating a stored procedure
Goto Forum:
  


Current Time: Sat Dec 10 01:10:54 CST 2016

Total time taken to generate the page: 0.10168 seconds