Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

Lexical Error Encountered <EOF>

9 posts in General Discussion Last posting was on 2003-07-09 11:08:33.0Z
Kumar Posted on 2003-07-04 11:24:59.0Z
From: Kumar
Date: Fri, 4 Jul 2003 07:24:59 -0400
Newsgroups: ianywhere.public.general
Subject: Lexical Error Encountered <EOF>
Message-ID: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums>
Lines: 21
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1276
Article PK: 3520

Hi,

While executing a SQL file in iSQL I am getting following error:

Could not execute statement.
Lexical Error at line 2, column 2. Encountered: <EOF> after : ""

Following is my other technical details:

Sybase Adaptive Server Anywhere iSQL Version 8.0.1 Build 3118
Machine : Windows 2000

The above SQL file created from a sql statement on different database to
copy function and procedure to this database.

I understand there was a problem in recognizing EOF but it was solved in
last patch set (EBF) which I have already applied on this server.

Need help urgently.

Thanks,


"Reg Domaratzki" <no_more_rdomarat_spam Posted on 2003-07-04 11:24:14.0Z
From: "Reg Domaratzki" <no_more_rdomarat_spam@no_more_sybase_spam.com>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums>
Subject: Re: Lexical Error Encountered <EOF>
Date: Fri, 4 Jul 2003 07:24:14 -0400
Lines: 37
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <#rR0j$hQDHA.81@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: 65.93.97.225
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1277
Article PK: 3521

The SQL that is causing the error would be a big help...

--
Reg Domaratzki, Sybase iAnywhere Solutions
Certified SQL Anywhere Associate
Please reply only to the newsgroup

ASA Patches and EBFs : http://downloads.sybase.com/swx/sdmain.stm
-> Choose SQL Anywhere Studio
-> Set "Platform Preview" and "Time Frame" to ALL and click "GO"

<Kumar> wrote in message
news:EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums...
> Hi,
>
> While executing a SQL file in iSQL I am getting following error:
>
> Could not execute statement.
> Lexical Error at line 2, column 2. Encountered: <EOF> after : ""
>
> Following is my other technical details:
>
> Sybase Adaptive Server Anywhere iSQL Version 8.0.1 Build 3118
> Machine : Windows 2000
>
> The above SQL file created from a sql statement on different database to
> copy function and procedure to this database.
>
> I understand there was a problem in recognizing EOF but it was solved in
> last patch set (EBF) which I have already applied on this server.
>
> Need help urgently.
>
> Thanks,


Kumar Posted on 2003-07-07 02:14:22.0Z
From: Kumar
Date: Sun, 6 Jul 2003 22:14:22 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Lexical Error Encountered <EOF>
Message-ID: <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub>
Lines: 54
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1278
Article PK: 3522

Using the following query I have created a SQL file and then I am running
this SQL file in iSQL:

- Extract application functions created in SYS or Public
SELECT proc_defn || '`' || CHAR(10) ||
'GRANT EXECUTE ON ' ||
(SELECT user_name FROM sysuserperm
WHERE user_id = creator ) || '.' ||
proc_name || ' TO PUBLIC`'
FROM sysprocedure
WHERE creator IN (
SELECT user_id FROM sysuserperm
WHERE user_name IN ('SYS', 'DBA', 'PUBLIC'))
ORDER BY proc_name`

OUTPUT to c:\temp\sysfunc.sql QUOTE ''

Following is a example of one of the statement:

create function BCOM.bax_gen_date_compare_two(in ad_date1 date,in ad_date2
date,in flag char(6))\x0D\x0Areturns date\x0D\x0Abegin\x0D\x0A if(ad_date1
is null) or(ad_date2 is null) then\x0D\x0A return null\x0D\x0A end
if\x0D\x0A ;\x0D\x0A if(flag<>'big') and(flag<>'small') then\x0D\x0A
return null\x0D\x0A end if\x0D\x0A ;\x0D\x0A if(flag='big') then\x0D\x0A
if(ad_date1>ad_date2) then\x0D\x0A return ad_date1\x0D\x0A
else\x0D\x0A return ad_date2\x0D\x0A end if\x0D\x0A else\x0D\x0A
if(ad_date1>ad_date2) then\x0D\x0A return ad_date2\x0D\x0A
else\x0D\x0A return ad_date1\x0D\x0A end if\x0D\x0A end
if\x0D\x0Aend;\x0AGRANT EXECUTE ON BCOM.bax_gen_date_compare_two TO PUBLIC;

Following is edited function, I have removed all special char:

create function BCOM.bax_gen_date_compare_two(in ad_date1 date,in ad_date2
date,in flag char(6)) returns date begin if(ad_date1 is null)
or(ad_date2 is null) then return null end if ; if(flag<>'big')
and(flag<>'small') then return null end if ; if(flag='big')
then if(ad_date1>ad_date2) then return ad_date1 else
return ad_date2 end if else if(ad_date1>ad_date2) then return
ad_date2 else return ad_date1 end if end if end;

Normally it works but this time I am having this problem. I have done few
data migration from 5.5.04 to 8.0.1 using full UNLOAD and LOAD method, but
while doing LOAD in this database I got lots of problems, first it was
giving me unique key problem although I set all the parameters same as old
database, so I decided to go one by one, I deleted all the objects
(Functions) we created in SYS (it was allowed in 5.5.05) and left data
only, then I use ASA upgrade/migration option it works, but I failed when I
try to create these functions in a newly created group!

After getting this error message I give any command it keep on giving me
Lexical Error...

Thanks


Nick Elson Posted on 2003-07-07 17:13:09.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums>
Subject: Re: Lexical Error Encountered <EOF>
Date: Mon, 7 Jul 2003 13:13:09 -0400
Lines: 74
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <ufdBtwKRDHA.356@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: nicelson-xp.sybase.com 172.31.140.167
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1284
Article PK: 3528

Is there a reason why you don't use a semi-colon, as in

ORDER BY proc_name;

instead of the back-quote used in

ORDER BY proc_name`

