Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: as400 Create alias command help please Post Reply Post New Topic
Author Message
pacuccaro
Newbie
Newbie
Avatar

Joined: 16 Sep 2011
Location: United States
Online Status: Offline
Posts: 17
Quote pacuccaro Replybullet Topic: as400 Create alias command help please
    Posted: 05 Feb 2013 at 6:59am
i am trying to use the create alias on the as400 - to read multi-member files. the command i must use is "create or replace alias"

If I enter this command

 

Create or replace alias qtemp.gripf80100 for pt4dtalib2.gripf80100(loose_084)

 

select count(*) pkgcount from qtemp.gripf80100

 

 

I get back this error

 

Failed to retrieve data from the database

Details: SQL Exception:[ SQL State:] 42601 [Error Message:] [SQL0199]Keyword SELECT not expected. Valid tokens: <END-OF-STATEMENT>.

[Database Vendor Code: -199]

 

 

 

When I remove the Select statement and just use the Alias command – I get this Error

Failed to retrieve data from the database

Details: SQL Exception:[ SQL State:] 24000 [Error Message:] Cursor state not valid. [Database Vendor Code: -99999]

 

 

But if after I say ok and then get rid of the alias command and put back in just the select statement – it works plus it returns the correct number of records.

any ideas or working examples would help thank you

IP IP Logged
hilfy
Admin Group
Admin Group
Avatar

Joined: 20 Nov 2006
Online Status: Offline
Posts: 3702
Quote hilfy Replybullet Posted: 05 Feb 2013 at 11:37am
I think "AS400" is an operating system that run the DB2 database, I don't think it's a database itself.  What type of connection are you using to get to the data?  If it's an ODBC connection, you may not be able to do this.  Another thought is, does the database user ID that you're using to run the report have rights to create aliases?
Another thing you could try would be to put a semi-colon at the end of the Create Alias statement to see whether Crystal will run it as two separate statements.
 
-Dell


Edited by hilfy - 05 Feb 2013 at 11:38am
IP IP Logged
pacuccaro
Newbie
Newbie
Avatar

Joined: 16 Sep 2011
Location: United States
Online Status: Offline
Posts: 17
Quote pacuccaro Replybullet Posted: 06 Feb 2013 at 2:48am
yes the as400 does use a db2 database but when i try the semicolon it does not like it , that is why I was hoping someone has a cure or work-around for multimember file access on the as400s.
 
the create command seems to work even with getting the curour error it still creates the alias - i just  can not find a way to do it without the error
 
thanks
tony
 
IP IP Logged
Post Reply Post New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum



This page was generated in 0.033 seconds.