simple 4gl programme
Posted in 2000
I have done the following to copy from table bkpayment the value in its
column bkpm_linkref to
a table bkrec in the column bkr_linkref but I am getting an error " 391:
Cannot insert a null into column (bkrec.bkr_linkref). ". I then looked if
there are any null values in the source table (bkpaymnt) and found that
there were no rows found , Please help urgently.
The SQL statement I used is as follows
Update bkrec
set bkr_linkref = ( select bkpaymnt.bkpm_linkref from bkpaymn
where bkr_batchref = bkpm_linkref
and bkr_currvalue = bkpm_currvalue * -1
and bkr_proof = bkpm_proof
and bkpm_linkref is not NULL
)
where bkr_status = "U"
and bkr_linkref = " "
nB) Please note that the source table has more columns that the destination
table
-----Original Message-----
From: ART KAGEL, BLOOMBERG/ NEW YORK [mailto:KAGEL@bloomberg.net]
Sent: Wednesday, November 29, 2000 3:02 PM
To: Simbarashe.Pangeti@icl.com
Subject: Re: simple 4gl programme
UPDATE table_1
SET course = (
select t2.course
from table_2 t2
where t2.name = table_1.name and t2.regno = table_1.regno
);Include the UNIQUE keyword or an aggregate (ie MAX, MIN, etc.) if there may
be more than one matching row in table_2.
Art S. Kagel
----- Original Message -----
From: Simbarashe Pangeti <Simbarashe.Pangeti@icl.com>
At: 11/29 2:56
> pple i am having problem s or may be i am tied because i have been working
> the whole night
>
> problem
>
> i have two tables and what i want is to take a unique value(column) from
> table 2 and put it in
> table 1
>
> example
>
> table one
> name regno course
> simba 34 ff
> arts 35 tt
> iwe 23 dd
>
>
> table two
> name regno course
> simba 34 aa
> arts 35 mm
> iwe 23 dd
>
> so i want a script that will run for three thousand records and update
> course
> to a value in table2 eg course in table one to aa ie basically copying
> column course in table two to table one
>
>
> -----Original Message-----
> From: Art S. Kagel [mailto:kagel@bloomberg.net]
> Sent: Wednesday, November 29, 2000 12:28 AM
> To: informix-list@iiug.org
> Subject: Re: TIMESTAMP data type?
>
>
> Richard harnden wrote:
> >
> > >>> "Obnoxio The Clown" <obnoxio@hotmail.com> 11/23 10:27 am >>>
> > >
> > >Well, why not create your own TIMESTAMP datatype, since you're using
> 9.20?
> > >
> > >Then you won't have to CHANGE YOUR CODE! :-)
> >
> > But, you can't create a distinct type with a default clause, can you?
>
> Don't need a default clause if the type is designed to insert a time stamp
> automatically.
>
> Art S. Kagel