???

<Kumar> wrote in message
news:CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums...
> Using the following query I have created a SQL file and then I am running
> this SQL file in iSQL:
>
> - Extract application functions created in SYS or Public
> SELECT proc_defn || '`' || CHAR(10) ||
> 'GRANT EXECUTE ON ' ||
> (SELECT user_name FROM sysuserperm
> WHERE user_id = creator ) || '.' ||
> proc_name || ' TO PUBLIC`'
> FROM sysprocedure
> WHERE creator IN (
> SELECT user_id FROM sysuserperm
> WHERE user_name IN ('SYS', 'DBA', 'PUBLIC'))
> ORDER BY proc_name`
>
> OUTPUT to c:\temp\sysfunc.sql QUOTE ''
>
> Following is a example of one of the statement:
>
> create function BCOM.bax_gen_date_compare_two(in ad_date1 date,in ad_date2
> date,in flag char(6))\x0D\x0Areturns date\x0D\x0Abegin\x0D\x0A
if(ad_date1
> is null) or(ad_date2 is null) then\x0D\x0A return null\x0D\x0A end
> if\x0D\x0A ;\x0D\x0A if(flag<>'big') and(flag<>'small') then\x0D\x0A
> return null\x0D\x0A end if\x0D\x0A ;\x0D\x0A if(flag='big')
then\x0D\x0A
> if(ad_date1>ad_date2) then\x0D\x0A return ad_date1\x0D\x0A
> else\x0D\x0A return ad_date2\x0D\x0A end if\x0D\x0A else\x0D\x0A
> if(ad_date1>ad_date2) then\x0D\x0A return ad_date2\x0D\x0A
> else\x0D\x0A return ad_date1\x0D\x0A end if\x0D\x0A end
> if\x0D\x0Aend;\x0AGRANT EXECUTE ON BCOM.bax_gen_date_compare_two TO
PUBLIC;
>
> Following is edited function, I have removed all special char:
>
> create function BCOM.bax_gen_date_compare_two(in ad_date1 date,in ad_date2
> date,in flag char(6)) returns date begin if(ad_date1 is null)
> or(ad_date2 is null) then return null end if ; if(flag<>'big')
> and(flag<>'small') then return null end if ; if(flag='big')
> then if(ad_date1>ad_date2) then return ad_date1 else
> return ad_date2 end if else if(ad_date1>ad_date2) then return
> ad_date2 else return ad_date1 end if end if end;
>
> Normally it works but this time I am having this problem. I have done few
> data migration from 5.5.04 to 8.0.1 using full UNLOAD and LOAD method,
but
> while doing LOAD in this database I got lots of problems, first it was
> giving me unique key problem although I set all the parameters same as old
> database, so I decided to go one by one, I deleted all the objects
> (Functions) we created in SYS (it was allowed in 5.5.05) and left data
> only, then I use ASA upgrade/migration option it works, but I failed when
I
> try to create these functions in a newly created group!
>
> After getting this error message I give any command it keep on giving me
> Lexical Error...
>
> Thanks
>


Kumar Posted on 2003-07-08 03:59:30.0Z
From: Kumar
Date: Mon, 7 Jul 2003 23:59:30 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Lexical Error Encountered <EOF>
Message-ID: <85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums> <ufdBtwKRDHA.356@forums-2-dub>
Lines: 3
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1286
Article PK: 3527

semi colon (;) or "`' is not the problem. This select is working fine on
5.5.05 but then next statement, bax_gen_date_compare_two function creation
has the problem, although command delimeter is defined properly.


Nick Elson Posted on 2003-07-08 20:16:05.0Z
From: "Nick Elson" <no_spam_nicelson@sybase.com>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums> <ufdBtwKRDHA.356@forums-2-dub> <85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums>
Subject: Re: Lexical Error Encountered <EOF>
Date: Tue, 8 Jul 2003 16:16:05 -0400
Lines: 71
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
Message-ID: <eDK3m7YRDHA.71@forums-2-dub>
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: nicelson-xp.sybase.com 172.31.140.167
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1299
Article PK: 3533

