155 pts.
 Create Alias In Rexx
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

Software/Hardware used:
ASKED: December 12, 2008  4:27 PM
UPDATED: December 17, 2008  9:13 AM

Answer Wiki:
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
Last Wiki Answer Submitted:  December 15, 2008  4:23 pm  by  Gilly400   23,625 pts.
All Answer Wiki Contributors:  Gilly400   23,625 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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,625 pts.

 

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 pts.

 

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,625 pts.

 

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 pts.