第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

cx_Oracle 獲取布爾返回值

cx_Oracle 獲取布爾返回值

我一整天都在努力嘗試使用 cx_Oracle 從 PL/SQL 函數(shù)獲取布爾值。我看過(guò)一些帖子討論使用其他一些數(shù)據(jù)類(lèi)型(如 char 或整數(shù))來(lái)存儲(chǔ)返回值,但是當(dāng)我嘗試使用此類(lèi)解決方案時(shí),我收到錯(cuò)誤的數(shù)據(jù)類(lèi)型錯(cuò)誤。首先,讓我展示代碼。def lives_on_campus(self):  cursor = conn.cursor()  ret = cursor.callfunc('students_api.lives_on_campus', bool, [self.pidm])  return ret如果我使用 11.2.0.4 數(shù)據(jù)庫(kù)客戶(hù)端,則會(huì)出現(xiàn)以下錯(cuò)誤。File "student-extracts.py", line 134, in <module>    if student.lives_on_campus():  File "student-extracts.py", line 58, in lives_on_campus    ret = cursor.callfunc('students_api.lives_on_campus', bool, [self.pidm])cx_Oracle.DatabaseError: DPI-1050: Oracle Client library is at version 11.2 but version 12.1 or higher is needed如果我使用 12.1.0.2 數(shù)據(jù)庫(kù)客戶(hù)端或更高版本,則會(huì)收到此錯(cuò)誤。Traceback (most recent call last):  File "student-extracts.py", line 134, in <module>    if student.lives_on_campus():  File "student-extracts.py", line 58, in lives_on_campus    ret = cursor.callfunc('students_api.lives_on_campus', bool, [self.pidm])cx_Oracle.DatabaseError: ORA-03115: unsupported network datatype or representation基本上,無(wú)論我使用哪個(gè)版本的 SQL 客戶(hù)端,它都會(huì)出錯(cuò)?,F(xiàn)在,我知道如果數(shù)據(jù)庫(kù)版本是 12c R2,上面的代碼將會(huì)工作。不幸的是,我們的測(cè)試環(huán)境中只有該版本,并且 PROD 僅使用 11g 數(shù)據(jù)庫(kù)。有什么可以使該功能與 11g 數(shù)據(jù)庫(kù)一起使用嗎?必須有一個(gè)解決方法。
查看完整描述

1 回答

?
海綿寶寶撒

TA貢獻(xiàn)1809條經(jīng)驗(yàn) 獲得超8個(gè)贊

嘗試包裝匿名塊,例如:


with connection.cursor() as cursor:

  outVal = cursor.var(int)


  sql="""

  begin

    :outVal := sys.diutil.bool_to_int(students_api.lives_on_campus(:pidm));

  end;

  """


  cursor.execute(sql, outVal=outVal, pidm='123456')


  print(outVal.getvalue())


查看完整回答
反對(duì) 回復(fù) 2023-10-06
  • 1 回答
  • 0 關(guān)注
  • 165 瀏覽
慕課專(zhuān)欄
更多

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢(xún)優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)