Create Alias In Rexx

155 pts.
Tags:
REXX/400
SQL commands
I am trying to execute the sql create alias in a rexx source however it fails with sql error 901, have tried command manually & works fine

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

Can you post the relevant source, so we can take a look at what you’re trying to do?

Regards,

Martin Gilbert.

Here is the source code I am running

parse arg Libd Liba File Member
address EXECSQL

execsql “rollback”
execsql “set transaction isolation level none”
execsql “SET OPTION NAMING = *SYS”

crtal = “Create Alias ” Liba||”/”||Member
crtal = crtal “FOR ” Libd||”/”||File” (” Member “)”

execsql crtal

Discuss This Question: 4  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Gilly400
    Hi, Try inserting the following line just before your "execsql crtal" :- 'SNDUSRMSG MSG(&crtal)' Check if you see the values you're expecting to have in your SQL command. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Markpg
    I did this and the command was as follows Create Alias TCTRNS/HM0153001 FOR PCPSRVDTA/TCTRNS ( HM0153001 ) I ran this under strsql and it worked fine owever in rex it fails
    155 pointsBadges:
    report
  • Gilly400
    Hi, Are you sure the parameters are correct? Liba (where you want to create your alias) seems to be the same as your file name (TCTRNS)? Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Markpg
    Hi, yes the parameters are correct, grnated it looks a bit weird :-), I find it strange that it works if run manually ! I ven tried doing the same thing in sqplrpgle and it complained about the : used to pass in parameters sating it was invalid ad pgm wouldnt compile. I wonder if it is a command that doesnt like parameters like that !!
    155 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following