Help Again - Looping - Sorry "guys"

Help Again - Looping - Sorry "guys"

Post by SPARTA » Mon, 22 Jan 2001 06:20:43



Ok, I am really stupid and confused and frustarted.

PLEASE help me out here...I just need a code slice to get going again.

I Have read Books Online, etc and still can't
get anything to work.

I need to create a procedure to step through each row of a table and
test the row/column value ( say Country <> 'UNITED STATES' ) and if
the expression is "true" update the column ( say FAXB_Req ) to a value
in that same row.

Am I crazy or stupid ? I just can't get this one no matter what I do.

Anyone done this before that can give me a hand, rather than a
refferal to books online. ( BTW I really do appreciate that referral,
only it just confused me more., my apologies on that one ).

AND I would really like to let everyone know how grateful I am for all
your past assitance and your total patience with me. It is well
recevied and much apprecaited.

THANK YOU ALL !

Spartan

 
 
 

Help Again - Looping - Sorry "guys"

Post by a29.. » Mon, 22 Jan 2001 06:55:30


DECLARE mark_cur   CURSOR FOR
         SELECT idcol, col1 ...
         FROM   mark
OPEN mark_cur
WHILE 1 = 1
BEGIN



END
CLOSE mark_cur
DEALLOCATE mark_cur



> Ok, I am really stupid and confused and frustarted.

> PLEASE help me out here...I just need a code slice to get going again.

> I Have read Books Online, etc and still can't
> get anything to work.

> I need to create a procedure to step through each row of a table and
> test the row/column value ( say Country <> 'UNITED STATES' ) and if
> the expression is "true" update the column ( say FAXB_Req ) to a value
> in that same row.

> Am I crazy or stupid ? I just can't get this one no matter what I do.

> Anyone done this before that can give me a hand, rather than a
> refferal to books online. ( BTW I really do appreciate that referral,
> only it just confused me more., my apologies on that one ).

> AND I would really like to let everyone know how grateful I am for all
> your past assitance and your total patience with me. It is well
> recevied and much apprecaited.

> THANK YOU ALL !

> Spartan

Sent via Deja.com
http://www.deja.com/

 
 
 

Help Again - Looping - Sorry "guys"

Post by Ivan Arjentinsk » Mon, 22 Jan 2001 20:19:33


Try:

UPDATE Table1
SET FAXB_Req = <expression>
WHERE Country <> 'UNITED STATES'

--
Ivan Arjentinski
-----------------------------------------------
Please answer only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.

-----------------------------------------------


Quote:> Ok, I am really stupid and confused and frustarted.

> PLEASE help me out here...I just need a code slice to get going again.

> I Have read Books Online, etc and still can't
> get anything to work.

> I need to create a procedure to step through each row of a table and
> test the row/column value ( say Country <> 'UNITED STATES' ) and if
> the expression is "true" update the column ( say FAXB_Req ) to a value
> in that same row.

> Am I crazy or stupid ? I just can't get this one no matter what I do.

> Anyone done this before that can give me a hand, rather than a
> refferal to books online. ( BTW I really do appreciate that referral,
> only it just confused me more., my apologies on that one ).

> AND I would really like to let everyone know how grateful I am for all
> your past assitance and your total patience with me. It is well
> recevied and much apprecaited.

> THANK YOU ALL !

> Spartan

 
 
 

1. "Do" Loop {I Need Help}

I need help. The code below is not working correctly. It gets stuck in a
continuos loop and the only way to stop it is <CTRL-PAUSE>
I want to take a list of backordered parts, then receive them into
inventory by the click of one button.

Thanks...

   If Data1.Recordset.RecordCount > 0 Then

     Data1.Recordset.MoveFirst

     On Error Resume Next
       Do
        Text4 = Text7  'Take the backordered qty and make it the qty
received
        Command4.Value = 1  'Now calculate the fields, making the
backordered field 0 and the instock field updated
        Data1.Recordset.MoveNext
         If Data1.Recordset.RecordCount = 0 Then Exit Do
       Loop
     Data1.Refresh
     SSDBGrid1.Visible = False  ' This is the visible list of what is on
backorder
     Me.Width = 8250   ' Trim the screen down

   Else

     Data1.RecordSource = "select * from parts"  ' Show all parts
     Data1.Refresh
     SSDBGrid1.Visible = False  ' Hide the B/O list
     Me.Width = 8250

   End If

2. SQL Problem

3. Sorry guys, will not commit this again

4. Free Report ### Free Report $$ Free Report

5. max of ("...","...","..")

6. US-VA-ORACLE DBA

7. Sorry for "222"

8. Run Time Error - HELP

9. "LIMIT" problem again

10. Issue w/ CASE and ">" - again

11. "INVALID DESCRIPTOR INDEX" problem again

12. DIA3605C / "81" errors again :(

13. How to make a "decimal"-field to an "integer"-field