home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 March
/
PCWK0397.iso
/
novell
/
webserv3
/
nws30.exe
/
DISK1
/
NETBASIC
/
WEB
/
WEBORA4.BAS
< prev
next >
Wrap
BASIC Source File
|
1996-09-12
|
3KB
|
99 lines
Sub main
DOC:HEADING("DATABASE QUERY ON EMP TABLE ")
'DOC:Body(DOC_RED,DOC_ORANGE)
ParamObj = DOC:Var
If (ParamObj.Error != 0)
DOC:Print("An Error has occurred ",ParamObj.Error)
Return
EndIf
Doc:Format(False)
Handle = ORA:Logon(ParamObj.User,ParamObj.password)
If (Err != 0)
DOC:Heading("NDS Login")
DOC:Body(DOC_BLACK,DOC_RED,DOC_GOLD,DOC_BLACK)
CENTERON()
DOC:Print:H3("LOGON ERROR")
Err1 = SYS:Error:Number
Msg = ORA:error:Message(Err1)
DOC:Print:H3(Msg)
'If (Err = 0)
Else
DOC:Print:H2("Query : ",ParamObj.Query); NewLine
DOC:Break
DOC:Tag:Begin("Pre")
Success = ORA:Query(ParamObj.Query)
If (Success)
ORA:Record:Get
Buffer= ORA:field:First
eType=ORA:Field:Type
Bu = ORA:Field:Next
cType=ORA:Field:Type
Buf = ORA:Field:Next
Buff= ORA:Field:Next
Buffe = ORA:Field:Next
Buffe1 = ORA:Field:Next
Buffe2 = ORA:Field:Next
Buffe3 = ORA:Field:Next
Size = ORA:Field:size
DOC:Print ("Field size of the current field is equal to ' ",Size," '")
Doc:Break
DOC:Print(Buffer," ",Bu," ",Buf," ",Buff," ",Buffe, " "," ",Buffe1, " ", Buffe2, " ",Buffe3)
DOC:Break
DOC:Print("---------------------------------------------------------------------------------------------------")
DOC:Break
Count = 0
Do While (ORA:Record:Get)
Empno= ORA:Field:Get("empno")
Ename= ORA:Field:Get("ename")
Job = ORA:Field:Get("Job")
MGR = ORA:Field:Get("MGR")
HIREDATE = ORA:Field:Get("HIREDATE")
SAL = ORA:Field:Get("SAL")
COMM = ORA:Field:Get("COMM")
DEPTNO = ORA:Field:Get("DEPTNO")
happy= ORA:field:Max(10)
MS=DATA:String(eType)
DOC:Print(Empno)
DOC:Print(" ")
DOC:Print(STR:Sub(STR:Pad:Right(Ename,18),1,10))
DOC:Print(STR:Sub(STR:Pad:Right(Job,18),1,10))
DOC:Print(" ",MGR," ")
DOC:Print(" ",HIREDATE," ")
DOC:Print(" ",SAL," ")
DOC:Print(" ",COMM," ")
DOC:Print(DEPTNO)
DOC:Break
Count = Count + 1
EndDo
Doc:Print(Count," records retrieved")
'DOC:Print(cType)
'DOC:Print(eType)
Else
Err1 = SYS:Error:Number
Msg = ORA:Error:Message(Err1)
DOC:Print(MSG)
'return
EndIf
' DOC:Break
' Doc:Print(Count," records retrieved")
Success = ORA:Logoff(Handle)
EndIf
DOC:Tag:End("Pre")
End Sub