Jump to content

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


Recommended Posts

Posted

[quote name='cherlapalli_jailer' timestamp='1356032597' post='1302989072']
nee requiment PM cheyyi kasta confusing ga vunnadi

coz

is this the stmt u r looking?


[b]SELECT count(*) INTO v_count
FROM afdb where :OLD:filed1=:NEW.field1 and status = 'K'

if v_count > 0
v_status:='K'
else
v_status:='X'[/b]

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

END;

;
[/quote]

Greater than zero avvalsina avasaram led baa..... v_count = 0 ithe v_status = 'k' else v_status = 'x'

  • 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

[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]


aok

Posted

[color=#282828][font=helvetica, arial, sans-serif]Table1 ane table lo status,key1 ane fields vunnai anukundam....[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]so na condition endhi ante kakateyudu ane variable lo ki table1 lo key1 lo same value and status='n' ane rows yenni vunnai ani[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]table:[/font][/color]

[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]1 x[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]paina table ki naku aa kakateyudu ane variable lo ki 2 ravali[/font][/color]

Posted

[quote name='cherlapalli_jailer' timestamp='1356032908' post='1302989135']
aok
[/quote]
avnaaa....... kasta edit cheyyi guru

Posted

[quote name='Kakateeyudu©' timestamp='1356032931' post='1302989144']
[color=#282828][font=helvetica, arial, sans-serif]Table1 ane table lo status,key1 ane fields vunnai anukundam....[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]so na condition endhi ante kakateyudu ane variable lo ki table1 lo key1 lo same value and status='n' ane rows yenni vunnai ani[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]table:[/font][/color]

[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]1 x[/font][/color]

[color=#282828][font=helvetica, arial, sans-serif]paina table ki naku aa kakateyudu ane variable lo ki 2 ravali[/font][/color]
[/quote]


nuvvu raasindi correct e mari

select count(*) into kaka from afdb where key1=1 and status = 'n'

Posted

[quote name='cherlapalli_jailer' timestamp='1356033026' post='1302989160']


nuvvu raasindi correct e mari

select count(*) into kaka from afdb where[b] key1=1[/b] and status = 'n'
[/quote]

Key1 = 1 endhi baa ?

Posted

[quote name='Kakateeyudu©' timestamp='1356033137' post='1302989182']

Key1 = 1 endhi baa ?
[/quote]

that will be the dynamic value u will be passing kada

value in key1 field (which is NEW value u will pass to trigger

Posted

[quote name='cherlapalli_jailer' timestamp='1356033217' post='1302989195']
that will be the dynamic value u will be passing kada

value in key1 field (which is NEW value u will pass to trigger
[/quote]


dynamic kaadhu baa..... already same values and status = 'n' tho yenni rows vunnai oo count cheyyali.... dynamic em passing ledu... compare cheseyyali as values differ each time kda

Posted

then do this

Posted

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]select count(*) into kaka from afdb where[/background][/size][/font][/color][color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)] status = 'n' group by key1,status[/background][/size][/font][/color]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]but this may return multiple values[/background][/size][/font][/color]

Posted

can i assume u data like this?

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

Posted

[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]


yes baa

Posted

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]select count(*) into kaka from afdb where[/background][/size][/font][/color][color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)] status = 'n' group by key1,status[/background][/size][/font][/color]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]but this may return multiple values[/background][/size][/font][/color]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]this will return multiple rows[/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]insert stmt deenitho join chesi raayali[/background][/size][/font][/color]

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]Aa tbl structure emiti?[/background][/size][/font][/color]

Posted

[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]select count(*) into kaka from afdb where[/background][/size][/font][/color][color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)] status = 'n' group by key1,status having count(*) > 0 [/background][/size][/font][/color]
[color=#282828][font=helvetica, arial, sans-serif][size=3][background=rgb(247, 247, 247)]try this[/background][/size][/font][/color]

×
×
  • Create New...