Hello
I would appreciate any help to translate this to python:
sub DoStuff()
oDBRange = thisComponent.DataBaseRanges.getByName("something")
oDesc() = oDBRange.getImportDescriptor()
For i = 0 to ubound(oDesc())
oPrp = oDesc(i)
If oPrp.Name = "DatabaseName" then
oPrp.Value = "checking_inserts"
elseIf oPrp.Name = "SourceType" then
oPrp.Value = com.sun.star.sheet.DataImportMode.SQL
elseIf oPrp.Name = "SourceObject" then
oPrp.Value = "SELECT * FROM WELLBORES"
elseif oPrp.Name = "IsNative" then
oPrp.Value = True
Endif
oDesc(i) = oPrp
Next
oDBRange.getReferredCells.doImport(oDesc())
end sub
def DoStuff():
this= XSCRIPTCONTEXT.getDocument()
print(this)
oDBRange = this.DataBaseRanges.getByName("something")