Well, I'll be darned...  In my mind you shouldn't be able to do this because
I thought the view didn't get created at all but it does and although it has
no rows, vrows is indeed equal to 0.

Thanks Buddy. 

Also thanks to everyone who helped me with the solution...

Claudine :)

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Walker, Buddy
Sent: Thursday, March 17, 2005 2:16 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Re: Create Error Code Table

Claudine
  If I'm understanding you right, all you want to do is see if the view
exists and if not display a message.
 
  Right after you create the view do this

*************** 
  CREATE TEMPORARY VIEW ........

  SET VAR vrows INTEGER = 0
  SELECT COUNT(*) INTO vrows INDIC ivrows FROM ViewName WHE LIMIT = 1

  IF vrows = 0 THEN
   your message here
   GOTO Done
  ENDIF

  PRINT yourreport 

LABEL DONE
  
RETURN

*******************
  


Buddy
 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Claudine
Robbins
Sent: Thursday, March 17, 2005 1:41 PM
To: RBG7-L Mailing List
Subject: [RBG7-L] - Re: Create Error Code Table

Thanks Razzak and Alastair,

OK, we're getting closer.  I have a listbox with an "on right click" eep
that creates a temporary view then prints a report based on the view.
If there is no data, there is no view, there is no report and more
importantly there is no indication to the user that no records were
found...  I'm not getting an error message just my form on the screen
with no feedback whatsoever.  I want to be able to test some value such
as sqlcode or sqlstate (which is HY000 on succeeds and 00000 on fails -
is that usable?) to set my vmsg variable to show the user in a pau 2
using command that there were no records found.

> -----Original Message-----
> From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of A. 
> Razzak Memon
> Sent: Thursday, March 17, 2005 12:09 PM
> To: RBG7-L Mailing List
> Subject: [RBG7-L] - Re: Create Error Code Table
> 
> 
> At 12:38 PM 3/17/2005, Claudine Robbins wrote:
> 
> >Hi everyone,
> >
> >I'm looking for the error code for "record not found" or something 
> >like that to trap in a form.
> 
> Claudine,
> 
> Here's how:
> 
> 01. -- CRobbins.EEP
>      CLEAR VAR vRows, vCaption, vPauseMsg
>      SET VAR vRows INTEGER = 0
>      SET VAR vCaption ' Just for fun!'
>      SET VAR vPauseMsg = 'Record(s) Not Found!'
>      SELECT COUNT(*) INTO vRows INDIC ivRows FROM TableName +
>      WHERE whereclause ...
>      IF vRows = 0 THEN
>         CLS
>         PAUSE 2 USING .vPauseMsg +
>         CAPTION .vCaption +
>         ICON STOP +
>         BUTTON 'Press any key to continue ...' +
>         OPTION BACK_COLOR WHITE +
>         |MESSAGE_COLOR WHITE +
>         |MESSAGE_FONT_COLOR RED +
>         |BUTTON_COLOR WHITE
>         GOTO TheEnd
>      ELSE
>        -- Do what you have to here ..
>      ENDIF
>      LABEL TheEnd
>      CLEAR VAR iv%, vRows, vCaption, vPauseMsg
>      RETURN
> 
> 02. To suppress the:
> 
>      <WARNING> No rows exist or satisfy the clause
> 
>      Use the following technique:
> 
>      SET ERROR MESSAGE 2059 OFF
>      SELECT selectclause FROM tableviewname ... +
>      WHERE whereclause ...
>      SET ERROR MESSAGE 2059 ON
> 
> Hope that helps!
> 
> Very Best R:egards,
> 
> Razzak.

Reply via email to