Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Alias not found error 1

Status
Not open for further replies.

TheLazyPig

Programmer
Sep 26, 2019
95
PH
Hi!

When I run this program I get an error of Alias elifepol not found and it was in the part where I select the newly created table. So I tried to add a USE after endtext and got an error of Access file denied which the table seems to be already open.

Code:
Do ext_elifetable

lcSql = ""
TEXT TO lcSQL TEXTMERGE NOSHOW
		
Create Table c:\rms\data\elifepol (polno c(15), nameid n(10,0), namestr c(150), last_name c(20), first_name c(20), mid_init c(10), inmast l(1), masterfile c(10))
Select a.polno, ;
       b.nameid, ;
       c.namestr ;
  from inb_policymst a ;
  left join inb_polrole_trn b ;
    on b.polno = a.polno and b.pertype=180 ;
  left join cnb_namelst_trn c ;
    on c.nameid = b.nameid ;
 where Left(Alltrim(a.polno),1)<>'M' ;
   and b.nameid is not null ;
  into table c:\temp\epol
	 
ENDTEXT
	
[highlight #FCE94F]Select elifepol[/highlight]
Append From c:\temp\epol

Thank you!
 
You're creating a string with TEXT...ENDTEXT. You haven't executed it yet. There isn't a table elifepol before you do the Select elifepol and USE without anything in a workarea will cause a prompt for a file you want to use.

Just take a look into the data session window and you'd see it.

Why use TEXT..ENDTEXT at all here, if you want to execute this, you simply put that code as is without TEXT.ENDTEXT and you create elifepol.dbf, epol and then copy epol into elifepol.
I mean, you could even do that in one step, just use the into table to create elifepol, you'd just need to add expressions for the fields after namestr into the query.

Chriss
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top