📄 info.txt
字号:
Create table Test(
ID NUMBER,
NAME VARCHAR2(50),
RESUME LONG NOT NULL)
CREATE OR REPLACE PROCEDURE INSERTTOTEST
/* This procedure is used to insert the data into TEST COLUMN RESUME
LONG DATA TYPE, wHEN WE USE THE SQLPLUS TO INSERT THE DATA, IT HAS LIMITATIONS,
WE CAN NOT INSERT MORE THAN 4000 CHARACTERS, WHEN YOU USE THE PL/SQL PROCEDURE
YOU CAN INSERT THE 32000 CHARACTERS, IT'S WORKING FINE USING vISUAL BASIC APPLICATION.
wRITTEN BY JAY POLAM
4/11/2001
*/
(PID IN TEST.ID%TYPE,
PNAME IN TEST.NAME%TYPE,
PRESUME IN TEST.RESUME%TYPE)
AS
BEGIN
DECLARE
RESUMENULL EXCEPTION;
BEGIN
INSERT INTO TEST
(ID,NAME,RESUME)
VALUES (PID,PNAME,PRESUME);
COMMIT;
EXCEPTION
WHEN RESUMENULL THEN
RAISE_APPLICATION_ERROR(-20100,'RESUME TEXT IS MISSING');
END;
END INSERTTOTEST;
'This is procedure cut paste in commnad button click event and run the application. 'It works
On Error GoTo InserTERROR
Dim cn As ADODB.Connection
Dim RSCOM As ADODB.Command
Dim strcon As String
Dim QID As Long
Dim QNAME As String
Dim QRESUME As String
If txtID.Text = "" Then
MsgBox "Please enter the ID"
txtID.SetFocus
Exit Sub
End If
If txtName.Text = "" Then
MsgBox "Please enter the Name"
txtName.SetFocus
Exit Sub
End If
If txtResume.Text = "" Then
MsgBox "Please enter the resume Text"
txtResume.SetFocus
Exit Sub
End If
QID = Val(txtID.Text)
QNAME = txtName.Text
QRESUME = txtResume.Text
Set cn = New ADODB.Connection
Set RSCOM = New ADODB.Command
strcon = "provider=msdasql;dsn=yourDSN name;uid=youruserid;pwd=yourpassword;"
With cn
.ConnectionString = strcon
.CursorLocation = adUseClient
.Open
End With
With RSCOM
.ActiveConnection = cn
.CommandText = "INSERTTOTEST"
.CommandType = adCmdStoredProc
.Parameters.Append .CreateParameter(, adInteger, adParamInput)
.Parameters.Append .CreateParameter(, adVarChar, adParamInput, 50)
.Parameters.Append .CreateParameter(, adVarChar, adParamInput, 31474)
End With
RSCOM(0) = QID
RSCOM(1) = QNAME
RSCOM(2) = QRESUME
RSCOM.Execute
Set RSCOM = Nothing
cn.Close
Set cn = Nothing
Exit Sub
InserTERROR:
MsgBox Err.Number & vbCrLf & Err.Description
If cn.State = adStateOpen Then
Set RSCOM = Nothing
cn.Close
Set cn = Nothing
End If
Exit Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -