zoukankan      html  css  js  c++  java
  • 在vb程序中对存储过程的参数变量进行初始化:如下:

    C:如下:
        COM.Parameters.Append COM.CreateParameter("sParamName", adVarChar, adParamInput, 20, sParamName)
         COM.Parameters.Append COM.CreateParameter("ParamValue", adVarChar, adParamOutput, 20, ParamValue)
        存储过程,和vb程序段如下:
        存储过程:
        PROCEDURE "ZY_GET_SYS_PARAM"
         (ParamName in varchar,
         ParamValue out varchar )
         AS
        BEGIN
         SELECT Param_Value
         INTO ParamValue
         from ZY_CARD_PARAM
         where param_name=ParamName;
        END;
        
        VB
        相关函数
        Public Function GetUnitParam(ByVal sParamName As String) As String
        
         Dim CNN As New ADODB.Connection
         Dim COM As New ADODB.Command
         CNN.ConnectionString = "Provider=OraOLEDB.Oracle.1;Persist Security Info=False;User ID=SYSMAN;PASSWORD=KKND;Data Source=KKND"
         CNN.Open
        
         COM.ActiveConnection = CNN
         COM.CommandType = adCmdStoredProc
         COM.CommandText = "ZY_Get_Sys_Param"
        
         COM.Parameters.Append COM.CreateParameter("sParamName", adVarChar, adParamInput, 20, sParamName)
         COM.Parameters.Append COM.CreateParameter("ParamValue", adVarChar, adParamOutput, 20, ParamValue)
        
         COM.Execute
         GetUnitParam = COM("ParamValue")
         Exit Function
        
        End Function
  • 相关阅读:
    OC中Foundation框架之NSDictionary、NSMutableDictionary
    【03_136】Single Number
    【算法】QuickSort
    【02_258】Add Digits
    【01_292】Nim Game
    做题过程中得到的注意点
    No.02——第一次使用Android Studio,并创建出Hello World
    No.01——配置编程环境
    一个好用的代码分享网站
    【数据结构】某些难理解点
  • 原文地址:https://www.cnblogs.com/zqmingok/p/1514000.html
Copyright © 2011-2022 走看看