Help with sql needed
Posted in 2000
Topics: Transactions, Locking & Isolation, Platform-Specific Issues
Informix Dynamic Server Version 7.30.UC8
Using an aix shell script, I ask the user for a few pieces of
information to import into a table. I then pipe this into isql with an
"isql << !EOF!" block.
The table basically logs times of certain things that happen
overnight.
In this case, the upload that the startupl and stopupl fields refer to
could contain 1 or more, or all of the projects on a given night.
I would like the user to be able to enter something like "*" when
prompted for that field. When I do that though, it returns 0 rows
updated..
How can I modify the code below to update everything that matched the
calldte , site, and a wildcard for project? ??
database development;lock table nightpost in exclusive mode;
update nightpost
set tkamx_startupl = '08:00',
tkamx_stopupl = '08:55'
where tkamx_calldte = "08/30/2000"
and tkamx_site = "47"
and tkamx_project = '*' ;
unlock table nightpost;
Thanks for any assistance!
Tony!
Pardon my ignorance of isql, but in 'normal' SQL, I believe that '%' is the
wildcard, not '*'.
Doug
"Tony!" <NoSpam@Thank.You.com> wrote in message
news:O4uuOaTIPiPMbUWPcUiSnDEDLSd0@4ax.com...
>
> Informix Dynamic Server Version 7.30.UC8
>
> Using an aix shell script, I ask the user for a few pieces of
> information to import into a table. I then pipe this into isql with an
> "isql << !EOF!" block.
> The table basically logs times of certain things that happen
> overnight.
> In this case, the upload that the startupl and stopupl fields refer to
> could contain 1 or more, or all of the projects on a given night.
> I would like the user to be able to enter something like "*" when
> prompted for that field. When I do that though, it returns 0 rows
> updated..
> How can I modify the code below to update everything that matched the
> calldte , site, and a wildcard for project? ??
>
> database development;> lock table nightpost in exclusive mode;
> update nightpost
> set tkamx_startupl = '08:00',
> tkamx_stopupl = '08:55'
> where tkamx_calldte = "08/30/2000"
> and tkamx_site = "47"
> and tkamx_project = '*' ;
> unlock table nightpost;
>
>
> Thanks for any assistance!
>
> Tony!
>
Your real close. You need to use the keyword matches versus =.
and tkamx_project matches '*' ;
Your current sql looks for the character project
names called '*' and I guess there are none.
Ray
"Tony!" wrote:
>
> Informix Dynamic Server Version 7.30.UC8
>
> Using an aix shell script, I ask the user for a few pieces of
> information to import into a table. I then pipe this into isql with an
> "isql << !EOF!" block.
> The table basically logs times of certain things that happen
> overnight.
> In this case, the upload that the startupl and stopupl fields refer to
> could contain 1 or more, or all of the projects on a given night.
> I would like the user to be able to enter something like "*" when
> prompted for that field. When I do that though, it returns 0 rows
> updated..
> How can I modify the code below to update everything that matched the
> calldte , site, and a wildcard for project? ??
>
> database development;> lock table nightpost in exclusive mode;
> update nightpost
> set tkamx_startupl = '08:00',
> tkamx_stopupl = '08:55'
> where tkamx_calldte = "08/30/2000"
> and tkamx_site = "47"
> and tkamx_project = '*' ;
> unlock table nightpost;
>
> Thanks for any assistance!
>
> Tony!
Your real close. You need to use the keyword matches versus =.
and tkamx_project matches '*' ;
Your current sql looks for the character project
names called '*' and I guess there are none.
Ray
"Tony!" wrote:
>
> Informix Dynamic Server Version 7.30.UC8
>
> Using an aix shell script, I ask the user for a few pieces of
> information to import into a table. I then pipe this into isql with an
> "isql << !EOF!" block.
> The table basically logs times of certain things that happen
> overnight.
> In this case, the upload that the startupl and stopupl fields refer to
> could contain 1 or more, or all of the projects on a given night.
> I would like the user to be able to enter something like "*" when
> prompted for that field. When I do that though, it returns 0 rows
> updated..
> How can I modify the code below to update everything that matched the
> calldte , site, and a wildcard for project? ??
>
> database development;> lock table nightpost in exclusive mode;
> update nightpost
> set tkamx_startupl = '08:00',
> tkamx_stopupl = '08:55'
> where tkamx_calldte = "08/30/2000"
> and tkamx_site = "47"
> and tkamx_project = '*' ;
> unlock table nightpost;
>
> Thanks for any assistance!
>
> Tony!