Jump to content

Pl/sql Topulu Konchem Randi Babu... Oo Sahayam Kavali


Recommended Posts

Posted

Ignore if you already got help:

naak requirement sakag ardam kale....filed1 lo same value ante ardam kale? example with data will be helpful..
[quote name='Kakateeyudu©' timestamp='1356027088' post='1302988154']
Ee kinda statement asalu em chestundhi..........


select count(*) into kakateyudu from afdb_table where :OLD.field1= :NEW.field1 and status = 'K';


na requirement vachesi... aa kakateyudu ane variable lo ki afdb_table lo field1 lo same value and status = k vunna count vellai

kasta seppandi vayya... aa paina statement ithe work avi savatledu... adhi trigger lo condition

CITI#H@ CITI#H@
[/quote]

  • Replies 88
  • Created
  • Last Reply

Top Posters In This Topic

  • Kakateyudu

    35

  • cherlapalli_jailer

    18

  • Mrlavangam

    10

  • ChampakDas

    8

Top Posters In This Topic

Posted

good


so epudu below dani output ela undalo chepu

key1 status

1 n
1 n
1 x
2 n
3 x

[quote name='Kakateeyudu©' timestamp='1356032759' post='1302989102']
Table1 ane table lo status,key1 ane fields vunnai anukundam....

so na condition endhi ante kakateyudu ane variable lo ki table1 lo key1 lo same value and status='n' ane rows yenni vunnai ani

table:

key1 status

1 n
1 n
1 x

paina table ki naku aa kakateyudu ane variable lo ki 2 ravali
[/quote]

Posted

[quote name='GatisKandis' timestamp='1356043392' post='1302990847']
Ignore if you already got help:

naak requirement sakag ardam kale....filed1 lo same value ante ardam kale? example with data will be helpful..
[/quote]Table1 ane table lo status,key1 ane fields vunnai anukundam....

so na condition endhi ante kakateyudu ane variable lo ki table1 lo key1 lo same value and status='n' ane rows yenni vunnai ani

table:

key1 status

1 n
1 n
1 x

paina table ki naku aa kakateyudu ane variable lo ki 2 ravali

Posted

there you go...deeni output chepu
[quote name='cherlapalli_jailer' timestamp='1356034315' post='1302989481']
can i assume u data like this?

KEY1 Status
1 N
1 N
2 N
2 N
1 X
2 X
[/quote]

Posted

key1 values different unnayi kada kaka....status 'n' undhi apudu output ela undali
[quote name='Kakateeyudu©' timestamp='1356038719' post='1302990252']

Key1 lo same value and status 'n' yenni rows vunnai oo kavali.... if that count = 0 then status 'n' tho insert cheyyali or status = 'x' tho
[/quote]

Posted

10th class lo nerpincharu edhi maku [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]
[quote name='Kaarthikeya' timestamp='1356036641' post='1302989893']
idem twist kothaga? [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]
[/quote]

Posted

[quote name='GatisKandis' timestamp='1356043914' post='1302990890']
key1 values different unnayi kada kaka....status 'n' undhi apudu output ela undali
[/quote]

Good question... Matter enti ante. Table1 meda trigger adi nenu cheppindhi... Aa table meda trigger adhi depending of those conditions vere table ki status change chesi rastunna.....

Posted

KEY1 Status
1 N
1 N
2 N
2 N
1 X
2 X

ela untey kaka anne variable ki value em undali?

[quote name='Kakateeyudu©' timestamp='1356044285' post='1302990953']
Good question... Matter enti ante. Table1 meda trigger adi nenu cheppindhi... Aa table meda trigger adhi depending of those conditions vere table ki status change chesi rastunna.....
[/quote]

Posted

[quote name='Kakateeyudu©' timestamp='1356044285' post='1302990953']
Good question... Matter enti ante. Table1 meda trigger adi nenu cheppindhi... Aa table meda trigger adhi depending of those conditions vere table ki status change chesi rastunna.....
[/quote]


nuvvoka value pampisthunnav...aa value already table lo vundi status n vunte count teesukovali ani anukuntunnav anthena???

Posted

[quote name='GatisKandis' timestamp='1356043979' post='1302990903']
10th class lo nerpincharu edhi maku [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]
[/quote]


seems like u r the topper right from 10th class [img]http://lh3.ggpht.com/--o7mXz3u-j4/T9VVBGzBJAI/AAAAAAAAGo0/kmj8a1-XW2g/s150/PK-1.gif[/img]

Posted

[quote name='mrudhula99' timestamp='1356043103' post='1302990827']
naku konni question unnai.. plsql script run chesthunte.. errors vasthunnai...

evarikaina thelisthee..cheppandi

error entantee


Encountered the symbol "SET" when expecting one of the following:
:= . ( @ % ;
The symbol ":= was inserted before "SET" to continue.


[/quote]
okasaari aa line motham vestaava...names maarchi

Posted

red: naak ardam kanidhi enti ante status same undi key value different untey?
[quote name='Mrlavangam' timestamp='1356044533' post='1302990981']


nuvvoka value pampisthunnav...aa value already table lo [color=#ff0000][b]vundi status [/b][/color]n vunte count teesukovali ani anukuntunnav anthena???
[/quote]

Posted

[quote name='GatisKandis' timestamp='1356044802' post='1302991019']
red: naak ardam kanidhi enti ante status same undi key value different untey?
[/quote]


This is what I understand from what kakateeyudu told...

Lets suppose the table has the data like this

[color=#282828][font=helvetica, arial, sans-serif]KEY1 Status[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]1 N[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]1 N[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]2 N[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]2 N[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]1 X[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]2 X[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]Now, he is trying to load a new record(might be to a different table or same table) and it has a value which he is comparing it with key1.Say if the value is 3, since there is no record with 3, it should show the count as zero.it the value is 2, then it has to check in this table with key1 as 2 and staus as 'N'..[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]Naaku ila arthamayyindi mama...kakateeyudu cheppali crrcto wrongo...and the below query satisfy chetshudi anukuntunna..[/font][/color]

select CASE when :OLD.field1= :NEW.field1 and status = 'N'
THEN 1 else 0 END into kakateyudu from afdb_table

if kakateeyudu =1
v_status:='X'
else
v_status:='N'

INSERT INTO New_tbl
(X,X,X,X )
VALUES
( :new.X,
:new.X,
:new.X,
:new.X,
v_status );

Posted

[quote name='Mrlavangam' timestamp='1356044533' post='1302990981']



nuvvoka value pampisthunnav...aa value already table lo vundi status n vunte count teesukovali ani anukuntunnav anthena???
[/quote]
Right

×
×
  • Create New...