Background Image

FORUM

조회 수 12656 추천 수 0 댓글 2
?

단축키

Prev이전 문서

Next다음 문서

크게 작게 위로 아래로 댓글로 가기 인쇄

 안녕하세요.

현재, MS-SQL, Visual Basic 6.0 환경하에 회사 전산 프로그램이 돌아가고 있는데,

대부분의 DB처리는 SQL의 Stored Procedure에서 하고,

VB에서는 OLEDB(ADO)로 접속하여 SP에 parameter 값만 넘겨주고, 데이터를 주고 받는 형태입니다.


큐브리드에서는 어떤 형태로 하는지 혹시 샘플이 있나요?


(참고) 현재 형태

============ MS-SQL의 SP ============

USE SYS_DB

GO

DROP PROCEDURE SA1040I_Q

GO

CREATE PROCEDURE SA1040I_Q 

     (@idno    Char(05)       = Null,

      @stdt     Char(08)       = Null)

AS

SET NOCOUNT ON

Begin

            DELETE FROM SAHIST_M

              WHERE hist_id   = @idno      

                  AND hist_stdt = @stdt

           SELECT 'DELETEOK'

           RETURN

End

============ VB 소스 ============
   Set AdoRs = New ADODB.Recordset
   StatusBar1.Panels(1) = "잠시만 기다려 주십시요...": vaSpread.MaxRows = 0
   
   Set AdoRs = New ADODB.Recordset
   sSql = "SA1040I_Q"
   sSql = sSql & ",@idno = '" + idno + "'"
   sSql = sSql & ",@sddt = '" + Format(dtpDate.Value, "yyyyMMdd") + "'"
   AdoRs.Open sSql, Dbcon
   
   If AdoRs.EOF = True Or AdoRs.BOF = True Then
      StatusBar1.Panels(1) = "검색된 자료가 없습니다..."
      AdoRs.Close: Set AdoRs = Nothing
      Exit Sub
   End If
   
   While Not AdoRs.EOF
      vaSpread.MaxRows = vaSpread.MaxRows + 1
      vaSpread.Row = vaSpread.MaxRows
      For i = 1 To vaSpread.MaxCols
         vaSpread.col = i: vaSpread.Text = Trim(AdoRs(i - 1))
      Next i
      AdoRs.MoveNext
   Wend
 
   AdoRs.Close: Set AdoRs = Nothing
    StatusBar1.Panels(1) = "자료가 정상적으로 조회되었습니다."
 

  • ?
    손승일 2012.02.07 08:30

    안녕하세요.

    큐브리드에 관심을 가져 주셔서 감사합니다. 문의하신 내용에 대하여 빠른 시일 내에 확인하여 알려드리도록 하겠습니다.

  • ?
    seongjoon 2012.02.23 00:13

    답변이 늦어 죄송합니다.

    mssql의 Stored Procedure을 CUBRID에서 바로 사용할 수는 없으며, Java Stored Procedure 형태로 변경하여 사용하셔야 됩니다.

    java stored procedure 사용방법은 다음 링크를 통해 확인하실 수 있으며 테스트에 사용한 VB 샘플코드를 참조하시면 될 것 같습니다..

    http://www.cubrid.org/manual/ko/8.4.4/sql/jsp.html

    샘플코드

    Private Sub Command1_Click()

            Dim adoConn As ADODB.Connection

            Dim strConn As String

            Dim strSQL As String

            strConn = ""

            'make OLEDB connection string

            strConn = strConn & "Provider = CUBRIDProvider;"

            strConn = strConn & "Data Source = demodb;" ' database name

            strConn = strConn & "Location = localhost;"  ' database server ip address

            strConn = strConn & "User ID = dba;"     ' database user id

            strConn = strConn & "Password = ;" ' database user id's password

            strConn = strConn & "Port = 33000;" ' broker1 port

            strConn = strConn & "Fetch Size = 100;"

            ' connect to database with ado connection object

            Set adoConn = New ADODB.Connection

            With adoConn

                .ConnectionString = strConn

                .Open

            End With

            Set rs = adoConn.Execute("call hello() into :Hello;")

            List1.Clear

            If Not rs.EOF Then rs.MoveFirst

            Do While Not rs.EOF

                List1.AddItem rs.Fields(0)

                rs.MoveNext

            Loop

            adoConn.Close

            Set rs = Nothing

            Set adoConn = Nothing

    End Sub


  1. CUBRID 사용자를 위한 DBeaver 도구 출시 안내

    Date2024.04.23 Byadmin Views127
    read more
  2. SQLGate for CUBRID 영구 무료 라이선스 제공

    Date2020.04.09 Byadmin Views4476
    read more
  3. Mac OS 에서 Cubrid Manager 실행이 안됩니다.

    Date2023.02.20 By엘L Views337
    Read More
  4. Mac OS CUBRID 매니저 Remote host closed connection during handshake 오류

    Date2020.05.04 By오충 Views349
    Read More
  5. MYSQL에서 CUBRID로 마이그레이션 중인데 몇가지 질문 드립니다.

    Date2015.12.11 Byrealjune2 Views7044
    Read More
  6. MYSQL5.X -> Cubrid 마이그레이션

    Date2013.01.23 ByDarkRanger Views6111
    Read More
  7. MYSQL LIMIT 10 OFFSET 0 을 CUBRID에서는 어떻게 바꿔야되나요 ?

    Date2014.03.13 By잘될꺼야 Views10786
    Read More
  8. MY-SQL 쿼리를 큐브리드에서 오류가 납니다.

    Date2016.06.29 By펌피 Views14
    Read More
  9. MY-SQL INSERT 쿼리문이 오류나서요.

    Date2016.08.11 By펌피 Views14889
    Read More
  10. MSSQL의 파티션테이블과 유사한 기능이 있나요?

    Date2013.07.23 By하늘나무 Views13823
    Read More
  11. MSSQL에서 큐브리드 연동

    Date2016.05.24 By미곰 Views10952
    Read More
  12. MSSQL과의 성능에 대한 비교를 알고 싶습니다

    Date2012.01.18 By로닥 Views17
    Read More
  13. MSSQL같이 레코드 복사는 안 되나요?

    Date2014.03.28 By하늘나무 Views10491
    Read More
  14. MSSQL DBLink INSERT

    Date2020.10.29 By흥노 Views1411
    Read More
  15. MSSQL -> CUBRID MIGRATION

    Date2019.11.15 By현수 Views221
    Read More
  16. MS949를 UTF-8 변경 방법

    Date2011.03.25 By혀니짱 Views19851
    Read More
  17. MS-SQL의 연결된 서버와 같은 기능은 없나요?

    Date2015.04.14 ByCUCUCUCU Views6038
    Read More
  18. MS-SQL의 Stored Procedure를 Cubrid로 변환 가능할런지?

    Date2012.02.07 By강나루소나무 Views12656
    Read More
  19. MS-SQL을 CUBRID로 마이그레이션 하는 방법.

    Date2009.09.07 By후추 Views9870
    Read More
  20. MS-SQL에서 GETDATE 함수와 같은게 있는지요.

    Date2017.08.18 By펌피 Views743
    Read More
  21. MS-SQL 에서 varbinary사용하는걸 큐브리드에서는 어떻게 사용하는지요?

    Date2017.09.25 By펌피 Views429
    Read More
  22. MS-SQL 암복호화 가 있는데 이걸 큐브리드에서 적용시킬려면 어떻게 하나여?

    Date2017.09.12 By펌피 Views518
    Read More
Board Pagination Prev 1 ... 155 156 157 158 159 160 161 162 163 164 ... 201 Next
/ 201

Contact Cubrid

대표전화 070-4077-2110 / 기술문의 070-4077-2113 / 영업문의 070-4077-2112 / Email. contact_at_cubrid.com
Contact Sales