我正在使用Google / Simba的最新JDBC驱动程序。当我们具有辅助作用力索引以及查询参数时,出现此错误
Simba] SpannerJDBCDriver来自服务器的错误消息:INVALID_ARGUMENT:不支持位置参数
import glob
read_files = glob.glob("*.agr")
with open("out.txt", "w") as outfile:
for f in read_files:
with open(f, "r") as infile:
outfile.write(infile.read())
with open("out.txt", "r") as file:
filedata = file.read()
filedata = filedata.replace(r'#time\s+residue\s+[0-9]\s+Total', 'x')
with open("out.txt", "w") as file:
file.write(filedata)
答案 0 :(得分:1)
Cloud Spanner的SQL方言不支持位置参数。 Cloud Spanner的SQL方言中的Parameters使用<tr class="ng-scope" role="button" style="" tabindex="0">
<td class="person-name-column">
<div aria-hidden="false" class="wfm-checkbox">
<label><input aria-invalid="false" class="ng-pristine ng-untouched ng-valid ng-empty" type="checkbox"> <span class="wfm-checkbox-toggle"></span> <span class="wfm-checkbox-label person-name-text inline-block ng-binding">FirstName LastName <!-- ngIf: vm.toggles.ViewScheduleOnTimezoneEnabled && vm.selectedTimezone && personSchedule.Timezone.IanaId !== vm.selectedTimezone --></span></label> <!-- ngIf: vm.toggles.ViewScheduleOnTimezoneEnabled && vm.selectedTimezone && personSchedule.Timezone.IanaId !== vm.selectedTimezone -->
</div>
<div aria-hidden="true" class="person-name-text inline-block ng-binding ng-hide">
FirstName LastName
</div><!-- ngIf: vm.showWarnings -->
</td><!-- ngIf: ::vm.toggles.ViewShiftCategoryEnabled -->
<td class="shift-category-cell ng-scope" role="button" style="cursor: pointer;" tabindex="0"><!-- ngIf: ::personSchedule.ShiftCategory.Name --> <span class="inline-block ng-binding ng-scope" id="name" style="background: rgb(255, 99, 71); color: black;">EX</span> <!-- end ngIf: ::personSchedule.ShiftCategory.Name -->
<!-- ngIf: ::personSchedule.ShiftCategory.Name --><!-- end ngIf: ::personSchedule.ShiftCategory.Name --></td><!-- end ngIf: ::vm.toggles.ViewShiftCategoryEnabled -->
<td class="schedule schedule-column">
<div class="relative time-line-for">
<!-- ngRepeat: dayOff in ::personSchedule.DayOffs -->
<!-- ngRepeat: shift in ::personSchedule.Shifts -->
<div class="shift ng-scope">
<!-- ngRepeat: projection in ::shift.Projections -->
<div aria-label="Phone 04:00 - 08:00" class="layer absolute floatleft selectable projection-layer ng-scope noneSelected" role="button" style="left: 3.7037%; width: 14.8148%; background-color: rgb(255, 255, 0);" tabindex="0"></div><!-- end ngRepeat: projection in ::shift.Projections -->
<div aria-label="Lunch 08:00 - 08:30" class="layer absolute floatleft selectable projection-layer ng-scope noneSelected" role="button" style="left: 18.5185%; width: 1.85185%; background-color: rgb(0, 255, 0);" tabindex="0"></div><!-- end ngRepeat: projection in ::shift.Projections -->
<div aria-label="Coffee 08:30 - 08:45" class="layer absolute floatleft selectable projection-layer ng-scope noneSelected" role="button" style="left: 20.3704%; width: 0.925926%; background-color: rgb(224, 224, 224);" tabindex="0"></div><!-- end ngRepeat: projection in ::shift.Projections -->
<div aria-label="Phone 08:45 - 10:30" class="layer absolute floatleft selectable projection-layer ng-scope noneSelected" role="button" style="left: 21.2963%; width: 6.48148%; background-color: rgb(255, 255, 0);" tabindex="0"></div><!-- end ngRepeat: projection in ::shift.Projections -->
<div aria-label="FL 10:30 - 12:30" class="layer absolute floatleft selectable projection-layer ng-scope noneSelected" role="button" style="left: 27.7778%; width: 7.40741%; background-color: rgb(255, 140, 0);" tabindex="0"></div><!-- end ngRepeat: projection in ::shift.Projections -->
</div><!-- end ngRepeat: shift in ::personSchedule.Shifts -->
<!-- ngIf: vm.hasHiddenScheduleAtStart(personSchedule) -->
<!-- ngIf: vm.hasHiddenScheduleAtEnd(personSchedule) -->
</div>
</td><!-- ngIf: ::!vm.toggles.EditAndViewInternalNoteEnabled -->
<!-- ngIf: ::vm.toggles.EditAndViewInternalNoteEnabled -->
<td class="schedule-note-column ng-scope" role="button" tabindex="0"><span class="noComment"><i class="mdi mdi-comment"></i></span> <!-- ngIf: vm.getScheduleNoteForPerson(personSchedule.PersonId) && vm.getScheduleNoteForPerson(personSchedule.PersonId).length > 0 --></td><!-- end ngIf: ::vm.toggles.EditAndViewInternalNoteEnabled -->
<!-- ngIf: ::vm.toggles.ShowContractTimeEnabled -->
<td class="contract-time contract-time-column ng-binding ng-scope">8:00</td><!-- end ngIf: ::vm.toggles.ShowContractTimeEnabled -->
</tr>
和后跟一个标识符来指定,例如
@