Try 8.0.2 and latest ebf. And see what happens.
The following does not fail for me (and I am running 8.0.2 #4272):

grant connect to BCOM identified by 'sqlsql';
grant group to BCOM;

create function BCOM.bax_gen_date_compare_two(in ad_date1 date,in
ad_date2
date,in flag char(6)) returns date begin if(ad_date1 is null)
or(ad_date2 is null) then return null end if ;
if(flag<>'big')
and(flag<>'small') then return null end if ;
if(flag='big')
then if(ad_date1>ad_date2) then return ad_date1 else
return ad_date2 end if else if(ad_date1>ad_date2) then
return
ad_date2 else return ad_date1 end if end if end;

-- NOTE: *** the above is your edited function ***

GRANT EXECUTE ON BCOM.bax_gen_date_compare_two TO
PUBLIC;

select BCOM.bax_gen_date_compare_two( CURRENT DATE, CURRENT DATE+5 ,
'big')

without any syntax errors. So I don't see your problem unless it was an
early
dbisql or server parser bug.
...

Your unique key problem was either a corrupted index or just a performance
warning
(5.5.0x could occasionally permit non-unique primary keys under certain
crash conditions
and these typically only show up after unloading the data -- so it is often
only seen during
full upgrades).

Modifying system tables and system groups should never have been allowed.
The very
fact that you coded to this, was **always** a case of **coding to a bug**
and it should
always fail ... so sorry for any inconvenience but that history tells me a
number of things
about your database (including it was either compromised due to a earlier
*failed* upgrade
and as such it was actually older [possibly much older] than 5.5.03 and may
have compromised
system schema).

The continuing saga of lexical errors could be due to early dbisql problems
that I am not
seeing [unless you are hitting the \x0d\x0a in the reload.sql file
generated by dbunload]
. . . but since you are not clear on 'which' problem with which sql, I am
assuming


Hopefully this

<Kumar> wrote in message
news:85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums...
> semi colon (;) or "`' is not the problem. This select is working fine on
> 5.5.05 but then next statement, bax_gen_date_compare_two function creation
> has the problem, although command delimeter is defined properly.


Kumar Posted on 2003-07-09 09:32:40.0Z
From: Kumar
Date: Wed, 9 Jul 2003 05:32:40 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Lexical Error Encountered <EOF>
Message-ID: <ADD23714A743B00800346E1685256D5E.0076E10485256D5D@webforums>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums> <ufdBtwKRDHA.356@forums-2-dub> <85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums> <eDK3m7YRDHA.71@forums-2-dub>
Lines: 4
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1300
Article PK: 3534

Thanks Elson,

Let me try with 8.0.2. I'll write again if I hit the same error.


Kumar Posted on 2003-07-09 09:39:41.0Z
From: Kumar
Date: Wed, 9 Jul 2003 05:39:41 -0400
Newsgroups: ianywhere.public.general
Subject: Re: Lexical Error Encountered <EOF>
Message-ID: <98894CE38E51384D0035128B85256D5E.0076E10485256D5D@webforums>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums> <ufdBtwKRDHA.356@forums-2-dub> <85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums> <eDK3m7YRDHA.71@forums-2-dub>
Lines: 6
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Path: forums-1-dub!forums-master.sybase.com!webforums.sybase.com!news
Xref: forums-1-dub ianywhere.public.general:1301
Article PK: 3535

Hi,

I have 8.0.1, Can I use EBF to upgrade it to 8.0.2? or I have to do the
full installation of 8.0.2?

Thanks


Breck Carter [TeamSybase] Posted on 2003-07-09 11:08:33.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Subject: Re: Lexical Error Encountered <EOF>
Date: Wed, 09 Jul 2003 07:08:33 -0400
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <mqtngvc0bt8dghblj77prdp418bude5b07@4ax.com>
References: <EE711EE0FDA67309003EB64885256D59.003EB68185256D59@webforums> <#rR0j$hQDHA.81@forums-2-dub> <CD60404E1F706894000C4D3285256D5C.0044E42185256D59@webforums> <ufdBtwKRDHA.356@forums-2-dub> <85E30F3A755B77140015ED3E85256D5D.006331DE85256D5C@webforums> <eDK3m7YRDHA.71@forums-2-dub> <98894CE38E51384D0035128B85256D5E.0076E10485256D5D@webforums>
X-Newsreader: Forte Agent 1.8/32.548
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Newsgroups: ianywhere.public.general
NNTP-Posting-Host: bcarter.sentex.ca 64.7.134.118
Lines: 14
Path: forums-1-dub!forums-master.sybase.com!forums-2-dub.sybase.com
Xref: forums-1-dub ianywhere.public.general:1302
Article PK: 3536

There is a separate "update" or "upgrade" download for anything less
than 8.0.2, to go up to 8.0.2. EBFs are applied after that, to take
8.0.2.xxxx to 8.0.2.yyyy. Both are listed in the same place. I think
the *docs* are a separate download.

On Wed, 9 Jul 2003 05:39:41 -0400, Kumar wrote:

>Hi,
>
>I have 8.0.1, Can I use EBF to upgrade it to 8.0.2? or I have to do the
>full installation of 8.0.2?
>
>Thanks

bcarter@risingroad.com
Mobile and Distributed Enterprise Database Applications
http://www.risingroad.com