熊朝柱 2 weeks ago
commit 2840f25a80

389
.gitignore vendored

@ -0,0 +1,389 @@
# ---> VisualStudio
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
##
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates
# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs
# Mono auto generated files
mono_crash.*
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/
# Visual Studio 2015/2017 cache/options directory
.vs/
# Uncomment if you have tasks that create the project's static files in wwwroot
#wwwroot/
# Visual Studio 2017 auto generated files
Generated\ Files/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
# NUnit
*.VisualState.xml
TestResult.xml
nunit-*.xml
# Build Results of an ATL Project
[Dd]ebugPS/
[Rr]eleasePS/
dlldata.c
# Benchmark Results
BenchmarkDotNet.Artifacts/
# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/
# StyleCop
StyleCopReport.xml
# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc
# Chutzpah Test files
_Chutzpah*
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opendb
*.opensdf
*.sdf
*.cachefile
*.VC.db
*.VC.VC.opendb
# Visual Studio profiler
*.psess
*.vsp
*.vspx
*.sap
# Visual Studio Trace Files
*.e2e
# TFS 2012 Local Workspace
$tf/
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
*.DotSettings.user
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# AxoCover is a Code Coverage Tool
.axoCover/*
!.axoCover/settings.json
# Coverlet is a free, cross platform Code Coverage Tool
coverage*[.json, .xml, .info]
# Visual Studio code coverage results
*.coverage
*.coveragexml
# NCrunch
_NCrunch_*
.*crunch*.local.xml
nCrunchTemp_*
# MightyMoose
*.mm.*
AutoTest.Net/
# Web workbench (sass)
.sass-cache/
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# Note: Comment the next line if you want to checkin your web deploy settings,
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
# Microsoft Azure Web App publish settings. Comment the next line if you want to
# checkin your Azure Web App publish settings, but sensitive information contained
# in these scripts will be unencrypted
PublishScripts/
# NuGet Packages
*.nupkg
# NuGet Symbol Packages
*.snupkg
# The packages folder can be ignored because of Package Restore
**/[Pp]ackages/*
# except build/, which is used as an MSBuild target.
!**/[Pp]ackages/build/
# Uncomment if necessary however generally it will be regenerated when needed
#!**/[Pp]ackages/repositories.config
# NuGet v3's project.json files produces more ignorable files
*.nuget.props
*.nuget.targets
# Microsoft Azure Build Output
csx/
*.build.csdef
# Microsoft Azure Emulator
ecf/
rcf/
# Windows Store app package directories and files
AppPackages/
BundleArtifacts/
Package.StoreAssociation.xml
_pkginfo.txt
*.appx
*.appxbundle
*.appxupload
# Visual Studio cache files
# files ending in .cache can be ignored
*.[Cc]ache
# but keep track of directories ending in .cache
!?*.[Cc]ache/
# Others
ClientBin/
~$*
*~
*.dbmdl
*.dbproj.schemaview
*.jfm
*.pfx
*.publishsettings
orleans.codegen.cs
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk
# Since there are multiple workflows, uncomment next line to ignore bower_components
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
#bower_components/
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file
# to a newer Visual Studio version. Backup files are not needed,
# because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
ServiceFabricBackup/
*.rptproj.bak
# SQL Server files
*.mdf
*.ldf
*.ndf
# Business Intelligence projects
*.rdl.data
*.bim.layout
*.bim_*.settings
*.rptproj.rsuser
*- [Bb]ackup.rdl
*- [Bb]ackup ([0-9]).rdl
*- [Bb]ackup ([0-9][0-9]).rdl
# Microsoft Fakes
FakesAssemblies/
# GhostDoc plugin setting file
*.GhostDoc.xml
# Node.js Tools for Visual Studio
.ntvs_analysis.dat
node_modules/
# Visual Studio 6 build log
*.plg
# Visual Studio 6 workspace options file
*.opt
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
*.vbw
# Visual Studio LightSwitch build output
**/*.HTMLClient/GeneratedArtifacts
**/*.DesktopClient/GeneratedArtifacts
**/*.DesktopClient/ModelManifest.xml
**/*.Server/GeneratedArtifacts
**/*.Server/ModelManifest.xml
_Pvt_Extensions
# Paket dependency manager
.paket/paket.exe
paket-files/
# FAKE - F# Make
.fake/
# CodeRush personal settings
.cr/personal
# Python Tools for Visual Studio (PTVS)
__pycache__/
*.pyc
# Cake - Uncomment if you are using it
# tools/**
# !tools/packages.config
# Tabs Studio
*.tss
# Telerik's JustMock configuration file
*.jmconfig
# BizTalk build output
*.btp.cs
*.btm.cs
*.odx.cs
*.xsd.cs
# OpenCover UI analysis results
OpenCover/
# Azure Stream Analytics local run output
ASALocalRun/
# MSBuild Binary and Structured Log
*.binlog
# NVidia Nsight GPU debugger configuration file
*.nvuser
# MFractors (Xamarin productivity tool) working folder
.mfractor/
# Local History for Visual Studio
.localhistory/
# BeatPulse healthcheck temp database
healthchecksdb
# Backup folder for Package Reference Convert tool in Visual Studio 2017
MigrationBackup/
# Ionide (cross platform F# VS Code tools) working folder
.ionide/
# ---> C++
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app

8
.idea/.gitignore vendored

@ -0,0 +1,8 @@
# 默认忽略的文件
/shelf/
/workspace.xml
# 基于编辑器的 HTTP 客户端请求
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml

@ -0,0 +1,64 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectInspectionProfilesVisibleTreeState">
<entry key="Project Default">
<profile-state>
<expanded-state>
<State>
<id>JUnit</id>
</State>
<State>
<id>JVM 语言</id>
</State>
<State>
<id>Java</id>
</State>
<State>
<id>Java 5Java 语言级别迁移帮助Java</id>
</State>
<State>
<id>Java 8Java 语言级别迁移帮助Java</id>
</State>
<State>
<id>Java 语言级别迁移帮助Java</id>
</State>
<State>
<id>JavadocJava</id>
</State>
<State>
<id>Spring</id>
</State>
<State>
<id>Spring AOPSpring</id>
</State>
<State>
<id>TestNGJava</id>
</State>
<State>
<id>代码成熟度Java</id>
</State>
<State>
<id>性能Java</id>
</State>
<State>
<id>数值问题Java</id>
</State>
<State>
<id>类结构Java</id>
</State>
<State>
<id>线程问题Java</id>
</State>
<State>
<id>编译器问题Java</id>
</State>
</expanded-state>
<selected-state>
<State>
<id>用户定义</id>
</State>
</selected-state>
</profile-state>
</entry>
</component>
</project>

@ -0,0 +1,153 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}</ProjectGuid>
<RootNamespace>CONNOR_ITK</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
<ProjectName>JL_ITK</ProjectName>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Application</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<WholeProgramOptimization>false</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<TargetExt>.dll</TargetExt>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
</ClCompile>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>D:\peixun\tc11_EVN\include;D:\peixun\tc11_EVN\include_cpp;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
</ClCompile>
<Link>
<AdditionalDependencies>D:\peixun\tc11_EVN\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>C:\environment\Teamcenter-ENV\ITK_Configuration_File\JL_ITK\libxl\libxl\include;C:\environment\Teamcenter-ENV\ITK_Configuration_File\JL_ITK\include_cpp;C:\environment\Teamcenter-ENV\ITK_Configuration_File\JL_ITK\include;C:\Users\Administrator\Desktop\依赖包\include;C:\Users\Administrator\Desktop\依赖包\include_cpp;C:\Users\Administrator\Desktop\依赖包\libxl\libxl\include;$(SolutionDir)OCI\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;WIN32;NDEBUG;_CONSOLE;IPLIB=none;%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<Link>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<OutputFile>$(OutDir)\jl.dll</OutputFile>
<AdditionalDependencies>C:\Users\Administrator\Desktop\依赖包\lib\*.lib;C:\Users\Administrator\Desktop\依赖包\libxl\libxl\lib\*.lib;C:\environment\Teamcenter-ENV\ITK_Configuration_File\JL_ITK\lib\*.lib;C:\environment\Teamcenter-ENV\ITK_Configuration_File\JL_ITK\libxl\libxl\lib\*.lib;%(AdditionalDependencies)</AdditionalDependencies>
<SubSystem>Console</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="common_itk_util.c" />
<ClCompile Include="connor_custom_main.cxx" />
<ClCompile Include="epm_register_handler.cxx" />
<ClCompile Include="JLCS_05.cxx" />
<ClCompile Include="JLCS_05_MasterData.cxx" />
<ClCompile Include="JL_Add_FinishTime.cpp" />
<ClCompile Include="JL_Change_Inspection_Of_Basic_Part.cxx" />
<ClCompile Include="JL_form_save.cpp" />
<ClCompile Include="jl_insert_img_pdf.cxx" />
<ClCompile Include="jl_insert_modular.cxx" />
<ClCompile Include="jl_locomotion_item.cxx" />
<ClCompile Include="JL_Send_Mail.cxx" />
<ClCompile Include="jl_dmu_auto.cxx" />
<ClCompile Include="JL_Send_Order_Process.cxx" />
<ClCompile Include="JL_Target_Moveto_Annex.cpp" />
<ClCompile Include="JL_Welding_Syetem.cpp" />
<ClCompile Include="ocilib.cxx" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="common_itk_util.h" />
<ClInclude Include="epm_handler_common.h" />
<ClInclude Include="epm_register_handler.h" />
<ClInclude Include="ocilib.h" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="头文件">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
</Filter>
<Filter Include="common">
<UniqueIdentifier>{ca041e83-7fab-47f9-b6e5-089441e62ecf}</UniqueIdentifier>
</Filter>
<Filter Include="handler">
<UniqueIdentifier>{48795282-4973-45c1-8088-ec3dc4f3c98c}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="connor_custom_main.cxx">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="epm_register_handler.cxx">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="JLCS_05.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Change_Inspection_Of_Basic_Part.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Send_Mail.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="jl_insert_img_pdf.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="jl_insert_modular.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="jl_dmu_auto.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="ocilib.cxx">
<Filter>common</Filter>
</ClCompile>
<ClCompile Include="jl_locomotion_item.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JLCS_05_MasterData.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Target_Moveto_Annex.cpp">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Add_FinishTime.cpp">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_form_save.cpp">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Welding_Syetem.cpp">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="JL_Send_Order_Process.cxx">
<Filter>handler</Filter>
</ClCompile>
<ClCompile Include="common_itk_util.c">
<Filter>handler</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="epm_handler_common.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="epm_register_handler.h">
<Filter>头文件</Filter>
</ClInclude>
<ClInclude Include="ocilib.h">
<Filter>common</Filter>
</ClInclude>
<ClInclude Include="common_itk_util.h">
<Filter>handler</Filter>
</ClInclude>
</ItemGroup>
</Project>

@ -0,0 +1,973 @@
#define _CRT_SECURE_NO_WARNINGS
#include "epm_handler_common.h"
#include <tc\preferences.h>
#include <epm\epm.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <string>
#include <ict/ict_userservice.h>
#include <map>
#include <vector>
#include<iostream>
#include<stdlib.h>
#pragma warning(disable : 4996)
#include <string>
#include <bom/bom.h>
#include <stdio.h>
#include <objbase.h>
extern "C" int POM_AM__set_application_bypass(logical bypass);
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
char *MATNR, *WERKS, *STLAN, *STALT, *VBELN, *VBPOS, *BMENG, *POSNR, *POSTP, *IDNRK, *MENGE, *MEINS, *POTX1, *POTX2;
//函数
void getBomPropertys(EPM_action_message_t msg, int ifail);
void getBomLinePropertys(tag_t top_line,char *type);
void getBomLinePropertysBom(tag_t top_line,string topUUID,char * carModel, _ConnectionPtr m_pConnection);
int countNum = 1;
long countInsertSql = 0;
//int countNumCoe = countNum * 512;
char *parameters;
string getUUid()
{
char buffer[64] = { 0 };
GUID guid;
if ( CoCreateGuid(&guid) )
{
fprintf(stderr, "create guid error\n");
return "";
}
_snprintf(buffer, sizeof(buffer),"%08X-%04X-%04x-%02X%02X-%02X%02X%02X%02X%02X%02X",guid.Data1, guid.Data2, guid.Data3,
guid.Data4[0], guid.Data4[1], guid.Data4[2],guid.Data4[3], guid.Data4[4], guid.Data4[5],guid.Data4[6], guid.Data4[7]);
//printf("guid: %s\n", buffer);
return buffer;
}
int JLCS_05_BOMSendOutSap_Single(EPM_action_message_t msg)
{
printf("开始执行\n");
int ifail = ITK_ok;
parameters = (char*)malloc(100000 * sizeof(char));
strcpy(parameters, "getBomPropertys}}");
//parameters = "getBomPropertys}}";
printf("parameters1:\n%s\n", parameters);
int attachments_num;
int bvr_count;
tag_t rootTask = NULLTAG, *attachments = NULLTAG, top_line = NULLTAG, *children_line = NULLTAG, *bvr_list = NULLTAG;
tag_t bom_window_tag;
char *object_type = NULL;
int count;
char *tc_root_file = getenv("tc_root"); //获取tc_root的路径==C:\Siemens\Teamcenter11
char jar_file[SS_MAXPATHLEN] = "";
strcpy(jar_file, tc_root_file);
strcat(jar_file, "\\portal\\plugins\\");
strcat(jar_file, "JLCS_05.jar");
//获取任务对象
EPM_ask_root_task(msg.task, &rootTask);
//获取任务目标对象
EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments);
//char *temp_dir = getenv("temp"); //C:\Windows\temp
for (int i = 0; i < attachments_num; i++)
{
//获取topline
AOM_ask_value_string(attachments[i], "object_type", &object_type);
printf("object_type=%s \n", object_type);
//过滤掉非版本的对象
if((strstr(object_type,"Revision") == NULL) || (strstr(object_type,"Master") != NULL)
|| (strstr(object_type,"master") != NULL) || (strstr(object_type,"BOM") != NULL) || (strstr(object_type,"bom") != NULL) || (strstr(object_type,"Bom") != NULL))
{
continue;
}
char * puid = NULL;
//获取PUID
ITK__convert_tag_to_uid(attachments[i], &puid);
//strcat(parameters, puid);
//strcat(parameters, "}}");
printf("object_type2=%s \n", object_type);
//if (strcmp("ItemRevision", object_type) == 0) {
ITEM_rev_list_bom_view_revs(attachments[i], &bvr_count, &bvr_list);
//printf("视图数量=%d \n", bvr_count);
if (bvr_count == 0) {
continue;
}
//传参属性
BOM_create_window(&bom_window_tag);
BOM_set_window_top_line_bvr(bom_window_tag, bvr_list[bvr_count - 1], &top_line);
//BOM_ask_window_top_line(bom_window_tag, &top_line);
printf("parameters1:\n%s\n", parameters);
//getBomLinePropertys(top_line,puid);
BOM_line_ask_all_child_lines(top_line, &count, &children_line);
for (int ii = 0; ii < count; ii++)
{
char * object_type = NULL;
//获取版本
tag_t partItemRevision = NULLTAG, parentItemRevision = NULLTAG;
AOM_ask_value_tag(children_line[ii],"bl_line_object",&partItemRevision);
AOM_ask_value_tag(top_line,"bl_line_object",&parentItemRevision);
//ITKCALL(ITEM_ask_latest_rev(partItem,&partItemRevision));
AOM_ask_value_string(partItemRevision, "object_type", &object_type);
//过滤非零件版本的对象
if (strcmp("Gd6_PartsRevision", object_type) == 0
|| strcmp("Gd6_BZJRevision", object_type) == 0|| strcmp("Gd6_XZMKCRevision", object_type) == 0) {
int item_mast_rev_count = 0;
tag_t * item_mast_rev = NULLTAG;
//获取版本表单
ITKCALL(AOM_ask_value_tags(partItemRevision, "IMAN_master_form_rev", &item_mast_rev_count, &item_mast_rev ) )
//获取topline属性
//父件代号
AOM_ask_value_string(parentItemRevision, "item_id", &MATNR);
//父件工厂
WERKS = "6300";
//AOM_ask_value_string(children_line[ii], "bl_formatted_parent_name", &bl_formatted_parent_name);
//BOM用途
STLAN = "1";
//可选BOM
STALT = "1";
//销售单号
VBELN = "";
//订单行项目
VBPOS = "";
//父件数量
AOM_ask_value_string(top_line, "bl_quantity", &BMENG);
//BOM项目号
AOM_ask_value_string(children_line[ii], "bl_sequence_no", &POSNR);
//项目类别
POSTP = "L";
//子件代号
AOM_ask_value_string(partItemRevision, "item_id", &IDNRK);
//子件数量
AOM_ask_value_string(children_line[ii], "bl_quantity", &MENGE);
//子件单位
AOM_ask_value_string(item_mast_rev[0], "gd6_dw", &MEINS);
//配送区域
AOM_ask_value_string(children_line[0], "Gd6_psqy", &POTX1);
//生产工位/配送工位gd6_scgw&gd6_psgw
char * scgw = NULL, * psgw = NULL;
AOM_ask_value_string(children_line[0], "Gd6_scgw", &scgw);
AOM_ask_value_string(children_line[0], "Gd6_psgw", &psgw);
strcat(parameters, MATNR);
strcat(parameters, ",");
strcat(parameters, WERKS);
strcat(parameters, ",");
strcat(parameters, STLAN);
strcat(parameters, ",");
strcat(parameters, STALT);
strcat(parameters, ",");
strcat(parameters, VBELN);
strcat(parameters, ",");
strcat(parameters, VBPOS);
strcat(parameters, ",");
strcat(parameters, BMENG);
strcat(parameters, ",");
strcat(parameters, POSNR);
strcat(parameters, ",");
strcat(parameters, POSTP);
strcat(parameters, ",");
strcat(parameters, IDNRK);
strcat(parameters, ",");
strcat(parameters, MENGE);
strcat(parameters, ",");
strcat(parameters, MEINS);
strcat(parameters, ",");
strcat(parameters, POTX1);
strcat(parameters, ",");
strcat(parameters, scgw);
strcat(parameters, ",");
strcat(parameters, psgw);
strcat(parameters, ",");
strcat(parameters, puid);
strcat(parameters, "}}");
//strcat(parameters, parameter);
printf("parameter:\n%s\n", parameters);
//strcat(parameters, C5_gc);
//strcat(parameters, C5_scgw);
//char cmd[256] = "";
//strcpy(cmd, "java -jar \"");
//strcat(cmd, jar_file);
//strcat(cmd, "\" ");
//传参
//strcat(cmd, parameter);
//printf("路径:\n%s\n", cmd);
//system(cmd);
//countNum++;
}
}
//DOFREE(puid)
//char *strResult = (char*)malloc((strlen(parameters) + 512) * sizeof(int));;
//string strResult;
/*while (fgets(buf, sizeof buf, pf) != NULL) {
printf("%s", buf);
EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,buf);
ifail = 1;
}*/
//}
}
//把数据用写入文件
char data_file[SS_MAXPATHLEN] = "";
strcat(data_file,tc_root_file);
strcat(data_file,"\\single_bom.txt");
FILE* fptr;
fptr = fopen(data_file, "w");
fprintf(fptr, "%s", parameters);
fclose(fptr);
char *cmd = (char*)malloc(512 * sizeof(int));
strcpy(cmd, "java -jar \"");
strcat(cmd, jar_file);
strcat(cmd, "\" ");
//传参
strcat(cmd, data_file);
strcat(cmd,"getBomPropertys");
printf("路径:\n%s\n", cmd);
char buf[64] = {0};
FILE *pf = NULL;
if ((pf = _popen(cmd, "r")) == NULL) {
printf("接口返回:\n%s", "1");
}
string strResult;
while (fgets(buf, sizeof buf, pf)) {
strResult += buf;
}
_pclose(pf);
unsigned int iSize = strResult.size();
if (iSize > 0 && strResult[iSize - 1] == '\n')
{
strResult = strResult.substr(0, iSize - 1);
//获取流程作业
tag_t job = NULLTAG;
EPM_ask_job(rootTask,&job);
POM_AM__set_application_bypass(true);
//设置描述属性值
//先lock
AOM_lock(job);
//再set
AOM_set_value_string(job,"object_desc",strResult.c_str());
//再save
AOM_save( job ) ;
//最后unlock
AOM_unlock( job ) ;
AOM_refresh( job,FALSE );
POM_AM__set_application_bypass(false);
//EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,strResult.c_str());
//ifail = 1;
}
//system(cmd);
BOM_close_window(bom_window_tag);
DOFREE(bvr_list);
parameters = NULL;
cmd = NULL;
DOFREE(attachments);
tc_root_file = NULL;
DOFREE(children_line);
DOFREE(MATNR);
WERKS = NULL;
STLAN = NULL;
STALT = NULL;
VBELN = NULL;
VBPOS = NULL;
BMENG = NULL;
DOFREE(POSNR);
POSTP = NULL;
DOFREE(IDNRK);
DOFREE(MENGE);
DOFREE(MEINS);
DOFREE(POTX1);
DOFREE(POTX2);
printf("执行结束\n");
return ifail;
}
int JLCS_05_BOMSendOutSap(EPM_action_message_t msg)
{
printf("开始执行\n");
int ifail = ITK_ok;
parameters = (char*)malloc(512 * sizeof(char));
strcpy(parameters, "getBomPropertys}}");
//parameters = "getBomPropertys}}";
printf("parameters1:\n%s\n", parameters);
int attachments_num;
int bvr_count;
tag_t rootTask = NULLTAG, *attachments = NULLTAG, top_line = NULLTAG, *children_line = NULLTAG, *bvr_list = NULLTAG;
tag_t bom_window_tag;
char *object_type = NULL;
int count;
char *tc_root_file = getenv("tc_root"); //获取tc_root的路径==C:\Siemens\Teamcenter11
char jar_file[SS_MAXPATHLEN] = "";
strcpy(jar_file, tc_root_file);
strcat(jar_file, "\\portal\\plugins\\");
strcat(jar_file, "JLCS_05.jar");
//获取任务对象
EPM_ask_root_task(msg.task, &rootTask);
//获取任务目标对象
EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments);
//char *temp_dir = getenv("temp"); //C:\Windows\temp
for (int i = 0; i < attachments_num; i++)
{
//获取topline
AOM_ask_value_string(attachments[i], "object_type", &object_type);
printf("object_type=%s \n", object_type);
//过滤掉非版本的对象
if((strstr(object_type,"Revision") == NULL) || (strstr(object_type,"Master") != NULL)
|| (strstr(object_type,"master") != NULL) || (strstr(object_type,"BOM") != NULL) || (strstr(object_type,"bom") != NULL) || (strstr(object_type,"Bom") != NULL))
{
continue;
}
char * puid = NULL;
//获取PUID
ITK__convert_tag_to_uid(attachments[i], &puid);
strcat(parameters, puid);
strcat(parameters, "}}");
printf("object_type2=%s \n", object_type);
//if (strcmp("ItemRevision", object_type) == 0) {
ITEM_rev_list_bom_view_revs(attachments[i], &bvr_count, &bvr_list);
//printf("视图数量=%d \n", bvr_count);
if (bvr_count == 0) {
continue;
}
//传参属性
BOM_create_window(&bom_window_tag);
BOM_set_window_top_line_bvr(bom_window_tag, bvr_list[bvr_count - 1], &top_line);
//BOM_ask_window_top_line(bom_window_tag, &top_line);
printf("parameters1:\n%s\n", parameters);
getBomLinePropertys(top_line,NULL);
char *cmd = (char*)malloc((strlen(parameters) + 512) * sizeof(int));
strcpy(cmd, "java -jar \"");
strcat(cmd, jar_file);
strcat(cmd, "\" ");
//传参
strcat(cmd, parameters);
//printf("路径:\n%s\n", cmd);
char buf[64] = {0};
FILE *pf = NULL;
if ((pf = _popen(cmd, "r")) == NULL) {
printf("接口返回:\n%s", "1");
}
string strResult;
while (fgets(buf, sizeof buf, pf)) {
strResult += buf;
}
_pclose(pf);
unsigned int iSize = strResult.size();
if (iSize > 0 && strResult[iSize - 1] == '\n')
{
strResult = strResult.substr(0, iSize - 1);
//获取流程作业
tag_t job = NULLTAG;
EPM_ask_job(rootTask,&job);
POM_AM__set_application_bypass(true);
//设置描述属性值
//先lock
AOM_lock(job);
//再set
AOM_set_value_string(job,"object_desc",strResult.c_str());
//再save
AOM_save( job ) ;
//最后unlock
AOM_unlock( job ) ;
AOM_refresh( job,FALSE );
POM_AM__set_application_bypass(false);
//EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,strResult.c_str());
//ifail = 1;
}
//char *strResult = (char*)malloc((strlen(parameters) + 512) * sizeof(int));;
//string strResult;
/*while (fgets(buf, sizeof buf, pf) != NULL) {
printf("%s", buf);
EMH_store_error_s1( EMH_severity_user_error, EMH_USER_error_base,buf);
ifail = 1;
}*/
_pclose(pf);
//system(cmd);
BOM_close_window(bom_window_tag);
DOFREE(bvr_list);
parameters = NULL;
cmd = NULL;
DOFREE(puid)
//}
}
DOFREE(attachments);
tc_root_file = NULL;
DOFREE(children_line);
DOFREE(MATNR);
WERKS = NULL;
STLAN = NULL;
STALT = NULL;
VBELN = NULL;
VBPOS = NULL;
BMENG = NULL;
DOFREE(POSNR);
POSTP = NULL;
DOFREE(IDNRK);
DOFREE(MENGE);
DOFREE(MEINS);
DOFREE(POTX1);
DOFREE(POTX2);
printf("执行结束\n");
return ifail;
}
int Super_Bom_Appent_Data (void *returnValue)
{
printf("=========================同步超级BOM START ===================\n");
countInsertSql = 0;
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
int valueNum=0;
char* server_address;
PREF_ask_char_value("TC11_SqlServer_Link_ITK", valueNum, &server_address);
char *object_type = NULL, * carModel = NULL;
int bvr_count;
tag_t * bvr_list = NULLTAG,bom_window_tag = NULLTAG, top_line = NULLTAG;
tag_t itemRevision = NULLTAG;
ITKCALL(USERARG_get_tag_argument(&itemRevision));
//char *people = NULL;
//USERARG_get_string_argument(&people);
//获取topline
AOM_ask_value_string(itemRevision, "object_type", &object_type);
AOM_ask_value_string(itemRevision, "item_id", &carModel);
printf("object_type=%s \n", object_type);
printf("item_id=%s \n", carModel);
ITEM_rev_list_bom_view_revs(itemRevision, &bvr_count, &bvr_list);
if (bvr_count == 0) {
return 0;
}
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
/*
Provider=SQLOLEDB.1 ------oledbbai
Persist Security Info ----du
User ID-------------------
PassWord------------------zhi
Initial Catalog-----------ipdao
Data Source---------------
*/
m_pConnection->ConnectionString = (server_address);
//printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
else
{
//m_pRecordset->Open("","", adOpenKeyset,adLockOptimistic,adCmdText);
//long RecordCount;
//RecordCount=m_pRecordset->Fields->GetItem((long)0)->GetValue();
//修改属性为更新中(如果不存在就新增)
long sumrows = 0;
char* selectLable = (char*)calloc(1024, sizeof(char));
sprintf(selectLable,"select count(*) from GD_ORDERBOM_LABLE where ItemID = '%s'",carModel);
m_pRecordset = m_pConnection->Execute(_bstr_t(selectLable), 0, adCmdText);
/*sumrows = m_pRecordset->GetRecordCount();*/
_variant_t vIndex = (long)0;
_variant_t vCount = m_pRecordset->GetCollect(vIndex);
printf("共有%d条记录",vCount.lVal);
sumrows = vCount.lVal;
m_pRecordset->Close();
printf("end =%ld\n",sumrows);
if(sumrows > 0){
//存在(修改)
char* updateLable = (char*)calloc(1024, sizeof(char));
sprintf(updateLable, "update GD_ORDERBOM_LABLE set Lable = '更新中' where ItemID = '%s'", carModel);
m_pConnection->Execute(_bstr_t(updateLable), 0, adCmdText);
updateLable = NULL;
}
else{
//不存在(新增)
char* insertLable = (char*)calloc(1024, sizeof(char));
sprintf(insertLable, "insert into GD_ORDERBOM_LABLE(ItemID,Lable) values('%s','更新中') ", carModel);
m_pConnection->Execute(_bstr_t(insertLable), 0, adCmdText);
insertLable = NULL;
}
selectLable = NULL;
//先删除Lable中的一行再添加。
//char* deleteLable = (char*)calloc(1024, sizeof(char));
//sprintf(deleteLable, "delete from GD_ORDERBOM_LABLE where ItemID = '%s'", carModel);
//m_pConnection->Execute(_bstr_t(deleteLable), 0, adCmdText);
//deleteLable = NULL;
//char* insertLable = (char*)calloc(1024, sizeof(char));
//sprintf(insertLable, "insert into GD_ORDERBOM_LABLE(ItemID,Lable) values('%s','更新中') ", carModel);
//m_pConnection->Execute(_bstr_t(insertLable), 0, adCmdText);
//insertLable = NULL;
//删除数据库中所有内容
char* deleteSql = (char*)calloc(1024, sizeof(char));
tag_t partItemRevision = NULLTAG,item = NULLTAG;
sprintf(deleteSql, "delete from GD_ORDERBOM_DATA where carModel = '%s'", carModel);
m_pConnection->Execute(_bstr_t(deleteSql), 0, adCmdText);
//printf("删除成功!\n");
//添加数据gd6_psgw
//传参属性
BOM_create_window(&bom_window_tag);
BOM_set_window_top_line_bvr(bom_window_tag, bvr_list[bvr_count - 1], &top_line);
string childUUID = carModel;
char * itemId = "";
char * formula = "";
char * itemType = "";
char * sequenceNumber = "";
char * hierarchy = "";
char * quantity = "";
char * psqy = "";
char * scqy = "";
char * psqw = "";
char * scgw = "";
char * name = "";
char * sjzl = "";
char * mz = "";
char * wlfl = "";
char * dw = "";
char * jcjwlh = "";
char * sfqdj = "";
char * gyzy = "";
char * clgg = "";
char * clhd = "";
AOM_ask_value_tag(top_line,"bl_line_object",&partItemRevision);
ITEM_ask_item_of_rev( partItemRevision, &item);
AOM_ask_value_string(item, "object_type", &itemType);
AOM_ask_value_string(top_line, "bl_sequence_no", &sequenceNumber);
AOM_ask_value_string(top_line, "bl_item_item_id", &itemId);
AOM_ask_value_string(top_line, "bl_formula", &formula);
//AOM_ask_value_string(children_line[ii], "bl_level_starting_0", &POTX1);
AOM_ask_value_string(top_line, "bl_quantity", &quantity);
AOM_ask_value_string(top_line, "Gd6_psqy", &psqy);
AOM_ask_value_string(top_line, "Gd6_scqy", &scqy);
AOM_ask_value_string(top_line, "Gd6_psgw", &psqw);
AOM_ask_value_string(top_line, "Gd6_scgw", &scgw);
AOM_ask_value_string(top_line, "bl_item_object_name", &name);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_sjzl", &sjzl);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_mz", &mz);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_wlfl", &wlfl);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_dw", &dw);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_jcjwlh", &jcjwlh);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_sfqdj", &sfqdj);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_gyzy", &gyzy);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_clgg", &clgg);
AOM_ask_value_string(top_line, "bl_Gd6_PartsRevisionMaster_gd6_clhd", &clhd);
char* insertSql = (char*)calloc(1024, sizeof(char));
sprintf(insertSql, "INSERT INTO GD_ORDERBOM_DATA (carModel,parentID,id,bl_formula,bl_item_type,bl_sequence_no,uid,hierarchy,bl_quantity,psqy,scqy,psgw,scgw,bl_item_object_name,sjzl,mz,wlfl,dw,jcjwlh,sfqdj,gyzy,realParentID,clgg,clhd) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",carModel,"",itemId,formula,itemType,sequenceNumber,childUUID.c_str(),hierarchy,quantity,psqy,scqy,psqw,scgw,name,sjzl,mz,wlfl,dw,jcjwlh,sfqdj,gyzy,"",clgg,clhd);
m_pConnection->Execute(_bstr_t(insertSql), 0, adCmdText);
countInsertSql++;
deleteSql = NULL;
DOFREE(itemId);
DOFREE(formula);
DOFREE(itemType);
DOFREE(sequenceNumber);
hierarchy = NULL;
DOFREE(quantity);
DOFREE(psqy);
DOFREE(scqy);
DOFREE(psqw);
DOFREE(scgw);
DOFREE(name);
DOFREE(sjzl);
DOFREE(mz);
DOFREE(wlfl);
DOFREE(dw);
DOFREE(jcjwlh);
DOFREE(sfqdj);
DOFREE(gyzy);
DOFREE(clgg);
DOFREE(clhd);
insertSql = NULL;
try{
getBomLinePropertysBom(top_line,carModel,carModel,m_pConnection);
//判断新增的条目数是否一致
long sqlCount = 0;
char* selectCount = (char*)calloc(1024, sizeof(char));
sprintf(selectCount,"select count(*) from GD_ORDERBOM_DATA where carModel = '%s'",carModel);
m_pRecordset = m_pConnection->Execute(_bstr_t(selectCount), 0, adCmdText);
/*sumrows = m_pRecordset->GetRecordCount();*/
_variant_t vIndexCount = (long)0;
_variant_t vCountCount = m_pRecordset->GetCollect(vIndexCount);
printf("共新增了%d条记录\n",countInsertSql);
printf("数据库中有%d条记录\n",vCountCount.lVal);
sqlCount = vCountCount.lVal;
m_pRecordset->Close();
if(sqlCount == countInsertSql){
//修改超级BOM的状态(成功)
char* updateSql = (char*)calloc(1024, sizeof(char));
sprintf(updateSql, "update GD_ORDERBOM_LABLE set Lable = '更新成功',Remark = '' where ItemID = '%s'", carModel);
m_pConnection->Execute(_bstr_t(updateSql), 0, adCmdText);
updateSql = NULL;
}
else{
//修改超级BOM的状态(失败)
char* updateSql = (char*)calloc(1024, sizeof(char));
sprintf(updateSql, "update GD_ORDERBOM_LABLE set Lable = '更新失败',Remark = '条目数不一致' where ItemID = '%s'", carModel);
m_pConnection->Execute(_bstr_t(updateSql), 0, adCmdText);
updateSql = NULL;
}
//日志表
//char *insertLog = (char*)calloc(1024, sizeof(char));
//sprintf(insertLog, "insert into GD_ORDERBOM_LABLE_LOG(ItemID,Lable) VALUES('%s','更新成功')",carModel);
//m_pConnection->Execute(_bstr_t(insertLog), 0, adCmdText);
//insertLog = NULL;
}
catch(exception e ){
//添加失败原因
char* updateSql = (char*)calloc(1024, sizeof(char));
sprintf(updateSql, "update GD_ORDERBOM_LABLE set Lable = '更新失败'Remark = '%s' where ItemID = '%s'",e.what() ,carModel);
m_pConnection->Execute(_bstr_t(updateSql), 0, adCmdText);
updateSql = NULL;
//日志表
//char *insertLog = (char*)calloc(1024, sizeof(char));
//sprintf(insertLog, "insert into GD_ORDERBOM_LABLE_LOG(ItemID,Lable,Remark) VALUES('%s','更新失败','%s')",carModel,e.what() );
//m_pConnection->Execute(_bstr_t(insertLog), 0, adCmdText);
//insertLog = NULL;
std::cout << e.what() << std::endl;
}
}
}
else
{
printf("Create instance of connection failed!");
return 1;
}
DOFREE(object_type);
DOFREE(server_address);
DOFREE(carModel);
DOFREE(bvr_list);
printf("=========================同步超级BOM END ===================\n");
return 0;
}
void getBomLinePropertysBom(tag_t top_line,string topUUID,char * carModel, _ConnectionPtr m_pConnection) {
//printf("开始执行getBomLinePropertys\n");
int count;
tag_t *children_line;
ITKCALL(BOM_line_ask_all_child_lines(top_line, &count, &children_line));
//printf("子行=%d \n", count);
for (int ii = 0; ii < count; ii++)
{
countInsertSql++;
tag_t partItemRevision = NULLTAG,item = NULLTAG;
string childUUID = getUUid();
char * itemId = "";
char * formula = "";
char * itemType = "";
char * sequenceNumber = "";
char * hierarchy = "";
char * quantity = "";
char * psqy = "";
char * scqy = "";
char * psqw = "";
char * scgw = "";
char * name = "";
char * sjzl = "";
char * mz = "";
char * wlfl = "";
char * dw = "";
char * jcjwlh = "";
char * sfqdj = "";
char * gyzy = "";
char * realParentID = "";
char * clgg = "";
char * clhd = "";
ITKCALL(AOM_ask_value_string(top_line,"bl_item_item_id",&realParentID));
ITKCALL(AOM_ask_value_tag(children_line[ii],"bl_line_object",&partItemRevision));
ITKCALL(ITEM_ask_item_of_rev( partItemRevision, &item));
ITKCALL(AOM_ask_value_string(item, "object_type", &itemType));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_sequence_no", &sequenceNumber));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_item_item_id", &itemId));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_formula", &formula));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_quantity", &quantity));
ITKCALL(AOM_ask_value_string(children_line[ii], "Gd6_psqy", &psqy));
ITKCALL(AOM_ask_value_string(children_line[ii], "Gd6_scqy", &scqy));
ITKCALL(AOM_ask_value_string(children_line[ii], "Gd6_psgw", &psqw));
ITKCALL(AOM_ask_value_string(children_line[ii], "Gd6_scgw", &scgw));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_item_object_name", &name));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_sjzl", &sjzl));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_mz", &mz));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_wlfl", &wlfl));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_dw", &dw));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_jcjwlh", &jcjwlh));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_sfqdj", &sfqdj));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_gyzy", &gyzy));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_clgg", &clgg));
ITKCALL(AOM_ask_value_string(children_line[ii], "bl_Gd6_PartsRevisionMaster_gd6_clhd", &clhd));
char* insertSql = (char*)calloc(2048, sizeof(char));
sprintf(insertSql, "INSERT INTO GD_ORDERBOM_DATA (carModel,parentID,id,bl_formula,bl_item_type,bl_sequence_no,uid,hierarchy,bl_quantity,psqy,scqy,psgw,scgw,bl_item_object_name,sjzl,mz,wlfl,dw,jcjwlh,sfqdj,gyzy,realParentID,clgg,clhd) VALUES ('%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s')",carModel,topUUID.c_str(),itemId,formula,itemType,sequenceNumber,childUUID.c_str(),hierarchy,quantity,psqy,scqy,psqw,scgw,name,sjzl,mz,wlfl,dw,jcjwlh,sfqdj,gyzy,realParentID,clgg,clhd);
//printf("插入sql%s\n",insertSql);
m_pConnection->Execute(_bstr_t(insertSql), 0, adCmdText);
DOFREE(itemId);
DOFREE(formula);
DOFREE(itemType);
DOFREE(sequenceNumber);
hierarchy = NULL;
DOFREE(quantity);
DOFREE(psqy);
DOFREE(scqy);
DOFREE(psqw);
DOFREE(scgw);
DOFREE(name);
DOFREE(sjzl);
DOFREE(mz);
DOFREE(wlfl);
DOFREE(dw);
DOFREE(jcjwlh);
DOFREE(sfqdj);
DOFREE(gyzy);
DOFREE(realParentID);
DOFREE(clgg);
DOFREE(clhd);
insertSql = NULL;
getBomLinePropertysBom(children_line[ii],childUUID,carModel,m_pConnection);
}
DOFREE(children_line);
}
//void getBomPropertys(EPM_action_message_t msg, int ifail) {
//
//
//
//
//}
void getBomLinePropertys(tag_t top_line,char *type) {
//printf("开始执行getBomLinePropertys\n");
int count;
tag_t *children_line;
parameters = (char *)realloc(parameters, (countNum * 512) * sizeof(char));
//char parameter[5120] = "getBomPropertys,";
char *tc_root_file = getenv("tc_root"); //C:\Siemens\Teamcenter11
char jar_file[SS_MAXPATHLEN] = "";
strcpy(jar_file, tc_root_file);
strcat(jar_file, "\\portal\\plugins\\");
strcat(jar_file, "JLCS_05.jar");
BOM_line_ask_all_child_lines(top_line, &count, &children_line);
printf("子行=%d \n", count);
for (int ii = 0; ii < count; ii++)
{
char * object_type = NULL;
//获取版本
tag_t partItemRevision = NULLTAG, parentItemRevision = NULLTAG;
AOM_ask_value_tag(children_line[ii],"bl_line_object",&partItemRevision);
AOM_ask_value_tag(top_line,"bl_line_object",&parentItemRevision);
//ITKCALL(ITEM_ask_latest_rev(partItem,&partItemRevision));
AOM_ask_value_string(partItemRevision, "object_type", &object_type);
//过滤非零件版本的对象
if (strcmp("Gd6_PartsRevision", object_type) == 0
|| strcmp("Gd6_BZJRevision", object_type) == 0|| strcmp("Gd6_XZMKCRevision", object_type) == 0) {
int item_mast_rev_count = 0;
tag_t * item_mast_rev = NULLTAG;
//获取版本表单
ITKCALL(AOM_ask_value_tags(partItemRevision, "IMAN_master_form_rev", &item_mast_rev_count, &item_mast_rev ) )
char * wlfl = NULL;
AOM_ask_value_string(item_mast_rev[0], "gd6_wlfl", &wlfl);
if(strcmp("H40", wlfl) == 0){
continue;
}
//获取topline属性
//父件代号
AOM_ask_value_string(parentItemRevision, "item_id", &MATNR);
//父件工厂
WERKS = "6300";
//AOM_ask_value_string(children_line[ii], "bl_formatted_parent_name", &bl_formatted_parent_name);
//BOM用途
STLAN = "1";
//可选BOM
STALT = "1";
//销售单号
VBELN = "";
//订单行项目
VBPOS = "";
//父件数量
AOM_ask_value_string(top_line, "bl_quantity", &BMENG);
//BOM项目号
AOM_ask_value_string(children_line[ii], "bl_sequence_no", &POSNR);
//项目类别
POSTP = "L";
//子件代号
AOM_ask_value_string(partItemRevision, "item_id", &IDNRK);
//子件数量
AOM_ask_value_string(children_line[ii], "bl_quantity", &MENGE);
//子件单位
AOM_ask_value_string(item_mast_rev[0], "gd6_dw", &MEINS);
//配送区域
AOM_ask_value_string(children_line[0], "Gd6_psqy", &POTX1);
//生产工位/配送工位gd6_scgw&gd6_psgw
char * scgw = NULL, * psgw = NULL;
AOM_ask_value_string(children_line[0], "Gd6_scgw", &scgw);
AOM_ask_value_string(children_line[0], "Gd6_psgw", &psgw);
strcat(parameters, MATNR);
strcat(parameters, ",");
strcat(parameters, WERKS);
strcat(parameters, ",");
strcat(parameters, STLAN);
strcat(parameters, ",");
strcat(parameters, STALT);
strcat(parameters, ",");
strcat(parameters, VBELN);
strcat(parameters, ",");
strcat(parameters, VBPOS);
strcat(parameters, ",");
strcat(parameters, BMENG);
strcat(parameters, ",");
strcat(parameters, POSNR);
strcat(parameters, ",");
strcat(parameters, POSTP);
strcat(parameters, ",");
strcat(parameters, IDNRK);
strcat(parameters, ",");
strcat(parameters, MENGE);
strcat(parameters, ",");
strcat(parameters, MEINS);
strcat(parameters, ",");
strcat(parameters, POTX1);
strcat(parameters, ",");
strcat(parameters, scgw);
strcat(parameters, ",");
strcat(parameters, psgw);
strcat(parameters, ",");
strcat(parameters, type);
strcat(parameters, "}}");
//strcat(parameters, parameter);
printf("parameter:\n%s\n", parameters);
//strcat(parameters, C5_gc);
//strcat(parameters, C5_scgw);
//char cmd[256] = "";
//strcpy(cmd, "java -jar \"");
//strcat(cmd, jar_file);
//strcat(cmd, "\" ");
//传参
//strcat(cmd, parameter);
//printf("路径:\n%s\n", cmd);
//system(cmd);
countNum++;
}
if(type == NULL){
getBomLinePropertys(children_line[ii],type);
}
}
}
//---------------------------------------------------工具------------------------------------------------------
//分割字符串
void split(char *src, const char *separator, char **dest, int *num) {
/*
src (buf)
separator
dest
num
*/
char *pNext;
int count = 0;
if (src == NULL || strlen(src) == 0) //如果传入的地址为空或长度为0直接终止
return;
if (separator == NULL || strlen(separator) == 0) //如未指定分割的字符串,直接终止
return;
printf("分割前的字符=======================%s\n",src);
pNext = strtok(src, separator); //必须使用(char *)进行强制类型转换(虽然不写有的编译器中不会出现指针错误)
while (pNext != NULL) {
printf("分割后的字符=======================%s\n",pNext);
dest[count] = pNext;
++count;
pNext = strtok(NULL, separator); //必须使用(char *)进行强制类型转换
}
*num = count;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,336 @@
#include "epm_handler_common.h"
#include <tccore\aom_prop.h>
#include <tccore\aom.h>
#include "dos.h"
#include "sstream"
#include <string>
#include <stddef.h>
#include "time.h"
#include "stdio.h"
#include<iostream>
extern "C" int POM_AM__set_application_bypass(logical bypass);
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
string intToString(int a){
stringstream ss;
ss << a;
string str = ss.str();
return str;
}
int JL_Add_FinishTime(EPM_action_message_t msg){
int ifail = ITK_ok,count = 0;
tag_t *sub = NULLTAG,rootTask = NULLTAG;
char *name = NULL;
cout << "开始执行" << endl;
//获取任务对象
EPM_ask_root_task(msg.task, &rootTask);
//得到当前时间
struct tm *local;
time_t t;
t=time(NULL);
local=localtime(&t);
cout << local <<endl;
cout << local->tm_year <<endl;
cout << local->tm_mon <<endl;
cout << local->tm_mday <<endl;
cout << local->tm_hour <<endl;
cout << local->tm_min<<endl;
cout << local->tm_sec<<endl;
cout << local->tm_wday<<endl;
char year[SS_MAXPATHLEN] = "",
month[SS_MAXPATHLEN] = "",
day[SS_MAXPATHLEN] = "",
hour[SS_MAXPATHLEN] = "",
min[SS_MAXPATHLEN] = "",
nowTime[4096] = "";
//下午接受,第二天完成
if(local->tm_hour > 12 && local->tm_hour <=23){
if(local->tm_mon == 0 || local->tm_mon == 2 || local->tm_mon == 4 ||
local->tm_mon == 6 || local->tm_mon == 7 || local->tm_mon == 9 ||
local->tm_mon == 11 ){
if(local->tm_wday == 5){
//该天是星期五(+3天
if(local->tm_mday < 29){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+3);
}
//29号
else if(local->tm_mday == 29){
//12月
if(local->tm_mon == 11){
sprintf(year, "%d", local->tm_year+1901);
sprintf(month, "%d", 1);
sprintf(day, "%d", 1);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
}
//30号
else if(local->tm_mday == 30){
//12月
if(local->tm_mon == 11){
sprintf(year, "%d", local->tm_year+1901);
sprintf(month, "%d", 1);
sprintf(day, "%d", 2);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 2);
}
}
//31号
else{
//12月
if(local->tm_mon == 11){
sprintf(year, "%d", local->tm_year+1901);
sprintf(month, "%d", 1);
sprintf(day, "%d", 3);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 3);
}
}
}
else{
//不是星期五(+1天
if(local->tm_mday < 31){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+1);
}
else{
//12月31号
if(local->tm_mon == 11){
sprintf(year, "%d", local->tm_year+1901);
sprintf(month, "%d", 1);
sprintf(day, "%d", 1);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
}
}
}
else if(local->tm_mon == 3 || local->tm_mon == 5 || local->tm_mon == 8 || local->tm_mon == 10){
if(local->tm_wday == 5){
if(local->tm_mday < 28){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+3);
}
//28号
else if(local->tm_mday == 28){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
//29号
else if(local->tm_mday == 29){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 2);
}
//30号
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 3);
}
}
else{
if(local->tm_mday < 30){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+1);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
}
}
//2月
else{
//判断是否是闰年有29天
int leap_year = local->tm_year+1900;
//闰年有29天
if((leap_year % 4 == 0 && leap_year % 100 != 0) || (leap_year % 400 == 0)){
if(local->tm_wday == 5){
if(local->tm_mday < 27){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+3);
}
//27号
else if(local->tm_mday == 27){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
//28号
else if(local->tm_mday == 28){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 2);
}
//29号
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 3);
}
}
else{
if(local->tm_mday < 29){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+1);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
}
}
//不是闰年28天
else{
if(local->tm_wday == 5){
if(local->tm_mday < 26){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+3);
}
//26号
else if(local->tm_mday == 26){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
//27号
else if(local->tm_mday == 27){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 2);
}
//28号
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 3);
}
}
else{
if(local->tm_mday < 28){
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday+1);
}
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+2);
sprintf(day, "%d", 1);
}
}
}
}
sprintf(hour, "%d", 12);
}
//上午接受,下午完成
else{
sprintf(year, "%d", local->tm_year+1900);
sprintf(month, "%d", local->tm_mon+1);
sprintf(day, "%d", local->tm_mday);
sprintf(hour, "%d", 17);
//sprintf(min, "%d", local->tm_min);
}
//string year = intToString(local->tm_year+1900);
//string month = intToString(local->tm_mon+1);
//string day = intToString(local->tm_mday);
//string hour = intToString(local->tm_hour);
//string min = intToString(local->tm_min);
//string nowTime = year + "年"+month+"月"+day+"日" + hour+":"+min;
cout << nowTime <<endl;
EPM_ask_name2(msg.task,&name);
cout <<name <<endl;
strcat(nowTime,year);
strcat(nowTime,"");
strcat(nowTime,month);
strcat(nowTime,"");
strcat(nowTime,day);
strcat(nowTime,"");
strcat(nowTime,hour);
strcat(nowTime,":");
strcat(nowTime,"00——");
strcat(nowTime,name);
strcat(nowTime,"\n");
//date_t date;
//AOM_ask_value_date(msg.task,"fnd0StartDate",&date);
//printf("%s\n",date.year);
//printf("%s\n",date.month);
//printf("%s\n",date.day);
//printf("%s\n",date.hour);
//printf("%s\n",date.minute);
//printf("%s\n",date.second);
local = NULL;
//EPM_ask_sub_tasks(msg.task,&count,&sub);
//cout<< count <<endl;
//for(int i=0;i<count;i++){
// char *name = NULL;
// EPM_ask_name2(sub[i],&name);
// cout<<name<<endl;
// DOFREE(name);
//}
//获取流程作业
tag_t job = NULLTAG;
EPM_ask_job(rootTask,&job);
POM_AM__set_application_bypass(true);
//设置描述属性值
//先lock
AOM_lock(job);
//再set
char *old = NULL;
AOM_ask_value_string(job,"object_desc",&old);
strcat(nowTime,old);
AOM_set_value_string(job,"object_desc",nowTime);
//再save
AOM_save( job ) ;
//最后unlock
AOM_unlock( job ) ;
AOM_refresh( job,FALSE );
POM_AM__set_application_bypass(false);
cout << "执行完成" << endl;
return ifail;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,628 @@
#define _CRT_SECURE_NO_WARNINGS
#include "epm_handler_common.h"
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
#include <tc\preferences.h>
#include <tc\tc_macros.h>
#include <tc\tc_startup.h>
#include <epm\epm.h>
#include <sa\user.h>
#include <fclasses\tc_date.h>
#include <tccore\aom.h>
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <string>
#include <map>
#include <vector>
#include<iostream>
#include <windows.h>
#include <stdio.h>
#include <WinSock.h>
#pragma comment(lib, "ws2_32.lib")
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
struct Base64Date6
{
unsigned int d4 : 6;
unsigned int d3 : 6;
unsigned int d2 : 6;
unsigned int d1 : 6;
};
// 协议中加密部分使用的是base64方法
char ConvertToBase64(char c6);
void EncodeBase64(char *dbuf, char *buf128, int len);
void SendMail(char *email, char *body, char * server_address, int port, char * from_email, char * password);
int OpenSocket(struct sockaddr *addr);
//////////////////////////////////////////////////////////////////////////////////
//JL_current_touser_mail_address
int JL_Send_Mail(EPM_action_message_t msg)
{
printf("开始执行======JL_Send_Mail\n");
int ifail = ITK_ok;
tag_t root_task = NULLTAG;
tag_t * attachments = NULLTAG;
int count = 0;
char * ProcessOwner = NULL;
tag_t process_assignee_user = NULLTAG;
tag_t process_assignee_person = NULL_TAG;
tag_t default_group = NULL_TAG;
char * group = NULL;
date_t process_creation_date;
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
//邮件属性
char *EmailTo = NULL;
//char serverAddress[] = "";
char * server_address = NULL;
int port = 25;
char * from_email = "";
char * password = "";
char * port_string = NULL;
char * ChangeType = NULL;
char * ChangeTheOddNumber = NULL;
char EmailContents[5120] = "";
char EmailTo1[5120] = "";
//获取首选项
int valueNum = 0;
int toEmailNum = 0;
char ** to_email = NULL;
//PREF_ask_char_value("JL_current_user_server_address", valueNum, &server_address);
PREF_ask_char_value("JL_current_user_server_address_port", valueNum, &port_string);
PREF_ask_char_value("JL_current_user_mail_password", valueNum, &password);
PREF_ask_char_value("JL_current_user_mail_address", valueNum, &from_email);
PREF_ask_char_values("JL_current_touser_mail_address", &toEmailNum, &to_email);
PREF_ask_char_value("TC11_SqlServer_Link_ITK", valueNum, &server_address);
printf("JL_current_user_server_address%s=======================\n", server_address);
port = atoi(port_string);
//获取id和名称
char all_ID[5120] = "";
char all_ID_name[512] = "";
char partName[512] = "";
EPM_ask_root_task(msg.task, &root_task);
EPM_ask_attachments(root_task, EPM_target_attachment, &count, &attachments);
for (int i = 0; i < count; i++) {
char * item_id, *object_name, *itemType = NULL;
AOM_ask_value_string(attachments[i], "object_type", &itemType);
printf("type_class : %s \r\n", itemType);
//过滤掉非版本的对象
if((strstr(itemType,"Revision") == NULL) || (strstr(itemType,"Master") != NULL)
|| (strstr(itemType,"master") != NULL) || (strstr(itemType,"BOM") != NULL) || (strstr(itemType,"bom") != NULL) || (strstr(itemType,"Bom") != NULL))
{
continue;
}
if(strstr(itemType,"ChangeRevision") == NULL){
continue;
}
AOM_ask_value_string(attachments[i], "item_id", &item_id);
AOM_ask_value_string(attachments[i], "object_name", &object_name);
sprintf_s(all_ID, "%s ", item_id);
sprintf_s(all_ID_name, "%s,%s ", item_id, object_name);
int relation_num = 0;
tag_t * C8RelationModification = NULLTAG;
//获取变更零部件和相关零部件下的对象
AOM_ask_value_tags(attachments[i], "Gd6_BGLBJ", &relation_num, &C8RelationModification);
for (int j = 0; j < relation_num; j++)
{
AOM_ask_value_string(C8RelationModification[j], "item_id", &item_id);
AOM_ask_value_string(C8RelationModification[j], "object_name", &object_name);
sprintf_s(partName, "%s变更零部件零件ID%s-零件名称:%s\n ",partName, item_id, object_name, "");
}
AOM_ask_value_tags(attachments[i], "Gd6_XGFJ", &relation_num, &C8RelationModification);
for (int j = 0; j < relation_num; j++)
{
AOM_ask_value_string(C8RelationModification[j], "item_id", &item_id);
AOM_ask_value_string(C8RelationModification[j], "object_name", &object_name);
sprintf_s(partName, "%s相关零部件零件ID%s-零件名称:%s\n ",partName, item_id, object_name, "");
}
DOFREE(item_id);
DOFREE(object_name);
DOFREE(itemType);
DOFREE(C8RelationModification);
}
printf("all_ID%s=======================\n", all_ID);
printf("all_ID_name%s=======================\n", all_ID_name);
//获取参数(变更类型、变更单号)
TC_argument_list_t * arguments = msg.arguments;
int arg_cnt = TC_number_of_arguments(arguments);
printf("TC_number_of_arguments %d\n", arg_cnt);
char * arg = NULL, *temp_key = NULL, *temp_val = NULL;
for (int ii = 0; ii<arg_cnt; ii++)
{
arg = TC_next_argument(arguments);
ITK_ask_argument_named_value((const char*)arg, &temp_key, &temp_val);
printf("temp_key%s=======================\n", temp_key);
printf("temp_val%s=======================\n", temp_val);
if (tc_strcmp(temp_key, "change_type") == 0) {
ChangeType = temp_val;
}
else {
printf("temp_key1=======================\n");
}
if (tc_strcmp(temp_key, "change_the_odd_number") == 0) {
ChangeTheOddNumber = temp_val;
}
else
{
printf("temp_key2=======================\n");
}
}
printf("change_type%s=======================\n", ChangeType);
printf("ChangeTheOddNumber%s=======================\n", ChangeTheOddNumber);
//获取发起人数据
AOM_ask_value_tag(msg.task, "fnd0Assignee", &process_assignee_user);
AOM_ask_value_tag(process_assignee_user, "default_group", &default_group);
AOM_ask_value_tag(process_assignee_user, "person", &process_assignee_person);
AOM_UIF_ask_value(process_assignee_user, "user_name", &ProcessOwner);
//AOM_ask_value_string_at(process_assignee_person, "PA9", 0, &from_email);
AOM_UIF_ask_value(default_group, "name", &group);
AOM_ask_value_date(msg.task, "creation_date", &process_creation_date);
char * date_string = NULL;
DATE_date_to_string(process_creation_date, "%Y-%m-%d %H:%M", &date_string);
//strcpy_s(from_email1, from_email);
//strncpy_s(from_email1, from_email, strlen(from_email) - 2);
printf("发起变更工程师:%s=======================\n", ProcessOwner);
//printf("发起变更工程师邮件地址:%s=======================\n", from_email1);
printf("发起变更工程师时间:%s=======================\n", date_string);
//获取节点选中的人
int valid_signoffs_count = 0;
tag_t * valid_signoffs_tags = NULL;
// AOM_ask_value_tags(msg.task, "valid_signoffs", &valid_signoffs_count, &valid_signoffs_tags);
int num=0;
tag_t *sub_tags=NULL;
EPM_ask_sub_tasks(root_task,&num,&sub_tags);
for (int j = 0; j < num; j++)
{
char * taskname2=NULL,*type2=NULL,*name2=NULL;
ITKCALL(EPM_ask_name2(sub_tags[j],&taskname2));
ITKCALL(AOM_ask_value_string(sub_tags[j],"object_type",&type2));
ITKCALL(AOM_ask_value_string(sub_tags[j],"object_name",&name2));
printf("name2=%s,type2=%s,mingcheng=%s\n",taskname2,type2,name2);
//if (strcmp(type2,"EPMPerformSignoffTask")==0)
if(strcmp(name2,"审核")==0&&strcmp(type2,"EPMReviewTask")==0)
{
//name2=审核,type2=EPMReviewTask,mingcheng=审核
//printf("name2=%s,type2=%s,mingcheng=%s\n",taskname2,type2,name2);
int valid_num=0;
tag_t *valid_tags=NULL;
ITKCALL(AOM_ask_value_tags(sub_tags[j],"valid_signoffs",&valid_signoffs_count,&valid_signoffs_tags));
printf("valid_num=%d\n",valid_num);
DOFREE(valid_tags);
DOFREE(taskname2);
DOFREE(type2);
DOFREE(name2);
break;
}
}
DOFREE(sub_tags);
//char assign_users[512] = "";
cout <<"aaaaaaaaaaaaaa"+66666<<endl;
cout << valid_signoffs_count <<endl;
if (valid_signoffs_count != 0)
{
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
/*
Provider=SQLOLEDB.1 ------oledbbai
Persist Security Info ----du
User ID-------------------
PassWord------------------zhi
Initial Catalog-----------ipdao
Data Source---------------
*/
m_pConnection->ConnectionString = (server_address);
printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
for (int j = 0; j < valid_signoffs_count; j++)
{
printf("开始执行发送++++++++\n");
char * assign_user_name = NULL;
tag_t assign_user = NULL_TAG;
tag_t person = NULL_TAG;
tag_t Email = NULL_TAG;
//负责人
AOM_ask_value_tag(valid_signoffs_tags[j], "fnd0Assignee", &assign_user);
if (assign_user != NULL_TAG)
{
AOM_UIF_ask_value(assign_user, "user_name", &assign_user_name);
AOM_ask_value_tag(assign_user, "person", &person);
AOM_ask_value_string_at(person, "PA9", 0, &EmailTo);
strcpy_s(EmailTo1, EmailTo);
//strncpy(1,2,3); 把2中长度为3的字符串复制入1
strncpy_s(EmailTo1, EmailTo, strlen(EmailTo1) - 2);
//sprintf_s(EmailContents, "From: \"%s\"<%s>\r\n To: \"%s\"<%s>\r\n Subject: %s %s 通知(%s\r\n\r\n %s\n您好由%s(部门)%s(人员)发布的%s %s的%s于%s正式发布生效变更单号为%s。\n请于今日内登录Teamcenter系统查阅具体变更信息\n操作路径为打开我的工作列表->查看要执行的任务下的附件。",
//ProcessOwner, from_email, assign_user_name, EmailTo, all_ID, ChangeType, ChangeTheOddNumber, assign_user_name, group, ProcessOwner, all_ID, all_ID_name, ChangeType, date_string, partName);
sprintf_s(EmailContents,
/*"From: \"%s\"<%s>\r\n"
"To: \"%s\"<%s>\r\n"
"Subject: %s %s 通知(%s\r\n\r\n"*/
"%s\n您好!由%s(部门)%s(人员)发布的%s %s的%s%s变更单号为%s。"
"\n%s"
"\n请于今日内登录Teamcenter系统查阅具体变更信息"
"\n操作路径为:在搜索框输入变更单号->查看变更单对象下的附件。",
//ProcessOwner, from_email, assign_user_name, EmailTo, all_ID, ChangeType, ChangeTheOddNumber,
assign_user_name,
group, ProcessOwner, all_ID, all_ID_name, ChangeType, ChangeTheOddNumber, all_ID,partName
);
cout<< EmailContents<<endl;
cout<<password<<endl;
//将邮件信息写入中间表中
char * describe = (char*) calloc (1024, sizeof(char));
sprintf(describe, " insert into [GD_SENDMAIL_DATA]([TO_MAIL],[CONTENTS],[SUBJECT],[STATUS]) values('%s','%s','%s %s 通知(%s','%s') ", EmailTo,EmailContents, all_ID, ChangeType, ChangeTheOddNumber,"");
printf(describe);
try
{
m_pConnection->Execute(_bstr_t(describe), 0, adCmdText);
//return 1;//中间不能直接返回导致内存释放错误
}
catch(_com_error e)
{
printf(e.Description());
//return 0;
}
describe = NULL;
//SendMail(EmailTo, EmailContents, server_address, port, from_email, password);
}
printf("执行发送完成————+++++++\n");
}
}
}
//for (int i = 0; i < toEmailNum; i++)
//{
// char ** userEmail = new char *[64];
// int userEmailNum = 0;
// split(to_email[i],"-",userEmail,&userEmailNum);
// if(userEmailNum = 2)
// {
//sprintf_s(EmailContents, "From: \"%s\"<%s>\r\n"
// "To: \"%s\"<%s>\r\n"
// "Subject: %s %s 通知(%s\r\n\r\n"
// "%s\n您好由%s(部门)%s(人员)发布的%s %s的%s%s变更单号为%s。"
// "\n%s"
// "\n请于今日内登录Teamcenter系统查阅具体变更信息"
// "\n操作路径为打开我的工作列表->查看要执行的任务下的附件。",
// ProcessOwner, from_email, userEmail[0], EmailTo, all_ID, ChangeType, ChangeTheOddNumber, userEmail[0],
// group, ProcessOwner, all_ID, all_ID_name, ChangeType, ChangeTheOddNumber, all_ID,partName
//);
// printf("EmailTo%s\n EmailContents%s\n server_address%s\n port%d\n from_email%s\n password%s\n", EmailTo, EmailContents, server_address, port, from_email, password);
// SendMail(userEmail[1], EmailContents, server_address, port, from_email, password);
// printf("负责人:%s=======================\n", EmailContents);
// printf("负责人:%=======================\n", userEmail[0]);
// printf("负责人邮件地址:%s=======================\n", userEmail[1]);
// //拼接负责人
// sprintf_s(assign_users, "%s%s,", assign_users, userEmail[0], "");
// }
// for (int j = 0; j < userEmailNum; j++)
// {
// userEmail[j] = NULL;
// }
// userEmail = NULL;
//}
//qilong.lu@xmgdab.com
//cout <<"aaaaaaaaaaaaaa"+valid_signoffs_count <<endl;
//if (valid_signoffs_count != 0)
//{
// for (int j = 0; j < valid_signoffs_count; j++)
// {
// printf("开始执行发送++++++++");
// char * assign_user_name = NULL;
// tag_t assign_user = NULL_TAG;
// tag_t person = NULL_TAG;
// tag_t Email = NULL_TAG;
// //负责人
// AOM_ask_value_tag(valid_signoffs_tags[j], "fnd0Assignee", &assign_user);
// if (assign_user != NULL_TAG)
// {
// AOM_UIF_ask_value(assign_user, "user_name", &assign_user_name);
// AOM_ask_value_tag(assign_user, "person", &person);
// AOM_ask_value_string_at(person, "PA9", 0, &EmailTo);
// strcpy_s(EmailTo1, EmailTo);
// strncpy_s(EmailTo1, EmailTo, strlen(EmailTo1) - 2);
// sprintf_s(EmailContents, "From: \"%s\"<%s>\r\n To: \"%s\"<%s>\r\n Subject: %s %s 通知(%s\r\n\r\n %s\n您好由%s(部门)%s(人员)发布的%s %s的%s于%s正式发布生效变更单号为%s。\n请于今日内登录Teamcenter系统查阅具体变更信息\n操作路径为打开我的工作列表->查看要执行的任务下的附件。",
// ProcessOwner, from_email, assign_user_name, EmailTo, all_ID, ChangeType, ChangeTheOddNumber, assign_user_name, group, ProcessOwner, all_ID, all_ID_name, ChangeType, date_string, ChangeTheOddNumber);
//
// }
// printf("执行发送完成————+++++++");
// }
//}
DOFREE(attachments);
DOFREE(ProcessOwner);
DOFREE(group);
DOFREE(EmailTo);
DOFREE(server_address);
DOFREE(from_email);
DOFREE(password);
DOFREE(port_string);
DOFREE(ChangeType);
DOFREE(ChangeTheOddNumber);
//DOFREE(arguments);
arg = NULL;
DOFREE(temp_key);
temp_val = NULL;
DOFREE(date_string);
for (int i = 0; i < toEmailNum; i++)
{
to_email[i] = NULL;
}
to_email = NULL;
//DOFREE(valid_signoffs_tags);
//10.1.100.4
//printf("节点选中的所有人=======================================%s\n", assign_users);
printf("执行结束======JL_Send_Mail\n");
//SendMail(EmailTo, EmailContents, serverAddress, port, from_email, password);*/
return ifail;
}
/////////////////////////////////////////////////////////////////////////
char ConvertToBase64(char uc)
{
if (uc < 26)
{
return 'A' + uc;
}
if (uc < 52)
{
return 'a' + (uc - 26);
}
if (uc < 62)
{
return '0' + (uc - 52);
}
if (uc == 62)
{
return '+';
}
return '/';
}
// base64的实现
void EncodeBase64(char *dbuf, char *buf128, int len)
{
struct Base64Date6 *ddd = NULL;
int i = 0;
char buf[256] = { 0 };
char *tmp = NULL;
char cc = '\0';
memset(buf, 0, 256);
strcpy_s(buf, 256, buf128);
for (i = 1; i <= len / 3; i++)
{
tmp = buf + (i - 1) * 3;
cc = tmp[2];
tmp[2] = tmp[0];
tmp[0] = cc;
ddd = (struct Base64Date6 *)tmp;
dbuf[(i - 1) * 4 + 0] = ConvertToBase64((unsigned int)ddd->d1);
dbuf[(i - 1) * 4 + 1] = ConvertToBase64((unsigned int)ddd->d2);
dbuf[(i - 1) * 4 + 2] = ConvertToBase64((unsigned int)ddd->d3);
dbuf[(i - 1) * 4 + 3] = ConvertToBase64((unsigned int)ddd->d4);
}
if (len % 3 == 1)
{
tmp = buf + (i - 1) * 3;
cc = tmp[2];
tmp[2] = tmp[0];
tmp[0] = cc;
ddd = (struct Base64Date6 *)tmp;
dbuf[(i - 1) * 4 + 0] = ConvertToBase64((unsigned int)ddd->d1);
dbuf[(i - 1) * 4 + 1] = ConvertToBase64((unsigned int)ddd->d2);
dbuf[(i - 1) * 4 + 2] = '=';
dbuf[(i - 1) * 4 + 3] = '=';
}
if (len % 3 == 2)
{
tmp = buf + (i - 1) * 3;
cc = tmp[2];
tmp[2] = tmp[0];
tmp[0] = cc;
ddd = (struct Base64Date6 *)tmp;
dbuf[(i - 1) * 4 + 0] = ConvertToBase64((unsigned int)ddd->d1);
dbuf[(i - 1) * 4 + 1] = ConvertToBase64((unsigned int)ddd->d2);
dbuf[(i - 1) * 4 + 2] = ConvertToBase64((unsigned int)ddd->d3);
dbuf[(i - 1) * 4 + 3] = '=';
}
return;
}
// 发送邮件 email:目标邮箱 body:内容 server_address:smtp地址 port:端口 from_email:发送用户邮箱 password:密码、授权码
void SendMail(char *email, char *body, char * server_address, int port, char * from_email, char * password)
{
int sockfd = { 0 };
char buf[1500] = { 0 };
char rbuf[1500] = { 0 };
char login[128] = { 0 };
char pass[128] = { 0 };
WSADATA WSAData;
struct sockaddr_in their_addr = { 0 };
WSAStartup(MAKEWORD(2, 2), &WSAData);
memset(&their_addr, 0, sizeof(their_addr));
their_addr.sin_family = AF_INET;
their_addr.sin_port = htons(port);
hostent* hptr = gethostbyname(server_address);
memcpy(&their_addr.sin_addr.S_un.S_addr, hptr->h_addr_list[0], hptr->h_length);
printf("IP of %s is : %d:%d:%d:%d\n", server_address,
their_addr.sin_addr.S_un.S_un_b.s_b1,
their_addr.sin_addr.S_un.S_un_b.s_b2,
their_addr.sin_addr.S_un.S_un_b.s_b3,
their_addr.sin_addr.S_un.S_un_b.s_b4);
// 连接邮件服务器如果连接后没有响应则2 秒后重新连接
sockfd = OpenSocket((struct sockaddr *)&their_addr);
memset(rbuf, 0, 1500);
while (recv(sockfd, rbuf, 1500, 0) == 0)
{
cout << "reconnect..." << endl;
Sleep(2);
sockfd = OpenSocket((struct sockaddr *)&their_addr);
memset(rbuf, 0, 1500);
}
cout << rbuf << endl;
// EHLO
memset(buf, 0, 1500);
sprintf_s(buf, 1500, "EHLO HYL-PC\r\n");
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "EHLO REceive: " << rbuf << endl;
// AUTH LOGIN
memset(buf, 0, 1500);
sprintf_s(buf, 1500, "AUTH LOGIN\r\n");
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Auth Login Receive: " << rbuf << endl;
// USER
memset(buf, 0, 1500);
sprintf_s(buf, 1500, from_email);//你的邮箱账号
memset(login, 0, 128);
EncodeBase64(login, buf, strlen(buf));
sprintf_s(buf, 1500, "%s\r\n", login);
send(sockfd, buf, strlen(buf), 0);
cout << "Base64 UserName: " << buf << endl;
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "User Login Receive: " << rbuf << endl;
// PASSWORD
sprintf_s(buf, 1500, password);//你的邮箱密码
memset(pass, 0, 128);
EncodeBase64(pass, buf, strlen(buf));
sprintf_s(buf, 1500, "%s\r\n", pass);
send(sockfd, buf, strlen(buf), 0);
cout << "Base64 Password: " << buf << endl;
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Send Password Receive: " << rbuf << endl;
// MAIL FROM
memset(buf, 0, 1500);
sprintf_s(buf, 1500, "MAIL FROM: <%s>\r\n", from_email);
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "set Mail From Receive: " << rbuf << endl;
// RCPT TO 第一个收件人
sprintf_s(buf, 1500, "RCPT TO:<%s>\r\n", email);
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Tell Sendto Receive: " << rbuf << endl;
// DATA 准备开始发送邮件内容
sprintf_s(buf, 1500, "DATA\r\n");
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Send Mail Prepare Receive: " << rbuf << endl;
// 发送邮件内容,\r\n.\r\n内容结束标记
sprintf_s(buf, 1500, "%s\r\n.\r\n", body);
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Send Mail Receive: " << rbuf << endl;
// QUIT
sprintf_s(buf, 1500, "QUIT\r\n");
send(sockfd, buf, strlen(buf), 0);
memset(rbuf, 0, 1500);
recv(sockfd, rbuf, 1500, 0);
cout << "Quit Receive: " << rbuf << endl;
//清理工作
closesocket(sockfd);
WSACleanup();
return;
}
// 打开TCP Socket连接
int OpenSocket(struct sockaddr *addr)
{
int sockfd = 0;
sockfd = socket(PF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
{
cout << "Open sockfd(TCP) error!" << endl;
exit(-1);
}
if (connect(sockfd, addr, sizeof(struct sockaddr)) < 0)
{
cout << "Connect sockfd(TCP) error!" << endl;
exit(-1);
}
return sockfd;
}

@ -0,0 +1,229 @@
#define _CRT_SECURE_NO_WARNINGS
#include "epm_handler_common.h"
#include <tc\preferences.h>
#include <tc\tc_macros.h>
#include <fclasses/tc_date.h>
#include <epm\epm.h>
#include <epm/signoff.h>
#include <epm/epm_task_template_itk.h>
#include <ae/ae.h>
#include <tccore\item.h>
#include <tccore\aom.h>
#include <ict/ict_userservice.h>
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <string>
#include <sa/user.h>
#include <map>
#include <vector>
#include<iostream>
#include <tc\preferences.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
int Send_Order_Process(void *returnValue){
printf("==================订单评审流程 START =======================\n");
//获取传递过来的参数
tag_t process = NULLTAG, tmp_select_signoff_task = NULLTAG, template_tag = NULLTAG;
int cnt_task = 0, signoff_cnt = 0;
tag_t * tasks = NULLTAG, * signoffs = NULLTAG;
char * processUser = NULL, * arctic = NULL;
char tmp_sub_task_name[WSO_name_size_c+1] = {'\0'};
ITKCALL(USERARG_get_tag_argument(&process));
//ITKCALL(USERARG_get_tag_argument(&itemRevision));
//ITKCALL(USERARG_get_string_argument(&processTemplate));
ITKCALL(USERARG_get_string_argument(&processUser));
//车型
ITKCALL(USERARG_get_string_argument(&arctic));
////发起流程
////查找模板EPM_find_template模板名称模板类型返回流程模板
//ITKCALL( EPM_find_template( processTemplate, PROCESS_TEMPLATE, &template_tag) );
//printf("获取流程模板成功!================\n");
//获取首选项的值
//printf("==================获取首选项的值 =======================\n");
//PREF_ask_char_values(processUser, &valueNum, &values);//获得首选项
//EPM_ask_tasks参数流程任务状态返回任务数任务,已开始的任务
ITKCALL( EPM_ask_tasks(process,EPM_started, &cnt_task, &tasks ));
//EPM_assign_responsible_party将责任方分配给给定的任务。责任方可以是用户也可以是资源池,参数:任务,责任人
printf("流程任务数:%d+++++++++++++++++++++++++++\n",cnt_task);
for( int k = 0; k < cnt_task; k++ )
{
//流程节点的名称
ITKCALL( EPM_ask_name( tasks[k] , tmp_sub_task_name ));
printf("流程节点名称:%s+++++++++++++++++++++++++++\n",tmp_sub_task_name);
////流程节点的类型
/*ITKCALL( AOM_ask_value_string( tasks[k] , "object_type" , &sub_task_object_type ));
printf("流程节点类型%s=====================\n",sub_task_object_type);*/
//if(strcmp(tmp_sub_task_name,nodeUsers[0]) == 0)
//{
//根据任务名称获取任务
ITKCALL( EPM_ask_sub_task( tasks[k] , EPM_select_signoff_team_task , &tmp_select_signoff_task ));
/*if(strstr(nodeUsers[1],",") != NULL)
{
char ** userIds = new char *[64];
int userIdNum = 0;
split(nodeUsers[1], ",", userIds, &userIdNum);
for (int l = 0; l < userIdNum; l++)
{
tag_t user = NULLTAG;
ITKCALL( SA_find_user(userIds[l],&user));
ITKCALL( EPM_create_adhoc_signoff( tmp_select_signoff_task , user , &signoff_cnt , &signoffs ) );
}
userIds = NULL;
}
else
{
tag_t user = NULLTAG;
ITKCALL( SA_find_user(nodeUsers[1],&user));
ITKCALL( EPM_create_adhoc_signoff( tmp_select_signoff_task , user , &signoff_cnt , &signoffs ) );
}*/
tag_t user = NULLTAG;
if(strcmp(tmp_sub_task_name,"评审") == 0){
ITKCALL( SA_find_user(processUser,&user));
ITKCALL( EPM_create_adhoc_signoff( tmp_select_signoff_task , user , &signoff_cnt , &signoffs ) );
ITKCALL( EPM_set_adhoc_signoff_selection_done( tmp_select_signoff_task , true ) );
ITKCALL(EPM_trigger_action(tmp_select_signoff_task,EPM_complete_action, ""));
}
DOFREE( signoffs );
//}
}
//DOFREE( values );
DOFREE( processUser );
DOFREE( arctic );
DOFREE( tasks );
printf("==================订单评审流程 END =======================\n");
return ITK_ok;
}
int JL_Auto_Order_Process(EPM_action_message_t msg){
//订单评审流程结束之后按钮发起bom搭建才能够点击
int ifail = ITK_ok;
tag_t rootTask = NULLTAG,*attachments;
int attachments_num = 0;
char *object_type = NULL;
EPM_ask_root_task(msg.task, &rootTask);
//获取任务目标对象
EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments);
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
char* server_address;
int valueNum=0;
PREF_ask_char_value("TC11_SqlServer_Link_ITK", valueNum, &server_address);
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
m_pConnection->ConnectionString = (server_address);
//m_pConnection->ConnectionString = ("Provider = SQLOLEDB.1; Persist Security Info = False; User ID =infodba; Password=infodba; Initial Catalog = TCTEST2; Data Source = 10.110.81.13");
//m_pConnection->ConnectionString = ("Provider = SQLOLEDB.1; Persist Security Info = False; User ID =lw; Password=lw590; Initial Catalog = HZPC; Data Source = 192.168.200.6");
//printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
else
{
for (int i = 0; i < attachments_num; i++)
{
char *uid_value;
AOM_ask_value_string(attachments[i], "object_type", &object_type);
printf("类型为:%s\n",object_type);
if(strstr(object_type,"OrderRevision") == NULL || strstr(object_type,"Master") != NULL){
continue;
}
ITK__convert_tag_to_uid(attachments[i],&uid_value);
printf("UID为%s\n",uid_value);
char* updateSql = (char*)calloc(1024, sizeof(char));
sprintf(updateSql,"update GD_CONTROLSTYPE_TABLE set ENABLED = 'true' where ORDER_TAGU = '%s'and CONTROL_NAME = 'btnbom_4'; update GD_CONTROLSTYPE_TABLE set BACKGROUND = 'GREEN' where ORDER_TAGU = '%s'and CONTROL_NAME = 'label_36'; ",uid_value,uid_value);
printf("写入语句为:%s\n",updateSql);
m_pConnection->Execute(_bstr_t(updateSql), 0, adCmdText);
updateSql = NULL;
DOFREE(uid_value);
//if(strstr(release_value,"Gd6_D") !=NULL && strstr(revision,"D00") == NULL){
// //向焊装排产系统数据库表写入发布的零件号、件名、版本、发布日期、发布时间等信息
// //修改数据库
// printf("开始写入\n");
// //开始写入
// AOM_ask_value_string(attachments[i],"object_name",&item_name);
// AOM_ask_value_string(attachments[i],"item_id",&item_id);
// date_t date = NULLDATE;
// char *date_string = NULL;
// AOM_ask_value_date(attachments[i],"date_released",&date);
// DATE_date_to_string(date,"%Y-%m-%d %H:%M",&date_string);
// printf("创建时间为:%s\n",date_string);
// //printf("%s\n",date.year);
// //printf("%s\n",date.month);
// //printf("%s\n",date.day);
// //printf("%s\n",date.hour);
// //printf("%s\n",date.minute);
// //printf("%s\n",date.second);
// char* insertSql = (char*)calloc(1024, sizeof(char));
// //sprintf(insertSql,"insert into AAA(PARTNO,PARTNAME,VerNO,REL_date) values('%s','%s','%s','%s')",item_id,item_name,revision,date_string);
// sprintf(insertSql,"insert into PLM_GetPartVerNO(PARTNO,PARTNAME,VerNO,REL_date) values('%s','%s','%s','%s')",item_id,item_name,revision,date_string);
// printf("写入语句为:%s\n",insertSql);
// m_pConnection->Execute(_bstr_t(insertSql), 0, adCmdText);
// insertSql = NULL;
// DOFREE(release_name);
// DOFREE(date_string);
//}
}
}
}
else
{
printf("Create instance of connection failed!");
return 1;
}
DOFREE(server_address);
DOFREE(object_type);
return ifail;
}

@ -0,0 +1,268 @@
#include "epm_handler_common.h"
#include <tc\preferences.h>
#include <tc\tc_macros.h>
#include <fclasses/tc_date.h>
#include <epm\epm.h>
#include <epm/signoff.h>
#include <epm/epm_task_template_itk.h>
#include "ae/dataset.h"
#include <tccore\aom.h>
#include <ict/ict_userservice.h>
#include <tc\emh.h>
#include <ae/ae.h>
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <tccore\imantype.h>
#include <tccore\iman_grmtype.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <string>
#include <sa/user.h>
#include "libxl.h"
#include <ctime>
#include <locale>
#include <codecvt>
#include "sstream"
#include <map>
#include <vector>
#include<iostream>
extern "C" int POM_AM__set_application_bypass(logical bypass);
using namespace libxl;
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
TCHAR* charToTchar(char * szWord){
//TCHAR tszWord[1024] = {0};
//#ifdef UNICODE
//MultiByteToWideChar(CP_ACP, 0, szWord, -1, tszWord, 1024);
//#else
//strcpy(tszWord, szWord);
//#endif
//return tszWord;
//char *CStr = "string to convert";
size_t len = strlen(szWord) + 1;
size_t converted = 0;
wchar_t *WStr;
WStr=(wchar_t*)malloc(len*sizeof(wchar_t));
mbstowcs_s(&converted, WStr, len, szWord, _TRUNCATE);
return WStr;
}
string ws2s(const std::wstring& wstr)
{
if (wstr.empty() || wstr.length() == 0) return std::string();
int size_needed = WideCharToMultiByte(CP_ACP, 0, &wstr[0], (int)wstr.size(), NULL, 0, NULL, NULL);
std::string strTo(size_needed, 0);
WideCharToMultiByte(CP_ACP, 0, &wstr[0], (int)wstr.size(), &strTo[0], size_needed, NULL, NULL);
return strTo;
}
int JL_Target_Moveto_Annex(EPM_action_message_t msg){
int ifail = ITK_ok,count = 0,valueNum = 0;
tag_t root_task=NULLTAG,model_path = NULLTAG,ref_obj=NULLTAG;
tag_t *attachments=NULLTAG;
Book* book = nullptr;
time_t t = time(0);
tm* local = localtime(&t);
wstringstream excel_path;
char ** values = NULL;
//获取流程任务
ITKCALL(EPM_ask_root_task(msg.task,&root_task));
char * rootname=NULL,excelName[26]= "";
EPM_ask_name2(root_task,&rootname); //原流程的流程名称
cout<<rootname<<endl;
if(strstr(rootname,"产品要求审核流程")!=NULL||strstr(rootname,"零部件发布流程")!=NULL){
//excelName = "零件汇总清单";
strcat(excelName,"零件汇总清单.xlsx");
cout<<excelName<<endl;
}
else{
//excelName = "零件明细清单";
strcat(excelName,"零件明细清单.xlsx");
cout<<excelName<<endl;
}
//获取流程任务目标文件夹中的版本
ITKCALL(EPM_ask_attachments(root_task,EPM_target_attachment,&count,&attachments));
//xls文件用xlCreateBook() 函数打开xlsx文件是xml结构所以得用xlCreateXMLBook() 函数来打开。
book = xlCreateXMLBook();
//如果购买了该库则设置相应的key若没有购买则不用这行
book->setKey(L"Halil Kural", L"windows-2723210a07c4e90162b26966a8jcdboe");
//找模板数据集的物理路径
//AE_find_dataset2("model.xlsx",&model_path);
//获取首选项
PREF_ask_char_values("JL_Target_Moveto_Annex", &valueNum, &values);//获得首选项
ITK__convert_uid_to_tag(values[0],&model_path);
AE_reference_type_t ae_ref;
ITKCALL(AE_ask_dataset_named_ref2(model_path, "excel", &ae_ref, &ref_obj));
excel_path << getenv("temp");
excel_path << "\\excel";//路径
excel_path << local->tm_year;
excel_path << local->tm_yday;
excel_path << local->tm_hour;
excel_path << local->tm_min;
excel_path << local->tm_sec;
excel_path << ".xlsx";
cout<< ws2s(excel_path.str()).c_str()<<endl;
IMF_export_file(ref_obj, ws2s(excel_path.str()).c_str());//导出文件
//cout<< model_path <<endl;
//ITKCALL(IMF_ask_file_pathname(model_path, SS_WNT_MACHINE, pathname));
//cout<<pathname<<endl;
if(book){
//if(book->load(L"F:/Siemens/Teamcenter11/portal/model.xlsx")){
if(book->load(excel_path.str().c_str())){
for(int i=0;i<count;i++){
char *itemType=NULL,*itemID=NULL,*name=NULL,*type;
AOM_ask_value_string(attachments[i],"object_type",&itemType);
//过滤掉非版本的对象
if((strstr(itemType,"Gd6_PartsRevision") == NULL) || (strstr(itemType,"Master") != NULL)
|| (strstr(itemType,"master") != NULL) || (strstr(itemType,"BOM") != NULL) || (strstr(itemType,"bom") != NULL) || (strstr(itemType,"Bom") != NULL))
{
continue;
}
AOM_ask_value_string(attachments[i],"item_id",&itemID);
AOM_ask_value_string(attachments[i],"object_name",&name);
AOM_ask_value_string(attachments[i],"gd6_wlfl",&type);
cout<<itemType<<endl;
cout<<itemID<<endl;
cout<<name<<endl;
cout<<type<<endl;
wstring result;
string s="4s";
Sheet *sheet = book->getSheet(0);
sheet->writeStr(i+1, 0, charToTchar(itemID));
sheet->writeStr(i+1, 1, charToTchar(name));
sheet->writeStr(i+1, 2, charToTchar(type));
sheet->writeStr(i+1, 3, L"新增");
//sheet->writeStr(i+1, 3, itemID);
//cout<<ws2s(sheet->readStr(i, 0))<<endl;
//cout<<ws2s(sheet->readStr(i, 1))<<endl;
//cout<<ws2s(sheet->readStr(i, 2))<<endl;
//cout<<ws2s(sheet->readStr(i, 3))<<endl;
DOFREE(itemType);
DOFREE(itemID);
DOFREE(name);
DOFREE(type);
}
}
}
char *temp = getenv("temp");
char out_path[SS_MAXPATHLEN] = "";
strcpy(out_path, temp);
strcat(out_path, "\\");
strcat(out_path, "维护数据表.xlsx");
cout<<out_path<<endl;
book->save(charToTchar(out_path));
book->release();//释放对象!!!!!
POM_AM__set_application_bypass(true);
//新建excel数据集
const char name[AE_datasettype_name_size_c + 1] = "MSExcelX";
//cout << name << endl;
tag_t datasetType = NULLTAG, tool = NULLTAG;
tag_t newDatasetTag = NULLTAG; //新数据集的tag
tag_t relation = NULLTAG;
//cout<<"111"<<endl;
AE_find_datasettype(name, &datasetType);
//cout<<"222"<<endl;
AE_ask_datasettype_def_tool(datasetType, &tool);
//cout<<"333"<<endl;
AE_create_dataset(datasetType, excelName, "", &newDatasetTag);
//cout<<"444"<<endl;
AOM_lock(newDatasetTag);
AE_set_dataset_tool(newDatasetTag, tool);
//cout<<newDatasetTag<<endl;
//cout<<"555"<<endl;
AE_set_dataset_format2(newDatasetTag, name);
AOM_save(newDatasetTag);
AOM_unlock(newDatasetTag);
AOM_refresh(newDatasetTag,TRUE);
tag_t new_file_tag = NULLTAG;
IMF_file_t file_descriptor;
//cout<<"666"<<endl;
char new_ds_name[WSO_name_size_c + 1] = "";
char *new_file_name = USER_new_file_name(new_ds_name, "excel", "excel", 0);
IMF_import_file(out_path, new_ds_name,SS_BINARY, &new_file_tag, &file_descriptor);
cout<<new_file_tag<<endl;
AOM_lock(new_file_tag);
//cout<<"777"<<endl;
IMF_set_original_file_name(new_file_tag, excelName);
//cout<<"111111"<<endl;
IMF_close_file(file_descriptor);
//cout<<out_path<<endl;
//cout<<new_file_tag<<endl;
AOM_save(new_file_tag);
AOM_unlock(new_file_tag);
AOM_refresh(new_file_tag,TRUE);
AOM_lock(newDatasetTag);
//AE_remove_dataset_named_ref_by_tag(spec_dataset_rev, ref_name, ref_object);
//cout<<"888"<<endl;
AE_add_dataset_named_ref(newDatasetTag, "excel", AE_PART_OF, new_file_tag);
AOM_save(newDatasetTag);
AOM_unlock(newDatasetTag);
AOM_refresh(newDatasetTag,TRUE);
int attachment_types = EPM_reference_attachment;
//AOM_unlock(rootTask_tag);
AOM_refresh(root_task, TRUE);
//cout<<"999"<<endl;
EPM_add_attachments(root_task, 1, &(newDatasetTag), &attachment_types);
AOM_save(root_task);
POM_AM__set_application_bypass(false);
DOFREE(attachments);
DOFREE(rootname);
//DOFREE(excelName);
//DOFREE(temp);
//DOFREE(new_file_name);
return ifail;
}

@ -0,0 +1,121 @@
#include "epm_handler_common.h"
#include <tccore\aom_prop.h>
#include <tccore\aom.h>
#include <epm\epm.h>
#include <objbase.h>
#include <tccore\grm.h>
#include <tccore\iman_grmtype.h>
#include <fclasses/tc_date.h>
#include <tc\preferences.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
int JL_Welding_Syetem(EPM_action_message_t msg){
int ifail = ITK_ok;
//当零部件发布时若为D状态且版本非D00版本则向焊装排产系统数据库表写入发布的零件号、件名、版本、发布日期、发布时间等信息
tag_t rootTask = NULLTAG,*attachments,relation_type = NULLTAG;
int attachments_num = 0;
char *object_type = NULL,*revision = NULL,*status = NULL,*item_id = NULL,*item_name = NULL;
EPM_ask_root_task(msg.task, &rootTask);
//获取任务目标对象
EPM_ask_attachments(rootTask, EPM_target_attachment, &attachments_num, &attachments);
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
//m_pConnection->ConnectionString = ("Provider = SQLOLEDB.1; Persist Security Info = False; User ID =infodba; Password=infodba; Initial Catalog = TCTEST2; Data Source = 10.110.81.13");
m_pConnection->ConnectionString = ("Provider = SQLOLEDB.1; Persist Security Info = False; User ID =lw; Password=lw590; Initial Catalog = HZPC; Data Source = 192.168.200.6");
//printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
else
{
for (int i = 0; i < attachments_num; i++)
{
int release_counts = 0;
tag_t *release_tag = NULLTAG;
char release_value[SS_MAXPATHLEN] = "";
char *release_name = NULL;
AOM_ask_value_string(attachments[i], "object_type", &object_type);
printf("类型为:%s\n",object_type);
if(strstr(object_type,"PartsRevision") == NULL || strstr(object_type,"Master") != NULL){
continue;
}
//得到所有的发布状态
ITKCALL(AOM_ask_value_tags(attachments[i],"release_status_list",&release_counts, &release_tag));
printf("发布的数量:%d\n",release_counts);
for (int j = 0; j < release_counts; j++)
{
AOM_ask_value_string(release_tag[j], "object_name", &release_name); //原来excel数据集的object_name
printf("%s\n",release_name);
strcat(release_value,release_name);
}
//AOM_ask_value_string(attachments[i],"release_status_list",&status);
AOM_ask_value_string(attachments[i],"item_revision_id",&revision);
//若为D状态且版本非D00版本
printf("%s——%s\n",release_value,revision);
if(strstr(release_value,"Gd6_D") !=NULL && strstr(revision,"D00") == NULL){
//向焊装排产系统数据库表写入发布的零件号、件名、版本、发布日期、发布时间等信息
//修改数据库
printf("开始写入\n");
//开始写入
AOM_ask_value_string(attachments[i],"object_name",&item_name);
AOM_ask_value_string(attachments[i],"item_id",&item_id);
date_t date = NULLDATE;
char *date_string = NULL;
AOM_ask_value_date(attachments[i],"date_released",&date);
DATE_date_to_string(date,"%Y-%m-%d %H:%M",&date_string);
printf("创建时间为:%s\n",date_string);
//printf("%s\n",date.year);
//printf("%s\n",date.month);
//printf("%s\n",date.day);
//printf("%s\n",date.hour);
//printf("%s\n",date.minute);
//printf("%s\n",date.second);
char* insertSql = (char*)calloc(1024, sizeof(char));
//sprintf(insertSql,"insert into AAA(PARTNO,PARTNAME,VerNO,REL_date) values('%s','%s','%s','%s')",item_id,item_name,revision,date_string);
sprintf(insertSql,"insert into PLM_GetPartVerNO(PARTNO,PARTNAME,VerNO,REL_date) values('%s','%s','%s','%s')",item_id,item_name,revision,date_string);
printf("写入语句为:%s\n",insertSql);
m_pConnection->Execute(_bstr_t(insertSql), 0, adCmdText);
insertSql = NULL;
DOFREE(release_name);
DOFREE(date_string);
}
}
}
}
else
{
printf("Create instance of connection failed!");
return 1;
}
DOFREE(object_type);
DOFREE(revision);
DOFREE(status);
DOFREE(item_id);
DOFREE(item_name);
return ifail;
}

@ -0,0 +1,155 @@
#include "epm_handler_common.h"
#include <tccore\aom_prop.h>
#include <tccore\aom.h>
#include <epm\epm.h>
#include <objbase.h>
#include <tc\preferences.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
//分割字符串函数
void split_img2(char* src, const char* separator, char** dest, int* num) {
/*
src (buf)
separator
dest
num
*/
char* pNext;
int count = 0;
if (src == NULL || strlen(src) == 0) //如果传入的地址为空或长度为0直接终止
return;
if (separator == NULL || strlen(separator) == 0) //如未指定分割的字符串,直接终止
return;
pNext = (char*)strtok(src, separator); //必须使用(char *)进行强制类型转换(虽然不写有的编译器中不会出现指针错误)
while (pNext != NULL) {
*dest++ = pNext;
++count;
pNext = (char*)strtok(NULL, separator); //必须使用(char *)进行强制类型转换
}
*num = count;
}
int JL_form_save(METHOD_message_t *msg, va_list args){
//表单属性修改保存后同步修改超级BOM的状态
printf("开始判断是否要修改超级BOM\n");
tag_t formTag = NULLTAG;
tag_t revTag = NULLTAG;
char *item_id;
//获取属性对象
tag_t prop_tag = va_arg(args, tag_t);
//获取值
char * values = va_arg(args, char*);
printf_s("修改的值:%s\n",values);
ITKCALL(PROP_ask_owning_object(prop_tag, &formTag));
printf_s("foem:%d\n",formTag);
ITKCALL(AOM_ask_value_tag(formTag,"item_revision",&revTag));
printf_s("rev:%d\n",revTag);
ITKCALL(AOM_ask_value_string(revTag,"item_id",&item_id));
printf_s("id:%s\n",item_id);
//修改数据库
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
char* server_address;
int valueNum=0;
PREF_ask_char_value("TC11_SqlServer_Link_ITK", valueNum, &server_address);
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
/*
Provider=SQLOLEDB.1 ------oledbbai
Persist Security Info ----du
User ID-------------------
PassWord------------------zhi
Initial Catalog-----------ipdao
Data Source---------------
*/
m_pConnection->ConnectionString = (server_address);
//printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
else
{
//char* updateLable = (char*)calloc(1024, sizeof(char));
//sprintf(updateLable, "update GD_ORDERBOM_LABLE set Lable = '更新中' where ItemID = '%s'", "50HS502");
//m_pConnection->Execute(_bstr_t(updateLable), 0, adCmdText);
//updateLable = NULL;
//printf("更新成功");
char * sjzl = "";
char * mz = "";
char * wlfl = "";
char * dw = "";
char * jcjwlh = "";
char * sfqdj = "";
char * gyzy = "";
AOM_ask_value_string(formTag, "gd6_sjzl", &sjzl);
AOM_ask_value_string(formTag, "gd6_mz", &mz);
AOM_ask_value_string(formTag, "gd6_wlfl", &wlfl);
AOM_ask_value_string(formTag, "gd6_dw", &dw);
AOM_ask_value_string(formTag, "gd6_jcjwlh", &jcjwlh);
AOM_ask_value_string(formTag, "gd6_sfqdj", &sfqdj);
AOM_ask_value_string(formTag, "gd6_gyzy", &gyzy);
char* updateSql = (char*)calloc(1024, sizeof(char));
sprintf(updateSql, "UPDATE GD_ORDERBOM_DATA SET sjzl = '%s',mz = '%s',wlfl='%s',dw='%s',jcjwlh='%s',sfqdj='%s',gyzy='%s' where id = '%s'",sjzl,mz,wlfl,dw,jcjwlh,sfqdj,gyzy,item_id);
printf("%s",updateSql);
m_pConnection->Execute(_bstr_t(updateSql), 0, adCmdText);
DOFREE(sjzl);
DOFREE(mz);
DOFREE(wlfl);
DOFREE(dw);
DOFREE(jcjwlh);
DOFREE(sfqdj);
DOFREE(gyzy);
//sjzl = NULL;
//mz = NULL;
//wlfl = NULL;
//dw = NULL;
//jcjwlh = NULL;
//sfqdj = NULL;
//gyzy = NULL;
updateSql = NULL;
}
}
else
{
printf("Create instance of connection failed!");
return 1;
}
DOFREE(server_address);
DOFREE(item_id);
//int self_num = 0;
//char* revbuf_test[8] = { }; //存放分割后的子字符串
//split_img2(object_name,"/", revbuf_test, &self_num);
//char self_new_name[WSO_name_size_c + 1] = "";
//strcat(self_new_name,revbuf_test[0]);
//printf("id号为%s",self_new_name);
printf("=========================修改超级BOM END ===================\n");
return 0;
}

@ -0,0 +1,288 @@
/**
* @file common_itk_util.cpp
* @brief itk warpper utility function
* @author James
* @history
* ===================================================================================
* Date Name Description of Change
* 18-July-2008 James
*/
#pragma warning (disable: 4996)
#pragma warning (disable: 4819)
#include <epm/epm.h>
#include <epm/epm_toolkit_tc_utils.h>
#include <ict/ict_userservice.h>
#include <tccore/item.h>
#include <ae/ae.h>
#include <tc/folder.h>
#include <tccore/aom.h>
#include <sa/sa.h>
#include <tccore/aom_prop.h>
#include <property/prop_errors.h>
#include <tccore/workspaceobject.h>
#include <tc/preferences.h>
#include <tccore/imantype.h>
#include <tccore//grm.h>
#include <tccore/grmtype.h>
#include <sa/am.h>
#include <cfm/cfm.h>
#include <bom/bom.h>
#include <tccore/uom.h>
#include <ps/ps.h>
#include <epm/signoff.h>
#include <fclasses/tc_date.h>
//#include <tccore/imantype.h>
//#include <textsrv/textserver.h>
//#include <user_exits/epm_toolkit_utils.h>
//#include <ss/ss_errors.h>
#include <stdlib.h>
//#include <io.h>
#include <stdio.h>
#include <time.h>
//#include <direct.h>
//#include <unistd.h>
#include "common_itk_util.h"
#ifdef WIN32
#include <io.h>
#include <direct.h>
#else
#include <unistd.h>
#endif
#define ARGS_LENGTH 200
#define ARGS_NAME_DEBUG "-debug"
#define DEBUG "-debug="
#define MAX_PRINTLINE_LENGTH 2000
#define MAX_PATH_LENGTH 2000
#define MAX_ARGUMENT_LENGTH 400
#define MAX_PARAMNAME_LENGTH 50
#define MAX_FILE_EXT_LENGTH 10
#define TRUE_FLAG 1
#define FALSE_FLAG 0
#define DETAILLOG 1
void ECHO(char *format, ...)
{
//if( !YFJC_OPT_DEBUG )
// return;
char msg[4000];
va_list args;
va_start( args, format );
vsprintf( msg, format, args );
va_end( args );
printf( msg );
TC_write_syslog( msg );
}
FILE* logFile = NULL;
void set_bypass(logical bypass)
{
AM__set_application_bypass(bypass);
}
/*=============================================================================*
* FUNCTION: current_time
* PURPOSE : get the current datetime
* INPUT:
* date_t* date_tag // current date time tag
*
* RETURN:
* void
*============================================================================*/
void current_time( date_t * date_tag )
{
time_t ltime;
struct tm *today ;
// Set time zone from TZ environment variable. If TZ is not set,
// the operating system is queried to obtain the default value
// for the variable.
//
//_tzset();
// Get UNIX-style time and display as number and string.
time( &ltime );
today = localtime( &ltime );
date_tag->year = today->tm_year + 1900 ;
date_tag->month = today->tm_mon ;
date_tag->day = today->tm_mday ;
date_tag->hour = today->tm_hour ;
date_tag->minute = today->tm_min ;
date_tag->second = today->tm_sec ;
}
/*=============================================================================*
* FUNCTION: CreateLogFile
* PURPOSE : create log file
* INPUT:
* char* FunctionName // the funtion which need to create log file
* FILE** logFile // out: the log file pointer
*
* RETURN:
* void
*============================================================================*/
void CreateLogFile(char* FunctionName, char **fullname)
{
int i=0, ifail = ITK_ok;
//date_t status_now;
//char* date_string = NULL;
char date_string[MAX_PATH_LENGTH];
char logFileDir[MAX_PATH_LENGTH];
char logFileName[MAX_PATH_LENGTH];
char* session_uid = NULL;
tag_t session_tag = NULLTAG;
time_t now;
struct tm *p;
time(&now);
logFile = NULL;
//current_time(&status_now);
p=localtime(&now);
memset(date_string, 0, sizeof(date_string));
sprintf(date_string,"%4d%02d%02d%02d%02d%02d",1900+p->tm_year,p->tm_mon+1 ,p->tm_mday ,p->tm_hour,p->tm_min ,p->tm_sec );
//if( DATE_date_to_string( status_now, "%Y%m%d%H%M%S", &date_string) != ITK_ok )
//ifail = ITK_date_to_string (status_now, &date_string );
//if (ifail)
//{
// printf("!*ERROR*!: Failed to get current date time\n");
// goto CLEANUP;
//}
memset(logFileDir, 0, sizeof(logFileDir));
memset(logFileName, 0, sizeof(logFileName));
//get log dir
sprintf(logFileDir, "%s", getenv("TEMP"));
printf("\n log file dir: %s\n", logFileDir);
//try to change dir to TC_USER_LOG_DIR
if(chdir(logFileDir)!=ITK_ok)
{
//not set TC_USER_LOG_DIR
//log in to default TC_LOG
memset(logFileDir, 0, sizeof(logFileDir));
sprintf(logFileDir, "%s", getenv("TC_LOG"));
printf("\n TC_USER_LOG_DIR invalide, log file dir: %s\n", logFileDir);
if(chdir(logFileDir)!=ITK_ok)
{
//still can not change to log dir
printf("!*ERROR*!: Failed to change dir to TC_USER_LOG_DIR\n");
goto CLEANUP;
}
}
//get session_uid to make sure the log file name unique
POM_ask_session(&session_tag);
ITK__convert_tag_to_uid(session_tag, &session_uid);
//get logFileName
sprintf(logFileName, "%s_%s_%s.log", FunctionName, session_uid, date_string);
printf("log file name: %s\n", logFileName);
*fullname = (char *)MEM_alloc(sizeof(char)*512);
sprintf(*fullname,"%s\\%s",logFileDir,logFileName);
//for(i = 0; _access((char *)logFileName, 4) == 0; i++)
/*{
memset(logFileName, 0, sizeof(logFileName));
sprintf(logFileName, "%s_%s_%s_%d.log", FunctionName, session_uid, date_string, i);
}
printf("final log file name: %s\n", logFileName);*/
//create log file
logFile = fopen(logFileName, "w");
CLEANUP:
//DOFREE(date_string);
DOFREE(session_uid);
}
/*=============================================================================*
* FUNCTION: WriteLog
* PURPOSE : write log, if debug log File not null, write log message to log File
* INPUT:
* const char* format // debug message string
*
* RETURN:
* void
*============================================================================*/
void WriteLog(const char* format, ...)
{
va_list arg;
char tmp[MAX_PRINTLINE_LENGTH];
if(logFile)
{
//get the message
memset(tmp, 0, sizeof(tmp));
va_start(arg, format);
vsprintf(tmp, format, arg);
va_end(arg);
//----------print to command window for trace--------//
printf("%s\n", tmp);
//print message to log file
fprintf(logFile, "%s\n", tmp);
fflush(logFile);
}
else
{
printf("*!Error!*: Log File Not Exist\n");
}
}
void CloseLog(void)
{
if(logFile)
{
fclose(logFile);
logFile = NULL;
}
}
//void getTypeinfo(char *type)
//{
// int ulen = 0,i=0,tempcount=0,asd=0;
//
// char temp[128]="";
// ulen = strlen(type);
// asd = ulen-1;
// for(i=0;i < ulen;i++)
// {
// if(type[i] == ';')
// {
// temp[tempcount] = '\0';
// strcpy(excludetypes[typecount].type,temp);
// strcpy(temp,"");
// tempcount = 0;
// typecount = typecount + 1;
// }
// else
// {
//
// temp[tempcount] = type[i];
// tempcount = tempcount + 1;
// if(i==asd)
// {
// temp[tempcount] = '\0';
// strcpy(excludetypes[typecount].type,temp);
// typecount = typecount + 1;
// }
//
// }
//
// }
//}

@ -0,0 +1,39 @@
/**
* @file common_itk_util.h
* @brief itk warpper utility function
* @author James
* @history
* ===================================================================================
* Date Name Description of Change
* 09-July-2008 James
*/
#ifndef COMMON_ITK_UTIL
#define COMMON_ITK_UTIL
#ifdef __cplusplus
extern "C" {
#endif
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
void ECHO(char *format, ...);
void CreateLogFile(char* FunctionName, char **fullname);
void WriteLog(const char* format, ...);
void CloseLog(void);
//int FindDatasetReferenceExt( tag_t datasettype, const char *datasettype_ref, char ext[10] );
//int CompareDate( date_t date1, date_t date2 );
//int GetRandomTempFile( char tempFile[256] );
//logical IsItemRevisionType( char object_type[WSO_name_size_c + 1] );
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,44 @@
#pragma warning (disable: 4819)
#include <tc/tc.h>
#include <tccore/custom.h>
#include "epm_register_handler.h"
#include "epm_handler_common.h"
#ifdef __cplusplus
extern "C" {
#endif
DLLAPI int jl_register_callbacks()
{
printf("=======================================\n");
int ifail = ITK_ok;
ifail = CUSTOM_register_exit(
"jl",
"USERSERVICE_register_methods",
(CUSTOM_EXIT_ftn_t)USERSERVICE_custom_register_methods);
ifail = CUSTOM_register_exit(
"jl",
"USER_gs_shell_init_module",
(CUSTOM_EXIT_ftn_t)CUST_init_module);
return ifail;
}
#ifdef __cplusplus
}
#endif
/**
* @}
*/

@ -0,0 +1,60 @@
#ifndef EPM_HANDLER_COMMON
#define EPM_HANDLER_COMMON
#include <epm/epm.h>
#include <string>
#include <vector>
#include <map>
#ifdef __cplusplus
extern "C" {
#endif
void split(char *src, const char *separator, char **dest, int *num);
int JLCS_05_BOMSendOutSap(EPM_action_message_t msg);
int JLCS_05_BOMSendOutSap_Single(EPM_action_message_t msg);
int JLCS_05_BOMUpdateSap_MasterData(EPM_action_message_t msg);
int JLCS_05_BOMSendOutSap_MasterData(EPM_action_message_t msg);
int JLCS_05_BOMDeleteSap_MasterData(EPM_action_message_t msg);
int JL_Send_Mail(EPM_action_message_t msg);
int Connor_set_bypass(void *returnValue);
int ORIGIN_close_bypass(void *returnValue);
int Create_Remodel_Process(void *returnValue);
int Send_Order_Process(void *returnValue);
int DMU_Review_Process(void *returnValue);
int JL_Change_Inspection_Of_Basic_Part(EPM_rule_message_t msg);
int jl_insert_img_pdf(EPM_action_message_t msg);
int jl_insert_modular(EPM_action_message_t msg);
int jl_dmu_auto(EPM_action_message_t msg);
int jl_locomotion_item(EPM_action_message_t msg);
int JL_sign_tongzhi(EPM_action_message_t msg);
int JL_sign_master(EPM_action_message_t msg);
int ORIGIN_ask_sign_info(tag_t task_node, char *output_str,char *task_name,char *arg3value);
int JL_Judge_Revision (EPM_action_message_t msg);
int JL_add_to_referenece(EPM_action_message_t msg);
int JL_create_process(EPM_action_message_t msg);
int test (EPM_action_message_t msg);
int Super_Bom_Appent_Data (void *returnValue);
int JL_Target_Moveto_Annex(EPM_action_message_t msg);
int JL_Add_FinishTime(EPM_action_message_t msg);
int JL_form_save(METHOD_message_t *msg, va_list args);
int JL_Welding_Syetem(EPM_action_message_t msg);
int JL_Auto_Order_Process(EPM_action_message_t msg);
//user service end
#ifdef __cplusplus
}
#endif
#endif
/**
* @}
*/

@ -0,0 +1,499 @@
#include <server_exits/user_server_exits.h>
#include <epm/epm.h>
#include <time.h>
#include <bom/bom_msg.h>
#include <tccore/item_msg.h>
#include <tccore\iman_msg.h>
#include <vector>
#include <string.h>
/**
* @headerfile user's header files
*/
#include "epm_register_handler.h"
#include "epm_handler_common.h"
using namespace std;
// Method and Workflow Handler
extern DLLAPI int CUST_init_module(int *decision, va_list args)
{
int ifail = ITK_ok;
//把目标对象下的属性id,名称,物料分类,"新增"写入excel放到附件中
ifail = EPM_register_action_handler("JL_Target_Moveto_Annex", "JL_Target_Moveto_Annex",
(EPM_action_handler_t)JL_Target_Moveto_Annex);
if (ifail)
{
printf("register JL_Target_Moveto_Annex failed\n");
}
else
{
printf("register JL_Target_Moveto_Annex successfully\n");
}
//当零部件发布时若为D状态且版本非D00版本则向焊装排产系统数据库表写入发布的零件号、件名、版本、发布日期、发布时间等信息
ifail = EPM_register_action_handler("JL_Welding_Syetem", "JL_Welding_Syetem",
(EPM_action_handler_t)JL_Welding_Syetem);
if (ifail)
{
printf("register JL_Welding_Syetem failed\n");
}
else
{
printf("register JL_Welding_Syetem successfully\n");
}
//订单评审流程结束之后按钮发起bom搭建'才能够点击
ifail = EPM_register_action_handler("JL_Auto_Order_Process", "JL_Auto_Order_Process",
(EPM_action_handler_t)JL_Auto_Order_Process);
if (ifail)
{
printf("register JL_Auto_Order_Process failed\n");
}
else
{
printf("register JL_Auto_Order_Process successfully\n");
}
//添加完成下一个节点的时间到流程描述
ifail = EPM_register_action_handler("JL_Add_FinishTime", "JL_Add_FinishTime",
(EPM_action_handler_t)JL_Add_FinishTime);
if (ifail)
{
printf("register JL_Add_FinishTime failed\n");
}
else
{
printf("register JL_Add_FinishTime successfully\n");
}
//基础件变更检查
ifail = EPM_register_action_handler("JL_Change_Inspection_Of_Basic_Part", "JL_Change_Inspection_Of_Basic_Part",
(EPM_action_handler_t)JL_Change_Inspection_Of_Basic_Part);
if (ifail)
{
printf("register JL_Change_Inspection_Of_Basic_Part failed\n");
}
else
{
printf("register JL_Change_Inspection_Of_Basic_Part successfully\n");
}
//变更信息邮件通知
ifail = EPM_register_action_handler("JL_Send_Mail", "JL_Send_Mail",
(EPM_action_handler_t)JL_Send_Mail);
if (ifail)
{
printf("register JL_Send_Mail failed\n");
}
else
{
printf("register JL_Send_Mail successfully\n");
}
//上传物料BOM到SAP
ifail = EPM_register_action_handler("JLCS_05_BOMSendOutSap", "JLCS_05_BOMSendOutSap",
(EPM_action_handler_t)JLCS_05_BOMSendOutSap);
if(ifail)
{
printf("register JLCS_05_BOMSendOutSap failed\n");
}else
{
printf("register JLCS_05_BOMSendOutSap successfully\n");
}
//上传物料BOM到SAP不需要校验仅需下发一层子件
ifail = EPM_register_action_handler("JLCS_05_BOMSendOutSap_Single", "JLCS_05_BOMSendOutSap_Single",
(EPM_action_handler_t)JLCS_05_BOMSendOutSap_Single);
if(ifail)
{
printf("register JLCS_05_BOMSendOutSap_Single failed\n");
}else
{
printf("register JLCS_05_BOMSendOutSap_Single successfully\n");
}
//更新SAP物料主数据
ifail = EPM_register_action_handler("JLCS_05_BOMUpdateSap_MasterData", "JLCS_05_BOMUpdateSap_MasterData",
(EPM_action_handler_t)JLCS_05_BOMUpdateSap_MasterData);
if(ifail)
{
printf("register JLCS_05_BOMUpdateSap_MasterData failed\n");
}else
{
printf("register JLCS_05_BOMUpdateSap_MasterData successfully\n");
}
//删除SAP物料主数据
ifail = EPM_register_action_handler("JLCS_05_BOMDeleteSap_MasterData", "JLCS_05_BOMDeleteSap_MasterData",
(EPM_action_handler_t)JLCS_05_BOMDeleteSap_MasterData);
if(ifail)
{
printf("register JLCS_05_BOMDeleteSap_MasterData failed\n");
}else
{
printf("register JLCS_05_BOMDeleteSap_MasterData successfully\n");
}
//上传物料主数据到SAP
ifail = EPM_register_action_handler("JLCS_05_BOMSendOutSap_MasterData", "JLCS_05_BOMSendOutSap_MasterData",
(EPM_action_handler_t)JLCS_05_BOMSendOutSap_MasterData);
if (ifail)
{
printf("register JLCS_05_BOMSendOutSap_MasterData failed\n");
}
else
{
printf("register JLCS_05_BOMSendOutSap_MasterData successfully\n");
}
//PDF插入图片
ifail = EPM_register_action_handler("JL_insert_img_pdf", "JL_insert_img_pdf",
(EPM_action_handler_t)jl_insert_img_pdf);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler tm_insert_img_pdf completed!\n");
}
else
{
fprintf(stdout, "Registering action handler tm_insert_img_pdf failed %d!\n", ifail);
}
//订单移至历史订单
ifail = EPM_register_action_handler("JL_insert_modular", "JL_insert_modular",
(EPM_action_handler_t)jl_insert_modular);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_insert_modular completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_insert_modular failed %d!\n", ifail);
}
//DMU验证完成
ifail = EPM_register_action_handler("jl_dmu_auto", "jl_dmu_auto",
(EPM_action_handler_t)jl_dmu_auto);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler jl_dmu_auto completed!\n");
}
else
{
fprintf(stdout, "Registering action handler jl_dmu_auto failed %d!\n", ifail);
}
//变更单移到零件的指定关系文件夹下
ifail = EPM_register_action_handler("jl_locomotion_item", "jl_locomotion_item",
(EPM_action_handler_t)jl_locomotion_item);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler jl_locomotion_item completed!\n");
}
else
{
fprintf(stdout, "Registering action handler jl_locomotion_item failed %d!\n", ifail);
}
//通知节点属性签名
ifail = EPM_register_action_handler("JL_sign_tongzhi", "JL_sign_tongzhi",
(EPM_action_handler_t)JL_sign_tongzhi);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_sign_tongzhi completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_sign_tongzhi failed %d!\n", ifail);
}
//各节点属性签名
ifail = EPM_register_action_handler("JL_sign_master", "JL_sign_master",
(EPM_action_handler_t)JL_sign_master);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_sign_master completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_sign_master failed %d!\n", ifail);
}
//判断对象版本号是否包含参数中配置的版本号
ifail = EPM_register_action_handler("JL_Judge_Revision", "JL_Judge_Revision",
(EPM_action_handler_t)JL_Judge_Revision);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_Judge_Revision completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_Judge_Revision failed %d!\n", ifail);
}
//将引用下的文件移到目标中
ifail = EPM_register_action_handler("JL_add_to_referenece", "JL_add_to_referenece",
(EPM_action_handler_t)JL_add_to_referenece);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_add_to_referenece completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_add_to_referenece failed %d!\n", ifail);
}
//发起SAP主数据维护流程
ifail = EPM_register_action_handler("JL_create_process", "JL_create_process",
(EPM_action_handler_t)JL_create_process);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler JL_create_process completed!\n");
}
else
{
fprintf(stdout, "Registering action handler JL_create_process failed %d!\n", ifail);
}
//测试
ifail = EPM_register_action_handler("test", "test",
(EPM_action_handler_t)test);
if (ifail == ITK_ok)
{
fprintf(stdout, "Registering action handler test completed!\n");
}
else
{
fprintf(stdout, "Registering action handler test failed %d!\n", ifail);
}
return ifail;
}
//
////register service method
extern DLLAPI int USERSERVICE_custom_register_methods()
{
int
status = ITK_ok,
numberOfArguments = 0,
returnValueType = USERARG_STRING_TYPE,
*argumentList = NULL;
USER_function_t functionPtr;
//METHOD_id_t mth_tag;
////METHOD_find_method("Gd6_PartsRevisionMaster",TC_import_msg,&mth_tag);
//
//vector<string> typeVec;
//typeVec.push_back("gd6_sjzl");
//typeVec.push_back("gd6_mz");
//typeVec.push_back("gd6_wlfl");
//typeVec.push_back("gd6_dw");
//typeVec.push_back("gd6_jcjwlh");
//typeVec.push_back("gd6_sfqdj");
//typeVec.push_back("gd6_gyzy");
//for (int i = 0; i < typeVec.size(); i++) {
// METHOD_find_prop_method("Gd6_PartsRevisionMaster", typeVec[i].c_str(), PROP_set_value_string_msg, &mth_tag);
// if ( mth_tag.id != NULLTAG )
// {
// printf("update superBOM start \n ");
// ITKCALL(status = METHOD_add_action2( mth_tag, METHOD_post_action_type,( METHOD_function_t ) JL_form_save, NULL ,true) );
// if(status == ITK_ok){
// printf("success superBOM \n ");
// }else{
// printf("faild superBOM \n ");
// }
// }else{
// printf("not find Gd6_PartsRevisionMaster \n ");
// }
//}
//QTM_ebom_to_pbom
//规定java需要传递过来的个数
numberOfArguments = 1;
//需要调用的函数地址函数地址
functionPtr = Connor_set_bypass;
//定义java需要传递的参数
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_STRING_TYPE;
//argumentList[1] = USERARG_DATE_TYPE;
//argumentList[2] = USERARG_STRING_TYPE +USERARG_ARRAY_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
//定义返回值的类型
returnValueType = USERARG_VOID_TYPE;
status = USERSERVICE_register_method("Connor_set_bypass", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering Connor_set_bypass finished\n");
}
else
{
fprintf(stdout, "\n Registering Connor_set_bypass failed %d\n", status);
}
//===========================================
numberOfArguments = 1;
functionPtr = ORIGIN_close_bypass;
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_STRING_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
returnValueType = USERARG_VOID_TYPE;
status = USERSERVICE_register_method("ORIGIN_close_bypass", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering ORIGIN_close_bypass finished\n");
}
else
{
fprintf(stdout, "\n Registering ORIGIN_close_bypass failed %d\n", status);
}
//===========================================
//规定java需要传递过来的个数
numberOfArguments = 3;
//需要调用的函数地址函数地址
functionPtr = DMU_Review_Process;
//定义java需要传递的参数
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_TAG_TYPE;
argumentList[1] = USERARG_STRING_TYPE;
argumentList[2] = USERARG_STRING_TYPE;
//argumentList[1] = USERARG_TAG_TYPE;
//argumentList[1] = USERARG_DATE_TYPE;
//argumentList[2] = USERARG_STRING_TYPE +USERARG_ARRAY_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
//定义返回值的类型
returnValueType = USERARG_VOID_TYPE;
//ITKCALL();
status = USERSERVICE_register_method("DMU_Review_Process", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering DMU_Review_Process finished\n");
}
else
{
fprintf(stdout, "\n Registering DMU_Review_Process failed %d\n", status);
}
//===========================================
//规定java需要传递过来的个数
numberOfArguments = 3;
//需要调用的函数地址函数地址
functionPtr = Send_Order_Process;
//定义java需要传递的参数
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_TAG_TYPE;
argumentList[1] = USERARG_STRING_TYPE;
argumentList[2] = USERARG_STRING_TYPE;
//argumentList[1] = USERARG_TAG_TYPE;
//argumentList[1] = USERARG_DATE_TYPE;
//argumentList[2] = USERARG_STRING_TYPE +USERARG_ARRAY_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
//定义返回值的类型
returnValueType = USERARG_VOID_TYPE;
//ITKCALL();
status = USERSERVICE_register_method("Send_Order_Process", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering Send_Order_Process finished\n");
}
else
{
fprintf(stdout, "\n Registering Send_Order_Process failed %d\n", status);
}
//===========================================
//规定java需要传递过来的个数
numberOfArguments = 3;
//需要调用的函数地址函数地址
functionPtr = Create_Remodel_Process;
//定义java需要传递的参数
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_TAG_TYPE;
argumentList[1] = USERARG_STRING_TYPE;
argumentList[2] = USERARG_STRING_TYPE;
//argumentList[1] = USERARG_TAG_TYPE;
//argumentList[1] = USERARG_DATE_TYPE;
//argumentList[2] = USERARG_STRING_TYPE +USERARG_ARRAY_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
//定义返回值的类型
returnValueType = USERARG_VOID_TYPE;
//ITKCALL();
status = USERSERVICE_register_method("Create_Remodel_Process", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering Create_Remodel_Process finished\n");
}
else
{
fprintf(stdout, "\n Registering Create_Remodel_Process failed %d\n", status);
}
//===========================================
//规定java需要传递过来的个数
numberOfArguments = 1;
//需要调用的函数地址函数地址
functionPtr = Super_Bom_Appent_Data;
//定义java需要传递的参数
argumentList = (int*)MEM_alloc(numberOfArguments * sizeof(int));
argumentList[0] = USERARG_TAG_TYPE;
//argumentList[1] = USERARG_TAG_TYPE;
//argumentList[1] = USERARG_DATE_TYPE;
//argumentList[2] = USERARG_STRING_TYPE +USERARG_ARRAY_TYPE;
//argumentList[1] = USERARG_STRING_TYPE + USERARG_ARRAY_TYPE;
//returnValueType = USERARG_STRING_TYPE;
//定义返回值的类型
returnValueType = USERARG_VOID_TYPE;
//ITKCALL();
status = USERSERVICE_register_method("Super_Bom_Appent_Data", functionPtr, numberOfArguments,
argumentList, returnValueType);
MEM_free(argumentList);
if (status == ITK_ok)
{
fprintf(stdout, "\n Registering Super_Bom_Appent_Data finished\n");
}
else
{
fprintf(stdout, "\n Registering Super_Bom_Appent_Data failed %d\n", status);
}
//===========================================
return(status);
}

@ -0,0 +1,21 @@
#ifndef EPM_REGISTER_HANDLER_CUSTOM
#define EPM_REGISTER_HANDLER_CUSTOM
#include <ict/ict_userservice.h>
#ifdef __cplusplus
extern "C" {
#endif
extern DLLAPI int CUST_init_module(int *, va_list);
extern DLLAPI int USERSERVICE_custom_register_methods();
#ifdef __cplusplus
}
#endif
#endif

@ -0,0 +1,281 @@
#include <epm\epm.h>
#import "C:\Program Files\Common Files\System\ado\msado15.dll" no_namespace rename("EOF","adoEOF")rename("BOF","adoBOF")
#include <atlstr.h>
#include "epm_handler_common.h"
#include <ae/ae.h>
#include <tccore\item.h>
#include <stdio.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grm.h>
#include <tccore\imantype.h>
#include <tccore\iman_grmtype.h>
#include <tccore\aom.h>
#include <property\prop_errors.h>
#include <qry\qry.h>
#include <epm\cr.h>
#include <bom/bom.h>
#include <stdio.h>
#include <string>
#include <iterator>
#include<iostream>
#include <vector>
#include<Windows.h>
#include "ocilib.h"
#include<ics\ics.h>
#include<ics\ics2.h>
#pragma warning(disable : 4996)
#include <tccore\aom_prop.h>
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
using namespace std;
//#include "E:/20200520/DM_ITK/jf_itk/jf_itk/jf_itk/ocilib.cxx"
int jl_dmu_auto(EPM_action_message_t msg) {
::CoInitialize(NULL); //初始化OLE/COM库环境
HRESULT hr = NULL;
_ConnectionPtr m_pConnection; // 数据库
_RecordsetPtr m_pRecordset; // 命令
_CommandPtr m_pCommand; // 记录
int ifail = ITK_ok, count = 0, arg_cnt = 0, item_mast_rev_count = 0,valueNum=0;
int outputColumn = 0, outputValueCount = 0;
tag_t root_task = NULL_TAG;
tag_t* attachments = NULL, * item_mast_rev = NULLTAG;
//char arg1value[1024] = "";
//char* arg = NULL, * argflag = NULL, * argvalue = NULL;
char* item_id = NULL, *type_class=NULL,*part_type = NULL;
char* object_type = NULL;
//char* control_name = "btnDmu"; //DMU验证通过按钮的name
char* puid = NULL;
//char*** outputValue = (char***)calloc(1024, sizeof(char**));
char* describeSelect = (char*)calloc(1024, sizeof(char));
char* describeUpdate = (char*)calloc(1024, sizeof(char));
//label_45,label_46
char* label45 = (char*)calloc(1024, sizeof(char));
char* label46 = (char*)calloc(1024, sizeof(char));
char* button = (char*)calloc(1024, sizeof(char));
char* describeSelect2 = (char*)calloc(1024, sizeof(char));
char* describeUpdate2 = (char*)calloc(1024, sizeof(char));
char* label25 = (char*)calloc(1024, sizeof(char));
char* button10 = (char*)calloc(1024, sizeof(char));
char* server_address;
PREF_ask_char_value("TC11_SqlServer_Link_ITK", valueNum, &server_address);
//获取流程任务
EPM_ask_root_task(msg.task, &root_task);
//获取流程任务目标文件夹中的当前对象
EPM_ask_attachments(root_task, EPM_target_attachment, &count, &attachments);//count 为流程中目标文件夹中的对象数量 attachments 为当前对象数据集
//获取参数个数
//arg_cnt = TC_number_of_arguments(msg.arguments);
for (int i = 0; i < count; i++)
{
ifail = AOM_ask_value_string(attachments[i], "object_type", &type_class);
printf("%s\n", type_class);
//过滤掉非版本对象
if ((strstr(type_class, "Revision") == NULL) || (strstr(type_class, "Master") != NULL)
|| (strstr(type_class, "master") != NULL) || (strstr(type_class, "BOM") != NULL) || (strstr(type_class, "bom") != NULL) || (strstr(type_class, "Bom") != NULL))
{
continue;
}
ifail = AOM_ask_value_string(attachments[i], "item_id", &item_id); //得到itemRev的id
printf("%s\n", item_id);
AOM_ask_value_tags(attachments[i], "IMAN_master_form_rev", &item_mast_rev_count, &item_mast_rev);
printf("获取订单类型\n");
//PROPDESC_ask_lov
//AOM_UIF_ask_value(item_mast_rev[0], "gd6_ddlx", &part_type);
AOM_UIF_ask_value(item_mast_rev[0], "gd6_ddlx", &part_type);//订单类型的值
printf("%s\n", part_type);
//ifail = ITEM_find_item(item_id, &item_tag);
//cout << item_tag << endl;
ITK__convert_tag_to_uid(attachments[i], &puid);
printf("%s\n", puid);
//printf("puid为:%s\n", puid);
hr = m_pConnection.CreateInstance(_uuidof(Connection));//创建连接对象实例
if (SUCCEEDED(hr))
{
/*
Provider=SQLOLEDB.1 ------oledbbai
Persist Security Info ----du
User ID-------------------
PassWord------------------zhi
Initial Catalog-----------ipdao
Data Source---------------
*/
m_pConnection->ConnectionString = (server_address);
printf("\n==========================================================\n");
hr = m_pConnection->Open("", "", "", adConnectUnspecified);//打开数据库
if (FAILED(hr))
{
printf("Open Failed!");
return 1;
}
else
{
printf("开始修改控件\n");
printf("%s\n", puid);
CString strSql;
CString updateSql;
// strSql.Format(_T("INSERT INTO [生产科数据库].[dbo].[tb_Process_Bom]([LinesNo],[ItemCode],[ItemName],[DrawingNo],[ProcessName],[EquiNo],[EquiName],[Designer],[ItemType],[CustomerDrawingNo],[MBomCode],[Material],[ProcessOwner],[RevNo],[OBID],[SysNo],[State]) VALUES('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s')"), LineID, ItemCode, ItemName, DrawingNo, ProcessName, EquiNo, EquiNames, Designer, Classify, CustomerDrawing, MBOMCode, MaterialNam, ProcessOwner, RevNo, OBID, SysNo, "UnCheck");
//strSql.Format(_T("SELECT ENABLED FROM GD_CONTROLSTYPE_TABLE WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = '%s'"), uid, control_name);
//char* describeSelect = (char*)calloc(1024, sizeof(char));
//char* describeUpdate = (char*)calloc(1024, sizeof(char));
////label_45,label_46
//char* label45 = (char*)calloc(1024, sizeof(char));
//char* label46 = (char*)calloc(1024, sizeof(char));
//char* button = (char*)calloc(1024, sizeof(char));
//updateSql.Format(_T("UPDATE GD_CONTROLSTYPE_TABLE SET ENABLED ='%s' WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = '%s'"), style, uid, control_name);
sprintf(describeSelect, "SELECT ENABLED FROM GD_CONTROLSTYPE_TABLE WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'btnDmu'", puid);
sprintf(describeUpdate, "UPDATE GD_CONTROLSTYPE_TABLE SET ENABLED ='false',BACKGROUND = 'GREEN' WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'btnDmu'", puid);
sprintf(label45, "UPDATE GD_CONTROLSTYPE_TABLE SET BACKGROUND = 'GREEN' WHERE CONTROL_NAME = 'label_45' AND ORDER_TAGU = '%s'", puid);
sprintf(label46, "UPDATE GD_CONTROLSTYPE_TABLE SET BACKGROUND = 'GREEN' WHERE CONTROL_NAME = 'label_46' AND ORDER_TAGU = '%s'", puid);
sprintf(button, "UPDATE GD_CONTROLSTYPE_TABLE SET ENABLED ='true' WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'button_3'", puid);
//sprintf();
/*char* describeSelect2 = (char*)calloc(1024, sizeof(char));
char* describeUpdate2 = (char*)calloc(1024, sizeof(char));
char* label25 = (char*)calloc(1024, sizeof(char));
char* button10 = (char*)calloc(1024, sizeof(char));*/
sprintf(describeSelect2, "SELECT ENABLED FROM GD_CONTROLSTYPE_TABLE WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'part_9'", puid);
sprintf(describeUpdate2, "UPDATE GD_CONTROLSTYPE_TABLE SET ENABLED ='false',BACKGROUND = 'GREEN' WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'part_9'", puid);
sprintf(label25, "UPDATE GD_CONTROLSTYPE_TABLE SET BACKGROUND = 'GREEN' WHERE CONTROL_NAME = 'label25' AND ORDER_TAGU = '%s'", puid);
sprintf(button10, "UPDATE GD_CONTROLSTYPE_TABLE SET ENABLED ='true' WHERE ORDER_TAGU = '%s' AND CONTROL_NAME = 'part_10'", puid);
cout << describeSelect << endl;
cout << describeUpdate << endl;
cout << label45 << endl;
cout << label46 << endl;
cout << button << endl;
//printf(describeSelect);
//printf(describeUpdate);
//printf(label45);
//printf(label46);
try
{
printf("查询开始\n");
//QuerySQLNoInputParam(describeSelect, &outputColumn, &outputValueCount, &outputValue);
//printf("状态为: %s", **outputValue);
m_pRecordset.CreateInstance(__uuidof(Recordset));
if (strcmp(part_type, "车身") == 0) {
printf("查询车身订单");
m_pRecordset->Open(describeSelect, m_pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText);
}
else {
m_pRecordset->Open(describeSelect2, m_pConnection.GetInterfacePtr(), adOpenStatic, adLockOptimistic, adCmdText);
}
while (!m_pRecordset->adoEOF)
{
printf("查询出dmu按钮得状态");
//查询出dmu按钮得状态
_variant_t taskStyle = NULL;
taskStyle = m_pRecordset->GetCollect("ENABLED");
const char* str;
_bstr_t bst_t = taskStyle;
str = (const char*)bst_t;
printf("按钮状态=======================%s\n", str);
if (strcmp(str,"true") == 0) {
if (strcmp(part_type,"车身") == 0) {
m_pConnection->Execute(_bstr_t(describeUpdate), 0, adCmdText);
m_pConnection->Execute(_bstr_t(label45), 0, adCmdText);
m_pConnection->Execute(_bstr_t(label46), 0, adCmdText);
m_pConnection->Execute(_bstr_t(button), 0, adCmdText);
printf("更新结束\n");
}
else if (strcmp(part_type, "配件") == 0 ){
m_pConnection->Execute(_bstr_t(describeUpdate2), 0, adCmdText);
m_pConnection->Execute(_bstr_t(label25), 0, adCmdText);
m_pConnection->Execute(_bstr_t(button10), 0, adCmdText);
printf("更新结束\n");
}
else {
printf("没有对应的类型");
break;
}
}
else {
break;
}
m_pRecordset->MoveNext();///移到下一条记录
}
printf("执行结束\n");
//if (strcmp(outputValue[0][0], "false") == 0) {
// printf("更新开始%s\n", outputValue[0][0]);
//m_pConnection->Execute(_bstr_t(describeUpdate), 0, adCmdText);
//m_pConnection->Execute(_bstr_t(label45), 0, adCmdText);
//m_pConnection->Execute(_bstr_t(label46), 0, adCmdText);
//m_pConnection->Execute(_bstr_t(updateDescribe), 0, adCmdText);
//printf("更新结束\n");
// return ifail;
//};
}
catch (_com_error e)
{
printf(e.Description());
return 1;
}
//strSql = NULL;
//describe = NULL;
}
}
else
{
printf("Create instance of connection failed!");
return 1;
}
}
DOFREE(attachments);
DOFREE(item_mast_rev);
DOFREE(item_id);
DOFREE(type_class);
DOFREE(part_type);
DOFREE(object_type);
DOFREE(puid);
describeSelect = NULL;
describeUpdate = NULL;
describeUpdate2 = NULL;
describeSelect2 = NULL;
label45 = NULL;
label46 = NULL;
label25 = NULL;
button = NULL;
button10 = NULL;
return ifail;
}

File diff suppressed because it is too large Load Diff

@ -0,0 +1,196 @@
#include "epm_handler_common.h"
#include <ae/ae.h>
#include <tccore\item.h>
#include <stdio.h>
#include <tc\emh.h>
#include <tc\preferences.h>
#include <epm\epm_toolkit_tc_utils.h>
#include <tccore\item.h>
#include <tccore\grm.h>
#include <tccore\imantype.h>
#include <tccore\iman_grmtype.h>
#include <tccore\aom.h>
#include <property\prop_errors.h>
#include <qry\qry.h>
#include <epm\cr.h>
#include <bom/bom.h>
#include <stdio.h>
#include <string>
#include <iterator>
#include<iostream>
#include <vector>
#include<Windows.h>
#include<ics\ics.h>
#include<ics\ics2.h>
#pragma warning(disable : 4996)
#include <tccore\aom_prop.h>
extern "C" int POM_AM__set_application_bypass(logical bypass);
using namespace std;
int jl_insert_modular(EPM_action_message_t msg)
{
printf("发送开始");
int ifail = ITK_ok, att_cnt = 0,i=0, item_mast_rev_count = 0,ico_att_count ,*ico_id_count,*ico_values_count;
tag_t task_tag = NULLTAG,
rootTask_tag = NULLTAG,
type_tag = NULLTAG,
old_ico_tag = NULLTAG,
new_ico_tag = NULLTAG,
item_class_tag = NULLTAG,
item_class_tag2 = NULLTAG,
rev_tag = NULLTAG, classificationObject;
tag_t *attachments = NULLTAG, *item_mast_rev = NULLTAG ;
logical verdict;
char* type_value = NULL, * bom_value = NULL, * orderType_value = NULL, *item_id = NULL,**ico_values,**ico_attribute,***ico_values2,
oldClassID[TCTYPE_class_name_size_c + 1], newClassID[TCTYPE_class_name_size_c + 1];
//获取流程
task_tag = msg.task;
//获取根流程
ifail = EPM_ask_root_task(task_tag,&rootTask_tag);
//获取目标对象
ifail = EPM_ask_attachments(rootTask_tag, EPM_target_attachment, &att_cnt, &attachments);
for (i = 0; i < att_cnt; i++) {
printf("循环开始");
//得到目标对象的类型
ifail = TCTYPE_ask_object_type(attachments[i], &type_tag);
//得到目标对象的最新版本
//ifail = ITEM_ask_item_of_rev(attachments[i],&rev_tag);
ifail = ITEM_ask_latest_rev(attachments[i], &rev_tag);
//AOM_UIF_ask_value();
//ITEM_ask_type();
//ITEM_ask_rev_master_form_type
ifail = AOM_ask_value_string(attachments[i], "object_type", &type_value); //得到item的类型
printf("object_type为%s\n", type_value);
ifail = AOM_ask_value_string(attachments[i], "item_id", &item_id); //得到item的id
printf("item_id为%s\n", item_id);
//得到版本下的主表单
AOM_ask_value_tags(rev_tag, "IMAN_master_form_rev", &item_mast_rev_count, &item_mast_rev);
//printf("test为%s\n", item_mast_rev[0]);
AOM_ask_value_string(item_mast_rev[0], "user_data_1", &bom_value);//订单属性“bom状态”的值
AOM_ask_value_string(item_mast_rev[0], "user_data_2", &orderType_value);//订单类型的值
printf("user_data_1为%s\n", bom_value);
printf("user_data_2为%s\n", orderType_value);
//得到分类的id(通过订单类型的值)
if (strcmp(orderType_value, "车身") == 0) {
strcpy(oldClassID,"jlcs010201");
strcpy(newClassID,"jlcs010101");
printf("分类id为 %s", oldClassID);
}
else if (strcmp(orderType_value, "配件") == 0)
{
strcpy(oldClassID, "jlcs010202");
strcpy(newClassID, "jlcs010102");
printf("分类id为 %s", oldClassID);
}
else if (strcmp(orderType_value, "KD") == 0)
{
strcpy(oldClassID, "jlcs010203");
strcpy(newClassID, "jlcs010103");
printf("分类id为 %s", oldClassID);
}
if (strcmp(type_value,"Gd6_Order")!=0) {
printf("该对象的类型不是订单 \n");
}
else {
printf("该对象的类型是订单 \n");
}
//ITK_ask_cli_argument();
//ITK__convert_uid_to_tag();
POM_AM__set_application_bypass(true);
if (strcmp(bom_value,"下发成功")==0) {
//ICS_find_class()
//ITK__convert_uid_to_tag
printf("分类开始 \n");
//ICS_ask_classification_object(attachments[i],&itemClass_tag); //通过item得到item的分类对象
ICS_is_wsobject_classified(attachments[i],&verdict); //此函数检查给定的工作区对象是否已分类。
/*这将根据对象id、视图/类标记和工作空间对象创建一个新的分类对象。
ws_object#NULLTAGICO
idws_idICO id
ws_object#NULLTAGICOidobject#id
ICO使ICS ICO*/
//ICS_create_classification_object();
//函数获取由给定ID字符串标识的组/类的标记。
ICS_find_class(oldClassID, &old_ico_tag); //原本分类的tag id流程中订单
ICS_find_class(newClassID, &new_ico_tag); //历史订单中的分类tag id
printf("类的tag %d\n", old_ico_tag);
cout << new_ico_tag << endl;
//cout << itemClass_tag << endl;
ICS_ask_classification_object(attachments[i],&item_class_tag);
//ICS_attribute_convert_attribute_values();
ICS_ico_ask_attributes(item_class_tag,&ico_att_count ,&ico_id_count, &ico_values_count,&ico_values2);
cout << ico_att_count << endl;
cout << *ico_id_count << endl;
cout << *ico_values_count << endl;
cout << ico_values2 << endl;
//ICS_ask_attributes_of_classification_obj(item_class_tag, &ico_att_count, &ico_attribute,&ico_values);
//ICS_attribute_set_property();
//ICS_attribute_ask_id;
//ICS_remove_classification() //全部删除item和分类中的对象
//ICS_delete_reference_to_wsobject
ICS_delete_reference_to_ico(item_class_tag);
ICS_delete_classification_object(item_class_tag);
//char** value = (char**)MEM_alloc(sizeof(char*));
ICS_create_classification_object(attachments[i],item_id, new_ico_tag, &classificationObject);
//此函数对给定的工作区对象进行分类即将工作区对象与使用IMAN_分类关系的给定分类对象。
ICS_classify_wsobject(attachments[i], classificationObject);
//ICS_ico_ask_attributes(item_class_tag, &ico_att_count, &ico_id_count, &ico_values_count, &ico_values2);
ICS_ask_classification_object(attachments[i],&item_class_tag2);
ICS_ico_set_attributes(item_class_tag2, ico_att_count, ico_id_count, ico_values_count,(const char*** )ico_values2);
printf("对象移到历史订单成功");
POM_AM__set_application_bypass(false);
//MEM_free(oldClassID);
//MEM_free(newClassID);
}
else {
printf("对象发送到分类失败");
}
}
return ifail;
}
////获取顶层 REVISION 对应的分类
//ICS_ask_classification_object(top_rev_tag,&top_classificationObject);
//if(top_classificationObject == NULL_TAG)
//{
//printf("顶层对象没有发送到分类\n");
//return 0;
//}
//ICS_ask_class_of_classification_obj(top_classificationObject,&top_class_tag);
//ICS_ask_id_name(top_class_tag, &top_class_id, &top_class_name);
//char *revbuf1[8] = { 0 };
//int num1 = 0;
//split(bl_formatted_parent_name, "/", revbuf1, &num1);
//ICS_create_classification_object
//ICS_is_wsobject_classified(
// ICS_classify_wsobject
//AOM_UIF_ask_value();

@ -0,0 +1,140 @@
#include "epm_handler_common.h"
#include <unidefs.h>
#include <epm\epm.h>
#include <vector>
//#include "string_helper.cpp"
#include <tccore\aom_prop.h>
#include <tccore\item.h>
#include <tccore\grm.h>
#include <stdio.h>
using namespace std;
#define DOFREE(obj) \
{ \
if(obj) \
{ \
MEM_free(obj); \
obj = NULL; \
} \
}
extern "C" int POM_AM__set_application_bypass(logical bypass);
int jl_locomotion_item(EPM_action_message_t msg) {
printf("==================将对象移动到指定文件夹下 START =======================\n");
int ifail = EPM_go, count = 0, arg_cnt = 0;
tag_t root_task = NULL_TAG;
tag_t* attachments = NULL;
//获取流程任务
EPM_ask_root_task(msg.task, &root_task);
//获取流程任务目标文件夹中的对象
EPM_ask_attachments(root_task, EPM_target_attachment, &count, &attachments);
//获取参数个数
arg_cnt = TC_number_of_arguments(msg.arguments);
/*
if (arg_cnt > 0)
{
for (int i = 0; i < arg_cnt; i++)
{
arg = TC_next_argument(msg.arguments);
//ITKCALL(ifail = ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue));
ifail = ITK_ask_argument_named_value((const char*)arg, &argflag, &argvalue);
if (stricmp(argflag, "ItemType") == 0)
{
if (argvalue != NULL)
{
strcpy(arg1value, argvalue);
}
}
}
MEM_free(argflag);
MEM_free(argvalue);
}
*/
for (int i = 0; i < count; i++)
{
int count1 = 0, count2 = 0, count3 = 0;
tag_t* target1, * target2, * target3;
int itemCount = 0, n_references = 0, items_tagCount = 0, item_mast_rev_count = 0;
char * type_class = NULL;
//int * levels = NULL;
//char **relation_type_name = NULL; * reference_tags = NULL,
tag_t spec_relation1 = NULLTAG, spec_relation2 = NULLTAG, spec_relation3 = NULLTAG,spec_relation4 = NULLTAG ;
tag_t items_tag = NULL_TAG;
//tag_t spec_relation11 , spec_relation21, spec_relation31;
tag_t relation1, relation2, relation3;
ifail = AOM_ask_value_string(attachments[i], "object_type", &type_class);
printf("type_class : %s\n", type_class);
//过滤掉非版本对象
if ((strstr(type_class, "Revision") == NULL) || (strstr(type_class, "Master") != NULL)
|| (strstr(type_class, "master") != NULL) || (strstr(type_class, "BOM") != NULL) || (strstr(type_class, "bom") != NULL) || (strstr(type_class, "Bom") != NULL))
{
continue;
}
//获取对象
ifail = ITEM_ask_item_of_rev(attachments[i], &items_tag);
GRM_find_relation_type("Gd6_BGLBJ", &spec_relation1); //变更零部件
GRM_find_relation_type("Gd6_SYXLBJ", &spec_relation2); //受影响零部件
GRM_find_relation_type("Gd6_XGFJ", &spec_relation3); //相关零部件
GRM_find_relation_type("Gd6_GLBGJ", &spec_relation4); //关联变更件(变更相关附件)
GRM_list_secondary_objects_only(attachments[i], spec_relation1, &count1, &target1);
if (count1!=0) {
printf("开始\n");
for (int j = 0; j < count1; j++)
{
//GRM_find_relation_type("Gd6_GYWJ", &spec_relation11);
GRM_create_relation(target1[j], items_tag, spec_relation4, NULLTAG, &relation1);
GRM_save_relation(relation1);
}
printf("结束\n");
}
GRM_list_secondary_objects_only(attachments[i], spec_relation2, &count2, &target2);
if (count2 != 0) {
for (int j = 0; j < count2; j++)
{
//GRM_find_relation_type("Gd6_GYWJ", &spec_relation21);
GRM_create_relation(target2[j], items_tag, spec_relation4, NULLTAG, &relation2);
GRM_save_relation(relation2);
}
}
GRM_list_secondary_objects_only(attachments[i], spec_relation3, &count3, &target3);
if (count3 != 0) {
for (int j = 0; j < count3; j++)
{
//GRM_find_relation_type("Gd6_GYWJ", &spec_relation31);
GRM_create_relation(target3[j], items_tag, spec_relation4, NULLTAG, &relation3);
GRM_save_relation(relation3);
}
}
DOFREE(target1);
DOFREE(target2);
DOFREE(target3);
DOFREE(type_class);
}
DOFREE(attachments);
printf("==================将对象移动到指定文件夹下 END =======================\n");
return ITK_ok;
}

@ -0,0 +1,439 @@
/*=====================================================================================================================
Copyright(c) 2012 ORIGIN.
Unpublished - All rights reserved
=======================================================================================================================
File description:
Filename: ocilib.cxx
Module : OCI
This file describes OCI library Package.
=======================================================================================================================
Date Name Description of Change
1-Feb-2015 Ray li Initialize creation
$HISTORY$
=====================================================================================================================*/
#include "ocilib.h"
#include <stdlib.h>
#define NUM 100
#define USERNAME "infodba"
#define PASSWORD "infodba"
#define DBNAME "tc"
// 定义句柄结构
typedef struct {
OCIEnv* p_env; //OCI environment handle 环境句柄
OCIError* p_err; //OCI error handle 错误句柄
OCISvcCtx* p_svc; //OCI service context handel 服务上下文句柄
OCIServer* p_ser; //OCI server handle 服务器句柄
OCISession* p_usr; //OCI user session handle 用户会话句柄
OCIStmt* p_sql; //OCI statement handle 语句句柄
OCIDefine* p_dfn; //OCI define handle 定义句柄
OCIBind* p_bnd; //OCI bind handle 绑定句柄
}OCIHandleInfo;
// 定义错误句柄结构
typedef struct {
OCIEnv* p_env;
OCIError* p_err;
OCISvcCtx* p_svc;
OCIStmt* p_sql;
OCIDefine* p_dfn;
OCIBind* p_bnd;
}OCIDATA;
// 定义执行语句时候的输入参数
typedef struct {
char value[NUM][NUM];
char type[NUM][NUM];
}SqlField;
// 定义查询语句时候的输入,输出参数
typedef struct {
int naIntValue[NUM];
int nIntNum;
char caCharValue[500][500];
int nCharNum;
}SqlSelField;
OCIHandleInfo* ociHandle = NULL;
OCIHandleInfo ociHand;
int InitHandle();
int _ExeSQL(char* SQL, char** inputValue, int inputValueCount);
int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField);
int GetDataFromQuery(int* pRc, SqlSelField* pOutField);
void QuitFreeHandle();
/****************************************************************************************************************************************
*****************************************************************************************************************************************/
// 初始化Handler
int InitHandle()
{
int swResult;
ociHandle = &ociHand;
/*create OCI environment*/
if (swResult = OCIEnvCreate(&ociHandle->p_env, OCI_DEFAULT, NULL, NULL, NULL, NULL, 0, NULL)) //环境句柄
{
printf("environment create error!\n\n");
return -1;
}
else
{
printf("environment create success!\n\n");
//return 0;
}
/*init handle*/
if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_ser, OCI_HTYPE_SERVER, 0, NULL)) //服务器句柄
{
printf("init server handle error!\n\n");
return -1;
}
if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_err, OCI_HTYPE_ERROR, 0, NULL)) //错误句柄
{
printf("init error handle error!\n\n");
return -1;
}
if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_usr, OCI_HTYPE_SESSION, 0, NULL)) //事务句柄
{
printf("init session handle error!\n\n");
return -1;
}
if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_svc, OCI_HTYPE_SVCCTX, 0, NULL)) //上下文句柄
{
printf("init service context handle error!\n\n");
return -1;
}
if (swResult = OCIHandleAlloc(ociHandle->p_env, (dvoid**)&ociHandle->p_sql, OCI_HTYPE_STMT, 0, NULL)) //SQL语句句柄
{
printf("init statement handle error!\n\n");
return -1;
}
printf("init handle success!\n\n");
return 0;
}
// 连接数据库服务器
int ConnServer(char* username, char* password, char* dbname)
{
int swResult;
char errbuf[100] = { 0 };
int errcode;
if (InitHandle() == -1)//初始化句柄
return -1;
if (swResult = OCILogon(ociHandle->p_env, ociHandle->p_err, &ociHandle->p_svc, (text*)username, strlen(username), (text*)password, strlen(password), (text*)dbname, strlen(dbname)))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("Error - %.*s/n", 512, errbuf);
return -1;
}
else
printf("数据库连接成功!\n\n");
return 0;
}
// SQL语句的陈述(执行SQL语句)
int _ExeSQL(char* SQL, char** inputValue, int inputValueCount)
{
int swResult, i;
int errcode;
//设置绑定变量
OCIBind* p_bndp[100];
//准备SQL语句
if (swResult = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, strlen(SQL), OCI_NTV_SYNTAX, OCI_DEFAULT))
{
printf("prepare SQL statements error!\n\n");
}
else
{
printf("prepare SQL statements success!\n\n");
}
// 绑定输入变量
for (i = 0; i < inputValueCount; i++)
{
char errbuf[100] = { 0 };
if (swResult = OCIBindByPos(ociHandle->p_sql, &p_bndp[i], ociHandle->p_err, i + 1, (dvoid*)inputValue[i], (sb4)strlen(inputValue[i]) + 1, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("Bind Error - %.*s/n", 512, errbuf);
return -1;
}
}
//执行SQL statements
if (swResult = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, 1, 0, NULL, NULL, OCI_DEFAULT | OCI_COMMIT_ON_SUCCESS))
{
char errbuf[100] = { 0 };
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("execute SQL statement Error - %.*s\n", 512, errbuf);
return -1;
}
else
{
printf("execute SQL statement success!\n\n");
}
return 0;
}
// 查询SQL
int _QuerySQL(char* SQL, SqlSelField* pOutField, SqlSelField* pSelField)
{
sword status;
int rc = 0, ret = 0;
char errbuf[100] = { 0 };
int maxNum = 2048;
char chTag[8];
int iIndex = 0;
int outputColumn = 0;
int errcode = 0;
char nullValue = '\0'; //
sb2 sb2aInd[30] = { '\0' };
// 准备SQL语句
status = OCIStmtPrepare(ociHandle->p_sql, ociHandle->p_err, (text*)SQL, (ub4)strlen(SQL), (ub4)OCI_NTV_SYNTAX, (ub4)OCI_DEFAULT);
if (status != OCI_SUCCESS)
{
printf("SQL Preparing failed/n");
return -1;
}
// 绑定int类型的, 定义SQL语句时 :1,:2, 定义输入变量
for (iIndex = 0; iIndex < pSelField->nIntNum; iIndex++)
{
memset(chTag, 0, 8);
sprintf(chTag, ":%d", iIndex + 1);
if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf);
return -1;
}
}
// 绑定char *类型的, 定义SQL语句时 :3,:4, 定义输入变量
for (iIndex = 0; iIndex < pSelField->nCharNum; iIndex++)
{
int n = 0;
memset(chTag, 0, 8);
n = pSelField->nIntNum + iIndex + 1;
sprintf(chTag, ":%d", n);
if (rc = OCIBindByName(ociHandle->p_sql, (OCIBind**)&ociHandle->p_dfn, ociHandle->p_err, (text*)chTag, (sb4)strlen((char*)chTag), (dvoid*)&pSelField->caCharValue[iIndex], NUM, SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, (ub4)0, (ub4*)0, OCI_DEFAULT))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("BindByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf);
return -1;
}
}
// 执行SQL语句
if (rc = OCIStmtExecute(ociHandle->p_svc, ociHandle->p_sql, ociHandle->p_err, (ub4)0, (ub4)0, (CONST OCISnapshot*) NULL, (OCISnapshot*)NULL, OCI_STMT_SCROLLABLE_READONLY))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("execute SQL Error - %.*s\n", 512, errbuf);
return -1;
}
else
{
printf("execute SQL success!\n\n");
}
if (ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)&outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("Get OCIAttr Error of ociHandle->p_sql - %.*s\n", 512, errbuf);
return -1;
}
// 绑定int类型的, 定义SQL语句时 :1,:2, 定义输出变量
for (iIndex = 0; iIndex < pOutField->nIntNum; iIndex++)
{
if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, iIndex + 1, (dvoid*)&pOutField->naIntValue[iIndex], sizeof(int), SQLT_INT, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf);
return -1;
}
}
// 绑定char *类型的, 定义SQL语句时 :1,:2, 定义输出变量
for (iIndex = 0; iIndex < outputColumn; iIndex++)
{
int n = iIndex + 1;
if (rc = OCIDefineByPos(ociHandle->p_sql, &ociHandle->p_dfn, ociHandle->p_err, n, (dvoid*)&pOutField->caCharValue[iIndex], 1000 * sizeof(char), SQLT_STR, (dvoid*)0, (ub2*)0, (ub2*)0, OCI_DEFAULT))
{
OCIErrorGet((dvoid*)ociHandle->p_err, (ub4)1, (text*)NULL, &errcode, (ub1*)errbuf, (ub4)sizeof(errbuf), OCI_HTYPE_ERROR);
printf("DefineByPos Error of ociHandle->p_sql - %.*s\n", 512, errbuf);
return -1;
}
}
return 0;
}
// 释放Handler
void QuitFreeHandle()
{
// 退出服务器
OCILogoff(ociHandle->p_svc, ociHandle->p_err);
printf("Quit success!\n");
// 释放句柄
OCIHandleFree(ociHandle->p_ser, OCI_HTYPE_SERVER); //释放服务器句柄
OCIHandleFree(ociHandle->p_err, OCI_HTYPE_ERROR); //释放错误句柄
OCIHandleFree(ociHandle->p_usr, OCI_HTYPE_SESSION); //释放事务句柄
OCIHandleFree(ociHandle->p_svc, OCI_HTYPE_SVCCTX); //释放上下文句柄
OCIHandleFree(ociHandle->p_sql, OCI_HTYPE_STMT); //释放SQL语句句柄
}
// 执行类操作
int ExecuteSQL(char* SQL, int valueCount, char** value)
{
int i = 0;
if (i = _ExeSQL(SQL, value, valueCount))
{
QuitFreeHandle();
return -1;
}
return 0;
}
// 有输入参数的查询
int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue)
{
int i = 0, j = 0, ret = 0;
int times = 0, temp = 0;
SqlSelField infield;
SqlSelField outField;
// 初始化参数结构
infield.nCharNum = inputValueCount;
infield.nIntNum = 0;
outField.nCharNum = 0;
outField.nIntNum = 0;
*outputColumn = 0;
*outputValueCount = 0;
for (i = 0; i < inputValueCount; i++)
{
strcpy(infield.caCharValue[i], inputValue[i]);
}
// 执行查询语句
if (ret = _QuerySQL(SQL, &outField, &infield))
{
printf("SQL查询失败!\n");
QuitFreeHandle();
return -1;
}
// 获取结果列数
ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputColumn, (ub4*)0, (ub4)OCI_ATTR_PARAM_COUNT, ociHandle->p_err);
// 提取最后一行,便于去行数
ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_LAST, 0, OCI_DEFAULT);
// 获取结果行数
ret = OCIAttrGet(ociHandle->p_sql, (ub4)OCI_HTYPE_STMT, (dvoid*)outputValueCount, (ub4*)0, (ub4)OCI_ATTR_ROW_COUNT, ociHandle->p_err);
if (*outputValueCount == 0)
return 0;
// 开始分配内存并且存储
ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_FIRST, 0, OCI_DEFAULT);
*outputValue = (char***)calloc((*outputValueCount) + 1, sizeof(char**));
do
{
(*outputValue)[i] = (char**)calloc((*outputColumn) + 1, sizeof(char*));
for (j = 0; j < (*outputColumn); j++)
{
(*outputValue)[i][j] = (char*)calloc(1000, sizeof(char));
strcpy((*outputValue)[i][j], outField.caCharValue[j]);
//printf("outValue[%d][%d] = %s , 地址=%d, 所指向地址= %d\n ",i,j,(*outputValue)[i][j],&(*outputValue)[i][j],(*outputValue)[i][j]);
}
i++;
} while ((ret = OCIStmtFetch2(ociHandle->p_sql, ociHandle->p_err, 1, OCI_FETCH_NEXT, 1, OCI_DEFAULT) != OCI_NO_DATA));
return 0;
}
// 无输入参数的查询
int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue)
{
return QuerySQL(SQL, 0, NULL, outputColumn, outputValueCount, outputValue);
}
// 无参数操作
int ExecuteSQLNoInputParam(char* SQL)
{
return ExecuteSQL(SQL, 0, NULL);
}
// 断开连接
void DisConnServer()
{
if (ociHandle != NULL)
QuitFreeHandle();
}

@ -0,0 +1,98 @@
/*=====================================================================================================================
Copyright(c) 2012 ORIGIN.
Unpublished - All rights reserved
=======================================================================================================================
File description:
Filename: ocilib.h
Module : OCI
This Header file of OCI library Package.
=======================================================================================================================
Date Name Description of Change
1-Feb-2015 Ray Initialize creation
$HISTORY$
=====================================================================================================================*/
#include <oci.h>
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include <malloc.h>
//#include <limits.h>
#define OCI_FAIL 1
#define OCI_OK 0
#ifdef __cplusplus
extern "C"
{
#endif
/**
* .
* @param username - <I>
* @param password - <I>
* @param dbname - <I> SID
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ConnServer(char* username, char* password, char* dbname);
/**
* SQL.
* @param SQL - <I> SQL
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ExecuteSQLNoInputParam(char* SQL);
/**
* SQL.
* @param SQL - <I> SQL
* @param inputValueCount - <I>
* @param inputValue - <I>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ExecuteSQL(char* SQL, int inputValueCount, char** inputValue);
/**
* SQL.
* @param SQL - <I> SQL
* @param outputColumn - <O>
* @param outputValueCount - <O>
* @param outputValue - <O>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue);
/**
* SQL.
* @param SQL - <I> SQL
* @param inputValueCount - <I>
* @param inputValue - <I>
* @param outputColumn - <O>
* @param outputValueCount - <O>
* @param outputValue - <O>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue);
/**
* .
*
* ORACLE
*/
extern void DisConnServer();
#ifdef __cplusplus
}
#endif

@ -0,0 +1,28 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CONNOR_ITK", "CONNOR_ITK\CONNOR_ITK.vcxproj", "{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Debug|x64.ActiveCfg = Debug|x64
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Debug|x64.Build.0 = Debug|x64
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Debug|x86.ActiveCfg = Debug|Win32
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Debug|x86.Build.0 = Debug|Win32
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Release|x64.ActiveCfg = Release|x64
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Release|x64.Build.0 = Release|x64
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Release|x86.ActiveCfg = Release|Win32
{A5936B6A-CCDE-41C6-A5EC-5D8CAF769F7F}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

@ -0,0 +1,674 @@
/* DISABLE check_long_lines */
/*
* $Header: security_src/public/nzerror.h /st_ldap_db11.2/1 2009/07/15 13:57:04 rchahal Exp $
*
* Copyright (c) 1995, 2009, Oracle and/or its affiliates.
* All rights reserved.
*/
/* ENABLE check_long_lines */
/*
NAME
nzerror.h - error numbers for the Oracle Security Server
DESCRIPTION
None.
PUBLIC FUNCTION(S)
None.
PRIVATE FUNCTION(S)
None.
NOTES
A pragma is used to silence olint about the enum value names not being
unique within 7 characters. This limit is being changed to 30.
MODIFIED
rchahal 06/12/06 -
skalyana 01/30/05 -
rchahal 07/16/04 - add cert label
rchahal 07/06/04 -
rchahal 10/15/03 - bug 2513821
rchahal 08/14/03 - new error range (43000 - 43499)
skalyana 08/25/03 - Error changes
rchahal 06/27/03 - RSA errors
rchahal 05/27/03 - convert wallet
skalyana 03/07/03 - Move FIPS errors
rchahal 02/28/03 - bug 2648177
rchahal 01/20/03 - use sltsky
rchahal 11/11/02 - pkcs11 support
skalyana 11/29/02 - Add mutex errors
akoyfman 11/01/02 - adding crl cache
rchahal 10/23/02 - crldp error
rchahal 10/15/02 - fetch crl from ldap
rchahal 10/07/02 - crl support
akoyfman 10/16/02 - Update with SSL PLus 4.2 errors
skalyana 10/04/02 - Certicom SSL Plus 4.2 Upgrade changes
akoyfman 08/06/02 - adding sso wallet errors
akoyfman 07/12/02 - adding secret store errors
skalyana 07/07/02 - Add more errors for FIPS self tests
skalyana 07/01/02 - Add more errors
skalyana 06/03/02 - Add NZ error for self test failure.
ajacobs 02/22/01 - Add some entrust errors
vle 02/09/01 - add error mesg
lkethana 08/11/00 - Extension Errors
lkethana 07/30/00 - add pkcs12 errors
lkethana 06/17/00 - mult cert errors
lkethana 06/11/00 - multiple cert support
rturlapa 03/29/00 - Add error meesage for Entrust Login failure.
rwessman 07/07/99 - Deleted include of sslerrs.h. It caused the RDBMS bu
rwessman 07/02/99 - fixed merge errors
rwessman 07/01/99 - moved NZOS errors to nzerror to make them visible
supriya 12/16/98 - add new error for cert chain.
arswamin 12/04/98 - add NZERROR_NO_MATCHING_PRIVATE_KEY
qdinh 11/12/98 - add NZERROR_VALIDITY_EXPIRED.
arswamin 06/17/98 - add INIT_FAILED
sdange 06/10/98 - change wrong password to bad password
amthakur 06/09/98 - adding error messages
wliau 03/10/97 - Add new error message for snzdfo.c.
rwessman 03/14/97 - Consolidated PL/SQL toolkit errors into generic erro
rwessman 02/26/97 - Added NZERROR_UNSUPPORTED. Corrected values of
errors outside the valid range.
asriniva 03/02/97 - Fix olint warning
rwessman 02/26/97 - Added NZERROR_UNSUPPORTED
rwessman 01/02/97 - Changed PLSQL package errors to be TK_PLSQL to
separate them from the errors generated by the
Oracle interface.
rwessman 12/30/96 - Merged in PL/SQL toolkit errors
sdange 11/14/96 - (Added NZERROR_DECRYPT_FAILED to the enum list)
rwessman 12/02/96 -
rwessman 11/25/96 - Added error messages for PL/SQL functions.
asriniva 10/31/96 - Include oratypes.h
asriniva 10/29/96 - Fix numbering.
asriniva 10/29/96 - Fix error numbers
asriniva 10/29/96 - Correct type-o
asriniva 10/28/96 - Add more TK errors
asriniva 10/28/96 - Convert OKAPI errors to TK errors.
rwessman 10/17/96 - still more OSS TK errors
asriniva 10/16/96 - OKAPI errors
asriniva 10/15/96 - OSSTK errors
rwessman 10/15/96 - Added more OSS TK errors
asriniva 10/09/96 - Add OSSTK errors.
rwessman 09/05/96 - Added errors for PL/SQL functions.
wliau 09/05/96 - correct error numbers.
$Log: $
* Revision 1.26 1996/07/15 23:07:23 wliau
* Added NZERROR_AUTH_SHARED_MEMORY
*
* Revision 1.25 1996/07/01 20:40:15 asriniva
* Finished RSA verify/sign.
*
* Revision 1.24 1996/06/27 20:39:41 rwessman
* Added more errors.
*
* Revision 1.23 1996/05/31 17:33:40 rwessman
* Updated nzerror.h to contain bug # for olint enum bug.
*
* Revision 1.22 1996/05/31 17:12:30 rwessman
* Assigned values to the various errors.
*
* Revision 1.21 1996/05/13 20:46:58 ggilchri
* Added more attribute related error conditions
*
*/
#ifndef NZERROR_ORACLE
# define NZERROR_ORACLE
#ifndef ORATYPES
# include <oratypes.h>
#endif /* ORATYPES */
/*
** Errors - when an error is added here, a message corresponding to the
** error number must be added to the message file.
** New errors must be assigned numbers, otherwise the compiler can assign any
** value that it wants, which may lead to invalid error numbers being
** generated.
** The number range currently assigned to the OSS is 28750 - 29249
** New number range 43000 - 43499
*/
typedef enum nzerror
{
NZERROR_OK = 0,
NZERROR_GENERIC = 28750, /* A catchall for errors */
NZERROR_NO_MEMORY = 28751, /* No more memory */
NZERROR_DATA_SOURCE_INIT_FAILED = 28752, /* Failed to init data source */
NZERROR_DATA_SOURCE_TERM_FAILED = 28753,/* Failed to terminate data source */
NZERROR_OBJECT_STORE_FAILED = 28754, /* Store object in data source failed */
NZERROR_OBJECT_GET_FAILED = 28755,
/* Failed to obtain object from data source */
NZERROR_MEMORY_ALLOC_FAILED = 28756,
/* Callback failed to allocate memory */
NZERROR_MEMORY_ALLOC_0_BYTES = 28757,
/* Attempted to ask for 0 bytes of memory */
NZERROR_MEMORY_FREE_FAILED = 28758,
/* Callback failed to free memory */
NZERROR_FILE_OPEN_FAILED = 28759,
/* Open of file failed */
NZERROR_LIST_CREATION_FAILED = 28760,
/* Creation of list failed */
NZERROR_NO_ELEMENT = 28761,
/* No list element found */
NZERROR_ELEMENT_ADD_FAILED = 28762,
/* Addition of list element failed */
NZERROR_PARAMETER_BAD_TYPE = 28763,
/* Retrieval of an unknown parameter type */
NZERROR_PARAMETER_RETRIEVAL = 28764, /* Retrieval of parameter failed */
NZERROR_NO_LIST = 28765, /* Data method list does not exist */
NZERROR_TERMINATE_FAIL = 28766, /* Failed to terminate */
NZERROR_BAD_VERSION_NUMBER = 28767, /* Bad version number */
NZERROR_BAD_MAGIC_NUMBER = 28768, /* Bad magic number */
NZERROR_METHOD_NOT_FOUND = 28769,
/* Data retrieval method specified does not exist */
NZERROR_ALREADY_INITIALIZED = 28770,
/*The data source is already initialized */
NZERROR_NOT_INITIALIZED = 28771, /* The data source is not initialized */
NZERROR_BAD_FILE_ID = 28772, /* File ID is bad */
NZERROR_WRITE_MAGIC_VERSION = 28773, /* Failed to write magic and version */
NZERROR_FILE_WRITE_FAILED = 28774, /* Failed to write to file */
NZERROR_FILE_CLOSE_FAILED = 28775, /* Failed to close file */
NZERROR_OUTPUT_BUFFER_TOO_SMALL = 28776,
/* The buffer supplied by the caller is too small */
NZERROR_BINDING_CREATION_FAILED = 28777,/* NL failed in creating a binding */
NZERROR_PARAMETER_MALFORMED = 28778, /* A parameter was in a bad format */
NZERROR_PARAMETER_NO_METHOD = 28779,
/* No method was specified for a data type */
NZERROR_BAD_PARAMETER_METHOD = 28780, /* Illegal method for data type */
NZERROR_PARAMETER_NO_DATA = 28781, /* No method specified when required */
NZERROR_NOT_ALLOCATED = 28782, /* Data source is not allocated */
NZERROR_INVALID_PARAMETER = 28783, /* Invalid parameter name */
NZERROR_FILE_NAME_TRANSLATION = 28784,/* Could not translate OSD file name */
NZERROR_NO_SUCH_PARAMETER = 28785, /* Selected parameter is non-existent */
NZERROR_DECRYPT_FAILED = 28786,
/* Encrypted private key decryption failure */
NZERROR_ENCRYPT_FAILED = 28787, /* Private key encryption failed */
NZERROR_INVALID_INPUT = 28788, /* Incorrect input or unknown error */
NZERROR_NAME_TYPE_NOT_FOUND = 28789,
/* Type of name requested is not available */
NZERROR_NLS_STRING_OPEN_FAILED = 28790,
/* Failure to generate an NLS string */
NZERROR_CERTIFICATE_VERIFY = 28791, /* Failed to verify a certificate */
NZERROR_OCI_PLSQL_FAILED = 28792,
/* an OCI call to process some plsql failed */
NZERROR_OCI_BIND_FAILED = 28793,
/* an OCI call to bind an internal var. failed */
NZERROR_ATTRIBUTE_INIT = 28794, /* failed to init role retrieval */
NZERROR_ATTRIBUTE_FINISH_FAILED = 28795,/* Did not complete role retrieval */
NZERROR_UNSUPPORTED_METHOD = 28796, /* Data method specified not supported */
NZERROR_INVALID_KEY_DATA_TYPE = 28797,
/* Invalid data type specified for key */
NZEROR_BIND_SUBKEY_COUNT = 28798,
/* Number of sub-keys to bind does not match count in initialized key */
NZERROR_AUTH_SHARED_MEMORY = 28799,
/* Failed to retreieve authentication information from the shared memory */
NZERROR_RIO_OPEN = 28800, /* RIO Open Failed */
NZERROR_RIO_OBJECT_TYPE = 28801, /* RIO object type invalid */
NZERROR_RIO_MODE = 28802, /* RIO mode invalid */
NZERROR_RIO_IO = 28803, /* RIO io set or numberinvalid */
NZERROR_RIO_CLOSE = 28804, /* RIO close failed */
NZERROR_RIO_RETRIEVE = 28805, /* RIO retrieve failed */
NZERROR_RIO_STORE = 28806, /* RIO store failed */
NZERROR_RIO_UPDATE = 28807, /* RIO update failed */
NZERROR_RIO_INFO = 28808, /* RIO info failed */
NZERROR_RIO_DELETE = 28809, /* RIO delete failed */
NZERROR_KD_CREATE = 28810, /* Key descriptor create failed */
NZERROR_RIO_ACCESS_DESCRIPTOR = 28811, /* access descriptor invalid */
NZERROR_RIO_RECORD = 28812, /* record invalid */
NZERROR_RIO_RECORD_TYPE = 28813, /* record type and AD type not matched */
NZERROR_PLSQL_ORACLE_TO_REAL = 28814,
/* A number passed to PL/SQL could not be converted to real format */
NZERROR_PLSQL_REAL_TO_ORACLE = 28815,
/* A number in machine format could not be converted to Oracle format */
NZERROR_TK_PLSQL_NO_PASSWORD = 28816,
/* A password was not provided to a PL/SQL function */
NZERROR_TK_PLSQL_GENERIC = 28817,
/* A PL/SQL function returned an error */
NZERROR_TK_PLSQL_NO_CONTEXT = 28818,
/* The package context was not specified to a PL/SQL function */
NZERROR_TK_PLSQL_NO_DIST_NAME = 28819,
/* The user's distinguished name was not provided to a PL/SQL function */
NZERROR_TK_PLSQL_NO_STATE = 28820,
/* The state of either a signature or decryption/encryption was not provided */
NZERROR_TK_PLSQL_NO_INPUT = 28821,
/* An input buffer was specified to a PL/SQL function */
NZERROR_TK_PLSQL_NO_SEED = 28822,
/* No seed was specified to the PL/SQL seed initialization function */
NZERROR_TK_PLSQL_NO_BYTES = 28823,
/* Number of bytes was not specified to the PL/SQL random number generator */
NZERROR_TK_INVALID_STATE = 28824,
/* Invalid encryption/decryption/signature state passed */
NZERROR_TK_PLSQL_NO_ENG_FUNC = 28825,
/* No crypto engine function was passed in */
NZERROR_TK_INV_ENG_FUNC = 28826,
/* An invalid crypto engine function was passed in */
NZERROR_TK_INV_CIPHR_TYPE = 28827,
/* An invalid cipher type was passed in */
NZERROR_TK_INV_IDENT_TYPE = 28828,
/* An invalid identity type was specified */
NZERROR_TK_PLSQL_NO_CIPHER_TYPE = 28829,
/* No cipher type was specified */
NZERROR_TK_PLSQL_NO_IDENT_TYPE = 28830,
/* No identity type was specified */
NZERROR_TK_PLSQL_NO_DATA_FMT = 28831,
/* No data unit format was specified */
NZERROR_TK_INV_DATA_FMT = 28832,
/* Invalid data unit format was provided to function */
NZERROR_TK_PLSQL_INSUFF_INFO = 28833,
/* Not enough info (usually parameters) provided to a PL/SQL function */
NZERROR_TK_PLSQL_BUF_TOO_SMALL = 28834,
/* Buffer provided by PL/SQL is too small for data to be returned */
NZERROR_TK_PLSQL_INV_IDENT_DESC = 28835,
/* Identity descriptor not present or too small */
NZERROR_TK_PLSQL_WALLET_NOTOPEN = 28836,
/* Wallet has not been opened yet */
NZERROR_TK_PLSQL_NO_WALLET = 28837,
/* No wallet descriptor specified to PL/SQL function */
NZERROR_TK_PLSQL_NO_IDENTITY = 28838,
/* No identity descriptor specified to PL/SQL function */
NZERROR_TK_PLSQL_NO_PERSONA = 28839,
/* No persona descriptor was specified to PL/SQL function */
NZERROR_TK_PLSQL_WALLET_OPEN = 28840,
/* Wallet was already opened */
NZERROR_UNSUPPORTED = 28841, /* Operation is not supported */
NZERROR_FILE_BAD_PERMISSION = 28842, /* Bad file permission specified */
NZERROR_FILE_OSD_ERROR = 28843, /* OSD error when opening file */
NZERROR_NO_WALLET = 28844, /* cert + privkey + tp files do not exist */
NZERROR_NO_CERTIFICATE_ALERT = 28845, /* no certificate */
NZERROR_NO_PRIVATE_KEY = 28846, /* no private-key */
NZERROR_NO_CLEAR_PRIVATE_KEY_FILE = 28847, /* no clear key-file */
NZERROR_NO_ENCRYPTED_PRIVATE_KEY_FILE = 28848, /* no encrypted priv key */
NZERROR_NO_TRUSTPOINTS = 28849, /* no trustpoints */
NZERROR_NO_CLEAR_TRUSTPOINT_FILE = 28850, /* no clear trustpoints */
NZERROR_NO_ENCRYPTED_TRUSTPOINT_FILE = 28851, /* no encrypted trustpoints */
NZERROR_BAD_PASSWORD = 28852, /* bad password */
NZERROR_INITIALIZATION_FAILED = 28853, /* init failed or
module loading failed */
/******************************* SSL ERRORS ********************************/
/*
* In order to allow SSL errors to be mapped to Oracle errors, space is
* provided here. One Oracle error is provided for each SSL error to make
* error handling easier. A macro is provided to do the conversion.
* NOTE: ANY CHANGE IN SSL ERRORS MUST BE REFLECTED HERE.
* To add an SSL error, use the following formula to calculate the Oracle
* error:
* new_oracle_error = (new_ssl_error - SSLMemoryError) + NZERROR_SSLMemoryErr
* or numerically:
* new_oracle_error = (new_ssl_error - -7000) + 28854
*/
NZERROR_SSLMemoryErr = 28854,
NZERROR_SSLUnsupportedErr = 28855,
NZERROR_SSLOverflowErr = 28856,
NZERROR_SSLUnknownErr = 28857,
NZERROR_SSLProtocolErr = 28858,
NZERROR_SSLNegotiationErr = 28859,
NZERROR_SSLFatalAlert = 28860,
NZERROR_SSLWouldBlockErr = 28861,
NZERROR_SSLIOErr = 28862,
NZERROR_SSLSessionNotFoundErr = 28863,
NZERROR_SSLConnectionClosedGraceful = 28864,
NZERROR_SSLConnectionClosedError = 28865,
NZERROR_ASNBadEncodingErr = 28866,
NZERROR_ASNIntegerTooBigErr = 28867,
NZERROR_X509CertChainInvalidErr = 28868,
NZERROR_X509CertExpiredErr = 28869,
NZERROR_X509NamesNotEqualErr = 28870,
NZERROR_X509CertChainIncompleteErr = 28871,
NZERROR_X509DataNotFoundErr = 28872,
NZERROR_SSLBadParameterErr = 28873,
NZERROR_SSLIOClosedOverrideGoodbyeKiss = 28874,
NZERROR_X509MozillaSGCErr = 28875,
NZERROR_X509IESGCErr = 28876,
NZERROR_ImproperServerCredentials = 28877,
NZERROR_ImproperClientCredentials = 28878,
NZERROR_NoProtocolSideSet = 28879,
NZERROR_setPersonaFailed = 28880,
NZERROR_setCertFailed = 28881,
NZERROR_setVKeyFailed = 28882,
NZERROR_setTPFailed = 28883,
NZERROR_BadCipherSuite = 28884,
NZERROR_NoKeyPairForKeyUsage = 28885,
/* ============>>> ENTRUST ERRORS */
NZERROR_EntrustLoginFailed = 28890,
NZERROR_EntrustGetInfoFailed = 28891,
NZERROR_EntrustLoadCertificateFailed = 28892,
NZERROR_EntrustGetNameFailed = 28893,
/* ============>>> NZERRORS CONTINUED */
NZERROR_CertNotInstalled = 29000,
NZERROR_ServerDNMisMatched = 29002,
NZERROR_ServerDNMisConfigured = 29003,
/* ============>>> PKI VENDORS ERRORS 29050 - 29099 */
/* ============>>> SSL Errors CONTINUED */
NZERROR_CIC_ERR_SSL_ALERT_CB_FAILURE = 29004,
NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE = 29005,
NZERROR_CIC_ERR_SSL_BAD_CERTIFICATE_REQUEST = 29006,
NZERROR_CIC_ERR_SSL_BAD_CLEAR_KEY_LEN = 29007,
NZERROR_CIC_ERR_SSL_BAD_DHPARAM_KEY_LENGTH = 29008,
NZERROR_CIC_ERR_SSL_BAD_ENCRYPTED_KEY_LEN = 29009,
NZERROR_CIC_ERR_SSL_BAD_EXPORT_KEY_LENGTH = 29010,
NZERROR_CIC_ERR_SSL_BAD_FINISHED_MESSAGE = 29011,
NZERROR_CIC_ERR_SSL_BAD_KEY_ARG_LEN = 29012,
NZERROR_CIC_ERR_SSL_BAD_MAC = 29013,
NZERROR_CIC_ERR_SSL_BAD_MAX_FRAGMENT_LENGTH_EXTENSION = 29014,
NZERROR_CIC_ERR_SSL_BAD_MESSAGE_LENGTH = 29015,
NZERROR_CIC_ERR_SSL_BAD_PKCS1_PADDING = 29016,
NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_LENGTH = 29017,
NZERROR_CIC_ERR_SSL_BAD_PREMASTER_SECRET_VERSION = 29018,
NZERROR_CIC_ERR_SSL_BAD_PROTOCOL_VERSION = 29019,
NZERROR_CIC_ERR_SSL_BAD_RECORD_LENGTH = 29020,
NZERROR_CIC_ERR_SSL_BAD_SECRET_KEY_LEN = 29021,
NZERROR_CIC_ERR_SSL_BAD_SIDE = 29022,
NZERROR_CIC_ERR_SSL_BUFFERS_NOT_EMPTY = 29023,
NZERROR_CIC_ERR_SSL_CERTIFICATE_VALIDATE_FAILED = 29024,
NZERROR_CIC_ERR_SSL_CERT_CHECK_CALLBACK = 29025,
NZERROR_CIC_ERR_SSL_DECRYPT_FAILED = 29026,
NZERROR_CIC_ERR_SSL_ENTROPY_COLLECTION = 29027,
NZERROR_CIC_ERR_SSL_FAIL_SERVER_VERIFY = 29028,
NZERROR_CIC_ERR_SSL_HANDSHAKE_ALREADY_COMPLETED = 29029,
NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUESTED = 29030,
NZERROR_CIC_ERR_SSL_HANDSHAKE_REQUIRED = 29031,
NZERROR_CIC_ERR_SSL_INCOMPLETE_IDENTITY = 29032,
NZERROR_CIC_ERR_SSL_INVALID_PFX = 29033,
NZERROR_CIC_ERR_SSL_NEEDS_CIPHER_OR_CLIENTAUTH = 29034,
NZERROR_CIC_ERR_SSL_NEEDS_PRNG = 29035,
NZERROR_CIC_ERR_SSL_NOT_SUPPORTED = 29036,
NZERROR_CIC_ERR_SSL_NO_CERTIFICATE = 29037,
NZERROR_CIC_ERR_SSL_NO_MATCHING_CERTIFICATES = 29038,
NZERROR_CIC_ERR_SSL_NO_MATCHING_CIPHER_SUITES = 29039,
NZERROR_CIC_ERR_SSL_NO_SUPPORTED_CIPHER_SUITES = 29040,
NZERROR_CIC_ERR_SSL_NULL_CB = 29041,
NZERROR_CIC_ERR_SSL_READ_BUFFER_NOT_EMPTY = 29042,
NZERROR_CIC_ERR_SSL_READ_REQUIRED = 29043,
NZERROR_CIC_ERR_SSL_RENEGOTIATION_ALREADY_REQUESTED = 29044,
NZERROR_CIC_ERR_SSL_RENEGOTIATION_REFUSED = 29045,
NZERROR_CIC_ERR_SSL_RESUMABLE_SESSION = 29046,
NZERROR_CIC_ERR_SSL_TLS_EXTENSION_MISMATCH = 29047,
NZERROR_CIC_ERR_SSL_UNEXPECTED_MSG = 29048,
NZERROR_CIC_ERR_SSL_UNKNOWN_RECORD = 29049,
NZERROR_CIC_ERR_SSL_UNSUPPORTED_CLIENT_AUTH_MODE = 29050,
NZERROR_CIC_ERR_SSL_UNSUPPORTED_PUBKEY_TYPE = 29051,
NZERROR_CIC_ERR_SSL_WRITE_BUFFER_NOT_EMPTY = 29052,
NZERROR_CIC_ERR_PKCS12_MISSING_ALG = 29053,
NZERROR_CIC_ERR_PKCS_AUTH_FAILED = 29054,
NZERROR_CIC_ERR_PKCS_BAD_CONTENT_TYPE = 29055,
NZERROR_CIC_ERR_PKCS_BAD_INPUT = 29056,
NZERROR_CIC_ERR_PKCS_BAD_PADDING = 29057,
NZERROR_CIC_ERR_PKCS_BAD_SN = 29058,
NZERROR_CIC_ERR_PKCS_BAD_SN_LENGTH = 29059,
NZERROR_CIC_ERR_PKCS_BAD_VERSION = 29060,
NZERROR_CIC_ERR_PKCS_BASE = 29061,
NZERROR_CIC_ERR_PKCS_FIELD_NOT_PRESENT = 29062,
NZERROR_CIC_ERR_PKCS_NEED_CERTVAL = 29063,
NZERROR_CIC_ERR_PKCS_NEED_PASSWORD = 29064,
NZERROR_CIC_ERR_PKCS_NEED_PKC = 29065,
NZERROR_CIC_ERR_PKCS_NEED_PRV_KEY = 29066,
NZERROR_CIC_ERR_PKCS_NEED_TRUSTED = 29067,
NZERROR_CIC_ERR_PKCS_UNSUPPORTED_CERT_FORMAT = 29068,
NZERROR_CIC_ERR_PKCS_UNSUP_PRVKEY_TYPE = 29069,
NZERROR_CIC_ERR_CODING_BAD_PEM = 29070,
NZERROR_CIC_ERR_CODING_BASE = 29071,
NZERROR_CIC_ERR_DER_BAD_ENCODING = 29072,
NZERROR_CIC_ERR_DER_BAD_ENCODING_LENGTH = 29073,
NZERROR_CIC_ERR_DER_BASE = 29074,
NZERROR_CIC_ERR_DER_ELEMENT_TOO_LONG = 29075,
NZERROR_CIC_ERR_DER_INDEFINITE_LENGTH = 29076,
NZERROR_CIC_ERR_DER_NO_MORE_ELEMENTS = 29077,
NZERROR_CIC_ERR_DER_OBJECT_TOO_LONG = 29078,
NZERROR_CIC_ERR_DER_TAG_SIZE = 29079,
NZERROR_CIC_ERR_DER_TIME_OUT_OF_RANGE = 29080,
NZERROR_CIC_ERR_DER_UNUSED_BITS_IN_BIT_STR = 29081,
NZERROR_CIC_ERR_GENERAL_BASE = 29082,
NZERROR_CIC_ERR_HASH_BASE = 29083,
NZERROR_CIC_ERR_ILLEGAL_PARAM = 29084,
NZERROR_CIC_ERR_MEM_NOT_OURS = 29085,
NZERROR_CIC_ERR_MEM_OVERRUN = 29086,
NZERROR_CIC_ERR_MEM_UNDERRUN = 29087,
NZERROR_CIC_ERR_MEM_WAS_FREED = 29088,
NZERROR_CIC_ERR_NOT_FOUND = 29090,
NZERROR_CIC_ERR_NO_PTR = 29091,
NZERROR_CIC_ERR_TIMEOUT = 29092,
NZERROR_CIC_ERR_UNIT_MASK = 29093,
NZERROR_CIC_ERR_BAD_CTX = 29094,
NZERROR_CIC_ERR_BAD_INDEX = 29095,
NZERROR_CIC_ERR_BAD_LENGTH = 29096,
NZERROR_CIC_ERR_CODING_BAD_ENCODING = 29097,
NZERROR_CIC_ERR_SSL_NO_CLIENT_AUTH_MODES = 29098,
/* ============>>> PKCS12 error 29100 - 29149 */
NZERROR_LOCKEYID_CREATE_FAILED = 29100,
NZERROR_P12_ADD_PVTKEY_FAILED = 29101,
NZERROR_P12_ADD_CERT_FAILED = 29102,
NZERROR_P12_WLT_CREATE_FAILED = 29103,
NZERROR_P12_ADD_CERTREQ_FAILED = 29104,
NZERROR_P12_WLT_EXP_FAILED = 29105,
NZERROR_P12_WLT_IMP_FAILED = 29106,
NZERROR_P12_CREATE_FAILED = 29107,
NZERROR_P12_DEST_FAILED = 29107,
NZERROR_P12_RAND_ERROR = 29108,
NZERROR_P12_PVTKEY_CRT_FAILED = 29109,
NZERROR_P12_INVALID_BAG = 29110,
NZERROR_P12_INVALID_INDEX = 29111,
NZERROR_P12_GET_CERT_FAILED = 29112,
NZERROR_P12_GET_PVTKEY_FAILED = 29113,
NZERROR_P12_IMP_PVTKEY_FAILED = 29114,
NZERROR_P12_EXP_PVTKEY_FAILED = 29115,
NZERROR_P12_GET_ATTRIB_FAILED = 29116,
NZERROR_P12_ADD_ATTRIB_FAILED = 29117,
NZERROR_P12_CRT_ATTRIB_FAILED = 29118,
NZERROR_P12_IMP_CERT_FAILED = 29119,
NZERROR_P12_EXP_CERT_FAILED = 29120,
NZERROR_P12_ADD_SECRET_FAILED = 29121,
NZERROR_P12_ADD_PKCS11INFO_FAILED = 29122,
NZERROR_P12_GET_PKCS11INFO_FAILED = 29123,
NZERROR_P12_MULTIPLE_PKCS11_LIBNAME = 29124,
NZERROR_P12_MULTIPLE_PKCS11_TOKENLABEL = 29125,
NZERROR_P12_MULTIPLE_PKCS11_TOKENPASSPHRASE = 29126,
NZERROR_P12_UNKNOWN_PKCS11INFO = 29127,
NZERROR_P12_PKCS11_LIBNAME_NOT_SET = 29128,
NZERROR_P12_PKCS11_TOKENLABEL_NOT_SET = 29129,
NZERROR_P12_PKCS11_TOKENPASSPHRASE_NOT_SET = 29130,
NZERROR_P12_MULTIPLE_PKCS11_CERTLABEL = 29131,
/* ===========>>> SSL Errors CONTINUED 29135 - 29139 */
NZERROR_CIC_ERR_RANDOM = 29135,
NZERROR_CIC_ERR_SMALL_BUFFER = 29136,
NZERROR_CIC_ERR_SSL_BAD_CONTEXT = 29137,
/* ==========>>> Mutex Errors 29138 - 29139 */
NZERROR_MUTEX_INITIALIZE_FAILED = 29138,
NZERROR_MUTEX_DESTROY_FAILED = 29139,
/* ============>>> EXTENSIONS Errors 29140 - 29149 */
NZERROR_BS_CERTOBJ_CREAT_FAILED = 29140,
NZERROR_BS_DER_IMP_FAILED = 29141,
/* ============>>> FIPS ERRORS 29150 - 29175 */
NZERROR_DES_SELF_TEST_FAILED = 29150,
NZERROR_3DES_SELF_TEST_FAILED = 29151,
NZERROR_SHA_SELF_TEST_FAILED = 29152,
NZERROR_RSA_SELF_TEST_FAILED = 29153,
NZERROR_DRNG_SELF_TEST_FAILED = 29154,
NZERROR_CKEYPAIR_SELF_TEST_FAILED = 29155,
NZERROR_CRNG_SELF_TEST_FAILED = 29156,
NZERROR_FIPS_PATHNAME_ERROR = 29157,
NZERROR_FIPS_LIB_OPEN_FAILED = 29158,
NZERROR_FIPS_LIB_READ_ERROR = 29159,
NZERROR_FIPS_LIB_DIFFERS = 29160,
NZERROR_DAC_SELF_TEST_FAILED = 29161,
NZERROR_NONFIPS_CIPHERSUITE = 29162,
NZERROR_VENDOR_NOT_SUPPORTED_FIPS_MODE = 29163,
NZERROR_EXTERNAL_PKCS12_NOT_SUPPORTED_FIPS_MODE = 29164,
NZERROR_AES_SELF_TEST_FAILED = 29165,
/* ============>>> CRL ERRORS 29176 - 29200 */
NZERROR_CRL_SIG_VERIFY_FAILED = 29176, /*CRL signature verification failed*/
NZERROR_CERT_NOT_IN_CRL = 29177,
/*Cert is not in CRL - cert is not revoked*/
NZERROR_CERT_IN_CRL = 29178, /*Cert is in CRL - cert is revoked*/
NZERROR_CERT_IN_CRL_CHECK_FAILED = 29179, /*Cert revocation check failed */
NZERROR_INVALID_CERT_STATUS_PROTOCOL = 29180,
NZERROR_LDAP_OPEN_FAILED = 29181, /* ldap_open failed */
NZERROR_LDAP_BIND_FAILED = 29182, /* ldap_bind failed */
NZERROR_LDAP_SEARCH_FAILED = 29183, /* ldap_search failed */
NZERROR_LDAP_RESULT_FAILED = 29184, /* ldap_result failed */
NZERROR_LDAP_FIRSTATTR_FAILED = 29185, /* ldap_first_attribute failed */
NZERROR_LDAP_GETVALUESLEN_FAILED = 29186, /* ldap_get_values_len failed */
NZERROR_LDAP_UNSUPPORTED_VALMEC = 29187,
/* unsupported validation mechanism */
NZERROR_LDAP_COUNT_ENTRIES_FAILED = 29188,/* ldap_count_entries failed */
NZERROR_LDAP_NO_ENTRY_FOUND = 29189, /* No entry found in OID */
NZERROR_LDAP_MULTIPLE_ENTRIES_FOUND = 29190, /* Multiple entries in OID*/
NZERROR_OID_INFO_NOT_SET = 29191,
NZERROR_LDAP_VALMEC_NOT_SET = 29192,
/* Validation mechanism not set in OID*/
NZERROR_CRLDP_NO_CRL_FOUND = 29193,
/* No CRL found using CRLDP mechanism */
NZERROR_CRL_NOT_IN_CACHE = 29194, /* No CRL found in the cache*/
NZERROR_CRL_EXPIRED = 29195, /* CRL nextUpdate time is in the past */
/* ============>>> ADD ERRORS HERE -- NOTE DECREASING numbers */
NZERROR_DN_MATCH = 29222, /* for nztCompareDN */
NZERROR_CERT_CHAIN_CREATION = 29223, /* unable to create a cert chain
* with the existing TPs for the
* cert to be installed.
*/
NZERROR_NO_MATCHING_CERT_REQ = 29224, /* No matching cert_req was
* found the corresponding to
* the privatekey which
* matches the cert to be
* installed */
NZERROR_CERT_ALREADY_INSTALLED = 29225, /* we are attempting to
* install a cert again into
* a persona which already
* has it installed.
*/
NZERROR_NO_MATCHING_PRIVATE_KEY = 29226, /* could not find a matching
* persona-private(privatekey) in
* the Persona, for the given
* cert(public key).
*/
NZERROR_VALIDITY_EXPIRED = 29227, /* certificate validity date expired */
NZERROR_TK_BYTES_NEEDED = 29228, /* Couldn't determine # of bytes needed */
NZERROR_TK_BAD_MAGIC_NUMBER = 29229,
/* Magic number found in header does not match expected */
NZERROR_TK_BAD_HEADER_LENGTH = 29230,
/* Header length passed in not sufficient for message header */
NZERROR_TK_CE_INIT = 29231, /* Crypto engine failed to initialize */
NZERROR_TK_CE_KEYINIT = 29232, /* Crypto engine key initialization failed */
NZERROR_TK_CE_ENCODE_KEY = 29233, /* Count not encode key object */
NZERROR_TK_CE_DECODE_KEY = 29234, /* Could not decode key into object */
NZERROR_TK_CE_GEYKEYINFO = 29235, /* Crypto engine failed to get key info */
NZERROR_TK_SEED_RANDOM = 29236, /* Couldn't seed random number generator */
NZERROR_TK_CE_ALGFINISH = 29237, /* Couldn't finish algorithm */
NZERROR_TK_CE_ALGAPPLY = 29238, /* Couldn't apply algorithm to data */
NZERROR_TK_CE_ALGINIT = 29239, /* Couldn't init CE for algorithm */
NZERROR_TK_ALGORITHM = 29240, /* Have no idea what algorithm you want */
NZERROR_TK_CANNOT_GROW = 29241, /* Cannot grow output buffer block */
NZERROR_TK_KEYSIZE = 29242, /* Key not large enough for data */
NZERROR_TK_KEYTYPE = 29243, /* Unknown key type. */
NZERROR_TK_PLSQL_NO_WRL = 29244,
/* Wallet resource locator not specified to PL/SQL function */
NZERROR_TK_CE_FUNC = 29245, /* Unknown crypto engine function */
NZERROR_TK_TDU_FORMAT = 29246, /* Unknown TDU format */
NZERROR_TK_NOTOPEN = 29247, /* Object must be open */
NZERROR_TK_WRLTYPE = 29248, /* Bad WRL type */
NZERROR_TK_CE_STATE = 29249, /* Bad state specified for the crypto engine */
/* After 29249, use error numbers in block 43000 - 43499 */
NZERROR_PKCS11_LIBRARY_NOT_FOUND = 43000, /* PKCS #11 library not found */
NZERROR_PKCS11_TOKEN_NOT_FOUND = 43001,
/* can't find token with given label*/
NZERROR_PKCS11_BAD_PASSPHRASE = 43002, /* passphrase is incorrect/expired */
NZERROR_PKCS11_GET_FUNC_LIST = 43003, /* C_GetFunctionList returned error */
NZERROR_PKCS11_INITIALIZE = 43004, /* C_Initialize returned error */
NZERROR_PKCS11_NO_TOKENS_PRESENT = 43005, /* No tokens present */
NZERROR_PKCS11_GET_SLOT_LIST = 43006, /* C_GetSlotList returned error */
NZERROR_PKCS11_GET_TOKEN_INFO = 43008, /* C_GetTokenInfo returned error */
NZERROR_PKCS11_SYMBOL_NOT_FOUND = 43009, /* Symbol not found in PKCS11 lib */
NZERROR_PKCS11_TOKEN_LOGIN_FAILED = 43011, /* Token login failed */
NZERROR_PKCS11_CHANGE_PROVIDERS_ERROR = 43013, /* Change providers error */
NZERROR_PKCS11_GET_PRIVATE_KEY_ERROR = 43014,
/* Error trying to find private key on token */
NZERROR_PKCS11_CREATE_KEYPAIR_ERROR = 43015, /* Key pair gen error */
NZERROR_PKCS11_WALLET_CONTAINS_P11_INFO = 43016, /* Wallet already contains
pkcs11 info */
NZERROR_PKCS11_NO_CERT_ON_TOKEN = 43017, /* No cert found on token */
NZERROR_PKCS11_NO_USER_CERT_ON_TOKEN = 43018, /*No user cert found on token*/
NZERROR_PKCS11_NO_CERT_ON_TOKEN_WITH_GIVEN_LABEL = 43019, /*No cert found on token with given certificate label.*/
NZERROR_PKCS11_MULTIPLE_CERTS_ON_TOKEN_WITH_GIVEN_LABEL = 43020, /*Multiple certs found on token with given certificate label.*/
NZERROR_PKCS11_CERT_WITH_LABEL_NOT_USER_CERT = 43021, /*Cert with given cert is not a user cert because no corresponding pvt key found on token */
/* RSA ERRORS 43050 - 43059 */
NZERROR_BIND_SERVICE_ERROR = 43050, /* C_BindService returned error */
NZERROR_CREATE_KEY_OBJ_ERROR = 43051, /* B_CreateKeyObject returned error */
NZERROR_GET_CERT_FIELDS = 43052, /* C_GetCertFields returned error */
NZERROR_CREATE_PKCS10_OBJECT = 43053,
/* C_CreatePKCS10Object returned error */
NZERROR_SET_PKCS10_FIELDS = 43054, /* C_SetPKCS10Fields returned error */
NZERROR_SIGN_CERT_REQUEST = 43055, /* C_SignCertRequest returned error */
NZERROR_GET_PKCS10_DER = 43056, /* C_GetPKCS10DER returned error */
NZERROR_INITIALIZE_CERTC = 43057, /* C_InitializeCertC returned error */
NZERROR_INSERT_PRIVATE_KEY = 43058, /* C_InsertPrivateKey returned error */
NZERROR_RSA_ERROR = 43059, /* RSA error. See trace output */
/* slts ERRORS 43060 - 43069 */
NZERROR_SLTSCTX_INIT_FAILED = 43060, /* sltsini() returned error */
NZERROR_SLTSKYC_FAILED = 43061, /* sltskyc() returned error */
NZERROR_SLTSCTX_TERM_FAILED = 43062, /* sltster() returned error */
NZERROR_SLTSKYS_FAILED = 43063, /* sltskys() returned error */
NZERROR_INVALID_HEADER_LENGTH = 43070, /* bad sso header length */
NZERROR_WALLET_CONTAINS_USER_CREDENTIALS = 43071, /* wallet not empty */
NZERROR_CANNOT_MODIFY_AL = 43072, /* Cannot modify AL wallet */
NZERROR_FILE_LOCK_FAILED = 43073, /* Cannot lock wallet file */
NZERROR_CSF_ALIAS_INVALID = 43100, /* alias is invalid */
NZERROR_CSF_KEY_INVALID = 43101, /* key invalid */
NZERROR_CSF_CRED_NOT_SUPPORTED = 43102, /* only pwd cred supported */
NZERROR_CSF_HOSTNAME = 43103, /* hostname error */
NZERROR_CSF_XML = 43104, /* XmlCreate error. See trace */
NZERROR_CSF_WALLET_NOT_SPECIFIED = 43105, /* no wallet specified */
NZERROR_CSF_MAP_NOT_IN_STORE = 43106, /* map does not exist in store */
NZERROR_CSF_KEY_NOT_IN_STORE = 43107, /* key does not exist in store */
NZERROR_CSF_ENTRY_EXISTS = 43108, /* entry with map/key exists */
NZERROR_LX_ERROR = 43120, /* lx api returned error */
NZERROR_LAST_ERROR = 43499, /* Last available error */
/* MAXIMUM ERROR NUMBER IS 43499 */
/*
* DO NOT JUST INSERT NEW ERRORS IN ANY OLD PLACE. New errors should be
* added such the current error retains their integer values. Duplicate
* values will cause compiler errors.
*/
NZERROR_THIS_MUST_BE_LAST
} nzerror;
/*
* Macro to convert SSL errors to Oracle errors. As SSL errors are negative
* and Oracle numbers are positive, the following needs to be done.
* 1. The base error number, which is the highest, is added to the
* SSL error to get the index into the number range.
* 2. The result is added to the base Oracle number to get the Oracle error.
*/
#define NZERROR_SSL_TO_ORACLE(ssl_error_) \
((ssl_error_ == SSLNoErr) \
? NZERROR_OK \
: (nzerror) ((ssl_error_ - SSLMemoryErr) + (uword) NZERROR_SSLMemoryErr))
#endif /* NZERROR_ORACLE */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,78 @@
/* Copyright (c) 2000, 2002, Oracle Corporation. All rights reserved. */
/*
NAME
occi.h - Oracle C++ Interface header files.
DESCRIPTION
<short description of facility this file declares/defines>
RELATED DOCUMENTS
<note any documents related to this facility>
EXPORT FUNCTION(S)
<external functions declared for use outside package - one-line
descriptions>
INTERNAL FUNCTION(S)
<other external functions declared - one-line descriptions>
EXAMPLES
NOTES
<other useful comments, qualifications, etc.>
MODIFIED (MM/DD/YY)
vvinay 08/19/02 -
aahluwal 06/03/02 - bug 2360115
gayyappa 01/03/01 - removed inclusions before occiCommon.h
kmohan 04/11/00 - include oci.h and occiCommon.h also
rkasamse 04/03/00 - header file for all the OCCI classes
rkasamse 04/03/00 - Creation
*/
#ifndef OCCI_ORACLE
# define OCCI_ORACLE
#ifndef OCCICOMMON_ORACLE
#include <occiCommon.h>
#endif
#ifndef OCCIDATA_ORACLE
#include <occiData.h>
#endif
#ifndef OCCICONTROL_ORACLE
#include <occiControl.h>
#endif
#ifndef OCCIOBJECTS_ORACLE
#include <occiObjects.h>
#endif
#ifndef OCCIAQ_ORACLE
#include <occiAQ.h>
#endif
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
#endif /* OCCI_ORACLE */

@ -0,0 +1,374 @@
/* Copyright (c) 2002, 2005, Oracle. All rights reserved. */
/*
NAME
occiAQ.h - Header file for occi AQ classes
DESCRIPTION
Class declarations for Producer, Consumer, Message, Agent
Listener, Subscription
RELATED DOCUMENTS
<note any documents related to this facility>
EXPORT FUNCTION(S)
<external functions declared for use outside package - one-line
descriptions>
INTERNAL FUNCTION(S)
<other external functions declared - one-line descriptions>
EXAMPLES
NOTES
<other useful comments, qualifications, etc.>
MODIFIED (MM/DD/YY)
cparampa 10/12/02 - creation
*/
#ifndef _olint /* disable olint check */
#ifndef OCCIAQ_ORACLE
# define OCCIAQ_ORACLE
#ifndef OCCICOMMON_ORACLE
#include <occiCommon.h>
#endif
namespace oracle {
namespace occi {
namespace aq{
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
class Message
{
public:
enum MessageState
{
MSG_READY = OCI_MSG_READY,
MSG_WAITING = OCI_MSG_WAITING,
MSG_PROCESSED = OCI_MSG_PROCESSED,
MSG_EXPIRED = OCI_MSG_EXPIRED
};
enum PayloadType
{
RAW,
ANYDATA,
OBJECT
};
Message( const Environment *env );
Message( const Message& rhs);
~Message();
void operator=(const Message& rhs);
int getAttemptsToDequeue() const ;
void setCorrelationId( const OCCI_STD_NAMESPACE::string& corr_id ) ;
OCCI_STD_NAMESPACE::string getCorrelationId() const ;
void setDelay( int delay ) ;
int getDelay() const ;
Date getMessageEnqueuedTime() const ;
void setExceptionQueueName( const OCCI_STD_NAMESPACE::string& queue ) ;
OCCI_STD_NAMESPACE::string getExceptionQueueName() const ;
void setExpiration( int exp ) ;
int getExpiration() const ;
MessageState getMessageState() const ;
void setPriority( int priority ) ;
int getPriority() const ;
void setRecipientList( OCCI_STD_NAMESPACE::vector<Agent>& ag_list ) ;
void setSenderId( const Agent& sender ) ;
Agent getSenderId() const ;
void setOriginalMessageId( const Bytes& queue ) ;
Bytes getOriginalMessageId() const ;
void setNull();
bool isNull() const;
void setBytes( const Bytes& bytes);
void setObject( PObject* pobj);
void setAnyData( const AnyData& any);
Bytes getBytes() const ;
PObject *getObject() ;
AnyData getAnyData() const ;
PayloadType getPayloadType( ) const;
private:
Ptr<MessageImpl> ptr;
OCIAQMsgProperties* getOCIMsgProperties() const;
Message( const Environment *env, const Connection *con,
OCIAQMsgProperties *msgprop, void *data, unsigned int dataLen,
bool isNull, PayloadType pType);
friend class ConsumerImpl;
friend class ProducerImpl;
friend class NotifyResult;
};
class Producer
{
public:
enum EnqueueSequence
{
ENQ_BEFORE = OCI_ENQ_BEFORE,
ENQ_TOP = OCI_ENQ_TOP
};
enum Visibility
{
ENQ_IMMEDIATE = OCI_ENQ_IMMEDIATE,
ENQ_ON_COMMIT = OCI_ENQ_ON_COMMIT
};
Producer( const Connection *conn );
Producer( const Connection *conn,
const OCCI_STD_NAMESPACE::string& queue );
Producer( const Producer& rhs);
~Producer();
void operator=(const Producer& prod);
void setRelativeMessageId( const Bytes& msgid );
Bytes getRelativeMessageId() const;
void setSequenceDeviation( EnqueueSequence option );
EnqueueSequence getSequenceDeviation() const;
void setVisibility( Visibility option );
Visibility getVisibility() const;
void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
OCCI_STD_NAMESPACE::string getQueueName() const;
void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
OCCI_STD_NAMESPACE::string getTransformation() const;
Bytes send( Message& msg, const OCCI_STD_NAMESPACE::string& queue );
Bytes send( Message& msg );
void setNull();
bool isNull() const;
private:
Ptr<ProducerImpl> ptr;
};
class Consumer
{
public:
enum DequeueMode
{
DEQ_BROWSE = OCI_DEQ_BROWSE,
DEQ_LOCKED = OCI_DEQ_LOCKED,
DEQ_REMOVE = OCI_DEQ_REMOVE,
DEQ_REMOVE_NODATA = OCI_DEQ_REMOVE_NODATA
};
enum Navigation
{
DEQ_FIRST_MSG = OCI_DEQ_FIRST_MSG,
DEQ_NEXT_TRANSACTION = OCI_DEQ_NEXT_TRANSACTION,
DEQ_NEXT_MSG = OCI_DEQ_NEXT_MSG
};
enum Visibility
{
DEQ_IMMEDIATE = OCI_DEQ_IMMEDIATE,
DEQ_ON_COMMIT = OCI_DEQ_ON_COMMIT
};
enum
{
DEQ_WAIT_FOREVER = OCI_DEQ_WAIT_FOREVER,
DEQ_NO_WAIT = OCI_DEQ_NO_WAIT
};
Consumer( const Connection *conn );
Consumer( const Connection * conn, const Agent& agent);
Consumer( const Connection *conn,
const OCCI_STD_NAMESPACE::string& queue );
Consumer(const Consumer& con);
~Consumer();
void operator=(const Consumer& con);
void setAgent(const Agent& agent);
void setConsumerName( const OCCI_STD_NAMESPACE::string& name );
OCCI_STD_NAMESPACE::string getConsumerName() const;
void setCorrelationId( const OCCI_STD_NAMESPACE::string& cor_id );
OCCI_STD_NAMESPACE::string getCorrelationId() const;
void setDequeueMode( DequeueMode mode );
DequeueMode getDequeueMode() const;
void setMessageIdToDequeue( const Bytes& msgid );
Bytes getMessageIdToDequeue() const;
void setPositionOfMessage( Navigation pos );
Navigation getPositionOfMessage() const;
void setVisibility( Visibility option );
Visibility getVisibility() const;
void setWaitTime( unsigned int wait );
unsigned int getWaitTime() const;
void setQueueName( const OCCI_STD_NAMESPACE::string& queue );
OCCI_STD_NAMESPACE::string getQueueName() const;
void setTransformation( const OCCI_STD_NAMESPACE::string& fName);
OCCI_STD_NAMESPACE::string getTransformation() const;
Message receive( Message::PayloadType pType,
const OCCI_STD_NAMESPACE::string& type="",
const OCCI_STD_NAMESPACE::string& schema="");
void setNull();
bool isNull() const;
private:
Ptr<ConsumerImpl> ptr;
};
class Agent
{
public:
Agent( const Environment *env );
Agent( const Environment *env,
const OCCI_STD_NAMESPACE::string& name,
const OCCI_STD_NAMESPACE::string& address,
unsigned int protocol=0 ) ;
Agent(const Agent& a);
~Agent() ;
void operator=(const Agent& a);
void setName( const OCCI_STD_NAMESPACE::string& name );
OCCI_STD_NAMESPACE::string getName() const;
void setAddress( const OCCI_STD_NAMESPACE::string& addr );
OCCI_STD_NAMESPACE::string getAddress() const;
void setProtocol(unsigned int protocol = 0);
unsigned int getProtocol() const;
void setNull();
bool isNull() const;
OCIAQAgent* getOCIAQAgent() const;
private:
Ptr<AgentImpl> ptr;
Agent( const Environment *env, OCIAQAgent *rhs, bool toFree = false );
friend class Listener;
friend class MessageImpl;
};
class Listener
{
public:
Listener( const Connection *conn );
Listener( const Connection *conn,
OCCI_STD_NAMESPACE::vector<Agent> &agList,
int waitTime=0 );
~Listener();
Agent listen();
void setAgentList(OCCI_STD_NAMESPACE::vector<Agent> &agList);
void setTimeOutForListen(int waitTime);
OCCI_STD_NAMESPACE::vector<Agent> getAgentList() const;
int getTimeOutForListen() const;
private:
const ConnectionImpl *conn;
OCIAQAgent** agentList;
unsigned int numAgents;
int timeOut;
void *listenerExt;
};
class Subscription
{
public:
enum Presentation
{
PRES_DEFAULT = OCI_SUBSCR_PRES_DEFAULT,
PRES_XML = OCI_SUBSCR_PRES_XML
};
enum Protocol
{
PROTO_CBK = OCI_SUBSCR_PROTO_OCI,
PROTO_MAIL = OCI_SUBSCR_PROTO_MAIL,
PROTO_SERVER = OCI_SUBSCR_PROTO_SERVER,
PROTO_HTTP = OCI_SUBSCR_PROTO_HTTP
};
enum Namespace
{
NS_ANONYMOUS = OCI_SUBSCR_NAMESPACE_ANONYMOUS,
NS_AQ = OCI_SUBSCR_NAMESPACE_AQ
};
Subscription(const Environment* env);
Subscription(const Environment* env, OCISubscription* sub);
Subscription(const Subscription& sub);
~Subscription();
void operator=(const Subscription& sub);
unsigned int getDatabaseServersCount() const;
void setDatabaseServerNames(
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>& dbsrv);
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string>
getDatabaseServerNames() const ;
void setNotifyCallback(unsigned int (*callback)(Subscription& sub,
NotifyResult *nr));
unsigned int (*getNotifyCallback() const)(Subscription& sub,
NotifyResult *nr);
void setCallbackContext(void* ctx);
void* getCallbackContext() const;
void setSubscriptionName(const OCCI_STD_NAMESPACE::string& name);
OCCI_STD_NAMESPACE::string getSubscriptionName() const ;
void setSubscriptionNamespace(Namespace nameSpace);
Namespace getSubscriptionNamespace() const ;
void setPayload(const Bytes& payload);
Bytes getPayload() const ;
void setRecipientName( const OCCI_STD_NAMESPACE::string& name);
OCCI_STD_NAMESPACE::string getRecipientName() const;
void setPresentation( Presentation pres) ;
Presentation getPresentation() const ;
void setProtocol( Protocol prot) ;
Protocol getProtocol() const ;
OCISubscription* getOCISubscription() const;
void setNull();
bool isNull() const;
Environment* getEnvironment() const;
private:
Ptr<SubscriptionImpl> ptr;
};
class NotifyResult
{
public:
Bytes getPayload() const;
Message getMessage() const;
Bytes getMessageId() const;
OCCI_STD_NAMESPACE::string getConsumerName() const;
OCCI_STD_NAMESPACE::string getQueueName() const;
private:
const EnvironmentImpl *env;
void *payload;
unsigned int payloadLen;
void *desc;
ub4 mode;
void *notifyResultExt;
//private constructor
NotifyResult(const Environment *env, void *payload, ub4 payloadLen,
void *pdescriptor, ub4 mode);
friend class SubscriptionImpl;
};
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
} /* end of namespace aq */
} /* end of namespace occi */
} /* end of namespace oracle */
#endif /* OCCIAQ_ORACLE */
#endif /* _olint */

@ -0,0 +1,982 @@
/* Copyright (c) 2000, 2008, Oracle. All rights reserved. */
/*
NAME
occiCommon.h - header file for doing forward references
DESCRIPTION
Just declare all the classes
RELATED DOCUMENTS
OCCI Programmer's Guide
EXPORT FUNCTION(S)
none
INTERNAL FUNCTION(S)
none
EXAMPLES
NOTES
none
*/
#ifndef OCCICOMMON_ORACLE
# define OCCICOMMON_ORACLE
#ifndef _olint
#ifndef OCI_ORACLE
#include <oci.h>
#endif
#ifndef ORASTRINGSTL
#define ORASTRINGSTL
#include <string>
#endif
#ifndef ORAVECTORSTL
#include <vector>
#define ORAVECTORSTL
#endif
#ifndef ORALISTSTL
#include <list>
#define ORALISTSTL
#endif
#define OCCI_STD_NAMESPACE std
#define OCCI_HAVE_STD_NAMESPACE 1
// version definitions
#define OCCI_MAJOR_VERSION OCI_MAJOR_VERSION
#define OCCI_MINOR_VERSION OCI_MINOR_VERSION
namespace oracle {
namespace occi {
//UString is the class for UTF16 characterset
//check for version = 3.2 or 3.3
#if (__GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3))
//char_traits<T> specialization for utext for gcc 3.2.3
struct utext_char_traits
{
typedef utext char_type;
typedef unsigned int int_type;
typedef OCCI_STD_NAMESPACE::streampos pos_type;
typedef OCCI_STD_NAMESPACE::streamoff off_type;
typedef OCCI_STD_NAMESPACE::mbstate_t state_type;
//assign one char to another
static void assign(char_type& c1, const char_type& c2)
{
c1 = c2;
}
//are 2 chars equal ?
static bool eq(const char_type& c1, const char_type& c2)
{
return c1 == c2;
}
//is char c1 less then c2 ?
static bool lt(const char_type& c1, const char_type& c2)
{
return c1 < c2;
}
//compare 2 strings of char
static int compare(const char_type* s1, const char_type* s2, size_t n)
{
for (size_t i = 0; i < n; ++i)
if (!eq(s1[i], s2[i]))
return s1[i] < s2[i] ? -1 : 1;
return 0;
}
//length of a char string
static size_t length(const char_type* s)
{
const char_type nullchar = char_type(0);
size_t i = 0;
while (!eq(*s++, nullchar)) i++;
return i;
}
//find a character in the char string
static const char_type* find(const char_type* s,
size_t n, const char_type& c)
{
for ( ; n > 0 ; ++s, --n)
if (eq(*s, c))
return s;
return 0;
}
//move n chars from s2 to s1
static char_type* move(char_type* s1, const char_type* s2, size_t n)
{
memmove(s1, s2, n * sizeof(char_type));
return s1;
}
//copy n chars from s2 to s1
static char_type* copy(char_type* s1, const char_type* s2, size_t n)
{
memcpy(s1, s2, n * sizeof(char_type));
return s1;
}
//fill char c into s
static char_type* assign(char_type* s, size_t n, char_type c)
{
for (size_t i = 0; i < n; ++i)
assign(s[i], c);
return s;
}
//is the int representation eof ?
static int_type not_eof(const int_type& c)
{
if (c == eof())
return 0;
else
return c;
}
//cast a int type to char
static char_type to_char_type(const int_type& c)
{
return static_cast<char_type>(c);
}
//cast char to int type
static int_type to_int_type(const char_type& c)
{
return static_cast<int_type>(c);
}
//eq operator when the chars are represented as ints
static bool eq_int_type(const int_type& c1, const int_type& c2)
{
return c1 == c2;
}
//eof character
static int_type eof()
{
return static_cast<int_type>(-1);
}
}; //end char_traits<unsigned short>
typedef OCCI_STD_NAMESPACE::basic_string<utext, utext_char_traits> UString;
#else
//for non gcc 3.2.3 platforms
typedef OCCI_STD_NAMESPACE::basic_string<utext> UString;
#endif /* if gcc 3.2.3 */
class Environment;
class EnvironmentImpl;
class Connection;
class ConnectionImpl;
class ConnectionPool;
class ConnectionPoolImpl;
class StatelessConnectionPool;
class StatelessConnectionPoolImpl;
class Statement;
class StatementImpl;
class ResultSet;
class ResultSetImpl;
class SQLException;
class SQLExceptionImpl;
class BatchSQLException;
class BatchSQLExceptionImpl;
class Stream;
class PObject;
class Number;
class Bytes;
class BytesImpl;
class Date;
class Timestamp;
class MetaData;
class MetaDataImpl;
template <class T> class Ref;
class RefImpl;
class RefAny;
class Blob;
class Bfile;
class Clob;
class LobStreamImpl;
class AnyData;
class AnyDataImpl;
class Map;
class IntervalDS;
class IntervalYM;
namespace aq {
class Message;
class MessageImpl;
class Agent;
class AgentImpl;
class Producer;
class ProducerImpl;
class Consumer;
class ConsumerImpl;
class Listener;
class Subscription;
class SubscriptionImpl;
class NotifyResult;
}
typedef struct BFloat BFloat;
typedef struct BDouble BDouble;
/*---------------------------------------------------------------------------
ENUMERATORS
---------------------------------------------------------------------------*/
enum Type
{
OCCI_SQLT_CHR=SQLT_CHR,
OCCI_SQLT_NUM=SQLT_NUM,
OCCIINT = SQLT_INT,
OCCIFLOAT = SQLT_FLT,
OCCIBFLOAT = SQLT_BFLOAT,
OCCIBDOUBLE = SQLT_BDOUBLE,
OCCIIBFLOAT = SQLT_IBFLOAT,
OCCIIBDOUBLE = SQLT_IBDOUBLE,
OCCI_SQLT_STR=SQLT_STR,
OCCI_SQLT_VNU=SQLT_VNU,
OCCI_SQLT_PDN=SQLT_PDN,
OCCI_SQLT_LNG=SQLT_LNG,
OCCI_SQLT_VCS=SQLT_VCS,
OCCI_SQLT_NON=SQLT_NON,
OCCI_SQLT_RID=SQLT_RID,
OCCI_SQLT_DAT=SQLT_DAT,
OCCI_SQLT_VBI=SQLT_VBI,
OCCI_SQLT_BIN=SQLT_BIN,
OCCI_SQLT_LBI=SQLT_LBI,
OCCIUNSIGNED_INT = SQLT_UIN,
OCCI_SQLT_SLS=SQLT_SLS,
OCCI_SQLT_LVC=SQLT_LVC,
OCCI_SQLT_LVB=SQLT_LVB,
OCCI_SQLT_AFC=SQLT_AFC,
OCCI_SQLT_AVC=SQLT_AVC,
OCCI_SQLT_CUR=SQLT_CUR,
OCCI_SQLT_RDD=SQLT_RDD,
OCCI_SQLT_LAB=SQLT_LAB,
OCCI_SQLT_OSL=SQLT_OSL,
OCCI_SQLT_NTY=SQLT_NTY,
OCCI_SQLT_REF=SQLT_REF,
OCCI_SQLT_CLOB=SQLT_CLOB,
OCCI_SQLT_BLOB=SQLT_BLOB,
OCCI_SQLT_BFILEE=SQLT_BFILEE,
OCCI_SQLT_CFILEE=SQLT_CFILEE,
OCCI_SQLT_RSET=SQLT_RSET,
OCCI_SQLT_NCO=SQLT_NCO,
OCCI_SQLT_VST=SQLT_VST,
OCCI_SQLT_ODT=SQLT_ODT,
OCCI_SQLT_DATE=SQLT_DATE,
OCCI_SQLT_TIME=SQLT_TIME,
OCCI_SQLT_TIME_TZ=SQLT_TIME_TZ,
OCCI_SQLT_TIMESTAMP=SQLT_TIMESTAMP,
OCCI_SQLT_TIMESTAMP_TZ=SQLT_TIMESTAMP_TZ,
OCCI_SQLT_INTERVAL_YM=SQLT_INTERVAL_YM,
OCCI_SQLT_INTERVAL_DS=SQLT_INTERVAL_DS,
OCCI_SQLT_TIMESTAMP_LTZ=SQLT_TIMESTAMP_LTZ,
OCCI_SQLT_FILE=SQLT_FILE,
OCCI_SQLT_CFILE=SQLT_CFILE,
OCCI_SQLT_BFILE=SQLT_BFILE,
OCCICHAR = 32 *1024,
OCCIDOUBLE,
OCCIBOOL,
OCCIANYDATA ,
OCCINUMBER,
OCCIBLOB,
OCCIBFILE,
OCCIBYTES,
OCCICLOB ,
OCCIVECTOR,
OCCIMETADATA,
OCCIPOBJECT,
OCCIREF ,
OCCIREFANY,
OCCISTRING ,
OCCISTREAM ,
OCCIDATE ,
OCCIINTERVALDS ,
OCCIINTERVALYM ,
OCCITIMESTAMP,
OCCIROWID,
OCCICURSOR
};
enum LockOptions {OCCI_LOCK_NONE = OCI_LOCK_NONE,
OCCI_LOCK_X = OCI_LOCK_X,
OCCI_LOCK_X_NOWAIT = OCI_LOCK_X_NOWAIT
};
enum {OCCI_MAX_PREFETCH_DEPTH = UB4MAXVAL};
enum TypeCode
{
OCCI_TYPECODE_REF = OCI_TYPECODE_REF,
OCCI_TYPECODE_DATE = OCI_TYPECODE_DATE,
OCCI_TYPECODE_REAL = OCI_TYPECODE_REAL,
OCCI_TYPECODE_DOUBLE = OCI_TYPECODE_DOUBLE,
OCCI_TYPECODE_BDOUBLE = OCI_TYPECODE_BDOUBLE,
OCCI_TYPECODE_FLOAT = OCI_TYPECODE_FLOAT,
OCCI_TYPECODE_BFLOAT = OCI_TYPECODE_BFLOAT,
OCCI_TYPECODE_NUMBER = OCI_TYPECODE_NUMBER,
OCCI_TYPECODE_DECIMAL = OCI_TYPECODE_DECIMAL,
OCCI_TYPECODE_OCTET = OCI_TYPECODE_OCTET,
OCCI_TYPECODE_INTEGER = OCI_TYPECODE_INTEGER,
OCCI_TYPECODE_SMALLINT= OCI_TYPECODE_SMALLINT,
OCCI_TYPECODE_RAW = OCI_TYPECODE_RAW,
OCCI_TYPECODE_VARCHAR2 = OCI_TYPECODE_VARCHAR2,
OCCI_TYPECODE_VARCHAR = OCI_TYPECODE_VARCHAR,
OCCI_TYPECODE_CHAR = OCI_TYPECODE_CHAR,
OCCI_TYPECODE_VARRAY= OCI_TYPECODE_VARRAY,
OCCI_TYPECODE_TABLE = OCI_TYPECODE_TABLE,
OCCI_TYPECODE_CLOB = OCI_TYPECODE_CLOB,
OCCI_TYPECODE_BLOB = OCI_TYPECODE_BLOB,
OCCI_TYPECODE_BFILE = OCI_TYPECODE_BFILE,
OCCI_TYPECODE_OBJECT = OCI_TYPECODE_OBJECT,
OCCI_TYPECODE_NAMEDCOLLECTION = OCI_TYPECODE_NAMEDCOLLECTION
};
enum CharSetForm
{
OCCI_SQLCS_IMPLICIT = SQLCS_IMPLICIT // use local db char set
,OCCI_SQLCS_NCHAR = SQLCS_NCHAR // use local db nchar set
,OCCI_SQLCS_EXPLICIT = SQLCS_EXPLICIT // char set explicitly specified
,OCCI_SQLCS_FLEXIBLE = SQLCS_FLEXIBLE // pl/sql flexible parameter
};
enum LobOpenMode
{ OCCI_LOB_READONLY = OCI_LOB_READONLY
,OCCI_LOB_READWRITE = OCI_LOB_READWRITE
,OCCI_LOB_WRITEONLY = OCI_LOB_WRITEONLY
,OCCI_LOB_APPENDONLY = OCI_LOB_APPENDONLY
,OCCI_LOB_FULLOVERWRITE = OCI_LOB_FULLOVERWRITE
,OCCI_LOB_FULLREAD = OCI_LOB_FULLREAD
};
enum LobOptionType
{
OCCI_LOB_OPT_NONE = 0,
OCCI_LOB_OPT_COMPRESS = OCI_LOB_OPT_COMPRESS,
OCCI_LOB_OPT_ENCRYPT = OCI_LOB_OPT_ENCRYPT,
OCCI_LOB_OPT_DEDUPLICATE = OCI_LOB_OPT_DEDUPLICATE,
OCCI_LOB_OPT_ALLOCSIZE = OCI_LOB_OPT_ALLOCSIZE,
OCCI_LOB_OPT_CONTENTTYPE = OCI_LOB_OPT_CONTENTTYPE,
OCCI_LOB_OPT_MODTIME = OCI_LOB_OPT_MODTIME
};
enum LobOptionValue
{
// Compression Options
OCCI_LOB_COMPRESS_OFF = OCI_LOB_COMPRESS_OFF,
OCCI_LOB_COMPRESS_ON = OCI_LOB_COMPRESS_ON,
// Encryption Options
OCCI_LOB_ENCRYPT_OFF = OCI_LOB_ENCRYPT_OFF,
OCCI_LOB_ENCRYPT_ON = OCI_LOB_ENCRYPT_ON,
// Sharing Options
OCCI_LOB_DEDUPLICATE_OFF = OCI_LOB_DEDUPLICATE_OFF,
OCCI_LOB_DEDUPLICATE_ON = OCI_LOB_DEDUPLICATE_ON
};
class RefCounted {
public:
RefCounted();
virtual ~RefCounted(){}
const RefCounted * newRef() const;
void deleteRef() const;
private:
void onZeroReferences();
unsigned long references_;
};
template <class T>
class ConstPtr
{
public:
ConstPtr( const T* ptr = 0 );
ConstPtr( const ConstPtr<T>& mp );
~ConstPtr();
const T * operator->() const;
const T* rawPtr() const;
#ifdef MEMBER_TEMPLATE
template<class OtherType> operator ConstPtr<OtherType>();
#endif
protected:
void operator=( const ConstPtr<T>& mp );
const T* rawPtr_;
};
template <class T>
class Ptr : public ConstPtr<T> {
public:
Ptr( T* ptr = 0 );
Ptr( const Ptr<T>& mp );
void operator=( const Ptr<T>& mp );
const T * operator->() const;
T * operator->();
T* rawPtr() ;
const T* rawPtr() const;
#ifdef MEMBER_TEMPLATE
template<class OtherType>
operator Ptr<OtherType>();
#endif
};
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect);
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector<UString> &vect);
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<BFloat> &vect);
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector<BDouble> &vect);
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
void getVector( const AnyData &any,
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
template <class T>
void getVectorOfRefs( const AnyData &any,
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector<T> &vect,
void *(*rSQL)(void *));
#else
template <class T>
void getVector(const AnyData &any,
OCCI_STD_NAMESPACE::vector<T *> &vect,
void *(*rSQL)(void *));
#endif
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<UString> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Number> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Bytes> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Date> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
template <class T>
void setVectorOfRefs( AnyData &any,
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector< T > &vect) ;
#else
template <class T>
void setVector( AnyData &any,
const OCCI_STD_NAMESPACE::vector< T* > &vect) ;
#endif
void getVector( ResultSet *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<int> &vect) ;
void getVector( ResultSet *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
void getVector( ResultSet *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<float> &vect);
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<BFloat> &vect);
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<double> &vect);
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<BDouble> &vect);
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
template <class T>
void getVectorOfRefs(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void getVector(ResultSet *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void getVector( ResultSet *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector< T > &vect) ;
#else
template <class T>
void getVector( ResultSet *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector< T* > &vect) ;
#endif
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Blob> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Clob> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Bfile> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Number> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<IntervalYM> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<IntervalDS> &vect) ;
void getVector( Statement *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<int> &vect) ;
void getVector( Statement *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect) ;
void getVector( Statement *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector<UString> &vect) ;//UTF16 support
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<unsigned int> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<float> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<BFloat> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<double> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<BDouble> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Date> &vect) ;
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Timestamp> &vect) ;
template <class T>
void getVectorOfRefs(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void getVector(Statement *rs, unsigned int,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void getVector( Statement *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector< T > &vect) ;
#else
template <class T>
void getVector( Statement *rs, unsigned int index,
OCCI_STD_NAMESPACE::vector< T* > &vect) ;
#endif
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<int> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<double> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<float> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Number> &vect,
const OCCI_STD_NAMESPACE::string &sqltype);
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Date> &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
template <class T>
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector< T > &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
#else
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<T* > &vect,
const OCCI_STD_NAMESPACE::string &sqltype) ;
#endif
/* ------------------------------------------------------------------------
Statement setVector functions, schema & type separate
arguments - multibyte support
------------------------------------------------------------------------
*/
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<int> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<double> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<float> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Number> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName);
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<OCCI_STD_NAMESPACE::string> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Date> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
template <class T>
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector< T > &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
#else
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<T* > &vect, const OCCI_STD_NAMESPACE::string
&schemaName, const OCCI_STD_NAMESPACE::string &typeName) ;
#endif
/*-------------------------------------------------------------------------
Statement setVector function - UTF16 support
-------------------------------------------------------------------------
*/
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<int> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<unsigned int> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<double> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BDouble> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<float> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<BFloat> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Number> &vect,
const UString &schemaName,
const UString &typeName);
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<UString> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<UString> &vect,
const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<RefAny> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Blob> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Clob> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Bfile> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Timestamp> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalDS> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<IntervalYM> &vect,
const UString &schemaName,
const UString &typeName) ;
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Date> &vect,
const UString &schemaName,
const UString &typeName) ;
template <class T>
void setVectorOfRefs(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const UString &schemaName,
const UString &typeName) ;
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void setVector(Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
const UString &schemaName,
const UString &typeName) ;
#endif
#if defined(WIN32COMMON) || defined(__MVS__)
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector< T > &vect,
const UString &schemaName,
const UString &typeName) ;
#else
template <class T>
void setVector( Statement *stmt, unsigned int paramIndex,
const OCCI_STD_NAMESPACE::vector<T* > &vect, const UString
&schemaName, const UString &typeName) ;
#endif
/* Global method for array pins */
template <class T>
void pinVectorOfRefs( const Connection *conn,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
OCCI_STD_NAMESPACE::vector<T* > &vectObj,
LockOptions lockOpt = OCCI_LOCK_NONE );
template <class T>
void pinVectorOfRefs( const Connection *conn,
OCCI_STD_NAMESPACE::vector<Ref<T> > &vect,
LockOptions lockOpt = OCCI_LOCK_NONE );
#ifdef ORAXB8_DEFINED
void readVectorOfBfiles(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Bfile> &vec,
oraub8 *byte_amts, oraub8 *offsets,
unsigned char *buffers[], oraub8 *buffer_lens);
void readVectorOfBlobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Blob> &vec,
oraub8 *byte_amts, oraub8 *offsets,
unsigned char *buffers[], oraub8 *buffer_lens);
void writeVectorOfBlobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Blob> &vec,
oraub8 *byte_amts, oraub8 *offsets,
unsigned char *buffers[], oraub8 *buffer_lens);
void readVectorOfClobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Clob> &vec,
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
unsigned char *buffers[], oraub8 *buffer_lens);
void writeVectorOfClobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Clob> &vec,
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
unsigned char *buffers[], oraub8 *buffer_lens);
void readVectorOfClobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Clob> &vec,
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
utext *buffers[], oraub8 *buffer_lens);
void writeVectorOfClobs(const Connection *conn,
OCCI_STD_NAMESPACE::vector<Clob> &vec,
oraub8 *byte_amts, oraub8 *char_amts, oraub8 *offsets,
utext *buffers[], oraub8 *buffer_lens);
#endif
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
} /* end of namespace occi */
} /* end of namespace oracle */
#endif /* _olint */
#endif /* OCCICOMMON_ORACLE */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -0,0 +1,910 @@
/* Copyright (c) 2000, 2007, Oracle. All rights reserved. */
/*
NAME
occiObjects.h - header file for OCCI object classes
DESCRIPTION
Class definitions for Ref, RefAny, AnyData
RELATED DOCUMENTS
<note any documents related to this facility>
EXPORT FUNCTION(S)
<external functions declared for use outside package - one-line
descriptions>
INTERNAL FUNCTION(S)
<other external functions declared - one-line descriptions>
EXAMPLES
NOTES
<other useful comments, qualifications, etc.>
*/
#ifndef _olint /* disable olint check */
#ifndef OCCIOBJECTS_ORACLE
# define OCCIOBJECTS_ORACLE
#ifndef OCCICOMMON_ORACLE
#include <occiCommon.h>
#endif
namespace oracle {
namespace occi {
struct AnyDataCtx {
ConnectionImpl *occiSession;
OCIAnyData *anyData;
void *objHeader;
ub4 errNum;
};
typedef struct AnyDataCtx AnyDataCtx;
class PObject
{
public:
enum LockOption {OCCI_LOCK_WAIT, OCCI_LOCK_NOWAIT};
enum UnpinOption {OCCI_PINCOUNT_DECR, OCCI_PINCOUNT_RESET};
static void destroy(void *);
static void refresh(void *);
PObject();
PObject(const void *ctx);
PObject(const PObject& obj);
virtual ~PObject();
PObject& operator=(const PObject& obj);
void *operator new(size_t size);
void *operator new(size_t size, const Connection *x,
const OCCI_STD_NAMESPACE::string& tablename,
const char *typeName);
void *operator new(size_t size, const Connection *sess,
const OCCI_STD_NAMESPACE::string& tablename,
const OCCI_STD_NAMESPACE::string& typName ,
const OCCI_STD_NAMESPACE::string& schTabName="",
const OCCI_STD_NAMESPACE::string& schTypName = "");
void *operator new(size_t size, const Connection *sess,
const UString& tablename, const UString &typName,
const UString& schTabName, const UString& schTypName);
void *operator new(size_t size, void *adctx);
void operator delete(void *obj, size_t size);
RefAny getRef() const;
bool isLocked() const;
void unpin(UnpinOption mode=OCCI_PINCOUNT_DECR);
void pin();
void lock(PObject::LockOption lock_option);
void unmark();
void flush();
void markDelete();
void markModified();
bool isNull() const;
void setNull();
const Connection *getConnection() const;
virtual OCCI_STD_NAMESPACE::string getSQLTypeName() const = 0;
virtual void getSQLTypeName(Environment *env, void **schName,
unsigned int &schNameLen, void **typeName,
unsigned int &typeNameLen) const = 0;
void getSQLTypeName(Environment *env, void *(*rSQL)(void *),
void **schname, unsigned int &schnamelen,
void **typname, unsigned int &typnamelen) const;
virtual void writeSQL(AnyData& stream) = 0;
virtual void readSQL(AnyData& stream) = 0;
private:
static void initialise( void * obj, const Connection * sess,
void *schTabName, unsigned int schTabLen,
void *tableName, unsigned int tabLen,
void *schTypName, unsigned int schTypLen,
void *typeName, unsigned int typLen);
ConnectionImpl *occiSession_;
void *objHeader_;
ub2 customNewed_;
enum {CUSTOM_NEWED = 0x5cde};
ub2 flags_;
enum {NULL_INFO = 0x0001, GARBAGE_COLLECTED = 0x0002,
REFRESH_OBJECT = 0x0004,
CACHED_OBJECT = 0xBAF8};
//check PObject implementation for CACHED_OBJECT flag
// for future use
void *pobjectExt;
friend class RefImpl;
};
class AnyData
{
public:
~AnyData();
AnyData(void *any) ;
AnyData(const Connection *sessp);
AnyData(const Connection *sessp, OCIAnyData *any, bool freeImg = true) ;
AnyData(const AnyData &src);
AnyData& operator = (const AnyData &src);
OCIAnyData* getOCIAnyData() const;
const Connection* getConnection() const;
bool isNull() const ;
void setNull() ;
OCCI_STD_NAMESPACE::string getString() const ;
UString getUString() const ;
Blob getBlob() const ;
Clob getClob() const ;
Bfile getBfile() const ;
BFloat getBFloat() const ;
BDouble getBDouble() const ;
Number getNumber() const ;
Bytes getBytes() const ;
Date getDate() const ;
Timestamp getTimestamp() const ;
IntervalYM getIntervalYM() const ;
IntervalDS getIntervalDS() const ;
PObject *getObject(void *(*rSQL)(void *)) const ;
RefAny getRef() const ;
void setString(const OCCI_STD_NAMESPACE::string &str) ;
void setUString(const UString &str) ;
void setBlob(const Blob &blob) ;
void setClob(const Clob &clob) ;
void setBfile(const Bfile &bfile) ;
void setBFloat(const BFloat &n) ;
void setBDouble(const BDouble &n) ;
void setNumber(const Number &n) ;
void setBytes(const Bytes &bytes) ;
void setDate(const Date &date) ;
void setTimestamp(const Timestamp &timestamp) ;
void setIntervalYM(const IntervalYM &intervalym) ;
void setIntervalDS(const IntervalDS &intervalds) ;
void setObject(const PObject *objptr) ;
void setRef(const RefAny &ref) ;
void setFromString(const OCCI_STD_NAMESPACE::string &str) ;
void setFromBfile(const Bfile &bfile) ;
void setFromBFloat(const BFloat &n) ;
void setFromBDouble(const BDouble &n) ;
void setFromNumber(const Number &n) ;
void setFromBytes(const Bytes &bytes) ;
void setFromDate(const Date &date) ;
void setFromTimestamp(const Timestamp &timestamp) ;
void setFromIntervalYM(const IntervalYM &intervalym) ;
void setFromIntervalDS(const IntervalDS &intervalds) ;
void setFromObject(const PObject *objptr) ;
void setFromRef(const RefAny &ref,
const OCCI_STD_NAMESPACE::string &typname,
const OCCI_STD_NAMESPACE::string &schname) ;
OCCI_STD_NAMESPACE::string getAsString() const ;
Bfile getAsBfile() const ;
BFloat getAsBFloat() const ;
BDouble getAsBDouble() const ;
Number getAsNumber() const ;
Bytes getAsBytes() const ;
Date getAsDate() const ;
Timestamp getAsTimestamp() const ;
IntervalYM getAsIntervalYM() const ;
IntervalDS getAsIntervalDS() const ;
PObject *getAsObject() const ;
RefAny getAsRef() const ;
TypeCode getType() const;
private:
// private data members
Ptr<AnyDataImpl> anyDataImplPtr;
};
template <class T>
class Ref
{
public:
Ref();
Ref(const T *obj) ;
Ref(const RefAny &refAny) ;
Ref(const Ref<T> &src) ;
Ref(const Connection *sessp, OCIRef *tref, bool copy=TRUE)
;
~Ref();
Ref<T>& operator=(const Ref<T> &src)
;
Ref<T>& operator=(const T *obj) ;
Ref<T>& operator=(const RefAny &src);
T * operator->() ;
T * ptr() ;
T & operator *() ;
const T * operator->() const;
const T * ptr() const;
const T & operator *() const ;
void markDelete() ;
void unmarkDelete() ;
void setNull();
bool isNull() const;
void clear() ;
bool isClear() const;
void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth);
void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth);
void setPrefetch(const UString &schName,
const UString &typeName,
unsigned int depth);
void setPrefetch(unsigned int depth) ;
void setLock(LockOptions );
operator RefAny() const;
OCIRef *getRef() const;
const Connection *getConnection() const;
bool operator == (const Ref<T> &ref) const;
bool operator != (const Ref<T> &ref) const;
bool operator == (const RefAny &refAnyR) const ;
bool operator != (const RefAny &refAnyR) const ;
OCIComplexObject *getCor() const;
void setPinnedObject(PObject *objPtr);
private:
RefImpl *rimplPtr;
};
class RefImpl
{
public:
RefImpl();
RefImpl(PObject *obj) ;
RefImpl(const RefAny &refAny) ;
RefImpl(const RefImpl &src) ;
RefImpl(const Connection *sessp, OCIRef *tref,
bool copy=TRUE) ;
~RefImpl();
bool isNull() const ;
void setNull() ;
void markDelete() ;
void unmarkDelete() ;
void clear() ;
bool isClear() const ;
void setPrefetch(const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth) ;
void setPrefetch(const OCCI_STD_NAMESPACE::string &schName,
const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth);
void setPrefetch(const UString &schName,
const UString &typeName,
unsigned int depth);
void setPrefetch(unsigned int depth) ;
void setLock(LockOptions lckOption) ;
PObject *pin() ;
void unpin(PObject *obj) ;
void setRefFromObjPtr(const PObject *obj) ;
OCIRef* getRef() const;
void setRefImpl(RefImpl *rptr);
const Connection * getConnection() const;
bool operator == (const RefImpl &refI) const ;
bool operator == (const RefAny &refAnyR) const ;
void assignObj(PObject *newObjPtr) ;
void assignRefAny(const RefAny &src) ;
// added following methods
bool isEqual(PObject *obj);
void operator = ( const RefImpl &src);
OCIComplexObject *getCor() const;
void setPinnedObject( PObject *objPtr);
private:
OCIRef *ref;
const ConnectionImpl *sessp;
OCIComplexObject *corhp;
OCCI_STD_NAMESPACE::list<void *> descriptorList;
LockOptions lockOption;
// added data member for object header
void *objHeader;
//common implementation function for setPrefetch
void do_setPrefetch(void *schName, unsigned int schNameLen,
void *typeName, unsigned int typeNameLen,
unsigned int depth);
};
class RefAny
{
public:
RefAny();
RefAny (const Connection *sessptr, const OCIRef *ref);
RefAny (const Connection *sessptr, const OCIRef *ref, bool isowner);
~RefAny() ;
RefAny(const RefAny& src) ;
RefAny& operator=(const RefAny& src) ;
void markDelete() ;
void unmarkDelete() ;
void clear() ;
bool isNull() const;
OCIRef * getRef() const;
const Connection * getConnection() const;
bool operator == (const RefAny &refAnyR) const;
bool operator != (const RefAny &refAnyR) const;
bool isOwner() const;
private:
OCIRef *ref;
const ConnectionImpl *sessp;
// for future use
void *refanyExt;
bool owner;
friend RefAny MetaData::getRef(MetaData::AttrId) const;
friend RefAny PObject::getRef() const;
friend class AnyDataImpl;
friend class ResultSetImpl;
friend class StatementImpl;
friend void getVector(const ResultSet *rs,
unsigned int colIndex,
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
friend void getVector(const Statement *stmt,
unsigned int colIndex,
OCCI_STD_NAMESPACE::vector<RefAny> &vect) ;
};
template <class T>
Ref<T>::Ref()
{
rimplPtr = new RefImpl();
}
template <class T>
Ref<T>::Ref(const T *obj)
{
rimplPtr = new RefImpl((PObject *)obj);
}
template <class T>
Ref<T>::Ref(const RefAny &refAny)
{
rimplPtr = new RefImpl(refAny);
}
template <class T>
Ref<T>::Ref(const Ref<T>& src)
{
rimplPtr = new RefImpl(*(src.rimplPtr));
}
template <class T>
Ref<T>::Ref(const Connection *sessp, OCIRef *tref, bool copy)
{
rimplPtr = new RefImpl(sessp, tref, copy);
}
template <class T>
Ref<T>::~Ref()
{
delete rimplPtr;
}
template <class T>
Ref<T>& Ref<T>::operator=(const Ref<T> &src)
{
if (&src == this)
return *this;
*rimplPtr = *(src.rimplPtr);
return *this;
}
template <class T>
Ref<T>& Ref<T>::operator=(const T *obj)
{
if (rimplPtr->isEqual((PObject *)obj))
return *this;
rimplPtr->assignObj((PObject *)obj);
return *this;
}
template <class T>
Ref<T>& Ref<T>::operator=(const RefAny &src)
{
rimplPtr->assignRefAny(src);
return *this;
}
template <class T>
T* Ref<T>::operator->()
{
return ((T *)rimplPtr->pin());
}
template <class T>
T* Ref<T>::ptr()
{
return ((T *)rimplPtr->pin());
}
template <class T>
T& Ref<T>::operator * ()
{
return ((T &)(*(rimplPtr->pin())));
}
template <class T>
const T* Ref<T>::operator->() const
{
return ((const T *)rimplPtr->pin());
}
template <class T>
const T* Ref<T>::ptr() const
{
return ((const T *)rimplPtr->pin());
}
template <class T>
const T& Ref<T>::operator * () const
{
return ((const T &)(*(rimplPtr->pin())));
}
template <class T>
void Ref<T>::markDelete ()
{
rimplPtr->markDelete();
}
template <class T>
void Ref<T>::unmarkDelete ()
{
rimplPtr->unmarkDelete();
}
template <class T>
void Ref<T>::setNull()
{
rimplPtr->setNull();
}
template <class T>
bool Ref<T>::isNull() const
{
return rimplPtr->isNull();
}
template <class T>
void Ref<T>::clear ()
{
rimplPtr->clear();
}
template <class T>
bool Ref<T>::isClear() const
{
return rimplPtr->isClear();
}
template <class T>
void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth)
{
rimplPtr->setPrefetch(typeName,depth);
}
template <class T>
void Ref<T>::setPrefetch (const OCCI_STD_NAMESPACE::string &schemaName,
const OCCI_STD_NAMESPACE::string &typeName,
unsigned int depth)
{
rimplPtr->setPrefetch(schemaName,typeName,depth);
}
template <class T>
void Ref<T>::setPrefetch (const UString &schemaName,
const UString &typeName,
unsigned int depth)
{
rimplPtr->setPrefetch(schemaName,typeName,depth);
}
template <class T>
void Ref<T>::setPrefetch (unsigned int depth)
{
rimplPtr->setPrefetch(depth);
}
template <class T>
void Ref<T>::setLock (LockOptions lckOption)
{
rimplPtr->setLock(lckOption);
}
template <class T>
OCIRef* Ref<T>::getRef() const
{
return (rimplPtr->getRef());
}
template<class T>
const Connection* Ref<T>::getConnection () const
{
return (rimplPtr->getConnection());
}
template <class T>
Ref<T>::operator RefAny () const
{
if (isNull())
return RefAny();
return (RefAny(rimplPtr->getConnection(), rimplPtr->getRef()));
}
template <class T>
bool Ref<T>::operator ==(const Ref<T> &ref) const
{
return ( (*rimplPtr) == (*(ref.rimplPtr)) );
}
template <class T>
bool Ref<T>::operator !=(const Ref<T> &ref) const
{
return ( !((*rimplPtr) == (*(ref.rimplPtr))) );
}
template <class T>
bool Ref<T>::operator == (const RefAny & refAnyR) const
{
return ( (*rimplPtr) == refAnyR );
}
template <class T>
bool Ref<T>::operator != (const RefAny & refAnyR) const
{
return ( !((*rimplPtr) == refAnyR ));
}
template <class T>
OCIComplexObject * Ref<T>::getCor() const
{
return (rimplPtr->getCor());
}
template < class T>
void Ref<T>::setPinnedObject( PObject *objPtr)
{
rimplPtr->setPinnedObject(objPtr);
}
/*---------------------------------------------------------------------------
PROTOTYPES USED BY FUNCTION TEMPLATES
---------------------------------------------------------------------------*/
void getVectorOfOCIRefs( const AnyData &any,
OCCI_STD_NAMESPACE::vector<void *> &vect);
void getVectorOfPObjects( const AnyData &any,
OCCI_STD_NAMESPACE::vector< PObject* > &vect,
void *(*rSQL)(void *)) ;
void setVectorOfOCIRefs( AnyData &any,
const OCCI_STD_NAMESPACE::vector<void *> &vect,
const OCCI_STD_NAMESPACE::vector< OCIInd> &vec_ind) ;
void setVectorOfPObjects( AnyData &any,
const OCCI_STD_NAMESPACE::vector< PObject* > &vect) ;
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
/*------------------- getVector for POBject----------------------------*/
/*
NAME
getVector - overloaded function. Retrieves the attribute in the
current position as a vector of PObject
PARAMETERS
any - AnyData
vect- reference to vector of PObject (OUT parameter).
DESCRIPTION
Retrieves the attribute in the current position as a vector
of PObject
The attribute at the current position should be a collection
type (varray or nested table). The SQL type of the elements in
the collection should be compatible with PObject
RETURNS
nothing
NOTES
compatible SQL types : user defined types (SQLT_NTY) etc.
*/
#if defined(WIN32COMMON) || defined(__MVS__)
// and other platforms that do not support
// partial function template specialization
template <class T>
void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T> &vect,
void *(*rSQL)(void *))
{
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
getVectorOfPObjects( any, vec_pobj, rSQL);
vect.clear();
unsigned int size= vec_pobj.size();
vect.reserve( size );
for( unsigned int i=0; i< size; i++)
vect.push_back( (T)vec_pobj[i] );
}
#else
template <class T>
void getVector(const AnyData &any, OCCI_STD_NAMESPACE::vector<T*> &vect,
void *(*rSQL)(void *))
{
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
getVectorOfPObjects( any, vec_pobj, rSQL);
vect.clear();
unsigned int size= vec_pobj.size();
vect.reserve( size );
for( unsigned int i=0; i< size; i++)
vect.push_back( (T*)vec_pobj[i] );
}
#endif /* end of #ifdef WIN32COMMON */
/*------------------- getVector for Ref<T>----------------------------*/
/*
NAME
getVector - overloaded function. Retrieves the attribute in the
current position as a vector of PObject
PARAMETERS
any - AnyData
vect- reference to vector of PObject (OUT parameter).
DESCRIPTION
Retrieves the attribute in the current position as a vector
of PObject
The attribute at the current position should be a collection
type (varray or nested table). The SQL type of the elements in
the collection should be compatible with PObject
RETURNS
nothing
NOTES
compatible SQL types : user defined types (SQLT_NTY) etc.
*/
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void getVector(const AnyData &any,OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
{
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
getVectorOfOCIRefs( any, vec_ref);
vect.clear();
unsigned int size = vec_ref.size();
vect.reserve( size );
const Connection *sess = any.getConnection();
for (unsigned int i=0; i< size; i++)
{
if (vec_ref[i] == (OCIRef *)0)
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
else
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
}
}
#endif /* end of #ifndef WIN32COMMON */
/*-----------------------setVector for PObject--------------------------*/
/*
NAME
setVector - overloaded function. sets the attribute in the current
position of anydata with the vector elements.
PARAMETERS
none.
DESCRIPTION
sets the attribute in the current position in anydata with the
vector elements.
The attribute in the current position of anydata should be a
collection type. If the collection type is a varray, the input vector
size should be equal to the size of the varray. Also the SQL type of
the collection's elements should be compatible with PObject.
RETURNS
nothing.
NOTES
compatible SQL types : SQLT_NTY (user defined types).
*/
#if defined(WIN32COMMON) || defined(__MVS__)
// and other platforms that do not support
// partial function template specialization
template <class T>
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T> &vect)
{
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
unsigned int size= vect.size();
vec_pobj.reserve( size );
for( unsigned int i=0; i< size; i++)
vec_pobj.push_back( vect[i] );
setVectorOfPObjects( any, vec_pobj);
}
#else
template <class T>
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector<T*> &vect)
{
OCCI_STD_NAMESPACE::vector< PObject *> vec_pobj;
unsigned int size= vect.size();
vec_pobj.reserve( size );
for( unsigned int i=0; i< size; i++)
vec_pobj.push_back( vect[i] );
setVectorOfPObjects( any, vec_pobj);
}
#endif /* end of #ifdef WIN32COMMON */
/*-----------------------setVector for Ref<T>--------------------------*/
/*
NAME
setVector - overloaded function. sets the attribute in the current
position of anydata with the vector elements.
PARAMETERS
none.
DESCRIPTION
sets the attribute in the current position in anydata with the
vector elements.
The attribute in the current position of anydata should be a
collection type. If the collection type is a varray, the input vector
size should be equal to the size of the varray. Also the SQL type of
the collection's elements should be compatible with PObject.
RETURNS
nothing.
NOTES
compatible SQL types : SQLT_NTY (user defined types).
*/
#if !defined(WIN32COMMON) && !defined(__MVS__)
template <class T>
void setVector(AnyData &any, const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
{
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
unsigned int size= vect.size();
vec_ref.reserve( size );
vec_ind.reserve( size );
for( unsigned int i=0; i< size; i++)
{
vec_ref.push_back( vect[i].getRef() );
vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
}
setVectorOfOCIRefs( any, vec_ref, vec_ind);
}
#endif /* end of #ifndef WIN32COMMON */
// Platform independent get/setVectorOfRefs method added
// get(set)Vector of Ref<T> and get(set)VectorOfRefs are identical
// in functionality.
/*------------------- getVectorOfRefs for Ref<T>----------------------------*/
/*
NAME
getVectorOfRefs - overloaded function. Retrieves the attribute in the
current position as a vector of PObject
PARAMETERS
any - AnyData
vect- reference to vector of PObject (OUT parameter).
DESCRIPTION
Retrieves the attribute in the current position as a vector
of PObject
The attribute at the current position should be a collection
type (varray or nested table). The SQL type of the elements in
the collection should be compatible with PObject
RETURNS
nothing
NOTES
compatible SQL types : user defined types (SQLT_NTY) etc.
*/
template <class T>
void getVectorOfRefs(const AnyData &any,
OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
{
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
getVectorOfOCIRefs( any, vec_ref);
vect.clear();
unsigned int size = vec_ref.size();
vect.reserve( size );
const Connection *sess = any.getConnection();
for (unsigned int i=0; i< size; i++)
{
if (vec_ref[i] == (OCIRef *)0)
vect.push_back(Ref<T>()); // pushing a default-constructed Ref
else
vect.push_back(Ref<T>(sess, (OCIRef *)vec_ref[i], FALSE));
}
}
/*-----------------------setVectorOfRefs for Ref<T>--------------------------*/
/*
NAME
setVectorOfRefs - overloaded function. sets the attribute in the current
position of anydata with the vector elements.
PARAMETERS
none.
DESCRIPTION
sets the attribute in the current position in anydata with the
vector elements.
The attribute in the current position of anydata should be a
collection type. If the collection type is a varray, the input vector
size should be equal to the size of the varray. Also the SQL type of
the collection's elements should be compatible with PObject.
RETURNS
nothing.
NOTES
compatible SQL types : SQLT_NTY (user defined types).
*/
template <class T>
void setVectorOfRefs(AnyData &any,
const OCCI_STD_NAMESPACE::vector< Ref<T> > &vect)
{
OCCI_STD_NAMESPACE::vector< void *> vec_ref;
OCCI_STD_NAMESPACE::vector<OCIInd> vec_ind;
unsigned int size= vect.size();
vec_ref.reserve( size );
vec_ind.reserve( size );
for( unsigned int i=0; i< size; i++)
{
vec_ref.push_back( vect[i].getRef() );
vec_ind.push_back(vect[i].isNull() ? OCI_IND_NULL : OCI_IND_NOTNULL);
}
setVectorOfOCIRefs( any, vec_ref, vec_ind);
}
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
} /* end of namespace occi */
} /* end of namespace oracle */
#endif /* OCCIOBJECTS_ORACLE */
#endif /* _olint */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,182 @@
/* Copyright (c) 1997, 2005, Oracle. All rights reserved. */
/* NOTE: See 'header_template.doc' in the 'doc' dve under the 'forms'
directory for the header file template that includes instructions.
*/
/*
NAME
oci1.h - Cartridge Service definitions
DESCRIPTION
<short description of component this file declares/defines>
RELATED DOCUMENTS
INSPECTION STATUS
Inspection date:
Inspection status:
Estimated increasing cost defects per page:
Rule sets:
ACCEPTANCE REVIEW STATUS
Review date:
Review status:
Reviewers:
PUBLIC FUNCTION(S)
<list of external functions declared/defined - with one-line descriptions>
PRIVATE FUNCTION(S)
<list of static functions defined in .c file - with one-line descriptions>
EXAMPLES
NOTES
<other useful comments, qualifications, etc.>
MODIFIED (MM/DD/YY)
mbastawa 09/16/05 - dbhygiene
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
nramakri 01/16/98 - remove #ifdef NEVER clause
ewaugh 12/18/97 - Turn type wrappers into functions.
skabraha 12/02/97 - Adding data structures & constants for OCIFile
rhwu 12/02/97 - OCI Thread
nramakri 12/15/97 - move to core4
ewaugh 12/11/97 - add OCIFormat package constants
ssamu 12/10/97 - do not include s.h
nramakri 11/19/97 - add OCIExtract definitions
ssamu 11/14/97 - creation
*/
#ifndef OCI1_ORACLE
# define OCI1_ORACLE
# ifndef ORATYPES
# include <oratypes.h>
# endif
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/* Constants required by the OCIFormat package. */
#define OCIFormatUb1(variable) OCIFormatTUb1(), &(variable)
#define OCIFormatUb2(variable) OCIFormatTUb2(), &(variable)
#define OCIFormatUb4(variable) OCIFormatTUb4(), &(variable)
#define OCIFormatUword(variable) OCIFormatTUword(), &(variable)
#define OCIFormatUbig_ora(variable) OCIFormatTUbig_ora(), &(variable)
#define OCIFormatSb1(variable) OCIFormatTSb1(), &(variable)
#define OCIFormatSb2(variable) OCIFormatTSb2(), &(variable)
#define OCIFormatSb4(variable) OCIFormatTSb4(), &(variable)
#define OCIFormatSword(variable) OCIFormatTSword(), &(variable)
#define OCIFormatSbig_ora(variable) OCIFormatTSbig_ora(), &(variable)
#define OCIFormatEb1(variable) OCIFormatTEb1(), &(variable)
#define OCIFormatEb2(variable) OCIFormatTEb2(), &(variable)
#define OCIFormatEb4(variable) OCIFormatTEb4(), &(variable)
#define OCIFormatEword(variable) OCIFormatTEword(), &(variable)
#define OCIFormatChar(variable) OCIFormatTChar(), &(variable)
#define OCIFormatText(variable) OCIFormatTText(), (variable)
#define OCIFormatDouble(variable) OCIFormatTDouble(), &(variable)
#define OCIFormatDvoid(variable) OCIFormatTDvoid(), (variable)
#define OCIFormatEnd OCIFormatTEnd()
#define OCIFormatDP 6
/*----------------- Public Constants for OCIFile -------------------------*/
/* flags for open.*/
/* flags for mode */
#define OCI_FILE_READ_ONLY 1 /* open for read only */
#define OCI_FILE_WRITE_ONLY 2 /* open for write only */
#define OCI_FILE_READ_WRITE 3 /* open for read & write */
/* flags for create */
#define OCI_FILE_EXIST 0 /* the file should exist */
#define OCI_FILE_CREATE 1 /* create if the file doesn't exist */
#define OCI_FILE_EXCL 2 /* the file should not exist */
#define OCI_FILE_TRUNCATE 4 /* create if the file doesn't exist,
else truncate file the file to 0 */
#define OCI_FILE_APPEND 8 /* open the file in append mode */
/* flags for seek */
#define OCI_FILE_SEEK_BEGINNING 1 /* seek from the beginning of the file */
#define OCI_FILE_SEEK_CURRENT 2 /* seek from the current position */
#define OCI_FILE_SEEK_END 3 /* seek from the end of the file */
#define OCI_FILE_FORWARD 1 /* seek forward */
#define OCI_FILE_BACKWARD 2 /* seek backward */
/* file type */
#define OCI_FILE_BIN 0 /* binary file */
#define OCI_FILE_TEXT 1 /* text file */
#define OCI_FILE_STDIN 2 /* standard i/p */
#define OCI_FILE_STDOUT 3 /* standard o/p */
#define OCI_FILE_STDERR 4 /* standard error */
/* Represents an open file */
typedef struct OCIFileObject OCIFileObject;
/*--------------------- OCI Thread Object Definitions------------------------*/
/* OCIThread Context */
typedef struct OCIThreadContext OCIThreadContext;
/* OCIThread Mutual Exclusion Lock */
typedef struct OCIThreadMutex OCIThreadMutex;
/* OCIThread Key for Thread-Specific Data */
typedef struct OCIThreadKey OCIThreadKey;
/* OCIThread Thread ID */
typedef struct OCIThreadId OCIThreadId;
/* OCIThread Thread Handle */
typedef struct OCIThreadHandle OCIThreadHandle;
/*-------------------- OCI Thread Callback Function Pointers ----------------*/
/* OCIThread Key Destructor Function Type */
typedef void (*OCIThreadKeyDestFunc)( void * );
/* Flags passed into OCIExtractFromXXX routines to direct processing */
#define OCI_EXTRACT_CASE_SENSITIVE 0x1 /* matching is case sensitive */
#define OCI_EXTRACT_UNIQUE_ABBREVS 0x2 /* unique abbreviations for keys
are allowed */
#define OCI_EXTRACT_APPEND_VALUES 0x4 /* if multiple values for a key
exist, this determines if the
new value should be appended
to (or replace) the current
list of values */
/* Constants passed into OCIExtractSetKey routine */
#define OCI_EXTRACT_MULTIPLE 0x8 /* key can accept multiple values */
#define OCI_EXTRACT_TYPE_BOOLEAN 1 /* key type is boolean */
#define OCI_EXTRACT_TYPE_STRING 2 /* key type is string */
#define OCI_EXTRACT_TYPE_INTEGER 3 /* key type is integer */
#define OCI_EXTRACT_TYPE_OCINUM 4 /* key type is ocinum */
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PUBLIC FUNCTIONS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PRIVATE FUNCTIONS
---------------------------------------------------------------------------*/
#endif /* OCI1_ORACLE */

@ -0,0 +1,317 @@
/*
*
*/
/* Copyright (c) 1998, 2005, Oracle. All rights reserved. */
/*
NAME
oci8dp.h - OCI: Direct Path API interface prototypes.
DESCRIPTION
Public types, constants, and interfaces to the direct path API.
RELATED DOCUMENTS
NOTES
This file is not directly included by the application, this file
is included by "oci.h", which the application should include.
MODIFIED (MM/DD/YY)
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
rphillip 02/27/04 - Add OCI_DIRPATH_COL_ERROR
srseshad 03/12/03 - convert oci public api to ansi
msakayed 10/28/02 - Bug #2643907: add OCI_ATTR_DIRPATH_SKIPINDEX_METHOD
cmlim 04/13/01 - remove OCIDirPathStreamToStream - not used by dpapi
cmlim 04/02/01 - OCI_DIRPATH_EXPR_OPQ_SQL_FN to OCI_DIRPATH_EXPR_SQL
ebatbout 01/22/01 - PARTIAL value for OCIDirPathDataSave action parameter
cmlim 07/20/00 - support opaques/sql strings in 8.2 dpapi
cmlim 08/14/00 - support refs in 8.2 dpapi
cmlim 04/17/00 - add defines for OCIDirPathFuncCtx handle & OCI_ATTR_D
whe 09/01/99 - 976457:check __cplusplus for C++ code
abrumm 04/16/99 - dpapi: more attributes
abrumm 02/26/99 - add defines for DataSave action
abrumm 10/04/98 - clen must be a ub4
abrumm 05/27/98 - add column array flag values
abrumm 05/12/98 - direct path api support
abrumm 03/31/98 - OCI direct path interface support
abrumm 03/18/98 - Creation
*/
#ifndef OCI8DP_ORACLE
# define OCI8DP_ORACLE
#ifndef ORATYPES
#include <oratypes.h>
#endif
#ifndef OCIDFN
#include <ocidfn.h>
#endif
#ifndef OCI_ORACLE
#include <oci.h>
#endif
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*----- Handles and descriptors for direct path operations (OCIDirPath*) ----*/
typedef struct OCIDirPathCtx OCIDirPathCtx; /* context */
typedef struct OCIDirPathFuncCtx OCIDirPathFuncCtx; /* function context */
typedef struct OCIDirPathColArray OCIDirPathColArray; /* column array */
typedef struct OCIDirPathStream OCIDirPathStream; /* stream */
typedef struct OCIDirPathDesc OCIDirPathDesc; /* direct path descriptor */
/*----- Defines for Direct Path Options -----*/
/* values for OCI_ATTR_DIRPATH_MODE attribute */
#define OCI_DIRPATH_LOAD 1 /* direct path load operation */
#define OCI_DIRPATH_UNLOAD 2 /* direct path unload operation */
#define OCI_DIRPATH_CONVERT 3 /* direct path convert only operation */
/*----- values for OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD attribute -----*/
#define OCI_DIRPATH_INDEX_MAINT_SINGLE_ROW 1
/* Note that there are two attributes dealing with index maintenance -
* OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD and OCI_ATTR_DIRPATH_SKIPINDEX_METHOD.
* OCI_ATTR_DIRPATH_SKIPINDEX_METHOD exists to isolate the behavior for
* skipping index maintenance since maintenance of unusable indexes is
* orthogonal to that of single row insertion.
* For backwards compatibility we still allow users to specify skip
* methods in OCI_ATTR_DIRPATH_INDEX_MAINT_METHOD so make sure the
* enumerations for the two attributes are distinct.
*/
/*----- values for OCI_ATTR_DIRPATH_SKIPINDEX_METHOD attribute -----*/
#define OCI_DIRPATH_INDEX_MAINT_SKIP_UNUSABLE 2
#define OCI_DIRPATH_INDEX_MAINT_DONT_SKIP_UNUSABLE 3
#define OCI_DIRPATH_INDEX_MAINT_SKIP_ALL 4
/* values for OCI_ATTR_STATE attribute of OCIDirPathCtx */
#define OCI_DIRPATH_NORMAL 1 /* can accept rows, last row complete */
#define OCI_DIRPATH_PARTIAL 2 /* last row was partial */
#define OCI_DIRPATH_NOT_PREPARED 3 /* direct path context is not prepared */
/*----- values for cflg argument to OCIDirpathColArrayEntrySet -----*/
#define OCI_DIRPATH_COL_COMPLETE 0 /* column data is complete */
#define OCI_DIRPATH_COL_NULL 1 /* column is null */
#define OCI_DIRPATH_COL_PARTIAL 2 /* column data is partial */
#define OCI_DIRPATH_COL_ERROR 3 /* column error, ignore row */
/*----- values for action parameter to OCIDirPathDataSave -----*/
#define OCI_DIRPATH_DATASAVE_SAVEONLY 0 /* data save point only */
#define OCI_DIRPATH_DATASAVE_FINISH 1 /* execute finishing logic */
/* save portion of input data (before space error occurred) and finish */
#define OCI_DIRPATH_DATASAVE_PARTIAL 2
/*- OCI_ATTR_DIRPATH_EXPR_TYPE values (describes OCI_ATTR_NAME expr type) -*/
#define OCI_DIRPATH_EXPR_OBJ_CONSTR 1 /* NAME is an object constructor */
#define OCI_DIRPATH_EXPR_SQL 2 /* NAME is an opaque or sql function */
#define OCI_DIRPATH_EXPR_REF_TBLNAME 3 /* NAME is table name if ref is scoped*/
/*---------------------------------------------------------------------------
PUBLIC FUNCTIONS
---------------------------------------------------------------------------*/
/*------------------------ OCIDirPathCtx Operations -------------------------*/
/*
NAME
OCIDirPathAbort - OCI: Abort a direct path operation.
DESCRIPTION
Aborts a direct path operation. Upon successful completion
the direct path context is no longer valid.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathAbort( OCIDirPathCtx *dpctx, OCIError *errhp );
/*
NAME
OCIDirPathDataSave - OCI: Execute a data save point.
DESCRIPTION
Successful return of this function indicates that a data save
point has been executed.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathDataSave( OCIDirPathCtx *dpctx, OCIError *errhp, ub4 action );
/*
NAME
OCIDirPathFinish - OCI: Finish a direct path operation.
DESCRIPTION
Finishes a direct path operation.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathFinish( OCIDirPathCtx *dpctx, OCIError *errhp );
/*
NAME
OCIDirPathFlushRow - OCI: Flush a partial row from the server.
DESCRIPTION
Flushes a partially loaded row from the server.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathFlushRow( OCIDirPathCtx *dpctx, OCIError *errhp );
/*
NAME
OCIDirPathPrepare - OCI: Prepare a direct path operation.
DESCRIPTION
Prepares a table/partition for a direct path operation.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathPrepare( OCIDirPathCtx *dpctx, OCISvcCtx *svchp,
OCIError *errhp );
/*
NAME
OCIDirPathLoadStream - OCI: Load a direct path stream.
DESCRIPTION
Load a direct path stream to the object associated with
the direct path context.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathLoadStream( OCIDirPathCtx *dpctx, OCIDirPathStream *dpstr,
OCIError *errhp );
/*---------------------- OCIDirPathColArray Operations ----------------------*/
/*
NAME
OCIDirPathColArrayEntryGet - OCI: Get column array entry.
DESCRIPTION
Column array function which is used to get a specified entry in
a column array.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathColArrayEntryGet( OCIDirPathColArray *dpca, OCIError *errhp,
ub4 rownum, ub2 colIdx, ub1 **cvalpp, ub4 *clenp,
ub1 *cflgp );
/*
NAME
OCIDirPathColArrayEntrySet - OCI: Set column array entry.
DESCRIPTION
Column array function which is used to set a specified entry in
a column array.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathColArrayEntrySet( OCIDirPathColArray *dpca, OCIError *errhp,
ub4 rownum, ub2 colIdx, ub1 *cvalp, ub4 clen,
ub1 cflg );
/*
NAME
OCIDirPathColArrayRowGet - OCI: Get column array row pointers.
DESCRIPTION
Column array function which is used to get the base row pointers
for a specified row in a column array.
To be used in lieu of OCIDirPathColArrayEntryGet() and
OCIDirPathColArrayEntrySet().
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathColArrayRowGet( OCIDirPathColArray *dpca, OCIError *errhp,
ub4 rownum, ub1 ***cvalppp, ub4 **clenpp,
ub1 **cflgpp );
/*
NAME
OCIDirPathColArrayReset - OCI: Reset Column Array State
DESCRIPTION
Function which resets the column array state.
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
Resetting the column array state is necessary when piecing in a large
column and an error occurs in the middle of loading the column.
*/
sword
OCIDirPathColArrayReset( OCIDirPathColArray *dpca, OCIError *errhp );
/*
NAME
OCIDirPathColArrayToStream - OCI: Convert Column Array to Stream Format.
DESCRIPTION
Convert from column array format to stream format which is suitable
for loading via OCIDirPathLoadStream().
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathColArrayToStream( OCIDirPathColArray *dpca, OCIDirPathCtx *dpctx,
OCIDirPathStream *dpstr, OCIError *errhp,
ub4 rowcnt, ub4 rowoff );
/*----------------------- OCIDirPathStream Operations -----------------------*/
/*
NAME
OCIDirPathStreamReset - OCI:
DESCRIPTION
RETURNS
An OCI error code, Oracle errors are returned via the error handle.
NOTES
*/
sword
OCIDirPathStreamReset( OCIDirPathStream *dpstr, OCIError *errhp );
#endif /* OCI8DP_ORACLE */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,155 @@
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/*
NAME
ociapr.h
MODIFIED (MM/DD/YY)
mbastawa 09/16/05 - dbhygiene
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
dsaha 05/19/00 - Fix lint
sgollapu 05/19/98 - Change text to OraText
dchatter 11/10/95 - add ognfd() - get native fd
lchidamb 04/06/95 - drop maxdsz from obindps/odefinps
slari 04/07/95 - add opinit
dchatter 03/08/95 - osetpi and ogetpi
lchidamb 12/09/94 - add obindps() and odefinps()
dchatter 03/06/95 - merge changes from branch 1.1.720.2
dchatter 11/14/94 - merge changes from branch 1.1.720.1
dchatter 02/08/95 - olog call; drop onblon
dchatter 10/31/94 - new functions for non-blocking oci
rkooi2 11/27/92 - Changing datatypes to agree with ocidef.h
rkooi2 10/26/92 - More portability mods
rkooi2 10/18/92 - Changed to agree with oci.c
sjain 03/16/92 - Creation
*/
/*
* Declare the OCI functions.
* Prototype information is included.
* Use this header for ANSI C compilers.
*/
#ifndef OCIAPR
#define OCIAPR
#ifndef ORATYPES
#include <oratypes.h>
#endif
#ifndef OCIDFN
#include <ocidfn.h>
#endif
/*
* Oci BIND (Piecewise or with Skips)
*/
sword obindps(struct cda_def *cursor, ub1 opcode, OraText *sqlvar,
sb4 sqlvl, ub1 *pvctx, sb4 progvl,
sword ftype, sword scale,
sb2 *indp, ub2 *alen, ub2 *arcode,
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
ub4 maxsiz, ub4 *cursiz,
OraText *fmt, sb4 fmtl, sword fmtt);
sword obreak(struct cda_def *lda);
sword ocan (struct cda_def *cursor);
sword oclose(struct cda_def *cursor);
sword ocof (struct cda_def *lda);
sword ocom (struct cda_def *lda);
sword ocon (struct cda_def *lda);
/*
* Oci DEFINe (Piecewise or with Skips)
*/
sword odefinps(struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
sb4 bufl, sword ftype, sword scale,
sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt,
ub2 *rlen, ub2 *rcode,
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip);
sword odessp(struct cda_def *cursor, OraText *objnam, size_t onlen,
ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
ub4 *spare, ub4 *arrsiz);
sword odescr(struct cda_def *cursor, sword pos, sb4 *dbsize,
sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
sb2 *prec, sb2 *scale, sb2 *nullok);
sword oerhms (struct cda_def *lda, sb2 rcode, OraText *buf,
sword bufsiz);
sword oermsg (sb2 rcode, OraText *buf);
sword oexec (struct cda_def *cursor);
sword oexfet (struct cda_def *cursor, ub4 nrows,
sword cancel, sword exact);
sword oexn (struct cda_def *cursor, sword iters, sword rowoff);
sword ofen (struct cda_def *cursor, sword nrows);
sword ofetch (struct cda_def *cursor);
sword oflng (struct cda_def *cursor, sword pos, ub1 *buf,
sb4 bufl, sword dtype, ub4 *retl, sb4 offset);
sword ogetpi (struct cda_def *cursor, ub1 *piecep, void **ctxpp,
ub4 *iterp, ub4 *indexp);
sword oopt (struct cda_def *cursor, sword rbopt, sword waitopt);
sword opinit (ub4 mode);
sword olog (struct cda_def *lda, ub1* hda,
OraText *uid, sword uidl,
OraText *pswd, sword pswdl,
OraText *conn, sword connl,
ub4 mode);
sword ologof (struct cda_def *lda);
sword oopen (struct cda_def *cursor, struct cda_def *lda,
OraText *dbn, sword dbnl, sword arsize,
OraText *uid, sword uidl);
sword oparse (struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
sword defflg, ub4 lngflg);
sword orol (struct cda_def *lda);
sword osetpi (struct cda_def *cursor, ub1 piece, void *bufp, ub4 *lenp);
void sqlld2 (struct cda_def *lda, OraText *cname, sb4 *cnlen);
void sqllda (struct cda_def *lda);
/* non-blocking functions */
sword onbset (struct cda_def *lda );
sword onbtst (struct cda_def *lda );
sword onbclr (struct cda_def *lda );
sword ognfd (struct cda_def *lda, void *fdp);
/*
* OBSOLETE CALLS
*/
/*
* OBSOLETE BIND CALLS
*/
sword obndra(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt);
sword obndrn(struct cda_def *cursor, sword sqlvn, ub1 *progv,
sword progvl, sword ftype, sword scale, sb2 *indp,
OraText *fmt, sword fmtl, sword fmtt);
sword obndrv(struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
sb2 *indp, OraText *fmt, sword fmtl, sword fmtt);
/*
* OBSOLETE DEFINE CALLS
*/
sword odefin(struct cda_def *cursor, sword pos, ub1 *buf,
sword bufl, sword ftype, sword scale, sb2 *indp,
OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen, ub2 *rcode);
/* older calls ; preferred equivalent calls above */
sword oname (struct cda_def *cursor, sword pos, sb1 *tbuf,
sb2 *tbufl, sb1 *buf, sb2 *bufl);
sword orlon (struct cda_def *lda, ub1 *hda,
OraText *uid, sword uidl,
OraText *pswd, sword pswdl,
sword audit);
sword olon (struct cda_def *lda, OraText *uid, sword uidl,
OraText *pswd, sword pswdl, sword audit);
sword osql3 (struct cda_def *cda, OraText *sqlstm, sword sqllen);
sword odsc (struct cda_def *cursor, sword pos, sb2 *dbsize,
sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
sb2 *bufl, sb2 *dsize);
#endif /* OCIAPR */

@ -0,0 +1,886 @@
/* Copyright (c) 1981, 2005, Oracle. All rights reserved. */
/* Copyright (c) 1984, 2005, Oracle. All rights reserved. */
/*
NAME
ocidef
CONTENTS
Oracle Call Interface cursor area and LDA definitions
NOTES
none
OWNER
Oates
DATE
09/07/82
MODIFIED
mbastawa 09/16/05 - dbhygiene
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
srseshad 03/25/03 - convert oci public api to ansi
csteinba 11/05/02 - bug 2521931: redefine OTYACL
aahluwal 06/03/02 - bug 2360115
bpalaval 02/08/01 - Change text to oratext.
chliang 02/01/01 - fix olint error.
bpalaval 11/16/00 - Bug 1244685 : Fix ALTER CLUSTER issue..
slari 11/08/00 - remove functions duplicated in ociapr.h
whe 09/01/99 - 976457:check __cplusplus for C++ code
skmishra 04/23/97 - Provide C++ compatibility
lchidamb 06/26/96 - put upidef.h, riddef.h within #ifndef
slari 06/12/96 - add ocigft_getFcnType
dchatter 11/10/95 - ocignfd - oci get native file descriptor
slari 05/11/95 - change OCIEVDEF/OCIEVTSF to UPIEVDEF/UPIEVTSF
dchatter 04/06/95 - add ifdef flags around OCI_flags
lchidamb 04/06/95 - drop maxdsz from ocibndps/ocidfnps
slari 04/07/95 - rename opinit to ocipin
slari 03/13/95 - thread safety changes
dchatter 03/08/95 - piece definitions OCI_*_PIECE
lchidamb 12/06/94 - add support for binding/defining with skips
dchatter 03/06/95 - merge changes from branch 1.12.720.1
dchatter 02/06/95 - add defines for login mode parameters
dchatter 07/06/94 - Deleting CRSCHK, with refcursor, no way to set this
dchatter 06/13/94 - add a new LDA flag LDANBL
rkooi 11/18/92 - update ocidpr interface
mmoore 10/31/92 - add ocidpr
gpongrac 11/17/92 - fix oexfet prototype
sjain 01/03/92 - Add ocibra
rjenkins 11/04/91 - adding prototypes for oparse and oexfet
sjain 04/15/91 - Change ocistf proto
sjain 04/01/91 - Rearrange oty codes. Add new ones
Jain 12/03/90 - Add #define for new describe call
Jain 11/29/90 - Add new function code for the new oci calls
Mendels 01/20/89 - fix 19170: make ocitbl CONST_DATA
Kabcene 01/27/88 - change interfaces to match V5
Navab 12/09/87 - add a parameter to ocierr call
Navab 11/30/87 - add ocierr, rename ocioer
Navab 10/08/87 - add prototypes for procedure declarations
Howard 09/07/87 - endif blah
Howard 05/11/87 - Add OTY types
Howard 04/27/87 - move ocldef defines here
Oates 10/15/85 - Add OCANCEL
Oates 09/30/85 - Implement ORA*Net
Oates 06/27/85 - Make datatype compatible with upidef.h
Andy 05/07/85 - delete CSRFBPIC
*/
#ifndef UPIDEF
#include <upidef.h>
#endif
#ifndef RIDDEF
#include <riddef.h>
#endif
#include <ociapr.h>
#ifndef OCIDEF
#define OCIDEF
#define CSRCHECK 172 /* csrdef is a cursor */
#define LDACHECK 202 /* csrdef is a login data area */
struct csrdef
{
sb2 csrrc; /* return code: v2 codes, v4 codes negative */
ub2 csrft; /* function type */
ub4 csrrpc; /* rows processed count */
ub2 csrpeo; /* parse error offset */
ub1 csrfc; /* function code */
ub1 csrlfl; /* lda flag to indicate type of login */
ub2 csrarc; /* actual untranslated return code */
ub1 csrwrn; /* warning flags */
ub1 csrflg; /* error action */
sword csrcn; /* cursor number */
riddef csrrid; /* rowid structure */
sword csrose; /* os dependent error code */
ub1 csrchk; /* check byte = CSRCHECK - in cursor */
/* check byte = LDACHECK - in LDA */
struct hstdef *csrhst; /* pointer to the hst */
};
typedef struct csrdef csrdef;
typedef struct csrdef ldadef; /* lda is the same as a csr */
/* values for csrlfl */
#define LDAFLG 1 /* ...via ologon */
#define LDAFLO 2 /* ...via olon or orlon */
#define LDANBL 3 /* ...nb logon in progress */
/* valuses for crsfc */
#define csrfpa 2 /* ...OSQL */
#define csrfex 4 /* ...OEXEC */
#define csrfbi 6 /* ...OBIND */
#define csrfdb 8 /* ...ODFINN */
#define csrfdi 10 /* ...ODSRBN */
#define csrffe 12 /* ...OFETCH */
#define csrfop 14 /* ...OOPEN */
#define csrfcl 16 /* ...OCLOSE */
#define csrfds 22 /* ...ODSC */
#define csrfnm 24 /* ...ONAME */
#define csrfp3 26 /* ...OSQL3 */
#define csrfbr 28 /* ...OBNDRV */
#define csrfbx 30 /* ...OBNDRN */
/*#defe csrfdf 32*/ /* ???? */
#define csrfso 34 /* ...OOPT */
#define csrfre 36 /* ...ORESUM */
#define csrfbn 50 /* ...OBINDN */
#define csrfca 52 /* ..OCANCEL */
#define csrfsd 54 /* ..OSQLD */
#define csrfef 56 /* ..OEXFEN */
#define csrfln 58 /* ..OFLNG */
#define csrfdp 60 /* ..ODSCSP */
#define csrfba 62 /* ..OBNDRA */
#define csrfbps 63 /*..OBINDPS */
#define csrfdps 64 /*..ODEFINPS */
#define csrfgpi 65 /* ...OGETPI */
#define csrfspi 66 /* ...OSETPI */
/* values for csrwrn */
#define CSRWANY 0x01 /* there is a warning flag set */
#define CSRWTRUN 0x02 /* a data item was truncated */
#define CSRWNVIC 0x04 /* NULL values were used in an aggregate function */
#define CSRWITCE 0x08 /* column count not equal to into list count */
#define CSRWUDNW 0x10 /* update or delete without where clause */
#define CSRWRSV0 0x20
#define CSRWROLL 0x40 /* rollback required */
#define CSRWRCHG 0x80 /* change after query start on select for update */
/* values fro csrflg */
#define CSRFSPND 0x01 /* current operation suspended */
#define CSRFATAL 0x02 /* fatal operation: transaction rolled back */
#define CSRFBROW 0x04 /* current row backed out */
#define CSRFREFC 0x08 /* ref cursor type CRSCHK disabled for this cursor */
#define CSRFNOAR 0x10 /* ref cursor type binds, so no array bind/execute */
/* define function codes; in order of octdef.h */
#define OTYCTB 1 /* CREATE TABLE */
#define OTYSER 2 /* set role */
#define OTYINS 3 /* INSERT */
#define OTYSEL 4 /* SELECT */
#define OTYUPD 5 /* UPDATE */
#define OTYDRO 6 /* drop role */
#define OTYDVW 7 /* DROP VIEW */
/* once was validate index */
/* once was create partition */
/* once was alter partition */
#define OTYDTB 8 /* DROP TABLE */
/* once was alter space */
/* once was drop space */
#define OTYDEL 9 /* DELETE */
#define OTYCVW 10 /* create view */
#define OTYDUS 11 /* drop user */
#define OTYCRO 12 /* create role */
#define OTYCSQ 13 /* create sequence */
#define OTYASQ 14 /* alter sequence */
#define OTYACL 15 /* alter cluster */
#define OTYDSQ 16 /* drop sequence */
#define OTYCSC 17 /* create schema */
#define OTYCCL 18 /* CREATE CLUSTER */
/* once was alter cluster */
#define OTYCUS 19 /* create user */
#define OTYCIX 20 /* CREATE INDEX */
#define OTYDIX 21 /* DROP INDEX */
#define OTYDCL 22 /* DROP CLUSTER */
#define OTYVIX 23 /* validate index */
#define OTYCPR 24 /* create procedure */
#define OTYAPR 25 /* alter procedure */
#define OTYATB 26 /* alter table */
/* once was evaluate */
#define OTYXPL 27 /* explain */
#define OTYGRA 28 /* grant */
#define OTYREV 29 /* revoke */
#define OTYCSY 30 /* create synonym */
#define OTYDSY 31 /* drop synonym */
#define OTYASY 32 /* alter system switch log */
#define OTYSET 33 /* set transaction */
#define OTYPLS 34 /* pl/sql execute */
#define OTYLTB 35 /* lock */
#define OTYNOP 36 /* noop */
#define OTYRNM 37 /* rename */
#define OTYCMT 38 /* comment */
#define OTYAUD 39 /* audit */
#define OTYNOA 40 /* no audit */
#define OTYAIX 41 /* ALTER INDEX */
#define OTYCED 42 /* create external database */
#define OTYDED 43 /* drop external database */
#define OTYCDB 44 /* create database */
#define OTYADB 45 /* alter database */
#define OTYCRS 46 /* create rollback segment */
#define OTYARS 47 /* alter rollback segment */
#define OTYDRS 48 /* drop rollback segment */
#define OTYCTS 49 /* create tablespace */
#define OTYATS 50 /* alter tablespace */
#define OTYDTS 51 /* drop tablespace */
#define OTYASE 52 /* alter session */
#define OTYAUR 53 /* alter user */
#define OTYCWK 54 /* commit (work) */
#define OTYROL 55 /* rollback */
#define OTYSPT 56 /* savepoint */
/* For number greater than 56 the the type is the same as defined in
** octdef.h for that number. So for completion look at octdef.h
*/
#define OTYDEV OTYCVW /* old DEFINE VIEW = create view */
/* FUNCTION CODES */
#define OCLFPA 2 /* parse - OSQL */
#define OCLFEX 4 /* execute - OEXEC */
#define OCLFBI 6 /* BIND by name - OBIND */
#define OCLFDB 8 /* define buffer - ODEFIN */
#define OCLFDI 10 /* describe item - ODSC */
#define OCLFFE 12 /* fetch - OFETCH */
#define OCLFOC 14 /* open cursor - OOPEN */
# define OCLFLI OCLFOC /* old name for open cursor - OOPEN */
#define OCLFCC 16 /* close cursor - OCLOSE */
# define OCLFLO OCLFCC /* old name for close cursor - OCLOSE */
#define OCLFDS 22 /* describe - ODSC */
#define OCLFON 24 /* get table and column names - ONAME */
#define OCLFP3 26 /* parse - OSQL3 */
#define OCLFBR 28 /* bind reference by name - OBNDRV */
#define OCLFBX 30 /* bind referecne numeric - OBNDRN */
#define OCLFSO 34 /* special function - OOPT */
#define OCLFRE 36 /* resume - ORESUM */
#define OCLFBN 50 /* bindn */
#define OCLFMX 52 /* maximum function number */
#ifdef NEVER /* unused codes */
# define OCLFLK 18 /* open for kernel operations */
# define OCLFEK 20 /* execute kernel operations */
# define OCLFOK 22 /* kernel close */
# define OCLFIN 28 /* logon to oracle */
# define OCLFOF 30 /* logoff from oracle */
# define OCLFAX 32 /* allocate a context area */
# define OCLFPI 34 /* page in context area */
# define OCLFIS 36 /* special system logon */
# define OCLFCO 38 /* cancel the current operation */
# define OCLFGI 40 /* get database id */
# define OCLFJN 42 /* journal operation */
# define OCLFCL 44 /* cleanup prior execute operation */
# define OCLFMC 46 /* map a cursor area */
# define OCLFUC 48 /* unmap cursor and restore user maping */
#endif /*NEVER *//* obsolete codes */
/* values for ocimode in ocipin call */
#define OCIEVDEF UPIEVDEF /* default : non-thread safe enivronment */
#define OCIEVTSF UPIEVTSF /* thread-safe environment */
/* OCIL* flags used to determine the mode of login, using ocilog().
** Currently defined only for non-blocking and thread-safe logins.
*/
#define OCILMDEF UPILMDEF /* default, regular login */
#define OCILMNBL UPILMNBL /* non-blocking logon */
#define OCILMESY UPILMESY /* thread safe but external sync */
#define OCILMISY UPILMISY /* internal sync, we do it */
#define OCILMTRY UPILMTRY /* try to, but do not block on mutex */
/*
* since sqllib uses both ocidef and ocidfn the following defines
* need to be guarded
*/
#ifndef OCI_FLAGS
#define OCI_FLAGS
/* OCI_*_PIECE defines the piece types that are returned or set
*/
#define OCI_ONE_PIECE UPI_ONE_PIECE /* there or this is the only piece */
#define OCI_FIRST_PIECE UPI_FIRST_PIECE /* the first of many pieces */
#define OCI_NEXT_PIECE UPI_NEXT_PIECE /* the next of many pieces */
#define OCI_LAST_PIECE UPI_LAST_PIECE /* the last piece of this column */
#endif
/*
** OCITAB: define return code pairs for version 2 to 3 conversions
*/
struct ocitab
{
sb2 ocitv3; /* Version 3/4 return code */
sb2 ocitv2; /* Version 2 equivalent return code */
};
typedef struct ocitab ocitab;
externref const ocitab ocitbl[];
/* macros to check cursors and LDA's. */
/* macros to set error codes */
# define CRSCHK(c) if ((c->csrchk != CSRCHECK)\
&& !bit(c->csrflg, CSRFREFC))\
return(ocir32(c, OER(1001)))
# define ldaerr(l, e) ( l->csrrc = (sb2)(-( l->csrarc = (ub2)(e)) ) )
# define LDACHK(l) if (l->csrchk != LDACHECK) \
return(ldaerr(l, OER(1001)))
/************************************************/
/* OCI PROCEDURE DECLARATIONS */
/************************************************/
/*****************************/
/* Database logon/logout */
/*****************************/
sword ocilog( ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,
oratext *psw, sword pswl, oratext* conn, sword connl,
ub4 mode );
sword ocilon( ldadef *lda, oratext *uid, sword uidl, oratext *psw,
sword pswl, sword audit );
sword ocilgi( ldadef *lda, sb2 areacount );
sword ocirlo( ldadef *lda, struct hstdef *hst, oratext *uid, sword uidl,
oratext *psw, sword pswl, sword audit );
/* ocilon - logon to oracle
** ocilgi - version 2 compatible ORACLE logon call.
** no login to ORACLE is performed: the LDA is initialized
** ocirlo - version 5 compatible ORACLE Remote Login call,
** oracle login is executed.
** lda - pointer to ldadef
** uid - user id [USER[/PASSWORD]]
** uidl - length of uid, if -1 strlen(uid) is used
** psw - password string; ignored if specified in uid
** pswl - length of psw, if -1 strlen(psw) is used
** audit - is not supported; the only permissible value is 0
** areacount - unused
*/
sword ocilof( ldadef *lda );
/*
** ocilof - disconnect from ORACLE
** lda - pointer to ldadef
*/
/*********************/
/* Error Messages */
/*********************/
sword ocierr( ldadef *lda, sb2 rcode, oratext *buffer, sword bufl );
sword ocidhe( sb2 rcode, oratext *buffer );
/*
** Move the text explanation for an ORACLE error to a user defined buffer
** ocierr - will return the message associated with the hstdef stored
** in the lda.
** ocidhe - will return the message associated with the default host.
** lda - lda associated with the login session
** rcode - error code as returned by V3 call interface
** buffer - address of a user buffer of at least 132 characters
*/
/***********************/
/* Cursor Open/Close */
/***********************/
sword ociope( struct csrdef *cursor, ldadef *lda, oratext *dbn, sword dbnl,
sword areasize, oratext *uid, sword uidl );
sword ociclo( struct csrdef *cursor );
/*
** open or close a cursor.
** cursor - pointer to csrdef
** ldadef - pointer to ldadef
** dbn - unused
** dbnl - unused
** areasize - if (areasize == -1) areasize <- system default initial size
** else if (areasize IN [1..256]) areasize <- areasize * 1024;
** most applications should use the default size since context
** areas are extended as needed until memory is exhausted.
** uid - user id
** uidl - userid length
*/
/***********************************/
/* CONTROL AND OPTIONS */
/***********************************/
sword ocibre( ldadef *lda );
/*
** ocibrk - Oracle Call Interface send BReaK Sends a break to
** oracle. If oracle is active, the current operation is
** cancelled. May be called asynchronously. DOES NOT SET
** OERRCD in the hst. This is because ocibrk may be called
** asynchronously. Callers must test the return code.
** lda - pointer to a ldadef
*/
sword ocican( struct csrdef *cursor );
/*
** cancel the operation on the cursor, no additional OFETCH calls
** will be issued for the existing cursor without an intervening
** OEXEC call.
** cursor - pointer to csrdef
*/
sword ocisfe( struct csrdef *cursor, sword erropt, sword waitopt );
/*
** ocisfe - user interface set error options
** set the error and cursor options.
** allows user to set the options for dealing with fatal dml errors
** and other cursor related options
** see oerdef for valid settings
** cursor - pointer to csrdef
** erropt - error optionsn
** waitopr - wait options
*/
/***************************************/
/* COMMIT/ROLLBACK/AUTOCOMMIT */
/***************************************/
sword ocicom( ldadef *lda );
sword ocirol( ldadef *lda );
/*
** ocicom - commit the current transaction
** ocirol - roll back the current transaction
*/
sword ocicon( ldadef *lda );
sword ocicof( ldadef *lda );
/*
** ocicon - auto Commit ON
** ocicof - auto Commit OFf
*/
/************************/
/* parsing */
/************************/
sword ocisq3(struct csrdef *cursor, oratext * /* sqlstm */, sword sqllen);
/*
** ocisq3 - user interface parse sql statement
** cursor - pointer to csrdef
** sqlstm - pointer to SQL statement
** sqllen - length of SQL statement. if -1, strlen(sqlstm) is used
*/
/***************************/
/* BINDING */
/***************************/
/* these are for the opcode in ocibndps, ocidfnps */
#define OCI_PCWS 0
#define OCI_SKIP 1
sword ocibin( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
oratext *fmt, sword fmtl, sword fmtt );
sword ocibrv( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale, sb2 *indp,
oratext *fmt, sword fmtl, sword fmtt );
sword ocibra( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
sb2 *indp, ub2 *aln, ub2 *rcp, ub4 mal, ub4 *cal,
oratext *fmt, sword fmtl, sword fmtt );
sword ocibndps( struct csrdef *cursor, ub1 opcode, oratext *sqlvar,
sb4 sqlvl, ub1 *progv, sb4 progvl, sword ftype,
sword scale, sb2 *indp, ub2 *aln, ub2 *rcp, sb4 pv_skip,
sb4 ind_skip, sb4 len_skip, sb4 rc_skip, ub4 mal,
ub4 *cal, oratext *fmt, sb4 fmtl, sword fmtt );
sword ocibnn ( struct csrdef *cursor, ub2 sqlvn, ub1 *progv, sword progvl,
sword ftype, sword scale, oratext *fmt, sword fmtl,
sword fmtt );
sword ocibrn( struct csrdef *cursor, sword sqlvn, ub1 *progv, sword progvl,
sword ftype, sword scale, sb2 *indp, oratext *fmt, sword fmtl,
sword fmtt );
/*
** ocibin - bind by value by name
** ocibrv - bind by reference by name
** ocibra - bind by reference by name (array)
** ocibndps - bind by reference by name (array) piecewise or with skips
** ocibnn - bind by value numeric
** ocibrn - bind by reference numeric
**
** the contents of storage specified in bind-by-value calls are
** evaluated immediately.
** the addresses of storage specified in bind-by-reference calls are
** remembered, and the contents are examined at every execute.
**
** cursor - pointer to csrdef
** sqlvn - the number represented by the name of the bind variables
** for variables of the form :n or &n for n in [1..256)
** (i.e. &1, :234). unnecessarily using larger numbers
** in the range wastes space.
** sqlvar - the name of the bind variable (:name or &name)
** sqlval - the length of the name;
** in bindif -1, strlen(bvname) is used
** progv - pointer to the object to bind.
** progvl - length of object to bind.
** in bind-by-value if specified as -1 then strlen(bfa) is
** used (really only makes sends with character types)
** in bind-by-value, if specified as -1 then UB2MAXVAL
** is used. Again this really makes sense only with
** SQLT_STR.
** ftype - datatype of object
** indp - pointer to indicator variable.
** -1 means to ignore bfa/bfl and bind NULL;
** not -1 means to bind the contents of bfa/bfl
** bind the contents pointed to by bfa
** aln - Alternate length pointer
** rcp - Return code pointer
** mal - Maximum array length
** cal - Current array length pointer
** fmt - format string
** fmtl - length of format string; if -1, strlen(fmt) is used
** fmtt - desired output type after applying forat mask. Not
** really yet implemented
** scale - number of decimal digits in a cobol packed decimal (type 7)
**
** Note that the length of bfa when bound as SQLT_STR is reduced
** to strlen(bfa).
** Note that trailing blanks are stripped of storage of SQLT_STR.
*/
/***************************/
/* DESCRIBING */
/***************************/
sword ocidsc ( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *fsize,
sb2 *rcode, sb2 *dtype, sb1 *buf, sb2 *bufl, sb2 *dsize );
sword ocidsr( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *dtype,
sb2 *fsize );
sword ocinam( struct csrdef *cursor, sword pos, sb1 *tbuf, sb2 *tbufl,
sb1 *buf, sb2 *bufl );
/*
** ocidsc, ocidsr: Obtain information about a column
** ocinam : get the name of a column
** cursor - pointer to csrdef
** pos - position in select list from [1..N]
** dbsize - place to store the database size
** fsize - place to store the fetched size
** rcode - place to store the fetched column returned code
** dtype - place to store the data type
** buf - array to store the column name
** bufl - place to store the column name length
** dsize - maximum display size
** tbuf - place to store the table name
** tbufl - place to store the table name length
*/
sword ocidsp ( struct csrdef *cursor, sword pos, sb4 *dbsize, sb2 *dbtype,
sb1 *cbuf, sb4 *cbufl, sb4 *dsize, sb2 *pre, sb2 *scl,
sb2 *nul );
sword ocidpr( ldadef *lda, oratext *object_name, size_t object_length,
void * reserved1, size_t reserved1_length, void * reserved2,
size_t reserved2_length, ub2 *overload, ub2 *position,
ub2 *level, oratext **argument_name, ub2 *argument_length,
ub2 *datatype, ub1 *default_supplied, ub1 *in_out,
ub4 *length, sb2 *precision, sb2 *scale, ub1 *radix,
ub4 *spare, ub4 *total_elements );
/*
** OCIDPR - User Program Interface: Describe Stored Procedure
**
** This routine is used to obtain information about the calling
** arguments of a stored procedure. The client provides the
** name of the procedure using "object_name" and "database_name"
** (database name is optional). The client also supplies the
** arrays for OCIDPR to return the values and indicates the
** length of array via the "total_elements" parameter. Upon return
** the number of elements used in the arrays is returned in the
** "total_elements" parameter. If the array is too small then
** an error will be returned and the contents of the return arrays
** are invalid.
**
**
** EXAMPLE :
**
** Client provides -
**
** object_name - SCOTT.ACCOUNT_UPDATE@BOSTON
** total_elements - 100
**
**
** ACCOUNT_UPDATE is an overloaded function with specification :
**
** type number_table is table of number index by binary_integer;
** table account (account_no number, person_id number,
** balance number(7,2))
** table person (person_id number(4), person_nm varchar2(10))
**
** function ACCOUNT_UPDATE (account number,
** person person%rowtype, amounts number_table,
** trans_date date) return accounts.balance%type;
**
** function ACCOUNT_UPDATE (account number,
** person person%rowtype, amounts number_table,
** trans_no number) return accounts.balance%type;
**
**
** Values returned -
**
** overload position argument level datatype length prec scale rad
** -------------------------------------------------------------------
** 0 0 0 NUMBER 22 7 2 10
** 0 1 ACCOUNT 0 NUMBER 22 0 0 0
** 0 2 PERSON 0 RECORD 0 0 0 0
** 0 2 PERSON_ID 1 NUMBER 22 4 0 10
** 0 2 PERSON_NM 1 VARCHAR2 10 0 0 0
** 0 3 AMOUNTS 0 TABLE 0 0 0 0
** 0 3 1 NUMBER 22 0 0 0
** 0 4 TRANS_NO 0 NUMBER 22 0 0 0
**
** 1 0 0 NUMBER 22 7 2 10
** 1 1 ACCOUNT 0 NUMBER 22 0 0 0
** 1 2 PERSON 0 RECORD 0 0 0 0
** 1 2 PERSON_ID 1 NUMBER 22 4 0 10
** 1 2 PERSON_NM 1 VARCHAR2 10 0 0 0
** 1 3 AMOUNTS 0 TABLE 0 0 0 0
** 1 3 1 NUMBER 22 0 0 0
** 1 4 TRANS_DATE 0 NUMBER 22 0 0 0
**
**
** OCIDPR Argument Descriptions -
**
** ldadef - pointer to ldadef
** object_name - object name, synonyms are also accepted and will
** be translate, currently only procedure and function
** names are accepted, also NLS names are accepted.
** Currently, the accepted format of a name is
** [[part1.]part2.]part3[@dblink] (required)
** object_length - object name length (required)
** reserved1 - reserved for future use
** reserved1_length - reserved for future use
** reserved2 - reserved for future use
** reserved2_length - reserved for future use
** overload - array indicating overloaded procedure # (returned)
** position - array of argument positions, position 0 is a
** function return argument (returned)
** level - array of argument type levels, used to describe
** sub-datatypes of data structures like records
** and arrays (returned)
** argument_name - array of argument names, only returns first
** 30 characters of argument names, note storage
** for 30 characters is allocated by client (returned)
** argument_length - array of argument name lengths (returned)
** datatype - array of oracle datatypes (returned)
** default_supplied - array indicating parameter has default (returned)
** 0 = no default, 1 = default supplied
** in_out - array indicating if argument is IN or OUT (returned
** 0 = IN param, 1 = OUT param, 2 = IN/OUT param
** length - array of argument lengths (returned)
** precision - array of precisions (if number type)(returned)
** scale - array of scales (if number type)(returned)
** radix - array of radix (if number type)(returned)
** spare - array of spares.
** total_elements - size of arrays supplied by client (required),
** total number of elements filled (returned)
*/
/*************************************/
/* DEFINING */
/*************************************/
sword ocidfi( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
sword ftype, sb2 *rc, sword scale );
sword ocidfn( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
sword ftype, sword scale, sb2 *indp, oratext *fmt, sword fmtl,
sword fmtt, ub2 *rl, ub2 *rc );
sword ocidfnps( struct csrdef *cursor, ub1 opcode, sword pos, ub1 *buf,
sb4 bufl, sword ftype, sword scale,
sb2 *indp, oratext *fmt, sb4 fmtl,
sword fmtt, ub2 *rl, ub2 *rc,
sb4 pv_skip, sb4 ind_skip, sb4 len_skip,
sb4 rc_skip );
/* Define a user data buffer using upidfn
** cursor - pointer to csrdef
** pos - position of a field or exp in the select list of a query
** bfa/bfl - address and length of client-supplied storage
to receive data
** ftype - user datatype
** scale - number of fractional digits for cobol packed decimals
** indp - place to store the length of the returned value. If returned
** value is:
** negative, the field fetched was NULL
** zero , the field fetched was same length or shorter than
** the buffer provided
** positive, the field fetched was truncated
** fmt - format string
** fmtl - length of format string, if -1 strlent(fmt) used
** rl - place to store column length after each fetch
** rc - place to store column error code after each fetch
** fmtt - fomat type
*/
/********************************/
/* PIECE INFORMATION GET/SET */
/********************************/
sword ocigetpi( struct csrdef *cursor, ub1 *piecep,
void **ctxpp, ub4 *iterp, ub4 *indexp );
sword ocisetpi( struct csrdef *cursor, ub1 piece,
void *bufp, ub4 *lenp );
/********************************/
/* EXECUTE */
/********************************/
sword ociexe( struct csrdef *cursor );
sword ociexn( struct csrdef *cursor, sword iters, sword roff );
sword ociefn( struct csrdef *cursor, ub4 nrows, sword can, sword exact );
/*
** ociexe - execute a cursor
** ociexn - execute a cursosr N times
** cursor - pointer to a csrdef
** iters - number of times to execute cursor
** roff - offset within the bind variable array at which to begin
** operations.
*/
/*********************************/
/* FETCHING */
/*********************************/
sword ocifet( struct csrdef *cursor );
sword ocifen( struct csrdef *cursor, sword nrows );
/* ocifet - fetch the next row
** ocifen - fetch n rows
** cursor - pointer to csrdef
** nrows - number of rows to be fetched
*/
sword ocilng( struct csrdef *cursor, sword posit, ub1 *bfa, sb4 bfl,
sword dty, ub4 *rln, sb4 off );
/*********************************/
/* CONVERSION */
/*********************************/
sword ocic32( struct csrdef *cursor );
/*
** Convert selected version 3 return codes to the equivalent
** version 2 code.
** csrdef->csrrc is set to the converted code
** csrdef->csrft is set to v2 oracle statment type
** csrdef->csrrpc is set to the rows processed count
** csrdef->csrpeo is set to error postion
**
** cursor - pointer to csrdef
*/
sword ocir32( struct csrdef *cursor, sword retcode );
/*
** Convert selected version 3 return codes to the equivalent version 2
** code.
**
** cursor - pointer to csrdef
** retcode - place to store the return code
*/
void ociscn( sword **arglst, char *mask_addr, sword **newlst );
/*
** Convert call-by-ref to call-by-value:
** takes an arg list and a mask address, determines which args need
** conversion to a value, and creates a new list begging at the address
** of newlst.
**
** arglst - list of arguments
** mast_addr _ mask address determines args needing conversion
** newlst - new list of args
*/
sword ocistf ( sword typ, sword bufl, sword rdig, oratext *fmt,
struct csrdef *cursor, sword *err );
/* Convert a packed decimal buffer length (bytes) and scale to a format
** string of the form mm.+/-nn, where mm is the number of packed
** decimal digits, and nn is the scaling factor. A positive scale name
** nn digits to the rights of the decimal; a negative scale means nn zeros
** should be supplied to the left of the decimal.
** bufl - length of the packed decimal buffer
** rdig - number of fractional digits
** fmt - pointer to a string holding the conversion format
** cursor - pointer to csrdef
** err - pointer to word storing error code
*/
/******************************************/
/* Non-blocking operations */
/******************************************/
sword ocinbs( ldadef *lda ); /* set a connection to non-blocking */
sword ocinbt( ldadef *lda ); /* test if connection is non-blocking */
sword ocinbc( ldadef *lda ); /* clear a connection to blocking */
sword ocinlo( ldadef *lda, struct hstdef *hst, oratext *conn,
sword connl, oratext *uid, sword uidl,
oratext *psw, sword pswl, sword audit );
/* logon in non-blocking fashion */
/* ocinlo allows an application to logon in non-blocking fashion.
** lda - pointer to ldadef
** hst - pointer to a 256 byte area, must be cleared to zero before call
** conn - the database link (if specified @LINK in uid will be ignored)
** connl - length of conn; if -1 strlen(conn) is used
** uid - user id [USER[/PASSWORD][@LINK]]
** uidl - length of uid, if -1 strlen(uid) is used
** psw - password string; ignored if specified in uid
** pswl - length of psw, if -1 strlen(psw) is used
** audit - is not supported; the only permissible value is 0
*/
/***************************************************/
/* Procedure Declaration for Pro*C */
/***************************************************/
/* Note: The following routines are used in Pro*C and have the
same interface as their couterpart in OCI.
Althought the interface follows for more details please refer
to the above routines */
/******************************************/
/* initialization/logon/logof */
/******************************************/
sword ocipin( ub4 mode );
sword ologin( ldadef *lda, sb2 areacount );
sword ologon( ldadef *lda, sb2 areacount );
/*****************************************/
/* Open/Close/Parse Cursor */
/*****************************************/
/*
** ocisqd - oci delayed parse (Should be used only with deferred upi/oci)
** FUNCTION: Call upidpr to delay the parse of the sql statement till the
** time that a call needs to be made to the kernel (execution or
** describe time )
** RETURNS: Oracle return code.
*/
sword ocisq7( struct csrdef *cursor, oratext * /* sqlstm */, sb4 sqllen,
sword defflg, ub4 sqlt );
/*****************************************/
/* Bind */
/*****************************************/
sword obind( struct csrdef *cursor, oratext *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
oratext *fmt, sword fmtl, sword fmtt );
sword obindn( struct csrdef *cursor, ub2 sqlvn, ub1 *progv, sword progvl,
sword ftype, sword scale, oratext *fmt, sword fmtl,
sword fmtt );
/**********************************************/
/* Define */
/**********************************************/
sword odfinn( struct csrdef *cursor, sword pos, ub1 *buf, sword bufl,
sword ftype, sb2 *rc, sword scale );
/**********************************************/
/* Describe */
/**********************************************/
sword odsrbn( struct csrdef *cursor, sword pos, sb2 *dbsize, sb2 *dtype,
sb2 *fsize );
/******************************************/
/* Non-blocking operations */
/******************************************/
sword onblon( ldadef *lda, struct hstdef *hst, oratext *conn,
sword connl, oratext *uid, sword uidl,
oratext *psw, sword pswl, sword audit );
/* logon in non-blocking fashion */
sword ocignfd( ldadef *lda, void *nfdp ); /* get native fd */
ub2 ocigft_getFcnType( ub2 oertyp ); /* get sql function code */
#endif

@ -0,0 +1,113 @@
/*
*
*/
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/*
NAME
ocidem.h - OCI demo header
MODIFIED (MM/DD/YY)
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
whe 04/07/99 - bug#810071
whe 03/19/99 - lrg 32079 etc.: putting static back for oci_func_tab
nmacnaug 02/02/99 - static declarations should not be in header files
mygopala 09/22/97 - Fix for bug 550351
surman 03/14/97 - Merge 413362 to 8.0.3
surman 11/08/96 - 413362: Add SS_64BIT_SERVER macro
emendez 04/07/94 - merge changes from branch 1.6.710.1
emendez 02/02/94 - Fix for bug 157576
jnlee 01/05/93 - include oratypes.h once, make oci_func_tab static
rkooi2 10/26/92 - More portability mods
rkooi2 10/22/92 - Change text back to char to avoid casts
rkooi2 10/20/92 - Changes to make it portable
sjain 03/16/92 - Creation
*/
/*
* ocidem.h
*
* Declares additional functions and data structures
* used in the OCI C sample programs.
*/
#ifndef ORATYPES
#include <oratypes.h>
#endif /* ORATYPES */
#ifndef OCIDFN
#include <ocidfn.h>
#endif /* OCIDFN */
#ifndef OCIDEM
#define OCIDEM
/* internal/external datatype codes */
#define VARCHAR2_TYPE 1
#define NUMBER_TYPE 2
#define INT_TYPE 3
#define FLOAT_TYPE 4
#define STRING_TYPE 5
#define ROWID_TYPE 11
#define DATE_TYPE 12
/* ORACLE error codes used in demonstration programs */
#define VAR_NOT_IN_LIST 1007
#ifndef NO_DATA_FOUND
# define NO_DATA_FOUND 1403
#endif
#define NULL_VALUE_RETURNED 1405
/* some SQL and OCI function codes */
#define FT_INSERT 3
#define FT_SELECT 4
#define FT_UPDATE 5
#define FT_DELETE 9
#define FC_OOPEN 14
/*
* OCI function code labels,
* corresponding to the fc numbers
* in the cursor data area.
*/
static const text *oci_func_tab[] = {(text *) "not used",
/* 1-2 */ (text *) "not used", (text *) "OSQL",
/* 3-4 */ (text *) "not used", (text *) "OEXEC, OEXN",
/* 5-6 */ (text *) "not used", (text *) "OBIND",
/* 7-8 */ (text *) "not used", (text *) "ODEFIN",
/* 9-10 */ (text *) "not used", (text *) "ODSRBN",
/* 11-12 */ (text *) "not used", (text *) "OFETCH, OFEN",
/* 13-14 */ (text *) "not used", (text *) "OOPEN",
/* 15-16 */ (text *) "not used", (text *) "OCLOSE",
/* 17-18 */ (text *) "not used", (text *) "not used",
/* 19-20 */ (text *) "not used", (text *) "not used",
/* 21-22 */ (text *) "not used", (text *) "ODSC",
/* 23-24 */ (text *) "not used", (text *) "ONAME",
/* 25-26 */ (text *) "not used", (text *) "OSQL3",
/* 27-28 */ (text *) "not used", (text *) "OBNDRV",
/* 29-30 */ (text *) "not used", (text *) "OBNDRN",
/* 31-32 */ (text *) "not used", (text *) "not used",
/* 33-34 */ (text *) "not used", (text *) "OOPT",
/* 35-36 */ (text *) "not used", (text *) "not used",
/* 37-38 */ (text *) "not used", (text *) "not used",
/* 39-40 */ (text *) "not used", (text *) "not used",
/* 41-42 */ (text *) "not used", (text *) "not used",
/* 43-44 */ (text *) "not used", (text *) "not used",
/* 45-46 */ (text *) "not used", (text *) "not used",
/* 47-48 */ (text *) "not used", (text *) "not used",
/* 49-50 */ (text *) "not used", (text *) "not used",
/* 51-52 */ (text *) "not used", (text *) "OCAN",
/* 53-54 */ (text *) "not used", (text *) "OPARSE",
/* 55-56 */ (text *) "not used", (text *) "OEXFET",
/* 57-58 */ (text *) "not used", (text *) "OFLNG",
/* 59-60 */ (text *) "not used", (text *) "ODESCR",
/* 61-62 */ (text *) "not used", (text *) "OBNDRA",
/* 63-64 */ (text *) "OBINDPS", (text *) "ODEFINPS",
/* 65-66 */ (text *) "OGETPI", (text *) "OSETPI"
};
#endif /* OCIDEM */

@ -0,0 +1,249 @@
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/*
NAME
ocidfn.h - OCI Definations
NOTES
Shipped to users.
MODIFIED (MM/DD/YY)
mbastawa 09/16/05 - dbhygiene
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
srseshad 11/25/02 - change binary float/double codes
srseshad 11/14/02 - Add SQLT_IBFLOAT, SQLT_IBDOUBLE
mxyang 09/17/02 - grabtrans 'mmorsi_obj_float'
srseshad 09/06/02 - Add binary float/double
aahluwal 06/04/02 - bug 2360115
kmuthukk 05/02/00 - add SQLT_PNTY
amangal 07/30/99 - Merge into 8.1.6 : Bug 879031
tnbui 07/28/99 - Remove SQLT_TIMESTAMP_ITZ
tnbui 07/21/99 - SQLT_TIMESTAMP_LTZ
tnbui 06/16/99 - TIMESTAMP WITH IMPLICIT TIME ZONE
whe 04/07/99 - bug#810075
whe 03/19/99 - lrg 32079 etc.: move HDA def from ocidem.h to ocidfn.
skmishra 05/10/98 -
vyanaman 04/16/98 - update sql92 datatypes
khnguyen 01/16/98 -
khnguyen 12/23/97 - SQLT* for datetimes and intervals
tanguyen 08/19/97 -
dchatter 03/18/97 - porting exception 390897
dchatter 05/02/97 - merge porting exception
dalpern 12/04/96 - SQLCS_LIT_NULL added
cxcheng 11/14/96 - add SQLT_BFILE/SQLT_CFILE to fix compile prob
cxcheng 11/12/96 - add SQLT_NCO for named collection
lchidamb 10/17/96 - add SQLT_VST and SQLT_ODT
sgollapu 10/14/96 - Mutual exclusion of ocidfn and sqldef
sgollapu 10/07/96 - OCI Simplification
aroy 09/09/96 - add SQLCS* definitions
slari 08/07/96 - add SQLT_RDD, rowid descriptor
slari 06/12/96 - remove SQLT_TTBL
dchatter 04/21/96 - prepare for merge into main
slari 08/24/95 - b299432, define CDA_SIZE
zwalcott 02/28/96 - add SQLT_BFILEE and SQLT_CFILEE.
lchidamb 02/22/96 - make dtys consistent with dtydef.h
lchidamb 02/16/96 - add SQLT_BFILEE and SQLT_CFILEE
lchidamb 01/30/96 - rename new datatypes for v8
lchidamb 09/06/95 - add new datatypes
slari 05/11/95 - add OCI_EV_DEF and OCI_EV_TSF
dchatter 04/06/95 - add ifdef flags around OCI_flags
dchatter 03/08/95 - piece values
dchatter 03/06/95 - merge changes from branch 1.2.720.3
jfbrown 02/17/95 - merge changes from branch 1.2.720.2
dchatter 02/08/95 - olog call modes
jfbrown 02/03/95 - remove non-printable characters
lchidamb 12/06/94 - merge changes from branch 1.2.720.1
lchidamb 10/04/94 - added field chk to cda_head, cda_def
dchatter 07/05/94 - SQLT_CUR added
rkooi2 11/27/92 - Changing e* datatypes to s*
rkooi2 10/26/92 - More portability mods
rkooi2 10/22/92 - Added #ifndef ORATYPES ...
rkooi2 10/18/92 - Changes to make it portable.
sjain 03/16/92 - Creation
*/
/*
* ocidfn.h
*
* Common header file for OCI C sample programs.
* This header declares the cursor and logon data area structure.
* The types used are defined in <oratypes.h>.
*
*/
#ifndef OCIDFN
#define OCIDFN
#include <oratypes.h>
/* The cda_head struct is strictly PRIVATE. It is used
internally only. Do not use this struct in OCI programs. */
struct cda_head {
sb2 v2_rc;
ub2 ft;
ub4 rpc;
ub2 peo;
ub1 fc;
ub1 rcs1;
ub2 rc;
ub1 wrn;
ub1 rcs2;
sword rcs3;
struct {
struct {
ub4 rcs4;
ub2 rcs5;
ub1 rcs6;
} rd;
ub4 rcs7;
ub2 rcs8;
} rid;
sword ose;
ub1 chk;
void *rcsp;
};
/*
** Size of HDA area:
** 512 for 64 bit arquitectures
** 256 for 32 bit arquitectures
*/
#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
# define HDA_SIZE 512
#else
# define HDA_SIZE 256
#endif
#if defined(SS_64BIT_SERVER) || defined(__64BIT__)
#define CDA_SIZE 88
#else
# define CDA_SIZE 64
#endif
/* the real CDA, padded to CDA_SIZE bytes in size */
struct cda_def {
sb2 v2_rc; /* V2 return code */
ub2 ft; /* SQL function type */
ub4 rpc; /* rows processed count */
ub2 peo; /* parse error offset */
ub1 fc; /* OCI function code */
ub1 rcs1; /* filler area */
ub2 rc; /* V7 return code */
ub1 wrn; /* warning flags */
ub1 rcs2; /* reserved */
sword rcs3; /* reserved */
struct { /* rowid structure */
struct {
ub4 rcs4;
ub2 rcs5;
ub1 rcs6;
} rd;
ub4 rcs7;
ub2 rcs8;
} rid;
sword ose; /* OSD dependent error */
ub1 chk;
void *rcsp; /* pointer to reserved area */
ub1 rcs9[CDA_SIZE - sizeof (struct cda_head)]; /* filler */
};
typedef struct cda_def Cda_Def;
/* the logon data area (LDA)
is the same shape as the CDA */
typedef struct cda_def Lda_Def;
/* OCI Environment Modes for opinit call */
#define OCI_EV_DEF 0 /* default single-threaded environment */
#define OCI_EV_TSF 1 /* thread-safe environment */
/* OCI Logon Modes for olog call */
#define OCI_LM_DEF 0 /* default login */
#define OCI_LM_NBL 1 /* non-blocking logon */
/*
* since sqllib uses both ocidef and ocidfn the following defines
* need to be guarded
*/
#ifndef OCI_FLAGS
#define OCI_FLAGS
/* OCI_*_PIECE defines the piece types that are returned or set
*/
#define OCI_ONE_PIECE 0 /* there or this is the only piece */
#define OCI_FIRST_PIECE 1 /* the first of many pieces */
#define OCI_NEXT_PIECE 2 /* the next of many pieces */
#define OCI_LAST_PIECE 3 /* the last piece of this column */
#endif
#ifndef SQLDEF
/* input data types */
#define SQLT_CHR 1 /* (ORANET TYPE) character string */
#define SQLT_NUM 2 /* (ORANET TYPE) oracle numeric */
#define SQLT_INT 3 /* (ORANET TYPE) integer */
#define SQLT_FLT 4 /* (ORANET TYPE) Floating point number */
#define SQLT_STR 5 /* zero terminated string */
#define SQLT_VNU 6 /* NUM with preceding length byte */
#define SQLT_PDN 7 /* (ORANET TYPE) Packed Decimal Numeric */
#define SQLT_LNG 8 /* long */
#define SQLT_VCS 9 /* Variable character string */
#define SQLT_NON 10 /* Null/empty PCC Descriptor entry */
#define SQLT_RID 11 /* rowid */
#define SQLT_DAT 12 /* date in oracle format */
#define SQLT_VBI 15 /* binary in VCS format */
#define SQLT_BFLOAT 21 /* Native Binary float*/
#define SQLT_BDOUBLE 22 /* NAtive binary double */
#define SQLT_BIN 23 /* binary data(DTYBIN) */
#define SQLT_LBI 24 /* long binary */
#define SQLT_UIN 68 /* unsigned integer */
#define SQLT_SLS 91 /* Display sign leading separate */
#define SQLT_LVC 94 /* Longer longs (char) */
#define SQLT_LVB 95 /* Longer long binary */
#define SQLT_AFC 96 /* Ansi fixed char */
#define SQLT_AVC 97 /* Ansi Var char */
#define SQLT_IBFLOAT 100 /* binary float canonical */
#define SQLT_IBDOUBLE 101 /* binary double canonical */
#define SQLT_CUR 102 /* cursor type */
#define SQLT_RDD 104 /* rowid descriptor */
#define SQLT_LAB 105 /* label type */
#define SQLT_OSL 106 /* oslabel type */
#define SQLT_NTY 108 /* named object type */
#define SQLT_REF 110 /* ref type */
#define SQLT_CLOB 112 /* character lob */
#define SQLT_BLOB 113 /* binary lob */
#define SQLT_BFILEE 114 /* binary file lob */
#define SQLT_CFILEE 115 /* character file lob */
#define SQLT_RSET 116 /* result set type */
#define SQLT_NCO 122 /* named collection type (varray or nested table) */
#define SQLT_VST 155 /* OCIString type */
#define SQLT_ODT 156 /* OCIDate type */
/* datetimes and intervals */
#define SQLT_DATE 184 /* ANSI Date */
#define SQLT_TIME 185 /* TIME */
#define SQLT_TIME_TZ 186 /* TIME WITH TIME ZONE */
#define SQLT_TIMESTAMP 187 /* TIMESTAMP */
#define SQLT_TIMESTAMP_TZ 188 /* TIMESTAMP WITH TIME ZONE */
#define SQLT_INTERVAL_YM 189 /* INTERVAL YEAR TO MONTH */
#define SQLT_INTERVAL_DS 190 /* INTERVAL DAY TO SECOND */
#define SQLT_TIMESTAMP_LTZ 232 /* TIMESTAMP WITH LOCAL TZ */
#define SQLT_PNTY 241 /* pl/sql representation of named types */
/* cxcheng: this has been added for backward compatibility -
it needs to be here because ocidfn.h can get included ahead of sqldef.h */
#define SQLT_FILE SQLT_BFILEE /* binary file lob */
#define SQLT_CFILE SQLT_CFILEE
#define SQLT_BFILE SQLT_BFILEE
/* CHAR/NCHAR/VARCHAR2/NVARCHAR2/CLOB/NCLOB char set "form" information */
#define SQLCS_IMPLICIT 1 /* for CHAR, VARCHAR2, CLOB w/o a specified set */
#define SQLCS_NCHAR 2 /* for NCHAR, NCHAR VARYING, NCLOB */
#define SQLCS_EXPLICIT 3 /* for CHAR, etc, with "CHARACTER SET ..." syntax */
#define SQLCS_FLEXIBLE 4 /* for PL/SQL "flexible" parameters */
#define SQLCS_LIT_NULL 5 /* for typecheck of NULL and empty_clob() lits */
#endif /* SQLDEF */
#endif /* OCIDFN */

@ -0,0 +1,282 @@
/*
*
*/
/* Copyright (c) 1996, 2005, Oracle. All rights reserved. */
/*
NAME
ociextp.h - Interface Definitions for PL/SQL External Procedures
DESCRIPTION
This header file contains C language callable interface from
PL/SQL External Procedures.
PUBLIC FUNCTION(S)
OCIExtProcAllocCallMemory - Allocate Call memory
OCIExtProcRaiseExcp - Raise Exception
OCIExtProcRaiseExcpWithMsg - Raise Exception with message
OCIExtProcGetEnv - Get OCI Environment
PRIVATE FUNCTION(S)
<list of static functions defined in .c file - with one-line descriptions>
EXAMPLES
NOTES
<other useful comments, qualifications, etc.>
MODIFIED (MM/DD/YY)
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
srseshad 03/12/03 - convert oci public api to ansi
rdecker 01/10/02 - change 32k to MAX_OEN for error numbers
sagrawal 07/20/01 - Statement Handle to safe cal outs
abrumm 04/19/01 - move include of oci.h after defines/typedef
rdecker 02/22/01 - lint fix
bpalaval 02/08/01 - Change text to oratext.
sagrawal 06/16/00 - ref cursor in callouts
whe 09/01/99 - 976457:check __cplusplus for C++ code
asethi 04/15/99 - Created (by moving ociextp.h from /vobs/plsql/public)
rhari 03/25/97 - Use ifndef
rhari 12/18/96 - Include oratypes.h
rhari 12/11/96 - #416977, Flip values of return codes
rhari 12/02/96 - Define Return Code Macros
rhari 11/18/96 - Error number is int
rhari 10/30/96 - Fix OCIExtProcRaiseExcpWithMsg
rhari 10/30/96 - Get rid of warnings
rhari 10/04/96 - Fix OCIExtProcRaiseExcpWithMsg
rhari 09/23/96 - Creation
*/
#ifndef OCIEXTP_ORACLE
# define OCIEXTP_ORACLE
# ifndef ORATYPES
# include <oratypes.h>
# endif
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/* ----------------------------- Return Codes ----------------------------- */
/* Success and Error return codes for certain external procedure interface
* functions. If a particular interface function returns OCIEXTPROC_SUCCESS
* or OCIEXTPROC_ERROR, then applications must use these macros to check
* for return values.
*
* OCIEXTPROC_SUCCESS -- External Procedure Success Return Code
* OCIEXTPROC_ERROR -- External Procedure Failure Return Code
*/
#define OCIEXTPROC_SUCCESS 0
#define OCIEXTPROC_ERROR 1
/* --------------------------- With-Context Type --------------------------- */
/*
* The C callable interface to PL/SQL External Procedures require the
* With-Context parameter to be passed. The type of this structure is
* OCIExtProcContext is is opaque to the user.
*
* The user can declare the With-Context parameter in the application as
*
* OCIExtProcContext *with_context;
*/
typedef struct OCIExtProcContext OCIExtProcContext;
/* NOTE: OCIExtProcContext must be visible prior to including <oci.h> */
# ifndef OCI_ORACLE
# include <oci.h>
# endif
/* ----------------------- OCIExtProcAllocCallMemory ----------------------- */
/* OCIExtProcAllocCallMemory
* Allocate N bytes of memory for the duration of the External Procedure.
*
* Memory thus allocated will be freed by PL/SQL upon return from the
* External Procedure. You must not use any kind of 'free' function on
* memory allocated by OCIExtProcAllocCallMemory.
* Use this function to allocate memory for function returns.
*
* PARAMETERS
* Input :
* with_context - The with_context pointer that is passed to the C
* External Procedure.
* Type of with_context : OCIExtProcContext *
* amount - The number of bytes to allocate.
* Type of amount : size_t
*
* Output :
* Nothing
*
* Return :
* An untyped (opaque) Pointer to the allocated memory.
*
* Errors :
* A 0 return value should be treated as an error
*
* EXAMPLE
* text *ptr = (text *)OCIExtProcAllocCallMemory(wctx, 1024)
*
*/
#define OCIExtProcAllocCallMemory(with_context, amount) \
ociepacm(with_context, (size_t)amount)
/* -------------------------- OCIExtProcRaiseExcp -------------------------- */
/* OCIExtProcRaiseExcp
* Raise an Exception to PL/SQL.
*
* Calling this function signalls an exception back to PL/SQL. After a
* successful return from this function, the External Procedure must start
* its exit handling and return back to PL/SQL. Once an exception is
* signalled to PL/SQL, INOUT and OUT arguments, if any, are not processed
* at all.
*
* PARAMETERS
* Input :
* with_context - The with_context pointer that is passed to the C
* External Procedure.
* Type of with_context : OCIExtProcContext *
* errnum - Oracle Error number to signal to PL/SQL. errnum
* must be a positive number and in the range 1 to MAX_OEN
* Type of errnum : int
* Output :
* Nothing
*
* Return :
* OCIEXTPROC_SUCCESS - If the call was successful.
* OCIEXTPROC_ERROR - If the call failed.
*
*/
#define OCIExtProcRaiseExcp(with_context, errnum) \
ocieperr(with_context, (int)errnum)
/* ---------------------- OCIExtProcRaiseExcpWithMsg ---------------------- */
/* OCIExtProcRaiseExcpWithMsg
* Raise an exception to PL/SQL. In addition, substitute the
* following error message string within the standard Oracle error
* message string. See note for OCIExtProcRaiseExcp
*
* PARAMETERS
* Input :
* with_context - The with_context pointer that is passed to the C
* External Procedure.
* Type of with_context : OCIExtProcContext *
* errnum - Oracle Error number to signal to PL/SQL. errnum
* must be a positive number and in the range 1 to MAX_OEN
* Type of errnum : int
* errmsg - The error message associated with the errnum.
* Type of errmsg : char *
* len - The length of the error message. 0 if errmsg is
* null terminated string.
* Type of len : size_t
* Output :
* Nothing
*
* Return :
* OCIEXTPROC_SUCCESS - If the call was successful.
* OCIEXTPROC_ERROR - If the call failed.
*
*/
#define OCIExtProcRaiseExcpWithMsg(with_context, errnum, errmsg, msglen) \
ociepmsg(with_context, (int)errnum, errmsg, (size_t)msglen)
/* --------------------------- OCIExtProcGetEnv --------------------------- */
/* OCIExtProcGetEnv
* Get OCI Environment
*
* PARAMETERS
* Input :
* with_context - The with_context pointer that is passed to the C
* External Procedure.
*
* Output :
* envh - The OCI Environment handle.
* svch - The OCI Service handle.
* errh - The OCI Error handle.
*
* Return :
* OCI_SUCCESS - Successful completion of the function.
* OCI_ERROR - Error.
*
*/
#define OCIExtProcGetEnv(with_context, envh, svch, errh) \
ociepgoe(with_context, envh, svch, errh)
/* ------------------------ OCIInitializeStatementHandle ------------------- */
/* OCIreateStatementHandle
* Initialize Statement Handle
*
* PARAMETERS
* Input :
* wctx - The
* cursorno - The cursor number for which we need to initialize
* the statement handle
* svch - The OCI Service handle.
*
* Output :
* stmthp - The OCI Statement handle.
* errh - The OCI Error handle.
*
* Return :
* OCI_SUCCESS - Successful completion of the function.
* OCI_ERROR - Error.
*
*/
#define OCIInitializeStatementHandle(wctx, cursorno, svch, stmthp, errh) \
ociepish(wctx, cursor, svch, stmthp, errh)
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PUBLIC FUNCTIONS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PRIVATE FUNCTIONS
---------------------------------------------------------------------------*/
void *ociepacm(OCIExtProcContext *with_context, size_t amount);
size_t ocieperr(OCIExtProcContext *with_context, int error_number);
size_t ociepmsg(OCIExtProcContext *with_context, int error_number,
oratext *error_message, size_t len );
sword ociepgoe(OCIExtProcContext *with_context, OCIEnv **envh,
OCISvcCtx **svch, OCIError **errh);
#endif /* OCIEXTP_ORACLE */

@ -0,0 +1,165 @@
/* Copyright (c) 1991, 2005, Oracle. All rights reserved. */
/*
NAME
ocikpr.h - header of K & R compilers
MODIFIED (MM/DD/YY)
mbastawa 09/16/05 - dbhygiene
porangas 12/04/00 - Forward merge bug#974710 to 9i
sgollapu 05/19/98 - Change text to OraText
dchatter 04/21/96 -
dchatter 11/10/95 - add ognfd() - get native fd
lchidamb 04/06/95 - drop maxdsz from obindps/odefinps
slari 04/07/95 - add opinit
dchatter 03/08/95 - osetpi and ogetpi
lchidamb 12/09/94 - add obindps() and odefinps()
dchatter 03/06/95 - merge changes from branch 1.1.720.2
dchatter 11/14/94 - merge changes from branch 1.1.720.1
dchatter 02/08/95 - olog call; drop onblon
dchatter 10/31/94 - new functions for non-blocking oci
rkooi2 11/27/92 - Changing datatypes (in comments) and return types
rkooi2 10/26/92 - More portability mods
rkooi2 10/18/92 - Changed to agree with oci.c
sjain 03/16/92 - Creation
*/
/*
* Declare the OCI functions.
* Prototype information is commented out.
* Use this header for non-ANSI C compilers.
* Note that you will need to include ocidfn.h in the .c files
* to get the definition for cda_def.
*/
#ifndef OCIKPR
#define OCIKPR
#include <oratypes.h>
/*
* Oci BIND (Piecewise or with Skips)
*/
sword obindps( struct cda_def *cursor, ub1 opcode, OraText *sqlvar,
sb4 sqlvl, ub1 *pvctx, sb4 progvl,
sword ftype, sword scale,
sb2 *indp, ub2 *alen, ub2 *arcode,
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip,
ub4 maxsiz, ub4 *cursiz,
OraText *fmt, sb4 fmtl, sword fmtt );
sword obreak( struct cda_def *lda );
sword ocan ( struct cda_def *cursor );
sword oclose( struct cda_def *cursor );
sword ocof ( struct cda_def *lda );
sword ocom ( struct cda_def *lda );
sword ocon ( struct cda_def *lda );
/*
* Oci DEFINe (Piecewise or with Skips)
*/
sword odefinps( struct cda_def *cursor, ub1 opcode, sword pos,ub1 *bufctx,
sb4 bufl, sword ftype, sword scale,
sb2 *indp, OraText *fmt, sb4 fmtl, sword fmtt,
ub2 *rlen, ub2 *rcode,
sb4 pv_skip, sb4 ind_skip, sb4 alen_skip, sb4 rc_skip );
sword odescr( struct cda_def *cursor, sword pos, sb4 *dbsize,
sb2 *dbtype, sb1 *cbuf, sb4 *cbufl, sb4 *dsize,
sb2 *prec, sb2 *scale, sb2 *nullok );
sword odessp( struct cda_def *cursor, OraText *objnam, size_t onlen,
ub1 *rsv1, size_t rsv1ln, ub1 *rsv2, size_t rsv2ln,
ub2 *ovrld, ub2 *pos, ub2 *level, OraText **argnam,
ub2 *arnlen, ub2 *dtype, ub1 *defsup, ub1* mode,
ub4 *dtsiz, sb2 *prec, sb2 *scale, ub1 *radix,
ub4 *spare, ub4 *arrsiz );
sword oerhms( struct cda_def *lda, sb2 rcode, OraText *buf,
sword bufsiz );
sword oermsg( sb2 rcode, OraText *buf );
sword oexec ( struct cda_def *cursor );
sword oexfet( struct cda_def *cursor, ub4 nrows,
sword cancel, sword exact );
sword oexn ( struct cda_def *cursor, sword iters, sword rowoff );
sword ofen ( struct cda_def *cursor, sword nrows );
sword ofetch( struct cda_def *cursor );
sword oflng ( struct cda_def *cursor, sword pos, ub1 *buf,
sb4 bufl, sword dtype, ub4 *retl, sb4 offset );
sword ogetpi( struct cda_def *cursor, ub1 *piecep, void **ctxpp,
ub4 *iterp, ub4 *indexp );
sword opinit( ub4 mode );
sword olog ( struct cda_def *lda, ub1 *hst,
OraText *uid, sword uidl,
OraText *psw, sword pswl,
OraText *conn, sword connl,
ub4 mode );
sword ologof( struct cda_def *lda );
sword oopen ( struct cda_def *cursor, struct cda_def *lda,
OraText *dbn, sword dbnl, sword arsize,
OraText *uid, sword uidl );
sword oopt ( struct cda_def *cursor, sword rbopt, sword waitopt );
sword oparse( struct cda_def *cursor, OraText *sqlstm, sb4 sqllen,
sword defflg, ub4 lngflg );
sword orol ( struct cda_def *lda );
sword osetpi( struct cda_def *cursor, ub1 piece, void *bufp,
ub4 *lenp );
void sqlld2 ( struct cda_def *lda, OraText *cname, sb4 *cnlen );
void sqllda ( struct cda_def *lda );
/* non-blocking functions */
sword onbset( struct cda_def *lda );
sword onbtst( struct cda_def *lda );
sword onbclr( struct cda_def *lda );
sword ognfd ( struct cda_def *lda, void *fdp );
/*
* OBSOLETE FUNCTIONS
*/
/*
* OBSOLETE BIND CALLS-- use obindps()
*/
sword obndra( struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
sb2 *indp, ub2 *alen, ub2 *arcode, ub4 maxsiz,
ub4 *cursiz, OraText *fmt, sword fmtl, sword fmtt );
sword obndrn( struct cda_def *cursor, sword sqlvn, ub1 *progv,
sword progvl, sword ftype, sword scale, sb2 *indp,
OraText *fmt, sword fmtl, sword fmtt );
sword obndrv( struct cda_def *cursor, OraText *sqlvar, sword sqlvl,
ub1 *progv, sword progvl, sword ftype, sword scale,
sb2 *indp, OraText *fmt, sword fmtl, sword fmtt );
/*
* OBSOLETE DEFINE CALLS-- use odefinps()
*/
sword odefin( struct cda_def *cursor, sword pos, ub1 *buf,
sword bufl, sword ftype, sword scale, sb2 *indp,
OraText *fmt, sword fmtl, sword fmtt, ub2 *rlen,
ub2 *rcode );
/* older calls ; preferred equivalent calls above */
sword odsc ( struct cda_def *cursor, sword pos, sb2 *dbsize,
sb2 *fsize, sb2 *rcode, sb2 *dtype, sb1 *buf,
sb2 *bufl, sb2 *dsize );
sword oname ( struct cda_def *cursor, sword pos, sb1 *tbuf,
sb2 *tbufl, sb1 *buf, sb2 *bufl );
sword olon ( struct cda_def *lda, OraText *uid, sword uidl,
OraText *pswd, sword pswdl, sword audit );
sword orlon ( struct cda_def *lda, ub1 *hda, OraText *uid,
sword uidl, OraText *pswd, sword pswdl, sword audit );
sword osql3 ( struct cda_def *cda, OraText *sqlstm, sword sqllen );
#endif /* OCIKPR */

@ -0,0 +1,98 @@
/*=====================================================================================================================
Copyright(c) 2012 ORIGIN.
Unpublished - All rights reserved
=======================================================================================================================
File description:
Filename: ocilib.h
Module : OCI
This Header file of OCI library Package.
=======================================================================================================================
Date Name Description of Change
1-Feb-2015 Ray Initialize creation
$HISTORY$
=====================================================================================================================*/
#include <oci.h>
#include <stdio.h>
#include <memory.h>
#include <string.h>
#include <malloc.h>
//#include <limits.h>
#define OCI_FAIL 1
#define OCI_OK 0
#ifdef __cplusplus
extern "C"
{
#endif
/**
* .
* @param username - <I>
* @param password - <I>
* @param dbname - <I> SID
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ConnServer(char* username, char* password, char* dbname);
/**
* SQL.
* @param SQL - <I> SQL
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ExecuteSQLNoInputParam(char* SQL);
/**
* SQL.
* @param SQL - <I> SQL
* @param inputValueCount - <I>
* @param inputValue - <I>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int ExecuteSQL(char* SQL, int inputValueCount, char** inputValue);
/**
* SQL.
* @param SQL - <I> SQL
* @param outputColumn - <O>
* @param outputValueCount - <O>
* @param outputValue - <O>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int QuerySQLNoInputParam(char* SQL, int* outputColumn, int* outputValueCount, char**** outputValue);
/**
* SQL.
* @param SQL - <I> SQL
* @param inputValueCount - <I>
* @param inputValue - <I>
* @param outputColumn - <O>
* @param outputValueCount - <O>
* @param outputValue - <O>
* @return - OCI_OK or error code
*
* ORACLE
*/
extern int QuerySQL(char* SQL, int inputValueCount, char** inputValue, int* outputColumn, int* outputValueCount, char**** outputValue);
/**
* .
*
* ORACLE
*/
extern void DisConnServer();
#ifdef __cplusplus
}
#endif

@ -0,0 +1,188 @@
/* Copyright (c) 2003, 2009, Oracle and/or its affiliates.
All rights reserved. */
/*
NAME
ocixml.h - OCIXMLType functions
DESCRIPTION
This file contains all OCIXMLType functions defined in ocixml.c
****************************IMPORTANT***********************************
*** If you change the signatures of any fucntions in this file, make sure
*** to make same changes to Windows OSD file ociclnt.c. Otherwise, users
*** of OCI instant client like ODP.NET will have build issues or crashes
****************************IMPORTANT***********************************
PUBLIC FUNCTION(S)
OCIXMLTypeNew()
OCIXMLTypeCreateFromSrc()
OCIXMLTypeCreateFromSrcWithSchema()
OCIXMLTypeTransform()
OCIXMLTypeExtract()
OCIXMLTypeIsSchemaBased()
OCIXMLTypeValidate()
OCIXMLTypeExists()
OCIXMLTypeGetDOM()
OCIXMLTypeGetFromDOM()
OCIDOMFree()
OCIXMLSEMutexAcq()
OCIXMLSEMutexRel()
OCIXMLUpdateNodeValues()
INTERNAL FUNCTION(S)
EXAMPLES
NOTES
MODIFIED (MM/DD/YY)
spetride 03/02/09 - add isdoc to OCIXMLTypeCreateFromSrc*
bsthanik 01/17/07 - 5753599: wrappers for service mutex acq/rel
bkhaladk 05/10/06 - add setpicklepref
nitgupta 01/30/06 - add signatures for OCIBinXMl*
dmukhin 06/16/05 - ANSI prototypes; miscellaneous cleanup
dmukhin 06/14/05 - ANSI prototypes; miscellaneous cleanup
ataracha 12/04/03 - convert public oci api to ansi
ataracha 01/21/03 - ataracha_uni_capi_cleanup
ataracha 01/08/03 - Creation
*/
#ifndef OCI_ORACLE
# include <oci.h>
#endif
#ifndef XML0_ORACLE
# include <xml0.h>
#endif
#ifndef OCIXML_ORACLE
# define OCIXML_ORACLE
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/* parameters for OCIXMLUpdateNodeValues */
struct OCIXMLunv
{
void * xpth_OCIXMLunv; /* xpath expression */
void * val_OCIXMLunv; /* value - string literal or xmltype */
ub4 xpthL_OCIXMLunv; /* length of xpath expression string */
ub4 valL_OCIXMLunv; /* length of value string */
ub1 tp_OCIXMLunv; /* type of value - xmltype of string */
#define OCIXMLUNV_XTP 0x00 /* param is xmltype */
#define OCIXMLUNV_STP 0x01 /* param is string literal */
#define OCIXMLUNV_STM 0x02 /* param is a stream (kghsstream *) */
#define OCIXMLUNV_CLOB 0x03 /* param is a CLOB locator (kolblc *) */
#define OCIXMLUNV_BLOB 0x04 /* param is a BLOB locator (kolblc *) */
};
typedef struct OCIXMLunv OCIXMLunv;
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
sword OCIXMLTypeNew(OCISvcCtx *svchp, OCIError *errhp, OCIDuration dur,
OraText *elname, ub4 elname_Len,
OraText *schemaURL, ub4 schemaURL_Len,
OCIXMLType **retInstance);
sword OCIXMLTypeCreateFromSrc(OCISvcCtx *svchp, OCIError *errhp,
OCIDuration dur, ub1 src_type, void *src_ptr,
sb4 ind, OCIXMLType **retInstance, ub4 csid);
sword OCIXMLTypeCreateFromSrcInt(OCISvcCtx *svchp, OCIError *errhp,
OCIDuration dur, ub1 src_type, void *src_ptr,
sb4 ind, OCIXMLType **retInstance, ub4 csid,
boolean isdoc);
sword OCIXMLTypeCreateFromSrcWithSchema(OCISvcCtx *svchp, OCIError *errhp,
OCIDuration dur, ub1 src_type, void *src_ptr,
sb4 ind, OraText *schemaURL, ub4 schemaURL_Len,
boolean wellformed, boolean valid,
OCIXMLType **retInstance, ub4 csid);
sword OCIXMLTypeCreateFromSrcWithSchemaInt(OCISvcCtx *svchp, OCIError *errhp,
OCIDuration dur, ub1 src_type, void *src_ptr,
sb4 ind, OraText *schemaURL, ub4 schemaURL_Len,
boolean wellformed, boolean valid,
OCIXMLType **retInstance, ub4 csid,
boolean isdoc);
sword OCIXMLTypeExtract(OCIError *errhp,
OCIXMLType *doc, OCIDuration dur,
OraText *xpathexpr, ub4 xpathexpr_Len,
OraText *nsmap, ub4 nsmap_Len,
OCIXMLType **retDoc);
sword OCIXMLTypeTransform(OCIError *errhp, OCIDuration dur,
OCIXMLType *doc, OCIXMLType *xsldoc,
OCIXMLType **retDoc);
/* Note: xpathexpr is case sensitive */
sword OCIXMLTypeExists(OCIError *errhp, OCIXMLType *doc,
OraText *xpathexpr, ub4 xpathexpr_Len,
OraText *nsmap, ub4 nsmap_Len,
boolean *retval);
sword OCIXMLTypeIsSchemaBased(OCIError *errhp,
OCIXMLType *doc, boolean *retval);
sword OCIXMLTypeIsFragment(OCIError *errhp, OCIXMLType *doc, boolean *retval);
sword OCIXMLTypeGetSchema(OCIError *errhp, OCIXMLType *doc,
OCIXMLType **schemadoc,
OraText **schemaURL, ub4 *schemaURL_Len,
OraText **rootelem, ub4 *rootelem_Len);
sword OCIXMLTypeValidate(OCIError *errhp, OCIXMLType *doc,
OraText *schemaURL, ub4 schemaURL_Len, boolean *retval);
sword OCIXMLTypeGetDOM(OCIError *errhp, OCIXMLType *doc, OCIDuration dur,
OCIDOMDocument **retDom);
sword OCIXMLTypeGetFromDOM(OCIError *errhp, OCIDOMDocument *domdoc,
OCIXMLType **retXMLType);
sword OCIXMLTypeGetNS(OCIError *errhp, OCIXMLType *domdoc,
OraText **ns, ub4 *ns_len);
sword OCIDOMFree(OCIError *errhp, OCIDOMDocument *domdoc);
sword OCIBinXmlCreateReposCtxFromConn(OCIEnv *env, OCISvcCtx *svcctx,
OCIError *err, OCIBinXmlReposCtx **ctx);
sword OCIBinXmlCreateReposCtxFromCPool(OCIEnv *env, OCICPool *cpool,
OCIError *err, OCIBinXmlReposCtx **ctx);
sword OCIBinXmlSetReposCtxForConn(OCISvcCtx *dataconn,
OCIBinXmlReposCtx *reposctx);
#define OCIXML_FORMATTYPE_TEXT 0
#define OCIXML_FORMATTYPE_BINXML 1
sword OCIBinXmlSetFormatPref(xmldocnode *doc, ub4 format);
/* OCI Wrapper to acquire mutex associated with service handle and
* env handle
*/
sword OCIXMLSEMutexAcq(OCISvcCtx *svchp, OCIError *errhp);
/* release wrapper corresponding to OCIXMLSEMutexAcq */
sword OCIXMLSEMutexRel(OCISvcCtx *svchp, OCIError *errhp);
/* acquires OCI svc and env mutexes, updates values of nodes pointed to by
* given XPATH locations, and releases mutexes.
*/
sword OCIXMLUpdateNodeValues(OCISvcCtx *svchp, OCIError *errhp, OCIXMLType
**docp, struct OCIXMLunv *values, ub4 numvalues, oratext *nsmap,
ub4 nsmapl);
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
#endif /* OCIXML_ORACLE */

@ -0,0 +1,141 @@
/* Copyright (c) 2003, 2009, Oracle and/or its affiliates.
All rights reserved. */
/*
NAME
ocixmldb.h - XDB public functions
DESCRIPTION
This file contains XDB specific public functions required for DOM C-API.
RELATED DOCUMENTS
EXPORT FUNCTION(S)
struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *,
ocixmldbparam *params, int num_params);
void OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
------------------------------------------------------------------------
EXAMPLES
NOTES
MODIFIED (MM/DD/YY)
ataracha 12/11/03 - remove redundant definitions
ataracha 05/28/03 - change names
ataracha 02/18/03 - add oratypes, remove XMLERR_*
imacky 02/01/03 - remove xml.h; xdbs fix
ataracha 01/24/03 - use "struct xmlctx" instead of xmlctx
imacky 01/28/03 - fix XMLERR defs
ataracha 01/21/03 - ataracha_uni_capi_cleanup
ataracha 01/09/03 - Creation
*/
#ifndef ORATYPES
#include <oratypes.h>
#endif
#ifndef OCI_ORACLE
# include <oci.h>
#endif
#ifndef OCIXMLDB_ORACLE
# define OCIXMLDB_ORACLE
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
#ifndef XMLCTX_DEFINED
# define XMLCTX_DEFINED
/* DATATYPE xmlctx - XML top-level context
*/
struct xmlctx; typedef struct xmlctx xmlctx;
#endif
typedef enum
{
XCTXINIT_OCIDUR = 1,
XCTXINIT_ERRHDL = 2
} ocixmldbpname;
typedef struct ocixmldbparam
{
ocixmldbpname name_ocixmldbparam;
void *value_ocixmldbparam;
} ocixmldbparam;
#define NUM_OCIXMLDBPARAMS 2
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
EXPORT FUNCTIONS
---------------------------------------------------------------------------*/
/*****************************************************************************
DESCRIPTION
-----------------------------OCIXmlDbInitXmlCtx---------------------------------
Name
OCIXmlDbInitXmlCtx
Purpose
To get a xmlctx structure initialized with error-handler and XDB callbacks.
Syntax
struct xmlctx *OCIXmlDbInitXmlCtx (OCIEnv *envhp,
OCISvcCtx *svchp,
OCIError *err,
params_ocixmldb *params,
int num_params);
Parameters
envhp (IN) - The OCI environment handle
svchp (IN) - The OCI service handle
errhp (IN) - The OCI error handle
params (IN)- This contains the following optional parameters :
(a) OCIDuration dur (IN - The OCI Duration (Default: OCI_DURATION_SESSION)
(b) void (*err_handler) (sword, (const oratext *) (IN) -
Pointer to the error handling function (Default: null)
num_params (IN) - Number of parameters to be read from parameter params.
If the value of num_params exceeds the size of array
"params", unexpected behavior will result.
Returns
A pointer to xmlctx structure, with xdb context, error handler and callbacks
populated with appropriate values. This is later used for all API calls. NULL
if no database connection available.
-----------------------------OCIXmlDbFreeXmlCtx----------------------------
Name
OCIXmlDbFreeXmlCtx
Pupose
To free any allocations done during OCIXmlDbInitXmlCtx.
Syntax
void OCIXmlDbFreeXmlCtx (struct xmlctx *xctx)
Parameters
xctx (IN) - The xmlctx to terminate
Returns
-
******************************************************************************/
struct xmlctx *OCIXmlDbInitXmlCtx(OCIEnv *, OCISvcCtx *, OCIError *,
ocixmldbparam *, int);
void OCIXmlDbFreeXmlCtx(struct xmlctx *xctx);
sword OCIXmlDbStreamFromXMLType(OCIError *errhp, void **stream,
OCIXMLType *doc, ub4 mode);
sword OCIXmlDbStreamRead(OCIError *errhp, void *stream,
void *bufp, sb8 *len, ub4 mode);
sword OCIXmlDbStreamClose(OCIError *errhp, void *stream);
/*---------------------------------------------------------------------------
INTERNAL FUNCTIONS
---------------------------------------------------------------------------*/
#endif /* OCIXMLDB_ORACLE */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,798 @@
/*
*
*/
/* Copyright (c) 1998, 2006, Oracle. All rights reserved. */
/*
NAME
odci.h - Oracle Data Cartridge Interface definitions
DESCRIPTION
This file contains Oracle Data Cartridge Interface definitions. These
include the ODCI Types and Constants.
RELATED DOCUMENTS
INSPECTION STATUS
Inspection date:
Inspection status:
Estimated increasing cost defects per page:
Rule sets:
ACCEPTANCE REVIEW STATUS
Review date:
Review status:
Reviewers:
PUBLIC FUNCTION(S)
None.
PRIVATE FUNCTION(S)
None.
EXAMPLES
NOTES
- The constants defined here are replica of the constants defined
in ODCIConst Package defined as part of catodci.sql. If you change
these do make the similar change in catodci.sql.
MODIFIED (MM/DD/YY)
spsundar 09/13/07 -
yhu 06/02/06 - add callproperty for statistics
yhu 05/22/06 - add ODCI_NODATA to speed rebuild empty index or ind.
part.
srirkris 05/09/06 - change ODCIOrderByInfo_ind
srirkris 02/06/06 - add definitions for CDI query.
spsundar 02/17/06 - add fields/types for system managed domain idx
yhu 02/08/06 - add RenameCol Na d RenameTopADT
yhu 03/11/05 - add flags for rename column and rename table
spsundar 11/28/05 - add fields/types for composite domain idx
yhu 12/06/05 - mapping table for local text indexes
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
ayoaz 04/21/03 - add CursorNum to ODCIEnv
abrumm 12/30/02 - Bug #2223225: add define for
ODCI_ARG_DESC_LIST_MAXSIZE
ayoaz 10/14/02 - Add Cardinality to ODCIArgDesc
ayoaz 09/11/02 - add ODCIQueryInfo to ODCIIndexCtx
yhu 09/19/02 - add ODCI_DEBUGGING_ON for ODCIEnv.EnvFlags
hsbedi 10/10/02 - add object number into ODCIExtTableInfo
ayoaz 08/30/02 - add ODCITable2 types
tchorma 07/29/02 - Add ODCIFuncCallInfo type for WITH COLUMN CONTEXT
hsbedi 06/29/02 - External table populate
yhu 07/20/01 - add parallel degree in ODCIIndexInfo.
abrumm 02/20/01 - ODCIExtTableInfo: add AccessParmBlob attribute
abrumm 01/18/01 - ODCIExtTableInfo: add default directory
spsundar 08/24/00 - Update attrbiute positions
abrumm 08/04/00 - external tables changes: ODCIExtTableInfo, constants
tchorma 09/11/00 - Add return code ODCI_FATAL
tchorma 08/08/00 - Add Update Block References Option for Alter Index
ayoaz 08/01/00 - Add ODCI_AGGREGATE_REUSE_CTX
spsundar 06/19/00 - add ODCIEnv type
abrumm 06/27/00 - add defines for ODCIExtTable flags
abrumm 06/04/00 - external tables: ODCIExtTableInfo change; add ODCIEnv
ddas 04/28/00 - extensible optimizer enhancements for 8.2
yhu 06/05/00 - add a bit in IndexInfoFlags for trans. tblspc
yhu 04/10/00 - add ODCIPartInfo & remove ODCIIndexPartList
abrumm 03/29/00 - external table support
spsundar 02/14/00 - update odci definitions for 8.2
nagarwal 03/07/99 - bug# 838308 - set estimate_stats=1
rmurthy 11/09/98 - add blocking flag
ddas 10/31/98 - add ODCI_QUERY_SORT_ASC and ODCI_QUERY_SORT_DESC
ddas 05/26/98 - fix ODCIPredInfo flag bits
rmurthy 06/03/98 - add macro for RegularCall
spsundar 05/08/98 - add constants related to ODCIIndexAlter options
rmurthy 04/30/98 - remove include s.h
rmurthy 04/20/98 - name fixes
rmurthy 04/13/98 - add C mappings for odci types
alsrivas 04/10/98 - adding defines for ODCI_INDEX1
jsriniva 04/04/98 - Creation
*/
#ifndef OCI_ORACLE
# include <oci.h>
#endif
#ifndef ODCI_ORACLE
# define ODCI_ORACLE
/*---------------------------------------------------------------------------*/
/* SHORT NAMES SUPPORT SECTION */
/*---------------------------------------------------------------------------*/
#ifdef SLSHORTNAME
/* The following are short names that are only supported on IBM mainframes
* with the SLSHORTNAME defined.
* With this all subsequent long names will actually be substituted with
* the short names here
*/
#define ODCIColInfo_ref odcicir
#define ODCIColInfoList odcicil
#define ODCIColInfoList2 odcicil2
#define ODCIIndexInfo_ref odciiir
#define ODCIPredInfo_ref odcipir
#define ODCIRidList odcirl
#define ODCIIndexCtx_ref odciicr
#define ODCIObject_ref odcior
#define ODCIObjectList odciol
#define ODCIQueryInfo_ref odciqir
#define ODCIFuncInfo_ref odcifir
#define ODCICost_ref odcicr
#define ODCIArgDesc_ref odciadr
#define ODCIArgDescList odciadl
#define ODCIStatsOptions_ref odcisor
#define ODCIColInfo odcici
#define ODCIColInfo_ind odcicii
#define ODCIIndexInfo odciii
#define ODCIIndexInfo_ind odciiii
#define ODCIPredInfo odcipi
#define ODCIPredInfo_ind odcipii
#define ODCIIndexCtx odciic
#define ODCIIndexCtx_ind odciici
#define ODCIObject odcio
#define ODCIObject_ind odcioi
#define ODCIQueryInfo odciqi
#define ODCIQueryInfo_ind odciqii
#define ODCIFuncInfo odcifi
#define ODCIFuncInfo_infd odcifii
#define ODCICost odcic
#define ODCICost_ind odcici
#define ODCIArgDesc odciad
#define ODCIArgDesc_ind odciadi
#define ODCIStatsOptions odciso
#define ODCIStatsOptions_ind odcisoi
#define ODCIPartInfo odcipti
#define ODCIPartInfo_ind odciptii
#define ODCIPartInfo_ref odciptir
#define ODCIExtTableInfo odcixt
#define ODCIExtTableInfo_ind odcixti
#define ODCIExtTableInfo_ref odcixtr
#define ODCIExtTableQCInfo odcixq
#define ODCIExtTableQCInfo_ind odcixqi
#define ODCIExtTableQCInfo_ref odcixqr
#define ODCIFuncCallInfo odcifc
#define ODCIFuncCall_ind odcifci
#define ODCIFuncCall_ref odcifcr
#define ODCIColValList odcicvl
#define ODCIColArrayList odcical
#define ODCIFilterInfoList odciflil
#define ODCIOrderByInfoList odciobil
#define ODCIFilterInfo_ref odciflir
#define ODCIOrderByInfo_ref odciobir
#define ODCICompQueryInfo_ref odcicqir
#define ODCIFilterInfo odcifli
#define ODCIOrderByInfo odciobi
#define ODCICompQueryInfo odcicqi
#define ODCIFilterInfo_ind odciflii
#define ODCIOrderByInfo_ind odciobii
#define ODCICompQueryInfo_ind odcicqii
#endif /* SLSHORTNAME */
/*---------------------------------------------------------------------------
PUBLIC TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/* Constants for Return Status */
#define ODCI_SUCCESS 0
#define ODCI_ERROR 1
#define ODCI_WARNING 2
#define ODCI_ERROR_CONTINUE 3
#define ODCI_FATAL 4
/* Constants for ODCIPredInfo.Flags */
#define ODCI_PRED_EXACT_MATCH 0x0001
#define ODCI_PRED_PREFIX_MATCH 0x0002
#define ODCI_PRED_INCLUDE_START 0x0004
#define ODCI_PRED_INCLUDE_STOP 0x0008
#define ODCI_PRED_OBJECT_FUNC 0x0010
#define ODCI_PRED_OBJECT_PKG 0x0020
#define ODCI_PRED_OBJECT_TYPE 0x0040
#define ODCI_PRED_MULTI_TABLE 0x0080
#define ODCI_PRED_NOT_EQUAL 0x0100
/* Constants for QueryInfo.Flags */
#define ODCI_QUERY_FIRST_ROWS 0x01
#define ODCI_QUERY_ALL_ROWS 0x02
#define ODCI_QUERY_SORT_ASC 0x04
#define ODCI_QUERY_SORT_DESC 0x08
#define ODCI_QUERY_BLOCKING 0x10
/* Constants for ScnFlg(Func /w Index Context) */
#define ODCI_CLEANUP_CALL 1
#define ODCI_REGULAR_CALL 2
/* Constants for ODCIFuncInfo.Flags */
#define ODCI_OBJECT_FUNC 0x01
#define ODCI_OBJECT_PKG 0x02
#define ODCI_OBJECT_TYPE 0x04
/* Constants for ODCIArgDesc.ArgType */
#define ODCI_ARG_OTHER 1
#define ODCI_ARG_COL 2 /* column */
#define ODCI_ARG_LIT 3 /* literal */
#define ODCI_ARG_ATTR 4 /* object attribute */
#define ODCI_ARG_NULL 5
#define ODCI_ARG_CURSOR 6
/* Maximum size of ODCIArgDescList array */
#define ODCI_ARG_DESC_LIST_MAXSIZE 32767
/* Constants for ODCIStatsOptions.Options */
#define ODCI_PERCENT_OPTION 1
#define ODCI_ROW_OPTION 2
/* Constants for ODCIStatsOptions.Flags */
#define ODCI_ESTIMATE_STATS 0x01
#define ODCI_COMPUTE_STATS 0x02
#define ODCI_VALIDATE 0x04
/* Constants for ODCIIndexAlter parameter alter_option */
#define ODCI_ALTIDX_NONE 0
#define ODCI_ALTIDX_RENAME 1
#define ODCI_ALTIDX_REBUILD 2
#define ODCI_ALTIDX_REBUILD_ONL 3
#define ODCI_ALTIDX_MODIFY_COL 4
#define ODCI_ALTIDX_UPDATE_BLOCK_REFS 5
#define ODCI_ALTIDX_RENAME_COL 6
#define ODCI_ALTIDX_RENAME_TAB 7
#define ODCI_ALTIDX_MIGRATE 8
/* Constants for ODCIIndexInfo.IndexInfoFlags */
#define ODCI_INDEX_LOCAL 0x0001
#define ODCI_INDEX_RANGE_PARTN 0x0002
#define ODCI_INDEX_HASH_PARTN 0x0004
#define ODCI_INDEX_ONLINE 0x0008
#define ODCI_INDEX_PARALLEL 0x0010
#define ODCI_INDEX_UNUSABLE 0x0020
#define ODCI_INDEX_ONIOT 0x0040
#define ODCI_INDEX_TRANS_TBLSPC 0x0080
#define ODCI_INDEX_FUNCTION_IDX 0x0100
#define ODCI_INDEX_LIST_PARTN 0x0200
/* Constants for ODCIIndexInfo.IndexParaDegree */
#define ODCI_INDEX_DEFAULT_DEGREE 32767
/* Constants for ODCIEnv.EnvFlags */
#define ODCI_DEBUGGING_ON 0x01
#define ODCI_NODATA 0x02
/* Constants for ODCIEnv.CallProperty */
#define ODCI_CALL_NONE 0
#define ODCI_CALL_FIRST 1
#define ODCI_CALL_INTERMEDIATE 2
#define ODCI_CALL_FINAL 3
#define ODCI_CALL_REBUILD_INDEX 4
#define ODCI_CALL_REBUILD_PMO 5
#define ODCI_CALL_STATSGLOBAL 6
#define ODCI_CALL_STATSGLOBALANDPARTITION 7
#define ODCI_CALL_STATSPARTITION 8
/* Constants for ODCIExtTableInfo.OpCode */
#define ODCI_EXTTABLE_INFO_OPCODE_FETCH 1
#define ODCI_EXTTABLE_INFO_OPCODE_POPULATE 2
/* Constants (bit definitions) for ODCIExtTableInfo.Flag */
/* sampling type: row or block */
#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE 0x00000001
#define ODCI_EXTTABLE_INFO_FLAG_SAMPLE_BLOCK 0x00000002
/* AccessParmClob, AccessParmBlob discriminator */
#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_CLOB 0x00000004
#define ODCI_EXTTABLE_INFO_FLAG_ACCESS_PARM_BLOB 0x00000008
/* Constants for ODCIExtTableInfo.IntraSourceConcurrency */
#define ODCI_TRUE 1
#define ODCI_FALSE 0
/* Constants (bit definitions) for ODCIExtTable{Open,Fetch,Populate,Close}
* Flag argument.
*/
#define ODCI_EXTTABLE_OPEN_FLAGS_QC 0x00000001 /* caller is Query Coord */
#define ODCI_EXTTABLE_OPEN_FLAGS_SHADOW 0x00000002 /* caller is shadow proc */
#define ODCI_EXTTABLE_OPEN_FLAGS_SLAVE 0x00000004 /* caller is slave proc */
#define ODCI_EXTTABLE_FETCH_FLAGS_EOS 0x00000001 /* end-of-stream on fetch */
/* Constants for Flags argument to ODCIAggregateTerminate */
#define ODCI_AGGREGATE_REUSE_CTX 1
/* Constants for ODCIColInfo.Flags */
#define ODCI_COMP_FILTERBY_COL 0x0001
#define ODCI_COMP_ORDERBY_COL 0x0002
#define ODCI_COMP_ORDERDSC_COL 0x0004
#define ODCI_COMP_UPDATED_COL 0x0008
#define ODCI_COMP_RENAMED_COL 0x0010
#define ODCI_COMP_RENAMED_TOPADT 0x0020
/* Constants for ODCIOrderByInfo.ExprType */
#define ODCI_COLUMN_EXPR 1
#define ODCI_ANCOP_EXPR 2
/* Constants for ODCIOrderByInfo.SortOrder */
#define ODCI_SORT_ASC 1
#define ODCI_SORT_DESC 2
#define ODCI_NULLS_FIRST 4
/* Constants for ODCIPartInfo.PartOp */
#define ODCI_ADD_PARTITION 1
#define ODCI_DROP_PARTITION 2
/*---------------------------------------------------------------------------
ODCI TYPES
---------------------------------------------------------------------------*/
/*
* These are C mappings for the OTS types defined in catodci.sql
*/
typedef OCIRef ODCIColInfo_ref;
typedef OCIArray ODCIColInfoList;
typedef OCIArray ODCIColInfoList2;
typedef OCIRef ODCIIndexInfo_ref;
typedef OCIRef ODCIPredInfo_ref;
typedef OCIArray ODCIRidList;
typedef OCIRef ODCIIndexCtx_ref;
typedef OCIRef ODCIObject_ref;
typedef OCIArray ODCIObjectList;
typedef OCIRef ODCIQueryInfo_ref;
typedef OCIRef ODCIFuncInfo_ref;
typedef OCIRef ODCICost_ref;
typedef OCIRef ODCIArgDesc_ref;
typedef OCIArray ODCIArgDescList;
typedef OCIRef ODCIStatsOptions_ref;
typedef OCIRef ODCIPartInfo_ref;
typedef OCIRef ODCIEnv_ref;
typedef OCIRef ODCIExtTableInfo_ref; /* external table support */
typedef OCIArray ODCIGranuleList; /* external table support */
typedef OCIRef ODCIExtTableQCInfo_ref; /* external table support */
typedef OCIRef ODCIFuncCallInfo_ref;
typedef OCIArray ODCINumberList;
typedef OCIArray ODCIPartInfoList;
typedef OCIArray ODCIColValList;
typedef OCIArray ODCIColArrayList;
typedef OCIArray ODCIFilterInfoList;
typedef OCIArray ODCIOrderByInfoList;
typedef OCIRef ODCIFilterInfo_ref;
typedef OCIRef ODCIOrderByInfo_ref;
typedef OCIRef ODCICompQueryInfo_ref;
struct ODCIColInfo
{
OCIString* TableSchema;
OCIString* TableName;
OCIString* ColName;
OCIString* ColTypName;
OCIString* ColTypSchema;
OCIString* TablePartition;
OCINumber ColFlags;
OCINumber ColOrderPos;
OCINumber TablePartitionIden;
OCINumber TablePartitionTotal;
};
typedef struct ODCIColInfo ODCIColInfo;
struct ODCIColInfo_ind
{
OCIInd atomic;
OCIInd TableSchema;
OCIInd TableName;
OCIInd ColName;
OCIInd ColTypName;
OCIInd ColTypSchema;
OCIInd TablePartition;
OCIInd ColFlags;
OCIInd ColOrderPos;
OCIInd TablePartitionIden;
OCIInd TablePartitionTotal;
};
typedef struct ODCIColInfo_ind ODCIColInfo_ind;
struct ODCIFuncCallInfo
{
struct ODCIColInfo ColInfo;
};
struct ODCIFuncCallInfo_ind
{
struct ODCIColInfo_ind ColInfo;
};
struct ODCIIndexInfo
{
OCIString* IndexSchema;
OCIString* IndexName;
ODCIColInfoList* IndexCols;
OCIString* IndexPartition;
OCINumber IndexInfoFlags;
OCINumber IndexParaDegree;
OCINumber IndexPartitionIden;
OCINumber IndexPartitionTotal;
};
typedef struct ODCIIndexInfo ODCIIndexInfo;
struct ODCIIndexInfo_ind
{
OCIInd atomic;
OCIInd IndexSchema;
OCIInd IndexName;
OCIInd IndexCols;
OCIInd IndexPartition;
OCIInd IndexInfoFlags;
OCIInd IndexParaDegree;
OCIInd IndexPartitionIden;
OCIInd IndexPartitionTotal;
};
typedef struct ODCIIndexInfo_ind ODCIIndexInfo_ind;
struct ODCIPredInfo
{
OCIString* ObjectSchema;
OCIString* ObjectName;
OCIString* MethodName;
OCINumber Flags;
};
typedef struct ODCIPredInfo ODCIPredInfo;
struct ODCIPredInfo_ind
{
OCIInd atomic;
OCIInd ObjectSchema;
OCIInd ObjectName;
OCIInd MethodName;
OCIInd Flags;
};
typedef struct ODCIPredInfo_ind ODCIPredInfo_ind;
struct ODCIFilterInfo
{
ODCIColInfo ColInfo;
OCINumber Flags;
OCIAnyData *strt;
OCIAnyData *stop;
};
typedef struct ODCIFilterInfo ODCIFilterInfo;
struct ODCIFilterInfo_ind
{
OCIInd atomic;
ODCIColInfo_ind ColInfo;
OCIInd Flags;
OCIInd strt;
OCIInd stop;
};
typedef struct ODCIFilterInfo_ind ODCIFilterInfo_ind;
struct ODCIOrderByInfo
{
OCINumber ExprType;
OCIString *ObjectSchema;
OCIString *TableName;
OCIString *ExprName;
OCINumber SortOrder;
};
typedef struct ODCIOrderByInfo ODCIOrderByInfo;
struct ODCIOrderByInfo_ind
{
OCIInd atomic;
OCIInd ExprType;
OCIInd ObjectSchema;
OCIInd TableName;
OCIInd ExprName;
OCIInd SortOrder;
};
typedef struct ODCIOrderByInfo_ind ODCIOrderByInfo_ind;
struct ODCICompQueryInfo
{
ODCIFilterInfoList *PredInfo;
ODCIOrderByInfoList *ObyInfo;
};
typedef struct ODCICompQueryInfo ODCICompQueryInfo;
struct ODCICompQueryInfo_ind
{
OCIInd atomic;
OCIInd PredInfo;
OCIInd ObyInfo;
};
typedef struct ODCICompQueryInfo_ind ODCICompQueryInfo_ind;
struct ODCIObject
{
OCIString* ObjectSchema;
OCIString* ObjectName;
};
typedef struct ODCIObject ODCIObject;
struct ODCIObject_ind
{
OCIInd atomic;
OCIInd ObjectSchema;
OCIInd ObjectName;
};
typedef struct ODCIObject_ind ODCIObject_ind;
struct ODCIQueryInfo
{
OCINumber Flags;
ODCIObjectList* AncOps;
ODCICompQueryInfo CompInfo;
};
typedef struct ODCIQueryInfo ODCIQueryInfo;
struct ODCIQueryInfo_ind
{
OCIInd atomic;
OCIInd Flags;
OCIInd AncOps;
ODCICompQueryInfo_ind CompInfo;
};
typedef struct ODCIQueryInfo_ind ODCIQueryInfo_ind;
struct ODCIIndexCtx
{
struct ODCIIndexInfo IndexInfo;
OCIString* Rid;
struct ODCIQueryInfo QueryInfo;
};
typedef struct ODCIIndexCtx ODCIIndexCtx;
struct ODCIIndexCtx_ind
{
OCIInd atomic;
struct ODCIIndexInfo_ind IndexInfo;
OCIInd Rid;
struct ODCIQueryInfo_ind QueryInfo;
};
typedef struct ODCIIndexCtx_ind ODCIIndexCtx_ind;
struct ODCIFuncInfo
{
OCIString* ObjectSchema;
OCIString* ObjectName;
OCIString* MethodName;
OCINumber Flags;
};
typedef struct ODCIFuncInfo ODCIFuncInfo;
struct ODCIFuncInfo_ind
{
OCIInd atomic;
OCIInd ObjectSchema;
OCIInd ObjectName;
OCIInd MethodName;
OCIInd Flags;
};
typedef struct ODCIFuncInfo_ind ODCIFuncInfo_ind;
struct ODCICost
{
OCINumber CPUcost;
OCINumber IOcost;
OCINumber NetworkCost;
OCIString* IndexCostInfo;
};
typedef struct ODCICost ODCICost;
struct ODCICost_ind
{
OCIInd atomic;
OCIInd CPUcost;
OCIInd IOcost;
OCIInd NetworkCost;
OCIInd IndexCostInfo;
};
typedef struct ODCICost_ind ODCICost_ind;
struct ODCIArgDesc
{
OCINumber ArgType;
OCIString* TableName;
OCIString* TableSchema;
OCIString* ColName;
OCIString* TablePartitionLower;
OCIString* TablePartitionUpper;
OCINumber Cardinality;
};
typedef struct ODCIArgDesc ODCIArgDesc;
struct ODCIArgDesc_ind
{
OCIInd atomic;
OCIInd ArgType;
OCIInd TableName;
OCIInd TableSchema;
OCIInd ColName;
OCIInd TablePartitionLower;
OCIInd TablePartitionUpper;
OCIInd Cardinality;
};
typedef struct ODCIArgDesc_ind ODCIArgDesc_ind;
struct ODCIStatsOptions
{
OCINumber Sample;
OCINumber Options;
OCINumber Flags;
};
typedef struct ODCIStatsOptions ODCIStatsOptions;
struct ODCIStatsOptions_ind
{
OCIInd atomic;
OCIInd Sample;
OCIInd Options;
OCIInd Flags;
};
typedef struct ODCIStatsOptions_ind ODCIStatsOptions_ind;
struct ODCIEnv
{
OCINumber EnvFlags;
OCINumber CallProperty;
OCINumber DebugLevel;
OCINumber CursorNum;
};
typedef struct ODCIEnv ODCIEnv;
struct ODCIEnv_ind
{
OCIInd _atomic;
OCIInd EnvFlags;
OCIInd CallProperty;
OCIInd DebugLevel;
OCIInd CursorNum;
};
typedef struct ODCIEnv_ind ODCIEnv_ind;
struct ODCIPartInfo
{
OCIString* TablePartition;
OCIString* IndexPartition;
OCINumber IndexPartitionIden;
OCINumber PartOp;
};
typedef struct ODCIPartInfo ODCIPartInfo;
struct ODCIPartInfo_ind
{
OCIInd atomic;
OCIInd TablePartition;
OCIInd IndexPartition;
OCIInd IndexPartitionIden;
OCIInd PartOp;
};
typedef struct ODCIPartInfo_ind ODCIPartInfo_ind;
/*---------- External Tables ----------*/
struct ODCIExtTableInfo
{
OCIString* TableSchema;
OCIString* TableName;
ODCIColInfoList* RefCols;
OCIClobLocator* AccessParmClob;
OCIBlobLocator* AccessParmBlob;
ODCIArgDescList* Locations;
ODCIArgDescList* Directories;
OCIString* DefaultDirectory;
OCIString* DriverType;
OCINumber OpCode;
OCINumber AgentNum;
OCINumber GranuleSize;
OCINumber Flag;
OCINumber SamplePercent;
OCINumber MaxDoP;
OCIRaw* SharedBuf;
OCIString* MTableName;
OCIString* MTableSchema;
OCINumber TableObjNo;
};
typedef struct ODCIExtTableInfo ODCIExtTableInfo;
struct ODCIExtTableInfo_ind
{
OCIInd _atomic;
OCIInd TableSchema;
OCIInd TableName;
OCIInd RefCols;
OCIInd AccessParmClob;
OCIInd AccessParmBlob;
OCIInd Locations;
OCIInd Directories;
OCIInd DefaultDirectory;
OCIInd DriverType;
OCIInd OpCode;
OCIInd AgentNum;
OCIInd GranuleSize;
OCIInd Flag;
OCIInd SamplePercent;
OCIInd MaxDoP;
OCIInd SharedBuf;
OCIInd MTableName;
OCIInd MTableSchema;
OCIInd TableObjNo;
};
typedef struct ODCIExtTableInfo_ind ODCIExtTableInfo_ind;
struct ODCIExtTableQCInfo
{
OCINumber NumGranules;
OCINumber NumLocations;
ODCIGranuleList* GranuleInfo;
OCINumber IntraSourceConcurrency;
OCINumber MaxDoP;
OCIRaw* SharedBuf;
};
typedef struct ODCIExtTableQCInfo ODCIExtTableQCInfo;
struct ODCIExtTableQCInfo_ind
{
OCIInd _atomic;
OCIInd NumGranules;
OCIInd NumLocations;
OCIInd GranuleInfo;
OCIInd IntraSourceConcurrency;
OCIInd MaxDoP;
OCIInd SharedBuf;
};
typedef struct ODCIExtTableQCInfo_ind ODCIExtTableQCInfo_ind;
/*********************************************************/
/* Table Function Info types (used by ODCITablePrepare) */
/*********************************************************/
struct ODCITabFuncInfo
{
ODCINumberList* Attrs;
OCIType* RetType;
};
typedef struct ODCITabFuncInfo ODCITabFuncInfo;
struct ODCITabFuncInfo_ind
{
OCIInd _atomic;
OCIInd Attrs;
OCIInd RetType;
};
typedef struct ODCITabFuncInfo_ind ODCITabFuncInfo_ind;
/*********************************************************************/
/* Table Function Statistics types (used by ODCIStatsTableFunction) */
/*********************************************************************/
struct ODCITabFuncStats
{
OCINumber num_rows;
};
typedef struct ODCITabFuncStats ODCITabFuncStats;
struct ODCITabFuncStats_ind
{
OCIInd _atomic;
OCIInd num_rows;
};
typedef struct ODCITabFuncStats_ind ODCITabFuncStats_ind;
/*---------------------------------------------------------------------------
PRIVATE TYPES AND CONSTANTS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PUBLIC FUNCTIONS
---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------
PRIVATE FUNCTIONS
---------------------------------------------------------------------------*/
#endif /* ODCI_ORACLE */

@ -0,0 +1,322 @@
/*
Copyright (c) 1982, 2008, Oracle and/or its affiliates.All rights reserved.
*/
/*
* $Header: oracore3/public/oratypes.h /nt/21 2009/01/01 19:48:06 sabchoud Exp $
*/
#ifndef ORATYPES
# define ORATYPES
# define SX_ORACLE
# define SX3_ORACLE
#ifndef ORASTDDEF
# include <stddef.h>
# define ORASTDDEF
#endif
#ifndef ORALIMITS
# include <limits.h>
# define ORALIMITS
#endif
#ifndef TRUE
# define TRUE 1
# define FALSE 0
#endif
#ifndef lint
typedef unsigned char ub1;
typedef signed char sb1;
#else
#define ub1 unsigned char
#define sb1 signed char
#endif
#define UB1MAXVAL ((ub1)UCHAR_MAX)
#define UB1MINVAL ((ub1) 0)
#define SB1MAXVAL ((sb1)SCHAR_MAX)
#define SB1MINVAL ((sb1)SCHAR_MIN)
#define MINUB1MAXVAL ((ub1) 255)
#define MAXUB1MINVAL ((ub1) 0)
#define MINSB1MAXVAL ((sb1) 127)
#define MAXSB1MINVAL ((sb1) -127)
#ifndef lint
typedef unsigned short ub2;
typedef signed short sb2;
#else
#define ub2 unsigned short
#define sb2 signed short
#endif
#define UB2MAXVAL ((ub2)USHRT_MAX)
#define UB2MINVAL ((ub2) 0)
#define SB2MAXVAL ((sb2) SHRT_MAX)
#define SB2MINVAL ((sb2) SHRT_MIN)
#define MINUB2MAXVAL ((ub2) 65535)
#define MAXUB2MINVAL ((ub2) 0)
#define MINSB2MAXVAL ((sb2) 32767)
#define MAXSB2MINVAL ((sb2)-32767)
#ifndef lint
typedef unsigned int ub4;
typedef signed int sb4;
#else
#define eb4 int
#define ub4 unsigned int
#define sb4 signed int
#endif
#define UB4MAXVAL ((ub4)UINT_MAX)
#define UB4MINVAL ((ub4) 0)
#define SB4MAXVAL ((sb4) INT_MAX)
#define SB4MINVAL ((sb4) INT_MIN)
#define MINUB4MAXVAL ((ub4) 4294967295)
#define MAXUB4MINVAL ((ub4) 0)
#define MINSB4MAXVAL ((sb4) 2147483647)
#define MAXSB4MINVAL ((sb4)-2147483647)
/* --- Signed/Unsigned eight-byte scalar (orasb8/oraub8) --- */
#define ORAXB8_DEFINED
#ifndef lint
#ifndef __GNUC__
#ifdef __BORLANDC__
typedef unsigned __int64 oraub8;
typedef signed __int64 orasb8;
#else
typedef unsigned _int64 oraub8;
typedef signed _int64 orasb8;
#endif /* __BORLANDC__ */
#else
typedef unsigned long long oraub8;
typedef signed long long orasb8;
#endif
typedef oraub8 ub8;
typedef orasb8 sb8;
#else
# define ub8 oraub8
# define sb8 orasb8
# define oraub8 unsigned _int64
# define orasb8 signed _int64
#endif /* !lint */
#define ORAUB8MINVAL ((oraub8)0)
#define ORAUB8MAXVAL ((oraub8)18446744073709551615)
#define ORASB8MINVAL ((orasb8)-9223372036854775808)
#define ORASB8MAXVAL ((orasb8) 9223372036854775807)
#define MAXORAUB8MINVAL ((oraub8)0)
#define MINORAUB8MAXVAL ((oraub8)18446744073709551615)
#define MAXORASB8MINVAL ((orasb8)-9223372036854775807)
#define MINORASB8MAXVAL ((orasb8) 9223372036854775807)
#define UB1BITS CHAR_BIT
#define UB1MASK ((1 << ((uword)CHAR_BIT)) - 1)
#ifdef lint
# define oratext unsigned char
#else
typedef unsigned char oratext;
#endif
#ifndef lint
typedef char eb1;
typedef short eb2;
typedef int eb4;
#else
# define eb1 char
# define eb2 short
# define eb4 int
#endif
#define EB1MAXVAL ((eb1)SCHAR_MAX)
#define EB1MINVAL ((eb1) 0)
#define MINEB1MAXVAL ((eb1) 127)
#define MAXEB1MINVAL ((eb1) 0)
#define EB2MAXVAL ((eb2) SHRT_MAX)
#define EB2MINVAL ((eb2) 0)
#define MINEB2MAXVAL ((eb2) 32767)
#define MAXEB2MINVAL ((eb2) 0)
#define EB4MAXVAL ((eb4) INT_MAX)
#define EB4MINVAL ((eb4) 0)
#define MINEB4MAXVAL ((eb4) 2147483647)
#define MAXEB4MINVAL ((eb4) 0)
#ifndef lint
typedef sb1 b1;
#else
#define b1 sb1
#endif
#define B1MAXVAL SB1MAXVAL
#define B1MINVAL SB1MINVAL
#ifndef lint
typedef sb2 b2;
#else
#define b2 sb2
#endif
#define B2MAXVAL SB2MAXVAL
#define B2MINVAL SB2MINVAL
#ifndef lint
typedef sb4 b4;
#else
#define b4 sb4
#endif
# define B4MAXVAL SB4MAXVAL
# define B4MINVAL SB4MINVAL
#if !defined(LUSEMFC)
# ifdef lint
# define text unsigned char
# else
typedef oratext text;
# endif
#endif
#ifdef lint
# define OraText unsigned char
#else
typedef oratext OraText;
#endif
#ifndef lint
typedef int eword;
typedef unsigned int uword;
typedef signed int sword;
#else
#define eword int
#define uword unsigned int
#define sword signed int
#endif
#define EWORDMAXVAL ((eword) INT_MAX)
#define EWORDMINVAL ((eword) 0)
#define UWORDMAXVAL ((uword)UINT_MAX)
#define UWORDMINVAL ((uword) 0)
#define SWORDMAXVAL ((sword) INT_MAX)
#define SWORDMINVAL ((sword) INT_MIN)
#define MINEWORDMAXVAL ((eword) 2147483647)
#define MAXEWORDMINVAL ((eword) 0)
#define MINUWORDMAXVAL ((uword) 4294967295)
#define MAXUWORDMINVAL ((uword) 0)
#define MINSWORDMAXVAL ((sword) 2147483647)
#define MAXSWORDMINVAL ((sword) -2147483647)
#ifdef _WIN64
#ifndef lint
#ifdef __BORLANDC__
typedef unsigned __int64 ubig_ora;
typedef signed __int64 sbig_ora;
#else
typedef unsigned _int64 ubig_ora;
typedef signed _int64 sbig_ora;
#endif /* End of __BORLANDC__ */
#else
#define ubig_ora unsigned _int64
#define sbig_ora signed _int64
#endif /* End of lint */
#define UBIG_ORAMAXVAL ((ubig_ora)_UI64_MAX)
#define UBIG_ORAMINVAL ((ubig_ora) 0)
#define SBIG_ORAMAXVAL ((sbig_ora) _I64_MAX)
#define SBIG_ORAMINVAL ((sbig_ora) _I64_MIN)
#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
#define MAXUBIG_ORAMINVAL ((ubig_ora) 0)
#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
#else
#ifndef lint
typedef unsigned long ubig_ora;
typedef signed long sbig_ora;
#else
#define ubig_ora unsigned long
#define sbig_ora signed long
#endif
#define UBIG_ORAMAXVAL ((ubig_ora)ULONG_MAX)
#define UBIG_ORAMINVAL ((ubig_ora) 0)
#define SBIG_ORAMAXVAL ((sbig_ora) LONG_MAX)
#define SBIG_ORAMINVAL ((sbig_ora) LONG_MIN)
#define MINUBIG_ORAMAXVAL ((ubig_ora) 4294967295)
#define MAXUBIG_ORAMINVAL ((ubig_ora) 0)
#define MINSBIG_ORAMAXVAL ((sbig_ora) 2147483647)
#define MAXSBIG_ORAMINVAL ((sbig_ora)-2147483647)
#endif /* _WIN64 */
#define UBIGORABITS (UB1BITS * sizeof(ubig_ora))
#undef CONST
#define CONST const
#define dvoid void
typedef void (*lgenfp_t)( void );
#ifndef ORASYS_TYPES
# include <sys/types.h>
# define ORASYS_TYPES
#endif
#ifndef boolean
# define boolean int
#endif
#ifdef sparc
# define SIZE_TMAXVAL SB4MAXVAL
#else
# define SIZE_TMAXVAL UB4MAXVAL
#endif
#define MINSIZE_TMAXVAL (size_t)4294967295
#if !defined(MOTIF) && !defined(LISPL) && !defined(__cplusplus) && !defined(LUSEMFC)
typedef oratext *string;
#endif
#ifndef lint
typedef unsigned short utext;
#else
#define utext unsigned short
#endif
#endif

File diff suppressed because it is too large Load Diff

@ -0,0 +1,373 @@
/* Copyright (c) 1994, 2006, Oracle. All rights reserved. */
/*
Author: Tin Nguyen
Date: 02/07/94
Source documents: "Functional Specification for C Object Interface, Object
Management Subsystem", "Oracle C Coding Standards
version 2.2", and the header file template
Rule sets: the generic and .h file rule sets
Quality status: not exited
Identification tag: [ one or more letters to identify the .h file ]
Revision code: [ date of the last revision of the .h file ]
Note to the user of this header file:
Anything in this header file that is marked private is not supported and
must not be used. Private sections are included in the header file to
improve internal maintenance.
NAME
ORID - Oracle Object Interface for Dynamic Data Access
DESCRIPTION
This file contains declarations for C object interface functions including
the dynamic object data access operations that allow callers to dynamically
access and manipulate objects; these operations include getting and setting
attributes of an object. These dynamic object operations are for accessing
and manipulation objects whose types are not known at compile-time.
RELATED DOCUMENTS
Functional Specification for C Object Interface / Object Management System
PUBLIC FUNCTIONS
OCIObjectSetAttr - ORID SET attribute value
OCIObjectGetAttr - ORID GET attribute value
PRIVATE FUNCTIONS
None
EXAMPLES
EXAMPLE 1
/o
o This example illustrates how an interative program can use the dynamic
o attribute access to display and modify attributes of an ADT instance.
o The interactive program does not know the type of the object at
o compile time.
o/
void display(adt_ref, object, null_struct, names, names_count,
names_length, indexes, indexes_count)
{
/o Pin the ADT o/
if (OCIObjectPin(env, &adt_ref, OROOPOCUR, OROOPDTRA, OROOLMNON, &adt)
!= OROSTASUC)
/o error handling code o/
/o
o Call the type manager to obtain all the attributes in the object.
o Display the content of each attribute in the ADT instance. If the
o attribute is an array, display each element of the array. If the
o attribute is an ADT instance, recursively call this routine to
o display the embedded ADT instance.
o/
numAttrs = OCITypeAttrs(env, adt);
for (i= 1; i <= numAttrs; i++)
{
/o get attribute descriptor o/
if (ortgabp(env, adt, i, &ado_ref, &ado) != OROSTASUC)
/o error handling code o/
/o get attribute name o/
names[names_count] = OCITypeElemName(env, ado,
&names_length[names_count]);
/o dynamically get the attr o/
if (OCIObjectGetAttr(env, object, null_struct, 0, adt_ref, names,
names_length, names_count+1, indexes, indexes_count, 0,
&null, &null_info, &attr) != OROSTASUC)
/o error handling code o/
/o check if attribute is null o/
if (null) continue;
/o get typecode of attribute o/
typecode = OCITypeElemTypeCode(env, ado);
/o if attribute is a varray, display each element in varray o/
if (typecode == OCI_TYPECODE_VARRAY)
{
/o get the reference to the type of the element of the array o/
if (OCITypeElemParameterizedTyper(env, ado, &attr_type_ref)
!= OROSTASUC)
/o error handling code o/
/o get the size of array o/
if (orlasiz(env, &attr_type_ref, (orlva *)attr,
&numElm) != OROSTASUC)
/o error handling code o/
/o get the typecode of the element of the array o/
if (ortty2r(env, attr_type_ref, &typecode) != OROSTASUC)
/o error handling code o/
/o iterate the array o/
for (j=0; j < numElm; j++)
{
/o get an element in the array o/
if (OCIObjectGetAttr(env, attr, null_info, j+1, attr_type_ref,
names, names_length, 0, indexes, 0, 0, &null, &null_info,
&element) != OROSTASUC)
/o error handling code o/
/o check if element is null o/
if (null) continue;
/o if attr is an ADT instance, recursively call this routine o/
if (typecode == OCI_TYPECODE_ADT || typecode ==
OCI_TYPECODE_UNNAMEDADT)
{
/o display the element as an adt o/
display(attr_type_ref, element, null_info, names, lengths,
0, indexes, 0);
}
/o if attribute is scalar, print the value to the screen o/
else output_to_screen(element, typecode);
}
}
/o if attribute is an ADT instance, recursively call this routine o/
else if (typecode == OCI_TYPECODE_ADT || typecode ==
OCI_TYPECODE_UNNAMEDADT)
{
/o get the type ref of the attribute o/
if (ortgarf(env, ado, &attr_type_ref) != OROSTASUC)
/o error handling code o/
display(attr_type_ref, attr, null_info, 0, names, 0, names_length,
indexes, 0);
}
/o if attribute is scalar, print the value to the screen o/
else output_to_screen(attr, typecode);
}
}
/o ******** main routine *********** o/
....
/o
o Allocate the arrays for storing the path expression
o/
/o get the tdo of type 'long' o/
if (orttypget(&env, con, "SYS", sizeof("SYS"), "SINT32", sizeof("SINT32"),
OROOPDSES, &long_ref, &long_tdo) != OROSTASUC)
/o error handling code o/
/o get the tdo of type 'varchar' o/
if (orttypget(&env, con, "SYS", sizeof("SYS"), "SQL_VARCHAR2",
sizeof("SQL_VARCHAR2"), OROOPDSES, &vchar_ref, &vchar_tdo)
!= OROSTASUC)
/o error handling code o/
/o allocate the varrays for the path expression o/
if (orlalloc(env, &vchar_ref, MAX_ARR_SIZE, &attr_names) != OROSTASUC)
/o error handling code o/
if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_lengths)
!= OROSTASUC)
/o error handling code o/
if (orlalloc(env, &long_ref, MAX_ARR_SIZE, &attr_name_indexes)
!= OROSTASUC)
/o error handling code o/
/o
o Get an ADT instance. The ref to the ADT instance can be obtained
o by through ORI or OSCI.
o/
if (OCIObjectPin(env, &obj_ref, OROOPOCUR, OROOPDTRA, OROOLMUPD, &object)
!= OROSTASUC)
/o error handling code o/
/o get the null structure of the ADT instance o/
if (OCIObjectGetInd(gp, object, &null_struct) != OROSTASUC)
/o error handling code o/
/o
o Get the type of the ADT instance
o/
/o find out the type of the ADT instance o/
if (oriogto(env, object, &adt_ref) != OROSTASUC)
/o error handling code o/
/o display the object o/
display(adt_ref, object, null_struct, attr_names, 0, attr_names_lengths,
attr_names_indexes, 0);
/o After the object is displayed, the program waits for the user to
o respond. The user modifies the values of an attribute and the
o program generates a path expression for the attribute and calls
o OCIObjectSetAttr() to set the value.
o/
if (OCIObjectSetAttr(env, object, null_struct, adt_ref,
(text **)attr_names, (ub4 *)attr_name_lengths,
attr_names_count, (ub4 *)attr_array_indexes,
attr_array_indexes_count,
(void *)0, FALSE, (void *)value) != OROSTASUC)
/o error handling code o/
END OF EXAMPLE 1
NOTES
This file has been subsetted to contain only the routines that will
be in the first release.
MODIFIED
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
srseshad 03/12/03 - convert oci public api to ansi
aahluwal 06/03/02 - bug 2360115
bpalaval 02/09/01 - Change text to oratext.
whe 09/01/99 - 976457:check __cplusplus for C++ code
sthakur 09/18/97 - collection indexing not supported
cxcheng 08/05/97 - fix compile with short names
skrishna 03/18/97 - fix ifdef for supporting ansi and k&r proto-types
cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
cxcheng 10/17/96 - final renaming of functions
jboonleu 10/07/96 - beautify with OCI long names
cxcheng 10/07/96 - change short names to long names for readability
jboonleu 09/27/96 - fix lint
jwijaya 07/03/96 - add ANSI prototypes
jboonleu 04/13/95 - new interface
jwijaya 10/11/94 - fix the sccs header and add namespace
tanguyen 08/22/94 - fix example
tanguyen 08/09/94 - remove Sccsid declaration
tanguyen 07/20/94 - fix OCIObjectSetAttr and OCIObjectGetAttr to
use position descriptor
tanguyen 07/18/94 - change 'object' type to become ptr to object
tanguyen 06/30/94 - Fix the ORID_ORACLE ifdef
tanguyen 06/27/94 - update to template format
skotsovo 05/12/94 - replace ado with attribute position
jweisz 05/11/94 - test new checkin facility
jwijaya 05/05/94 - orienv/ref/typ -> oroenv/ref/typ
jwijaya 02/07/94 - Creation
*/
#ifndef ORATYPES
#include <oratypes.h>
#endif
#ifndef ORO_ORACLE
#include <oro.h>
#endif
#ifndef OCI_ORACLE
#include <oci.h>
#endif
#ifndef ORID_ORACLE
#define ORID_ORACLE
#ifdef SLSHORTNAME
#define OCIObjectSetAttr oridset
#define OCIObjectGetAttr oridget
#endif /* SLSHORTNAME */
/*---------------------------------------------------------------------------*/
/* PUBLIC FUNCTIONS */
/*---------------------------------------------------------------------------*/
/*-------------------------- OCIObjectSetAttr ----------------------------*/
sword OCIObjectSetAttr( OCIEnv *env, OCIError *err, void *instance,
void *null_struct, struct OCIType *tdo,
const oratext **names, const ub4 *lengths,
const ub4 name_count, const ub4 *indexes,
const ub4 index_count, const OCIInd null_status,
const void *attr_null_struct, const void *attr_value );
/*
NAME: OCIObjectSetAttr - ORID SET value
PARAMETERS:
env (IN) - OCI environment handle initialized in object mode
err (IN) - error handle. If there is an error, it is
recorded in 'err' and this function returns OCI_ERROR.
The error recorded in 'err' can be retrieved by calling
OCIErrorGet().
instance (IN) - pointer to an ADT instance
null_struct (IN) - the null structure of the ADT instance or array
tdo (IN) - pointer to the TDO
names (IN) - array of attribute names. This is used to specify
the names of the attributes in the path expression.
lengths (IN) - array of lengths of attribute names.
name_count (IN) - number of element in the array 'names'.
indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
attr_null_status (IN) - the null status of the attribute if the type of
attribute is primitive.
attr_null_struct (IN) - the null structure of an ADT or collection
attribute.
attr_value (IN) - pointer to the attribute value.
REQUIRES:
DESCRIPTION:
This function set the attribute of the given object with the given
value. The position of the attribute is specified as a path
expression which is an array of names and an array of indexes.
RETURNS:
one of OROSTA*
EXAMPLES:
For path expression stanford.cs.stu[5].addr, the arrays will look like
names = {"stanford", "cs", "stu", "addr"}
lengths = {8, 2, 3, 4}
indexes = {5}
Also see the above example.
*/
/*-------------------------- OCIObjectGetAttr ----------------------------*/
sword OCIObjectGetAttr( OCIEnv *env, OCIError *err, void *instance,
void *null_struct, struct OCIType *tdo,
const oratext **names, const ub4 *lengths,
const ub4 name_count, const ub4 *indexes,
const ub4 index_count, OCIInd *attr_null_status,
void **attr_null_struct, void **attr_value,
struct OCIType **attr_tdo );
/*
NAME: OCIObjectGetAttr - ORID GET value
PARAMETERS:
env (IN) - OCI environment handle initialized in object mode
err (IN) - error handle. If there is an error, it is
recorded in 'err' and this function returns OCI_ERROR.
The error recorded in 'err' can be retrieved by calling
OCIErrorGet().
instance (IN) - pointer to an ADT instance
null_struct (IN) - the null structure of the ADT instance or array
tdo (IN) - pointer to the TDO
names (IN) - array of attribute names. This is used to specify
the names of the attributes in the path expression.
lengths (IN) - array of lengths of attribute names.
name_count (IN) - number of element in the array 'names'.
indexes (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4 *)0.
index_count (IN) [OPTIONAL] - currently NOT SUPPORTED, pass (ub4)0.
attr_null_status (OUT) - the null status of the attribute if the type
of attribute is primitive.
attr_null_struct (OUT) - the null structure of an ADT or collection
attribute.
attr_value (OUT) - pointer to the attribute value.
attr_tdo (OUT) - pointer to the TDO of the attribute.
REQUIRES:
- a valid OCI environment handle must be given.
DESCRIPTION:
This function gets a value from an ADT instance or from an array.
If the parameter 'instance' points to an ADT instance, then the path
expression specifies the location of the attribute in the ADT.
It is assumed that the object is pinned and that the value returned
is valid until the object is unpinned.
RETURNS:
one of OROSTA*
EXAMPLES:
See example in OCIObjectSetAttr(). Also see the above example.
*/
#endif /* ORID_ORACLE */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,883 @@
/* Copyright (c) 1994, 2003, Oracle Corporation. All rights reserved. */
/*
NAME
OCI - Oracle Object Interface for External/Internal/Kernel Clients
DESCRIPTION
This header file contains Oracle object interface definitions which
can be included by external user applications, tools, as well as
the kernel. It defines types and constants that are common to all
object interface which is being defined in several other header files
(e.g., ori.h, ort.h, and orl.h).
RELATED DOCUMENTS
TBD
INSPECTION STATUS [[ deletable if no inspection ]]
Inspection date: [[ date of the last logging meeting ]]
Inspection status: [[ exited, not exited, or N/A if exit is not a goal ]]
Estimated increasing cost defects per page:
Rule sets: [[ rule sets inspected against or planned to be
inspected against ]]
ACCEPTANCE REVIEW STATUS [[ deletable if no approval review ]]
Review date: [[ date of the meeting where issues were logged and the
approval status was decided ]]
Review status: [[ current status: accepted, conditionally accepted,
major revision required, rejected ]]
Reviewers: [[ names of the members on the review team ]]
PUBLIC FUNCTIONS
EXAMPLES
Examples are given in the description of each function or macro where
relevant.
MODIFIED
mnanal 06/09/03 - backout of fix 2836388
mnanal 05/14/03 - bug-2836388
srseshad 11/27/02 - Change OCI_TYPECODE_BFLOAT/BDOUBLE codes
rxgovind 10/09/02 - add OCI_TYPECODE_UROWID
mxyang 09/17/02 - grabtrans 'mmorsi_obj_float'
srseshad 09/11/02 -
srseshad 09/01/02 -
aahluwal 06/03/02 - bug 2360115
celsbern 10/19/01 - merge LOG to MAIN
rxgovind 10/16/01 - update typecodes
rxgovind 09/19/01 - add typecodes
rkasamse 08/15/01 - add OCI_DURATION_USER_CALLBACK
jchai 09/24/01 - add type code for PLS_INTEGER
porangas 08/22/01 - Fix bug#1776434
schatter 04/09/01 - merge 1456235: define OCI_DURATION_INVALID
rdani 10/12/00 - 1449943 NOCOPY and PIPELINE
ciyer 05/26/00 - short names for abstract, overriding
rkasamse 05/25/00 - OCCI enhancements
smuralid 05/11/00 - OCITypeMethodFlags - add NOT INSTANTIABLE, OVERRIDING
rxgovind 05/09/00 - add OCI_TYPECODE_NONE
tnbui 07/28/99 - Remove OCI_TYPECODE_TIMESTAMP_ITZ
tnbui 07/21/99 - TS LOCAL TZ
thoang 06/21/99 - Add OCI_TYPECODE_TIMESTAMP_ITZ
thoang 03/04/99 - Add datetime datatypes
rkasamse 10/20/98 - add OCI_ATTR_CACHE_ARRAYFLUSH
rkasamse 10/29/98 - add OCI_DURATION_CALLOUT
rkasamse 04/28/98 - OCI_OBJECT_DETECTCHANGE -> OCI_ATTR_OBJECT_DETECTCHAN
rkasamse 04/28/98 - OCI_OBJECT_NEWNOTNULL -> OCI_ATTR_OBJECT_NEWNOTNULL
rkasamse 04/23/98 - add OCI_OBJECT_DETECTCHANGE
rkasamse 04/03/98 - add OCI_OBJECT_NEWNOTNULL
pmitra 04/01/98 - OCI_LOCK_X_NOWAIT added
rxgovind 02/18/98 - add OCI_TYPECODE_OPAQUE
rkasamse 02/13/98 - Add OCI_DURATION_PROCESS
cxcheng 07/28/97 - fix compile with SLSHORTNAME
skrishna 07/14/97 - add OCIObjectGetProperty
cxcheng 04/30/97 - make OCITypeParamMode values consistent with PL/SQL
skrishna 04/28/97 - undocument OCIObjectProperty & OCIObjectEvent
cxcheng 03/29/97 - remove all remaining short names
sthakur 03/20/97 - add casts to constants
cxcheng 02/21/97 - temporarily put SLSHORTNAME for PL/SQL
cxcheng 02/06/97 - take out short name support except with SLSHORTNAME
lchidamb 01/20/97 - update OCIRef comments
sgollapu 11/19/96 - Add OCI type codes for BOOL,REC,and TAB
cxcheng 11/19/96 - more typecode changes
cxcheng 11/13/96 - add #include for ocidfn.h
cxcheng 11/13/96 - add OCI_TYPECODE_ADT for compatibility
cxcheng 11/12/96 - add SQLT_NCO for named collection
cxcheng 11/11/96 - more changes to typecodes
cxcheng 11/07/96 - #define OCI_TYPECODE_MLSLABEL to SQLT_LAB
cxcheng 11/06/96 - fix #define omission for OROTCNAT
cxcheng 10/30/96 - move OCI_TYPECODE_* to ocidfn.h as SQLT_*
cxcheng 10/28/96 - more beautification changes
jboonleu 10/29/96 - add flags for freeing object
dchatter 10/26/96 - delete redef of OCISvcCtx, OCIError, OCIEnv
cxcheng 10/15/96 - more changes
cxcheng 10/14/96 - more final fixes to constants
mluong 10/11/96 -
mluong 10/11/96 - KOCON and KONSP are in lowercase
mluong 10/11/96 - add some define per Calvin
cxcheng 10/09/96 - add #define for OROOCOSFN to OCI_COPY_NOREF
jboonleu 10/08/96 - change OROOCOSFN to OCICopyFlag
jboonleu 10/07/96 - use new OCI names for cache options
cxcheng 10/07/96 - add OROTCS02 for KOTTCBRI and OROTCS03 as spare
cxcheng 10/07/96 - more lint fixes
cxcheng 10/02/96 - move oronsp to ko.h as konsp
cxcheng 10/01/96 - add long names for readability
cxcheng 10/01/96 - remove orotty and orotal
rjenkins 09/28/96 - 2k char 4k varchar2
jboonleu 09/27/96 - add macro used only in beta2
cxcheng 09/27/96 - move oroenv to oroenv.h
cxcheng 09/24/96 - remove unnecessary orotyp
cxcheng 09/25/96 - add typecode OROTCS01 as placeholder for lob pointer
cxcheng 09/20/96 - add TDO load option orotgo
jboonleu 09/18/96 - add OROOPOREC
jboonleu 09/10/96 - add OROOPODFL
jweisz 08/27/96 - add SQL internal typecode OROTCS00
cxcheng 08/02/96 - add PLSQL internal typecodes OROTCP..
cxcheng 08/01/96 - add OROTCFAR to fill up space left by OROTCCAR
jboonleu 07/16/96 - new pin option
cxcheng 06/18/96 - add casts to OROTNOPRE and OROTNOSCL
cxcheng 05/29/96 - change OROTCNPT back to OROTCDOM
vkrishna 05/27/96 - add OROTCCAR
cxcheng 05/17/96 - replace OROTCFAR with OROTCCAR
cxcheng 05/08/96 - change orotmf from ub1 to ub2
cxcheng 05/07/96 - fix public defines for method types
cxcheng 04/30/96 - change OROTCDOM to OROTCNPT
cxcheng 04/15/96 - remove obsolete OROTTYICT
jboonleu 04/12/96 - add new pin option
sthakur 04/12/96 - add indicator type and indicator status
cxcheng 04/10/96 - add function parameter codes for ORT/KOT
cxcheng 04/03/96 - replace OROTCFAR as OROTCCAR
jwijaya 03/29/96 - add OROTTCCAR
jwijaya 03/27/96 - better comments for orotc
cxcheng 02/23/96 - add typecodes for SMALLINT and VARCHAR2
skrishna 02/22/96 - add oroind - null indicator type
cxcheng 02/21/96 - change lob character codes to OROTCCLB, OROTCBLB...
jboonleu 02/06/96 - new value for predefined duration
cxcheng 01/12/96 - add OROTCCLO, OROTCBLO, OROTCFIL to orotc
cxcheng 12/05/95 - add OROTCDOM and OROTCAAT to orotc
skotsovo 10/30/95 - reserve space for internal 'oid' type
jwijaya 10/20/95 - support variable-length ref
cxcheng 10/03/95 - add OROTMFOR for ordering function to orotmf
cxcheng 10/03/95 - Adding the ordering function type to orotmf
jboonleu 09/28/95 - set OROODTPRE
jboonleu 09/25/95 - add oroodt
skotsovo 03/10/95 - update to only include release 1
jboonleu 02/15/95 - add OROOPOREC, remove orocro, oroolo
skotsovo 01/30/95 - add default max lengths for varrays and vstrings
skotsovo 01/24/95 - categorize sint32, double, and real as number types
(with precision and scale) instead of scalar types.
skotsovo 12/20/94 - add release 1 types
skotsovo 12/12/94 - update according to new ots doc
skotsovo 12/01/94 - add default precision and scale
jwijaya 11/15/94 - rename ORONSPTAB to ORONSPEXT
jwijaya 10/25/94 - tint
jwijaya 10/06/94 - add namespace
jwijaya 10/02/94 - connection handle -> connection number
skotsovo 09/12/94 - keep 0 as uninitialized value for ORT consts
skotsovo 08/24/94 - fix orotec
skotsovo 08/17/94 - modify type code names
skotsovo 08/12/94 - fix 141 lint errors
skotsovo 07/25/94 - modify categorization of complex types (orotc)
skotsovo 07/07/94 - change typecode enum values & add decimal type
skotsovo 07/01/94 - change order of typecodes
jwijaya 06/15/94 - review
jboonleu 06/13/94 - add comments for the object cache options
jwijaya 06/13/94 - adhere to the header file template
skotsovo 06/09/94 - make ots scalar type names consistent with the ots
document
jwijaya 06/07/94 - include oratypes.h instead of s.h
skotsovo 05/24/94 - change typecodes
jwijaya 05/23/94 - fix comments of ororef
skotsovo 05/19/94 - remove type composition
skotsovo 05/09/94 - modified orotc according to new OTS document
jwijaya 05/03/94 - oroid and ororef
jwijaya 01/26/94 - Creation
*/
#ifndef ORATYPES
#include <oratypes.h>
#endif
#ifndef OCIDFN_ORACLE
#include <ocidfn.h>
#endif
#ifndef ORO_ORACLE
#define ORO_ORACLE
/*---------------------------------------------------------------------------*/
/* SHORT NAMES SUPPORT SECTION */
/*---------------------------------------------------------------------------*/
#ifdef SLSHORTNAME
/* the following are short names that are only supported on IBM mainframes
with the SLSHORTNAME defined.
With this all subsequent long names will actually be substituted with
the short names here */
#define OCIDuration oroodt
#define OCIInd oroind
#define OCILockOpt oroolm
#define OCIMarkOpt oroomo
#define OCIObjectEvent orocev
#define OCIObjectProperty oroopr
#define OCIPinOpt oroopo
#define OCIRef ororef
#define OCIRefreshOpt orooro
#define OCITypeCode orotc
#define OCITypeEncap orotec
#define OCITypeGetOpt orotgo
#define OCITypeMethodFlag orotmf
#define OCITypeParamMode orotpm
#define OCIObjectPropId oroopi
#define OCIObjectLifetime oroolft
#define OCIObjectMarkstatus oroomst
#define OCI_LOCK_NONE OROOLMNUL
#define OCI_LOCK_X OROOLMX
#define OCI_LOCK_X_NOWAIT OROOLMXNW
#define OCI_MARK_DEFAULT OROOMODFL
#define OCI_MARK_NONE OROOMONON
#define OCI_MARK_UPDATE OROOMOUPD
#define OCI_OBJECTEVENT_AFTER_FLUSH OROCEVAFL
#define OCI_OBJECTEVENT_AFTER_REFRESH OROCEVARF
#define OCI_OBJECTEVENT_BEFORE_FLUSH OROCEVBFL
#define OCI_OBJECTEVENT_BEFORE_REFRESH OROCEVBRF
#define OCI_OBJECTEVENT_WHEN_LOCK OROCEVWLK
#define OCI_OBJECTEVENT_WHEN_MARK_DELETED OROCEVWDL
#define OCI_OBJECTEVENT_WHEN_MARK_UPDATED OROCEVWUP
#define OCI_OBJECTEVENT_WHEN_UNMARK OROCEVWUM
#define OCI_OBJECTPROP_DIRTIED OROOPRDRT
#define OCI_OBJECTPROP_LOADED OROOPRLOD
#define OCI_OBJECTPROP_LOCKED OROOPRLCK
#define OCI_PIN_ANY OROOPOANY
#define OCI_PIN_DEFAULT OROOPODFL
#define OCI_PIN_LATEST OROOPOLST
#define OCI_PIN_RECENT OROOPOREC
#define OCI_REFRESH_LOADED OROOROLOD
#define OCI_TYPEENCAP_PRIVATE OROTECPVT
#define OCI_TYPEENCAP_PUBLIC OROTECPUB
#define OCI_TYPEGET_ALL OROTGOALL
#define OCI_TYPEGET_HEADER OROTGOHDR
#define OCI_TYPEMETHOD_CONSTANT OROTMCON
#define OCI_TYPEMETHOD_CONSTRUCTOR OROTMCSTR
#define OCI_TYPEMETHOD_DESTRUCTOR OROTMDSTR
#define OCI_TYPEMETHOD_INLINE OROTMINL
#define OCI_TYPEMETHOD_MAP OROTMMAP
#define OCI_TYPEMETHOD_OPERATOR OROTMOP
#define OCI_TYPEMETHOD_ORDER OROTMOR
#define OCI_TYPEMETHOD_RNDS OROTMRDS
#define OCI_TYPEMETHOD_RNPS OROTMRPS
#define OCI_TYPEMETHOD_SELFISH OROTMSLF
#define OCI_TYPEMETHOD_VIRTUAL OROTMVRT
#define OCI_TYPEMETHOD_WNDS OROTMWDS
#define OCI_TYPEMETHOD_WNPS OROTMWPS
#define OCI_TYPEMETHOD_ABSTRACT OROTMABSTRACT
#define OCI_TYPEMETHOD_OVERRIDING OROTMOVERRIDING
#define OCI_TYPEMETHOD_PIPELINED OROTMPIPELINED
#define OCI_TYPEPARAM_BYREF OROTPMREF
#define OCI_TYPEPARAM_IN OROTPMIN
#define OCI_TYPEPARAM_INOUT OROTPMIO
#define OCI_TYPEPARAM_OUT OROTPMOUT
#define OCI_TYPEPARAM_OUTNCPY OROTPMOUTNCPY
#define OCI_TYPEPARAM_INOUTNCPY OROTPMIONCPY
#endif /* SLSHORTNAME */
/*---------------------------------------------------------------------------*/
/* PUBLIC TYPES, CONSTANTS AND MACROS */
/*---------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* GENERAL OBJECT TYPES, CONSTANTS, MACROS */
/*---------------------------------------------------------------------------*/
/*------------------------- OBJECT REFERENCE (REF) --------------------------*/
typedef struct OCIRef OCIRef;
/*
* OCIRef - OCI object REFerence
*
* In the Oracle object runtime environment, an object is identified by an
* object reference (ref) which contains the object identifier plus other
* runtime information. The contents of a ref is opaque to clients. Use
* OCIObjectNew() to construct a ref.
*/
/*--------------------------- OBJECT INDICATOR ------------------------------*/
typedef sb2 OCIInd;
/*
* OCIInd -- a variable of this type contains (null) indicator information
*/
#define OCI_IND_NOTNULL (OCIInd)0 /* not NULL */
#define OCI_IND_NULL (OCIInd)(-1) /* NULL */
#define OCI_IND_BADNULL (OCIInd)(-2) /* BAD NULL */
#define OCI_IND_NOTNULLABLE (OCIInd)(-3) /* not NULLable */
/*---------------------------------------------------------------------------*/
/* OBJECT CACHE */
/*---------------------------------------------------------------------------*/
/* To enable object change detection mode, set this to TRUE */
#define OCI_ATTR_OBJECT_DETECTCHANGE 0x00000020
/* To enable object creation with non-NULL attributes by default, set the
following to TRUE.
By default, object is created with NULL attributes
*/
#define OCI_ATTR_OBJECT_NEWNOTNULL 0x00000010
/* To enable sorting of the objects that belong to the same table
before being flushed through OCICacheFlush.
Please note that by enabling this object cache will not be flushing
the objects in the same order they were dirtied */
#define OCI_ATTR_CACHE_ARRAYFLUSH 0x00000040
/*--------------------------- OBJECT PIN OPTION -----------------------------*/
enum OCIPinOpt
{
/* 0 = uninitialized */
OCI_PIN_DEFAULT = 1, /* default pin option */
OCI_PIN_ANY = 3, /* pin any copy of the object */
OCI_PIN_RECENT = 4, /* pin recent copy of the object */
OCI_PIN_LATEST = 5 /* pin latest copy of the object */
};
typedef enum OCIPinOpt OCIPinOpt;
/*
* OCIPinOpt - OCI object Pin Option
*
* In the Oracle object runtime environment, the program has the option to
* specify which copy of the object to pin.
*
* OCI_PINOPT_DEFAULT pins an object using the default pin option. The default
* pin option can be set as an attribute of the OCI environment handle
* (OCI_ATTR_PINTOPTION). The value of the default pin option can be
* OCI_PINOPT_ANY, OCI_PINOPT_RECENT, or OCI_PIN_LATEST. The default option
* is initialized to OCI_PINOPT_ANY.
*
* OCI_PIN_ANY pins any copy of the object. The object is pinned
* using the following criteria:
* If the object copy is not loaded, load it from the persistent store.
* Otherwise, the loaded object copy is returned to the program.
*
* OCI_PIN_RECENT pins the latest copy of an object. The object is
* pinned using the following criteria:
* If the object is not loaded, load the object from the persistent store
* from the latest version.
* If the object is not loaded in the current transaction and it is not
* dirtied, the object is refreshed from the latest version.
* Otherwise, the loaded object copy is returned to the program.
*
* OCI_PINOPT_LATEST pins the latest copy of an object. The object copy is
* pinned using the following criteria:
* If the object copy is not loaded, load it from the persistent store.
* If the object copy is loaded and dirtied, it is returned to the program.
* Otherwise, the loaded object copy is refreshed from the persistent store.
*/
/*--------------------------- OBJECT LOCK OPTION ----------------------------*/
enum OCILockOpt
{
/* 0 = uninitialized */
OCI_LOCK_NONE = 1, /* null (same as no lock) */
OCI_LOCK_X = 2, /* exclusive lock */
OCI_LOCK_X_NOWAIT = 3 /* exclusive lock, do not wait */
};
typedef enum OCILockOpt OCILockOpt;
/*
* OCILockOpt - OCI object LOCK Option
*
* This option is used to specify the locking preferences when an object is
* loaded from the server.
*/
/*------------------------- OBJECT MODIFYING OPTION -------------------------*/
enum OCIMarkOpt
{
/* 0 = uninitialized */
OCI_MARK_DEFAULT = 1, /* default (the same as OCI_MARK_NONE) */
OCI_MARK_NONE = OCI_MARK_DEFAULT, /* object has not been modified */
OCI_MARK_UPDATE /* object is to be updated */
};
typedef enum OCIMarkOpt OCIMarkOpt;
/*
* OCIMarkOpt - OCI object Mark option
*
* When the object is marked updated, the client has to specify how the
* object is intended to be changed.
*/
/*-------------------------- OBJECT Duration --------------------------------*/
typedef ub2 OCIDuration;
#define OCI_DURATION_INVALID 0xFFFF /* Invalid duration */
#define OCI_DURATION_BEGIN (OCIDuration)10
/* beginning sequence of duration */
#define OCI_DURATION_NULL (OCIDuration)(OCI_DURATION_BEGIN-1)
/* null duration */
#define OCI_DURATION_DEFAULT (OCIDuration)(OCI_DURATION_BEGIN-2) /* default */
#define OCI_DURATION_USER_CALLBACK (OCIDuration)(OCI_DURATION_BEGIN-3)
#define OCI_DURATION_NEXT (OCIDuration)(OCI_DURATION_BEGIN-4)
/* next special duration */
#define OCI_DURATION_SESSION (OCIDuration)(OCI_DURATION_BEGIN)
/* the end of user session */
#define OCI_DURATION_TRANS (OCIDuration)(OCI_DURATION_BEGIN+1)
/* the end of user transaction */
/******************************************************************************
** DO NOT USE OCI_DURATION_CALL. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
#define OCI_DURATION_CALL (OCIDuration)(OCI_DURATION_BEGIN+2)
/* the end of user client/server call */
#define OCI_DURATION_STATEMENT (OCIDuration)(OCI_DURATION_BEGIN+3)
/* This is to be used only during callouts. It is similar to that
of OCI_DURATION_CALL, but lasts only for the duration of a callout.
Its heap is from PGA */
#define OCI_DURATION_CALLOUT (OCIDuration)(OCI_DURATION_BEGIN+4)
#define OCI_DURATION_LAST OCI_DURATION_CALLOUT
/* last of predefined durations */
/* This is not being treated as other predefined durations such as
SESSION, CALL etc, because this would not have an entry in the duration
table and its functionality is primitive such that only allocate, free,
resize memory are allowed, but one cannot create subduration out of this
*/
#define OCI_DURATION_PROCESS (OCIDuration)(OCI_DURATION_BEGIN-5)
/*
* OCIDuration - OCI object duration
*
* A client can specify the duration of which an object is pinned (pin
* duration) and the duration of which the object is in memory (allocation
* duration). If the objects are still pinned at the end of the pin duration,
* the object cache manager will automatically unpin the objects for the
* client. If the objects still exist at the end of the allocation duration,
* the object cache manager will automatically free the objects for the client.
*
* Objects that are pinned with the option OCI_DURATION_TRANS will get unpinned
* automatically at the end of the current transaction.
*
* Objects that are pinned with the option OCI_DURATION_SESSION will get
* unpinned automatically at the end of the current session (connection).
*
* The option OCI_DURATION_NULL is used when the client does not want to set
* the pin duration. If the object is already loaded into the cache, then the
* pin duration will remain the same. If the object is not yet loaded, the
* pin duration of the object will be set to OCI_DURATION_DEFAULT.
*/
/*----------------------------- OBJECT PROPERTY -----------------------------*/
/******************************************************************************
** DO NOT USE OCIObjectProperty. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
enum OCIObjectProperty
{
/* 0 = uninitialized */
OCI_OBJECTPROP_DIRTIED = 1, /* dirty objects */
OCI_OBJECTPROP_LOADED, /* objects loaded in the transaction */
OCI_OBJECTPROP_LOCKED /* locked objects */
};
typedef enum OCIObjectProperty OCIObjectProperty;
/*
* OCIObjectProperty -- OCI Object Property
* This specifies the properties of objects in the object cache.
*/
/*------------------------- CACHE REFRESH OPTION ---------------------------*/
enum OCIRefreshOpt
{
/* 0 = uninitialized */
OCI_REFRESH_LOADED = 1 /* refresh objects loaded in the transaction */
};
typedef enum OCIRefreshOpt OCIRefreshOpt;
/*
* OCIRefreshOpt - OCI cache Refresh Option
* This option is used to specify the set of objects to be refreshed.
*
* OCI_REFRESH_LOAD refreshes the objects that are loaded in the current
* transaction.
*/
/*-------------------------------- OBJECT EVENT -----------------------------*/
/******************************************************************************
** DO NOT USE OCIObjectEvent. IT IS UNSUPPORTED **
** WILL BE REMOVED/CHANGED IN A FUTURE RELEASE **
******************************************************************************/
enum OCIObjectEvent
{
/* 0 = uninitialized */
OCI_OBJECTEVENT_BEFORE_FLUSH = 1, /* before flushing the cache */
OCI_OBJECTEVENT_AFTER_FLUSH, /* after flushing the cache */
OCI_OBJECTEVENT_BEFORE_REFRESH, /* before refreshing the cache */
OCI_OBJECTEVENT_AFTER_REFRESH, /* after refreshing the cache */
OCI_OBJECTEVENT_WHEN_MARK_UPDATED, /* when an object is marked updated */
OCI_OBJECTEVENT_WHEN_MARK_DELETED, /* when an object is marked deleted */
OCI_OBJECTEVENT_WHEN_UNMARK, /* when an object is being unmarked */
OCI_OBJECTEVENT_WHEN_LOCK /* when an object is being locked */
};
typedef enum OCIObjectEvent OCIObjectEvent;
/*
* OCIObjectEvent -- OCI Object Event
* This specifies the kind of event that is supported by the object
* cache. The program can register a callback that is invoked when the
* specified event occurs.
*/
/*----------------------------- OBJECT COPY OPTION --------------------------*/
#define OCI_OBJECTCOPY_NOREF (ub1)0x01
/*
* OCIObjectCopyFlag - Object copy flag
*
* If OCI_OBJECTCOPY_NOREF is specified when copying an instance, the
* reference and lob will not be copied to the target instance.
*/
/*----------------------------- OBJECT FREE OPTION --------------------------*/
#define OCI_OBJECTFREE_FORCE (ub2)0x0001
#define OCI_OBJECTFREE_NONULL (ub2)0x0002
#define OCI_OBJECTFREE_HEADER (ub2)0x0004
/*
* OCIObjectFreeFlag - Object free flag
*
* If OCI_OBJECTCOPY_FORCE is specified when freeing an instance, the instance
* is freed regardless it is pinned or diritied.
* If OCI_OBJECTCOPY_NONULL is specified when freeing an instance, the null
* structure is not freed.
*/
/*----------------------- OBJECT PROPERTY ID -------------------------------*/
typedef ub1 OCIObjectPropId;
#define OCI_OBJECTPROP_LIFETIME 1 /* persistent or transient or value */
#define OCI_OBJECTPROP_SCHEMA 2 /* schema name of table containing object */
#define OCI_OBJECTPROP_TABLE 3 /* table name of table containing object */
#define OCI_OBJECTPROP_PIN_DURATION 4 /* pin duartion of object */
#define OCI_OBJECTPROP_ALLOC_DURATION 5 /* alloc duartion of object */
#define OCI_OBJECTPROP_LOCK 6 /* lock status of object */
#define OCI_OBJECTPROP_MARKSTATUS 7 /* mark status of object */
#define OCI_OBJECTPROP_VIEW 8 /* is object a view object or not? */
/*
* OCIObjectPropId - OCI Object Property Id
* Identifies the different properties of objects.
*/
/*----------------------- OBJECT LIFETIME ----------------------------------*/
enum OCIObjectLifetime
{
/* 0 = uninitialized */
OCI_OBJECT_PERSISTENT = 1, /* persistent object */
OCI_OBJECT_TRANSIENT, /* transient object */
OCI_OBJECT_VALUE /* value object */
};
typedef enum OCIObjectLifetime OCIObjectLifetime;
/*
* OCIObjectLifetime - OCI Object Lifetime
* Classifies objects depending upon the lifetime and referenceability
* of the object.
*/
/*----------------------- OBJECT MARK STATUS -------------------------------*/
typedef uword OCIObjectMarkStatus;
#define OCI_OBJECT_NEW 0x0001 /* new object */
#define OCI_OBJECT_DELETED 0x0002 /* object marked deleted */
#define OCI_OBJECT_UPDATED 0x0004 /* object marked updated */
/*
* OCIObjectMarkStatus - OCI Object Mark Status
* Status of the object - new or updated or deleted
*/
/* macros to test the object mark status */
#define OCI_OBJECT_IS_UPDATED(flag) bit((flag), OCI_OBJECT_UPDATED)
#define OCI_OBJECT_IS_DELETED(flag) bit((flag), OCI_OBJECT_DELETED)
#define OCI_OBJECT_IS_NEW(flag) bit((flag), OCI_OBJECT_NEW)
#define OCI_OBJECT_IS_DIRTY(flag) \
bit((flag), OCI_OBJECT_UPDATED|OCI_OBJECT_NEW|OCI_OBJECT_DELETED)
/*---------------------------------------------------------------------------*/
/* TYPE MANAGER */
/*---------------------------------------------------------------------------*/
/*------------------------------ TYPE CODE ----------------------------------*/
/*
* Type manager typecodes
*
* These are typecodes designed to be used with the type manager;
* they also include longer, more readable versions of existing SQLT names.
* Those types that are directly related to existing SQLT types are #define'd
* to their SQLT equivalents.
*
* The type manager typecodes are designed to be useable for all OCI calls.
* They are in the range from 192 to 320 for typecodes, so as not to conflict
* with existing OCI SQLT typecodes (see ocidfn.h).
*/
#define OCI_TYPECODE_REF SQLT_REF /* SQL/OTS OBJECT REFERENCE */
#define OCI_TYPECODE_DATE SQLT_DAT /* SQL DATE OTS DATE */
#define OCI_TYPECODE_SIGNED8 27 /* SQL SIGNED INTEGER(8) OTS SINT8 */
#define OCI_TYPECODE_SIGNED16 28 /* SQL SIGNED INTEGER(16) OTS SINT16 */
#define OCI_TYPECODE_SIGNED32 29 /* SQL SIGNED INTEGER(32) OTS SINT32 */
#define OCI_TYPECODE_REAL 21 /* SQL REAL OTS SQL_REAL */
#define OCI_TYPECODE_DOUBLE 22 /* SQL DOUBLE PRECISION OTS SQL_DOUBLE */
#define OCI_TYPECODE_BFLOAT SQLT_IBFLOAT /* Binary float */
#define OCI_TYPECODE_BDOUBLE SQLT_IBDOUBLE /* Binary double */
#define OCI_TYPECODE_FLOAT SQLT_FLT /* SQL FLOAT(P) OTS FLOAT(P) */
#define OCI_TYPECODE_NUMBER SQLT_NUM/* SQL NUMBER(P S) OTS NUMBER(P S) */
#define OCI_TYPECODE_DECIMAL SQLT_PDN
/* SQL DECIMAL(P S) OTS DECIMAL(P S) */
#define OCI_TYPECODE_UNSIGNED8 SQLT_BIN
/* SQL UNSIGNED INTEGER(8) OTS UINT8 */
#define OCI_TYPECODE_UNSIGNED16 25 /* SQL UNSIGNED INTEGER(16) OTS UINT16 */
#define OCI_TYPECODE_UNSIGNED32 26 /* SQL UNSIGNED INTEGER(32) OTS UINT32 */
#define OCI_TYPECODE_OCTET 245 /* SQL ??? OTS OCTET */
#define OCI_TYPECODE_SMALLINT 246 /* SQL SMALLINT OTS SMALLINT */
#define OCI_TYPECODE_INTEGER SQLT_INT /* SQL INTEGER OTS INTEGER */
#define OCI_TYPECODE_RAW SQLT_LVB /* SQL RAW(N) OTS RAW(N) */
#define OCI_TYPECODE_PTR 32 /* SQL POINTER OTS POINTER */
#define OCI_TYPECODE_VARCHAR2 SQLT_VCS
/* SQL VARCHAR2(N) OTS SQL_VARCHAR2(N) */
#define OCI_TYPECODE_CHAR SQLT_AFC /* SQL CHAR(N) OTS SQL_CHAR(N) */
#define OCI_TYPECODE_VARCHAR SQLT_CHR
/* SQL VARCHAR(N) OTS SQL_VARCHAR(N) */
#define OCI_TYPECODE_MLSLABEL SQLT_LAB /* OTS MLSLABEL */
#define OCI_TYPECODE_VARRAY 247 /* SQL VARRAY OTS PAGED VARRAY */
#define OCI_TYPECODE_TABLE 248 /* SQL TABLE OTS MULTISET */
#define OCI_TYPECODE_OBJECT SQLT_NTY /* SQL/OTS NAMED OBJECT TYPE */
#define OCI_TYPECODE_OPAQUE 58 /* SQL/OTS Opaque Types */
#define OCI_TYPECODE_NAMEDCOLLECTION SQLT_NCO
/* SQL/OTS NAMED COLLECTION TYPE */
#define OCI_TYPECODE_BLOB SQLT_BLOB /* SQL/OTS BINARY LARGE OBJECT */
#define OCI_TYPECODE_BFILE SQLT_BFILE /* SQL/OTS BINARY FILE OBJECT */
#define OCI_TYPECODE_CLOB SQLT_CLOB /* SQL/OTS CHARACTER LARGE OBJECT */
#define OCI_TYPECODE_CFILE SQLT_CFILE /* SQL/OTS CHARACTER FILE OBJECT */
/* the following are ANSI datetime datatypes added in 8.1 */
#define OCI_TYPECODE_TIME SQLT_TIME /* SQL/OTS TIME */
#define OCI_TYPECODE_TIME_TZ SQLT_TIME_TZ /* SQL/OTS TIME_TZ */
#define OCI_TYPECODE_TIMESTAMP SQLT_TIMESTAMP /* SQL/OTS TIMESTAMP */
#define OCI_TYPECODE_TIMESTAMP_TZ SQLT_TIMESTAMP_TZ /* SQL/OTS TIMESTAMP_TZ */
#define OCI_TYPECODE_TIMESTAMP_LTZ SQLT_TIMESTAMP_LTZ /* TIMESTAMP_LTZ */
#define OCI_TYPECODE_INTERVAL_YM SQLT_INTERVAL_YM /* SQL/OTS INTRVL YR-MON */
#define OCI_TYPECODE_INTERVAL_DS SQLT_INTERVAL_DS /* SQL/OTS INTRVL DAY-SEC */
#define OCI_TYPECODE_UROWID SQLT_RDD /* Urowid type */
#define OCI_TYPECODE_OTMFIRST 228 /* first Open Type Manager typecode */
#define OCI_TYPECODE_OTMLAST 320 /* last OTM typecode */
#define OCI_TYPECODE_SYSFIRST 228 /* first OTM system type (internal) */
#define OCI_TYPECODE_SYSLAST 235 /* last OTM system type (internal) */
#define OCI_TYPECODE_PLS_INTEGER 266 /* type code for PLS_INTEGER */
/* the following are PL/SQL-only internal. They should not be used */
#define OCI_TYPECODE_ITABLE SQLT_TAB /* PLSQL indexed table */
#define OCI_TYPECODE_RECORD SQLT_REC /* PLSQL record */
#define OCI_TYPECODE_BOOLEAN SQLT_BOL /* PLSQL boolean */
/* NOTE : The following NCHAR related codes are just short forms for saying
OCI_TYPECODE_VARCHAR2 with a charset form of SQLCS_NCHAR. These codes are
intended for use in the OCIAnyData API only and nowhere else. */
#define OCI_TYPECODE_NCHAR 286
#define OCI_TYPECODE_NVARCHAR2 287
#define OCI_TYPECODE_NCLOB 288
/* To indicate absence of typecode being specified */
#define OCI_TYPECODE_NONE 0
/* To indicate error has to be taken from error handle - reserved for
sqlplus use */
#define OCI_TYPECODE_ERRHP 283
/* The OCITypeCode type is interchangeable with the existing SQLT type
which is a ub2 */
typedef ub2 OCITypeCode;
/*----------------------- GET OPTIONS FOR TDO ------------------------------*/
enum OCITypeGetOpt
{
OCI_TYPEGET_HEADER,
/* load only the header portion of the TDO when getting type */
OCI_TYPEGET_ALL /* load all attribute and method descriptors as well */
};
typedef enum OCITypeGetOpt OCITypeGetOpt;
/*
* OCITypeGetOpt
*
* This is the flag passed to OCIGetTypeArray() to indicate how the TDO is
* going to be loaded into the object cache.
* OCI_TYPEGET_HEADER implies that only the header portion is to be loaded
* initially, with the rest loaded in on a 'lazy' basis. Only the header is
* needed for PL/SQL and OCI operations. OCI_TYPEGET_ALL implies that ALL
* the attributes and methods belonging to a TDO will be loaded into the
* object cache in one round trip. Hence it will take much longer to execute,
* but will ensure that no more loading needs to be done when pinning ADOs
* etc. This is only needed if your code needs to examine and manipulate
* attribute and method information.
*
* The default is OCI_TYPEGET_HEADER.
*/
/*------------------------ TYPE ENCAPSULTATION LEVEL ------------------------*/
enum OCITypeEncap
{
/* 0 = uninitialized */
OCI_TYPEENCAP_PRIVATE, /* private: only internally visible */
OCI_TYPEENCAP_PUBLIC /* public: visible to both internally and externally */
};
typedef enum OCITypeEncap OCITypeEncap;
/*
* OCITypeEncap - OCI Encapsulation Level
*/
/*---------------------------- TYPE METHOD FLAGS ----------------------------*/
enum OCITypeMethodFlag
{
OCI_TYPEMETHOD_INLINE = 0x0001, /* inline */
OCI_TYPEMETHOD_CONSTANT = 0x0002, /* constant */
OCI_TYPEMETHOD_VIRTUAL = 0x0004, /* virtual */
OCI_TYPEMETHOD_CONSTRUCTOR = 0x0008, /* constructor */
OCI_TYPEMETHOD_DESTRUCTOR = 0x0010, /* destructor */
OCI_TYPEMETHOD_OPERATOR = 0x0020, /* operator */
OCI_TYPEMETHOD_SELFISH = 0x0040, /* selfish method (generic otherwise) */
OCI_TYPEMETHOD_MAP = 0x0080, /* map (relative ordering) */
OCI_TYPEMETHOD_ORDER = 0x0100, /* order (relative ordering) */
/* OCI_TYPEMETHOD_MAP and OCI_TYPEMETHOD_ORDER are mutually exclusive */
OCI_TYPEMETHOD_RNDS= 0x0200, /* Read no Data State (default) */
OCI_TYPEMETHOD_WNDS= 0x0400, /* Write no Data State */
OCI_TYPEMETHOD_RNPS= 0x0800, /* Read no Process State */
OCI_TYPEMETHOD_WNPS= 0x1000, /* Write no Process State */
OCI_TYPEMETHOD_ABSTRACT = 0x2000, /* abstract (not instantiable) method */
OCI_TYPEMETHOD_OVERRIDING = 0x4000, /* overriding method */
OCI_TYPEMETHOD_PIPELINED = 0x8000 /* method is pipelined */
};
typedef enum OCITypeMethodFlag OCITypeMethodFlag;
/* macros to test the type method flags */
#define OCI_METHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
#define OCI_METHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
#define OCI_METHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
#define OCI_METHOD_IS_CONSTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
#define OCI_METHOD_IS_DESTRUCTOR(flag) bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
#define OCI_METHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
#define OCI_METHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
#define OCI_METHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
#define OCI_METHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
#define OCI_METHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
#define OCI_METHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
#define OCI_METHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
#define OCI_METHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
#define OCI_METHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
#define OCI_METHOD_IS_OVERRIDING(flag) bit((flag), OCI_TYPEMETHOD_OVERRIDING)
#define OCI_METHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
#define OCI_TYPEMETHOD_IS_INLINE(flag) bit((flag), OCI_TYPEMETHOD_INLINE)
#define OCI_TYPEMETHOD_IS_CONSTANT(flag) bit((flag), OCI_TYPEMETHOD_CONSTANT)
#define OCI_TYPEMETHOD_IS_VIRTUAL(flag) bit((flag), OCI_TYPEMETHOD_VIRTUAL)
#define OCI_TYPEMETHOD_IS_CONSTRUCTOR(flag) \
bit((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
#define OCI_TYPEMETHOD_IS_DESTRUCTOR(flag) \
bit((flag), OCI_TYPEMETHOD_DESTRUCTOR)
#define OCI_TYPEMETHOD_IS_OPERATOR(flag) bit((flag), OCI_TYPEMETHOD_OPERATOR)
#define OCI_TYPEMETHOD_IS_SELFISH(flag) bit((flag), OCI_TYPEMETHOD_SELFISH)
#define OCI_TYPEMETHOD_IS_MAP(flag) bit((flag), OCI_TYPEMETHOD_MAP)
#define OCI_TYPEMETHOD_IS_ORDER(flag) bit((flag), OCI_TYPEMETHOD_ORDER)
#define OCI_TYPEMETHOD_IS_RNDS(flag) bit((flag), OCI_TYPEMETHOD_RNDS)
#define OCI_TYPEMETHOD_IS_WNDS(flag) bit((flag), OCI_TYPEMETHOD_WNDS)
#define OCI_TYPEMETHOD_IS_RNPS(flag) bit((flag), OCI_TYPEMETHOD_RNPS)
#define OCI_TYPEMETHOD_IS_WNPS(flag) bit((flag), OCI_TYPEMETHOD_WNPS)
#define OCI_TYPEMETHOD_IS_ABSTRACT(flag) bit((flag), OCI_TYPEMETHOD_ABSTRACT)
#define OCI_TYPEMETHOD_IS_OVERRIDING(flag) \
bit((flag), OCI_TYPEMETHOD_OVERRIDING)
#define OCI_TYPEMETHOD_IS_PIPELINED(flag) bit((flag), OCI_TYPEMETHOD_PIPELINED)
/* macros to set the type method flags */
#define OCI_TYPEMETHOD_SET_INLINE(flag) bis((flag), OCI_TYPEMETHOD_INLINE)
#define OCI_TYPEMETHOD_SET_CONSTANT(flag) bis((flag), OCI_TYPEMETHOD_CONSTANT)
#define OCI_TYPEMETHOD_SET_VIRTUAL(flag) bis((flag), OCI_TYPEMETHOD_VIRTUAL)
#define OCI_TYPEMETHOD_SET_CONSTRUCTOR(flag) \
bis((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
#define OCI_TYPEMETHOD_SET_DESTRUCTOR(flag) \
bis((flag), OCI_TYPEMETHOD_DESTRUCTOR)
#define OCI_TYPEMETHOD_SET_OPERATOR(flag) bis((flag), OCI_TYPEMETHOD_OPERATOR)
#define OCI_TYPEMETHOD_SET_SELFISH(flag) bis((flag), OCI_TYPEMETHOD_SELFISH)
#define OCI_TYPEMETHOD_SET_MAP(flag) bis((flag), OCI_TYPEMETHOD_MAP)
#define OCI_TYPEMETHOD_SET_ORDER(flag) bis((flag), OCI_TYPEMETHOD_ORDER)
#define OCI_TYPEMETHOD_SET_RNDS(flag) bis((flag), OCI_TYPEMETHOD_RNDS)
#define OCI_TYPEMETHOD_SET_WNDS(flag) bis((flag), OCI_TYPEMETHOD_WNDS)
#define OCI_TYPEMETHOD_SET_RNPS(flag) bis((flag), OCI_TYPEMETHOD_RNPS)
#define OCI_TYPEMETHOD_SET_WNPS(flag) bis((flag), OCI_TYPEMETHOD_WNPS)
/* macros to clear the type method flags */
#define OCI_TYPEMETHOD_CLEAR_INLINE(flag) bic((flag), OCI_TYPEMETHOD_INLINE)
#define OCI_TYPEMETHOD_CLEAR_CONSTANT(flag) \
bic((flag), OCI_TYPEMETHOD_CONSTANT)
#define OCI_TYPEMETHOD_CLEAR_VIRTUAL(flag) bic((flag), OCI_TYPEMETHOD_VIRTUAL)
#define OCI_TYPEMETHOD_CLEAR_CONSTRUCTOR(flag) \
bic((flag), OCI_TYPEMETHOD_CONSTRUCTOR)
#define OCI_TYPEMETHOD_CLEAR_DESTRUCTOR(flag) \
bic((flag), OCI_TYPEMETHOD_DESTRUCTOR)
#define OCI_TYPEMETHOD_CLEAR_OPERATOR(flag) \
bic((flag), OCI_TYPEMETHOD_OPERATOR)
#define OCI_TYPEMETHOD_CLEAR_SELFISH(flag) bic((flag), OCI_TYPEMETHOD_SELFISH)
#define OCI_TYPEMETHOD_CLEAR_MAP(flag) bic((flag), OCI_TYPEMETHOD_MAP)
#define OCI_TYPEMETHOD_CLEAR_ORDER(flag) bic((flag), OCI_TYPEMETHOD_ORDER)
#define OCI_TYPEMETHOD_CLEAR_RNDS(flag) bic((flag), OCI_TYPEMETHOD_RNDS)
#define OCI_TYPEMETHOD_CLEAR_WNDS(flag) bic((flag), OCI_TYPEMETHOD_WNDS)
#define OCI_TYPEMETHOD_CLEAR_RNPS(flag) bic((flag), OCI_TYPEMETHOD_RNPS)
#define OCI_TYPEMETHOD_CLEAR_WNPS(flag) bic((flag), OCI_TYPEMETHOD_WNPS)
/*--------------------------- TYPE PARAMETER MODE ---------------------------*/
enum OCITypeParamMode
{
/* PL/SQL starts this from 0 */
OCI_TYPEPARAM_IN = 0, /* in */
OCI_TYPEPARAM_OUT, /* out */
OCI_TYPEPARAM_INOUT, /* in-out */
OCI_TYPEPARAM_BYREF, /* call by reference (implicitly in-out) */
OCI_TYPEPARAM_OUTNCPY, /* OUT with NOCOPY modifier */
OCI_TYPEPARAM_INOUTNCPY /* IN OUT with NOCOPY modifier */
};
typedef enum OCITypeParamMode OCITypeParamMode;
/*-------------------------------- DEFAULTS ---------------------------------*/
/* default binary and decimal precision and scale */
#define OCI_NUMBER_DEFAULTPREC ((ub1)0) /* no precision specified */
#define OCI_NUMBER_DEFAULTSCALE ((sb1)MAXSB1MINVAL)
/* no binary/decimal scale specified */
/* default maximum length for varrays and vstrings (used in sql.bsq) */
#define OCI_VARRAY_MAXSIZE 4000
/* default maximum number of elements for a varray */
#define OCI_STRING_MAXLEN 4000 /* default maximum length of a vstring */
/*---------------------------------------------------------------------------*/
/* This set of macro is used only in beta2. They should be removed as soon as
* PLSQL has made the changes of not using these macros.
*/
/* Special duration for allocating memory only. No instance can be allocated
* given these durations.
*/
#define OCICoherency OCIRefreshOpt
#define OCI_COHERENCY_NONE (OCIRefreshOpt)2
#define OCI_COHERENCY_NULL (OCIRefreshOpt)4
#define OCI_COHERENCY_ALWAYS (OCIRefreshOpt)5
#endif /* ORO_ORACLE */

File diff suppressed because it is too large Load Diff

@ -0,0 +1,200 @@
/* Copyright (c) 1992, 2006, Oracle. All rights reserved. */
/*
NAME
xa.h - <one-line expansion of the name>
DESCRIPTION
<short description of component this file declares/defines>
PUBLIC FUNCTION(S)
<list of external functions declared/defined - with one-line descriptions>
PRIVATE FUNCTION(S)
<list of static functions defined in .c file - with one-line descriptions>
RETURNS
<function return values, for .c file with single function>
NOTES
<other useful comments, qualifications, etc.>
This is the public XA .h file
MODIFIED (MM/DD/YY)
yohu 08/27/06 - XA/RAC project changes: XAER_AFFINITY
dmukhin 06/29/05 - ANSI prototypes; miscellaneous cleanup
whe 09/01/99 - 976457:check __cplusplus for C++ code
ntang 10/20/98 - Remove TMCACHE & TMFORCL
abhide 08/04/97 - implement xaoforcl
abhide 07/23/97 - XA OTS project changes
schandra 02/20/96 - lint
abhide 04/07/94 - merge changes from branch 1.1.710.1
abhide 02/14/94 - Creation
abhide 02/10/94 - Creation
abhide 02/10/94 - Creation
*/
/*
* xa.h header
* Typed in from X/Open doc of March 13, 1990
* Updated to Parsippany II draft, March, 1991
* Updated to Co Review draft, 19 Sep 1991
*/
#ifndef XA_H
#define XA_H
/*
* Transaction branch identification: XID and NULLXID:
*/
#define XIDDATASIZE 128 /* size in bytes */
#define MAXGTRIDSIZE 64 /* maximum size in bytes of gtrid */
#define MAXBQUALSIZE 64 /* maximum size in bytes of bqual */
struct xid_t {
long formatID; /* format identifier */
long gtrid_length; /* value from 1 through 64 */
long bqual_length; /* value from 1 through 64 */
char data[XIDDATASIZE];
};
typedef struct xid_t XID;
/*
* A value of -1 in formatID means that the XID is null.
*/
/*
* Declarations of routines by which RMs call TMs:
*/
int ax_reg(int, XID *, long);
int ax_unreg(int, long);
/*
* XA Switch Data Structure
*/
#define RMNAMESZ 32 /* length of resource manager name, */
/* including the null terminator */
#define MAXINFOSIZE 256 /* maximum size in bytes of xa_info strings, */
/* including the null terminator */
struct xa_switch_t {
char name[RMNAMESZ]; /* name of resource manager */
long flags; /* resource manager specific options */
long version; /* must be 0 */
int (*xa_open_entry)(char *, int, long); /*xa_open function pointer*/
int (*xa_close_entry)(char *, int, long); /*xa_close function pointer*/
int (*xa_start_entry)(XID *, int, long); /*xa_start function pointer*/
int (*xa_end_entry)(XID *, int, long); /*xa_end function pointer*/
int (*xa_rollback_entry)(XID *, int, long);
/*xa_rollback function pointer*/
int (*xa_prepare_entry)(XID *, int, long); /*xa_prepare function pointer*/
int (*xa_commit_entry)(XID *, int, long); /*xa_commit function pointer*/
int (*xa_recover_entry)(XID *, long, int, long);
/*xa_recover function pointer*/
int (*xa_forget_entry)(XID *, int, long); /*xa_forget function pointer*/
int (*xa_complete_entry)(int *, int *, int, long);
};
/*
* Flag definition for the RM switch
*/
#define TMNOFLAGS 0x00000000L /* no resource manager features
selected */
#define TMREGISTER 0x00000001L /* resource manager dynamically
registers */
#define TMNOMIGRATE 0x00000002L /* resource manager does not support
association migration */
#define TMUSEASYNC 0x00000004L /* resource manager supports
asynchronous operations */
/*
* Flag definitions for xa_ and ax_ routines
*/
/* Use TMNOFLAGS, defined above, when not specifying other flags */
#define TMASYNC 0x80000000L /* perform routine asynchronously */
#define TMONEPHASE 0x40000000L /* caller is using one-phase commit
optimisation */
#define TMFAIL 0x20000000L /* dissociates caller and marks
transaction branch rollback-only */
#define TMNOWAIT 0x10000000L /* return if blocking condition
exists */
#define TMRESUME 0x08000000L /* caller is resuming association
with suspended transaction branch */
#define TMSUCCESS 0x04000000L /* dissociate caller from transaction
branch */
#define TMSUSPEND 0x02000000L /* caller is suspending, not ending,
association */
#define TMSTARTRSCAN 0x01000000L /* start a recovery scan */
#define TMENDRSCAN 0x00800000L /* end a recovery scan */
#define TMMULTIPLE 0x00400000L /* wait for any asynchronous
operation */
#define TMJOIN 0x00200000L /* caller is joining existing
transaction branch */
#define TMMIGRATE 0x00100000L /* caller intends to perform
migration */
/*
* ax_() return codes (transaction manager reports to resource manager)
*/
#define TM_JOIN 2 /* caller is joining existing transaction
branch */
#define TM_RESUME 1 /* caller is resuming association with
suspended transaction branch */
#define TM_OK 0 /* normal execution */
#define TMER_TMERR -1 /* an error occurred in the transaction
manager */
#define TMER_INVAL -2 /* invalid arguments were given */
#define TMER_PROTO -3 /* routine invoked in an improper context */
/*
* xa_() return codes (resource manager reports to transaction manager)
*/
#define XA_RBBASE 100 /* The inclusive lower bound of the
rollback codes */
#define XA_RBROLLBACK XA_RBBASE /* The rollback was caused by an
unspecified reason */
#define XA_RBCOMMFAIL XA_RBBASE+1 /* The rollback was caused by a
communication failure */
#define XA_RBDEADLOCK XA_RBBASE+2 /* A deadlock was detected */
#define XA_RBINTEGRITY XA_RBBASE+3 /* A condition that violates the
integrity of the resources was
detected */
#define XA_RBOTHER XA_RBBASE+4 /* The resource manager rolled back the
transaction for a reason not on this
list */
#define XA_RBPROTO XA_RBBASE+5 /* A protocal error occurred in the
resource manager */
#define XA_RBTIMEOUT XA_RBBASE+6 /* A transaction branch took too long*/
#define XA_RBTRANSIENT XA_RBBASE+7 /* May retry the transaction branch */
#define XA_RBEND XA_RBTRANSIENT /* The inclusive upper bound of the
rollback codes */
#define XA_NOMIGRATE 9 /* resumption must occur where
suspension occurred */
#define XA_HEURHAZ 8 /* the transaction branch may have been
heuristically completed */
#define XA_HEURCOM 7 /* the transaction branch has been
heuristically comitted */
#define XA_HEURRB 6 /* the transaction branch has been
heuristically rolled back */
#define XA_HEURMIX 5 /* the transaction branch has been
heuristically committed and rolled
back */
#define XA_RETRY 4 /* routine returned with no effect
and may be re-issued */
#define XA_RDONLY 3 /* the transaction was read-only
and has been committed */
#define XA_OK 0 /* normal execution */
#define XAER_ASYNC -2 /* asynchronous operation already
outstanding */
#define XAER_RMERR -3 /* a resource manager error occurred
in the transaction branch */
#define XAER_NOTA -4 /* the XID is not valid */
#define XAER_INVAL -5 /* invalid arguments were given */
#define XAER_PROTO -6 /* routine invoked in an improper
context */
#define XAER_RMFAIL -7 /* resource manager unavailable */
#define XAER_DUPID -8 /* the XID already exists */
#define XAER_OUTSIDE -9 /* resource manager doing work */
/* outside global transaction */
#define XAER_AFFINITY -10 /* XA on RAC: resumption must occur on
RAC instance where the transaction
branch was created */
#endif /* ifndef XA_H */

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

@ -0,0 +1,6 @@
# ITK
ITK模板
VisualStudio版本: 2015
Loading…
Cancel
Save