I am not able to understand the output of following code I just wrote. I am trying to extract the complete value of the group in a string value.
>> str1 = "CREATE TABLE TABLE1 (NAME VARCHAR, PHONE VARCHAR) as SELECT NAME, PHONE FROM SCHEMA1.ADDRESS"
>> pat1 = re.compile("CREATE TABLE .+ FROM (\w).+")
>> ret= pat1.search(str1)
>> ret.groups()
('S',)
I was expecting the value to be SCHEMA1
. How can I retrieve the entire value ?
Why I am doing this?
I have a file filled with DML statements intended for different schemas. So, I need to create separate files for each schema with DML statement from the file mentioned before.