03-13-2018 08:08 AM
I was trying to replace the csv file in the cas server using python-swat interface. However, I encounter error with "Global Table cannot be replaced" when I run it.
Below is the code I used to upload the data. Anyone know the reason behind it? Thank you
conn.upload('abc.csv',casout=dict(name='trialupload2',caslib='public',promote = 'true',replace = 'true'))
TRIALUPLOAD2 table is in my cas server, and when I try to replace it, it resulted in the above error.
03-13-2018 09:10 AM
If that is the case, then may I know is there any workaround for this? because I wish to overwrite the existing data in the CAS server. And if I set the promote to false, the data uploaded won't be visible to me anymore.
03-13-2018 10:51 AM
May I know the proper way of promoting to global scope? Now that with
thiis command I am able to upload to the session scope.
But using when trying to promote to global scope using the below command it fails.
conn.read_csv('abc.csv',casout=dict(name='trialupload123',caslib='public',promote = 'true'))
03-13-2018 11:54 AM
Something like that:
load_csv = conn.read_csv('https://raw.githubusercontent.com/sassoftware/sas-viya-programming/master/data/cars.csv',casout=dict(name='CARS',caslib='CASUSER',replace ='true')) promote_csv = conn.promote(load_csv,target='NEW_NAME_FOR_CARS_TABLE')
03-13-2018 12:07 PM
Thanks for the code. However, there is still one problem here. The error exists because the target table of the promotion already exists. Means that I couldn't overwrite the table of the same name in the CAS server.
ERROR: The target table trialupload432 of the promotion already exists. Please specify a different name.
03-20-2018 01:09 AM
thanks for the solution. However, the problem is that the table name in the global scope will be different everytime I upload the data. And in the SAS Studio I will have to access data from different tables every time.
Need further help from the community? Please ask a new question.