Board index » kylix » Re: Update

Re: Update


2004-12-07 06:10:20 AM
kylix0
Andreas Hausladen wrote:
Quote
Hey, I'm using Lego mindstorms and I'm even teaching it to 13 to 15
years old pupils.
While I own every mindstorms kit (1 of each that's been released)
currently available in Australia, I unfortunately don't get any time to
use them! Perhaps one day I keep telling myself!
--
** Currently looking for a couple of testers.
** More information in my blog!
+++++++++++++++++++++++++++++++++
Sneak Peek: JED, QC - IDE Edition at
www.alphalink.com.au/~jed/QC/
Blog: jedqc.blogspot.com/
 
 

Re:Re: Update

IB 6.5
Can someone please correct below sql ?
UPDATE TABLE1 SET CURR=1.25
WHERE ( TABLE1.CUSTNO=TABLE2.CUSTNO AND
TABLE2.CURR='Euro' )
Thank You.
 

Re:Re: Update

Henry Olive wrote:
Quote
IB 6.5

Can someone please correct below sql ?

UPDATE TABLE1 SET CURR=1.25
WHERE ( TABLE1.CUSTNO=TABLE2.CUSTNO AND
TABLE2.CURR='Euro' )
You didn't tell it how to select from Table2.
UPDATE TABLE1 SET CURR=1.25
WHERE EXISTS (
SELECT 1 FROM TABLE2
WHERE TABLE1.CUSTNO=TABLE2.CUSTNO
AND TABLE2.CURR='Euro'
)
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks.html
It used to be that other people's achievements were considered an
inspiration, not a grievance.
 

{smallsort}

Re:Re: Update

hi, is it easy to update to v10 and do some test and switch back to v9.0?
v9.0 it still my request developemnt version. thanks.
 

Re:Re: Update

This is a multi-part message in MIME format.
no text
 

Re:Re: Update

This is a multi-part message in MIME format.
Eric Grange wrote:
Quote
See BASM
 

Re:Re: Update

IB 6.02
I need something like below
UPDATE CK SET ID = GEN_ID(CK_ID, 1),
(IF TYP='D' THEN TYP='S' ELSE
IF TYP='R' THEN TYP='W' ELSE IF TYP='T'
THEN TYP='P'))
How can i do it ?
Thank you.
 

Re:Re: Update

Henry wrote:
Quote
UPDATE CK SET ID = GEN_ID(CK_ID, 1),
(IF TYP='D' THEN TYP='S' ELSE
IF TYP='R' THEN TYP='W' ELSE IF TYP='T'
THEN TYP='P'))

How can i do it ?
In IB < 7.5, with separate statements or a proc.
In IB 7.5 you can use CASE.
--
Craig Stuntz [TeamB] . Vertex Systems Corp. . Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
IB 6 versions prior to 6.0.1.6 are pre-release and may corrupt
your DBs! Open Edition users, get 6.0.1.6 from mers.com
 

Re:Re: Update

D7, IB 6.02
What is wrong with below SQL ?
UPDATE ODETAILS SET ODETAILS.COST=PARTS.COST
WHERE ODETAILS.PARTNO=PARTS.PARTNO
 

Re:Re: Update

Stan wrote:
Quote
What is wrong with below SQL ?

UPDATE ODETAILS SET ODETAILS.COST=PARTS.COST
WHERE ODETAILS.PARTNO=PARTS.PARTNO
Well, it isn't syntactically valid.
I suspect what you really want is:
UPDATE
ODETAILS
SET
ODETAILS.COST = (SELECT PARTS.COST
FROM PARTS
WHERE PARTS.PARTNO = ODETAILS.PARTNO);
--
Craig Stuntz [TeamB] ?Vertex Systems Corp. ?Columbus, OH
Delphi/InterBase Weblog : blogs.teamb.com/craigstuntz
All the great TeamB service you've come to expect plus (New!)
Irish Tin Whistle tips: learningtowhistle.blogspot.com
 

Re:Re: Update

Stan wrote:
Quote
D7, IB 6.02

What is wrong with below SQL ?

UPDATE ODETAILS SET ODETAILS.COST=PARTS.COST
WHERE ODETAILS.PARTNO=PARTS.PARTNO
And "Parts." is what actual table maybe "Car" ?
hth
--
Rob Schieck
TeamB
 

Re:Re: Update

Stan wrote:
Quote

What is wrong with below SQL ?

UPDATE ODETAILS SET ODETAILS.COST=PARTS.COST
WHERE ODETAILS.PARTNO=PARTS.PARTNO
While the syntax is nice (i.e. I think it would be great <g>), this is not a
valid update statement because values from other tables need to be
*selected*.
UPDATE ODETAILS SET
ODETAILS.COST= (
SELECT PARTS.COST FROM PARTS
WHERE ODETAILS.PARTNO=PARTS.PARTNO
)
Note that this is a correlated subquery, it executes once for every ODETAILS
row to be updated. If you find this statement slow, it can be made much more
efficient in a stored procedure where you could do the following:
FOR
SELECT ODETAILS.PARTNO, ODETAILS.COST
FROM ODETAILS
INNER JOIN PARTS
ON ODETAILS.PARTNO=PARTS.PARTNO
INTO :PARTNO, :COST
DO BEGIN
UPDATE ODETAILS SET
ODETAILS.COST = :COST
WHERE ODETAILS.PARTNO=:PARTNO
END;
--
Wayne Niddery - Logic Fundamentals, Inc. (www.logicfundamentals.com)
RADBooks: www.logicfundamentals.com/RADBooks.html
"The legitimate powers of government extend to such acts only as are
injurious to others. But it does me no injury for my neighbor to say
there are twenty gods, or no God. It neither picks my pocket nor breaks
my leg." ?Thomas Jefferson
 

Re:Re: Update

Eric Grange wrote:
Quote
Should fix dropdown and secondary windows default position.

Eric
The exe in the archive starts fine, but this one crashes immediately
after starting with runtime error 217. YMMV.
--
 

Re:Re: Update

Quote
The exe in the archive starts fine, but this one crashes immediately
after starting with runtime error 217. YMMV.
Re-uploaded, wrapped in a zip this time. Seems ok now.
Eric
 

Re:Re: Update

D7, IB 6,02
Part Name= AAAA XABC
How can i change just XABC to XXXX
That is, Part name should be 'AAAA XXXX'
Thank you.