0

这是从 Minitab 到 SQL db 的查询。

在这个对 SQL db 的调用中,我该如何声明@k1, @k2, @k3

 ODBC;  
   Connect "DSN=STEConversion;APP=Minitab 17 Statistical Software;WSID=CMM-OFF" &
   "ICE;DATABASE=STEConversion;Trusted_Connection=Yes";
   SQLString "SELECT ""CharacteristicNumber"",""DateRecorded"",""DrawingNumber" &
   """,""DrawingRequirement"",""EnteredText"",""EnteredValue"",""EnteredValueH" &
   "igh"",""Entries"",""HighLimit"",""LowLimit"",""MONumber"",""NAME"",""Opera" &
   "tionSequenceNumber"",""PARENT"",""UserID"" FROM ""STEConversion"".""dbo""." &
   """vwMinitabMORoutingData"" where  ""PARENT""=@k1 And  ""OperationSeque" &
   "nceNumber""=@K2 And  ""CharacteristicNumber""=@k3".

大家好,

以防万一有一天有人有答案!

下面让我提示用户输入父编号,然后是操作编号和字符编号,我可以用这些数据做很多事情,除了将它传递给 ODBC 调用。

这是我使用的命令,下面是错误。

当我有答案时,我会发布答案!


命令

NOTE What is Parent Number?

SET C1; 

FILE "TERMINAL";

NOBS 1.

NOTE What is Operation Number?

SET C2; 

FILE "TERMINAL";

NOBS 1. 

NOTE What is Character Number?

SET C3; 

FILE "TERMINAL";

NOBS 1. 

let k1 = concatenate("""",c1[1],"""")

let k2 = concatenate("""",c2[1],"""")

let k3 = concatenate("""",c3[1],"""")

Print k1 k2 k3




ODBC;
Connect “DSN=STEConversion;APP=Minitab 17 Statistical Software;WSID=CMM-OFF” &
“ICE;DATABASE=STEConversion;Trusted_Connection=Yes”;
SQLString “SELECT “”CharacteristicNumber””,””DateRecorded””,””DrawingNumber” &
“””,””DrawingRequirement””,””EnteredText””,””EnteredValue””,””EnteredValueH” &
“igh””,””Entries””,””HighLimit””,””LowLimit””,””MONumber””,””NAME””,””Opera” &
“tionSequenceNumber””,””PARENT””,””UserID”” FROM “”STEConversion””.””dbo””.” &
“””vwMinitabMORoutingData”” where “”PARENT””=” &
k1 &
“And “”OperationSequenceNumber””=” &
k2 &
“ And “”CharacteristicNumber””=” &
k3.

这是我得到的错误!

MTB > Execute "\ste1\users$\jmccafferty\documents\MiniTab\Exec Files\Get_Data_ParentNo_OpNo_CharNo.mtb" 从文件执行:\ste1\users$\jmccafferty\documents\MiniTab\Exec Files\Get_Data_ParentNo_OpNo_CharNo.mtb 什么是父编号?DATA> 1524 什么是操作号?DATA> 110 什么是字符数?数据> 118

数据显示

K1 “1524” K2 “110” K3 “118”

  • 错误 * 不允许有额外的文字。

  • 其余子命令被忽略。

  • 错误 * 不允许有额外的文字。

  • 错误 * 不允许有额外的文字。

  • 错误 * 不允许有额外的文字。

  • 错误 * 不允许有额外的文字。

  • 无法完成计算。

  • 错误 * 无法识别的变量名。

  • 可能的原因:多余的文字。

  • 其余子命令被忽略。

  • 无法完成计算。
4

1 回答 1

0

这是有效的代码,在 Minitab 支持的帮助下。

NOTE What is Parent Number?
TSET C1; 
  FILE "TERMINAL";
  END

NOTE What is Operation Number?
TSET C2; 
  FILE "TERMINAL";
  END

NOTE What is Character Number?
TSET C3; 
  FILE "TERMINAL";
  END

let k1 = concatenate("''",c1[1],"''")
let k2 = concatenate("''",c2[1],"''")
let k3 = concatenate("''",c3[1],"''")

erase C1 C2 C3

Print k1 k2 k3


ODBC;
Connect "DSN=STEConversion;APP=Minitab 17 Statistical Software;WSID=CMM-OFF" &
"ICE;DATABASE=STEConversion;Trusted_Connection=Yes";
SQLString "SELECT ""CharacteristicNumber"",""DateRecorded"",""DrawingNumber" &
""",""DrawingRequirement"",""EnteredText"",""EnteredValue"",""EnteredValueH" &
"igh"",""Entries"",""HighLimit"",""LowLimit"",""MONumber"",""NAME"",""Opera" &
"tionSequenceNumber"",""PARENT"",""UserID"" FROM ""STEConversion"".""dbo""." &
"""vwMinitabMORoutingData"" where ""PARENT""=" &
k1 &
"And ""OperationSequenceNumber""=" &
k2 &
" And ""CharacteristicNumber""=" &
k3.

希望它可以帮助某人!

吉姆

于 2014-05-28T15:23:11.617 回答