Accessing a C function from PL/SQL.

I have a c function that I would like to access from pl/sql, that is call as any other function in pl/sql. Is this possible? Where can I read about it?

Yes, this is possible. You have to use the feature named external procedure that involves Oracle Net configuration. Here is a example with Oracle 8:
http://www.unix.org.ua/orelly/oracle/prog2/ch21_01.htm

Similar Messages

  • Access a web service from pl/sql

    I am trying to access a web service from pl/sql. I have downloaded the code from
    http://www.oracle.com/technology/tech/webservices/htdocs/samples/dbwebservice/DBWebServices_PLSQL.html
    But when I try to execute the sql, I am getting the following error:
    SQL> @local.sql
    Package created.
    Package body created.
    No errors.
    BEGIN dbms_output.put_line(time_service.get_local_time('94065')); END;
    ERROR at line 1:
    ORA-29273: HTTP request failed
    ORA-06512: at "SYS.UTL_HTTP", line 1022
    ORA-12545: Connect failed because target host or object does not exist
    ORA-06512: at "WEB.DEMO_SOAP", line 71
    ORA-06512: at "WEB.TIME_SERVICE", line 15
    ORA-06512: at line 1
    It is failing at:
    resp := demo_soap.invoke(req,
    'http://www.ripedev.com/webservices/LocalTime.asmx',
    'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
    But in the examples that I got from downloading source code, site used was:
    'http://www.alethea.net/webservices/LocalTime.asmx',
    'http://www.alethea.net/webservices/LocalTimeByZipCode');
    This site was not accessible. So I changed to the working site as follows, but still I
    am getting the above error.
    But I can access this site, if I type in the above address in the address bar of IE.
    Can any body help?
    I have oracle9i client installed on my machine and able to connect to server thru toad and sql plus.
    or IF any body refers me to a good website for the topic of "using webservies from pl/sql" that would be great too!

    Here is the complete code:
    time_service:
    CREATE OR REPLACE PACKAGE time_service AS
    FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2;
    END;
    CREATE OR REPLACE PACKAGE BODY time_service AS
    -- Location of Web service definition
    -- http://www.alethea.net/webservices/LocalTime.asmx?WSDL
    -- http://www.ripedev.com/webservices/LocalTime.asmx?WSDL
    -- http://www.xmethods.com/sd/2001/CurrencyExchangeService.wsdl
    --'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode style=document');
    FUNCTION get_local_time(zipcode IN VARCHAR2) RETURN VARCHAR2 IS
    req demo_soap.request;
    resp demo_soap.response;
    BEGIN
    dbms_output.put_line('before new request..');
    req := demo_soap.new_request('LocalTimeByZipCode',
    'xmlns="http://ripedev.com/xsd/ZipCodeResults.xsd"');
    dbms_output.put_line('before add param..');
    demo_soap.add_parameter(req, 'ZipCode', 'xsd:string', zipcode);
    dbms_output.put_line('before invoke..');
    resp := demo_soap.invoke(req,
    'http://www.ripedev.com/webservices/LocalTime.asmx',
    'http://ripedev.com/xsd/ZipCodeResults.xsd/LocalTimeByZipCode');
    dbms_output.put_line('before return..');
    RETURN demo_soap.get_return_value(resp, 'LocalTimeByZipCodeResult',
    'xmlns="http://www.ripedev.com/webservices/"');
    END;
    BEGIN
    dbms_output.put_line('inside main time_service..');
    END;
    show errors
    SET serveroutput ON
    exec dbms_output.put_line(time_service.get_local_time('94065'));
    Here is demo_soap.sql:
    Rem
    Rem $Header: soapdemo.sql 21-may-2002.13:48:17 rpang Exp $
    Rem
    Rem soapdemo.sql
    Rem
    Rem Copyright (c) 2002, Oracle Corporation. All rights reserved.
    Rem
    Rem NAME
    Rem soapdemo.sql - <one-line expansion of the name>
    Rem
    Rem DESCRIPTION
    Rem A PL/SQL demo package for making SOAP RPC calls.
    Rem
    Rem NOTES
    Rem This demo package can only be used in oracle 9ir2. It utilizes 9iR2's
    Rem XDB (XMLType and HttpUriType) and 9iR1's enhancements to UTL_HTTP to
    Rem make SOAP RPC calls.
    Rem
    Rem MODIFIED (MM/DD/YY)
    Rem rpang 05/21/02 - created
    Rem
    Rem A PL/SQL demo package that makes a SOAP RPC calls.
    Rem
    CREATE OR REPLACE PACKAGE demo_soap AS
    /* A type to represent a SOAP RPC request */
    TYPE request IS RECORD (
    method VARCHAR2(256),
    namespace VARCHAR2(256),
    body VARCHAR2(32767));
    /* A type to represent a SOAP RPC response */
    TYPE response IS RECORD (
    doc xmltype);
    * Create a new SOAP RPC request.
    FUNCTION new_request(method IN VARCHAR2,
    namespace IN VARCHAR2)
    RETURN request;
    * Add a simple parameter to the SOAP RPC request.
    PROCEDURE add_parameter(req IN OUT NOCOPY request,
    name IN VARCHAR2,
    type IN VARCHAR2,
    value IN VARCHAR2);
    * Make the SOAP RPC call.
    FUNCTION invoke(req IN OUT NOCOPY request,
    url IN VARCHAR2,
    action IN VARCHAR2) RETURN response;
    * Retrieve the sipmle return value of the SOAP RPC call.
    FUNCTION get_return_value(resp IN OUT NOCOPY response,
    name IN VARCHAR2,
    namespace IN VARCHAR2) RETURN VARCHAR2;
    END;
    show errors
    CREATE OR REPLACE PACKAGE BODY demo_soap AS
    FUNCTION new_request(method IN VARCHAR2,
    namespace IN VARCHAR2)
    RETURN request AS
    req request;
    BEGIN
    req.method := method;
    req.namespace := namespace;
    RETURN req;
    END;
    PROCEDURE add_parameter(req IN OUT NOCOPY request,
    name IN VARCHAR2,
    type IN VARCHAR2,
    value IN VARCHAR2) AS
    BEGIN
    req.body := req.body ||
    '<'||name||' xsi:type="'||type||'">'||value||'</'||name||'>';
    END;
    PROCEDURE generate_envelope(req IN OUT NOCOPY request,
                   env IN OUT NOCOPY VARCHAR2) AS
    BEGIN
    env := '<SOAP-ENV:Envelope
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
    xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/1999/XMLSchema">
    <SOAP-ENV:Body><'||req.method||' '||req.namespace||'
    SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">'||
    req.body||'</'||req.method||'></SOAP-ENV:Body></SOAP-ENV:Envelope>';
    END;
    PROCEDURE show_envelope(env IN VARCHAR2) AS
    i pls_integer;
    len pls_integer;
    BEGIN
    i := 1; len := length(env);
    WHILE (i <= len) LOOP
    dbms_output.put_line(substr(env, i, 60));
    i := i + 60;
    END LOOP;
    END;
    PROCEDURE check_fault(resp IN OUT NOCOPY response) AS
    fault_node xmltype;
    fault_code VARCHAR2(256);
    fault_string VARCHAR2(32767);
    BEGIN
    fault_node := resp.doc.extract('/soap:Fault',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/');
    IF (fault_node IS NOT NULL) THEN
    fault_code := fault_node.extract('/soap:Fault/faultcode/child::text()',
         'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    fault_string := fault_node.extract('/soap:Fault/faultstring/child::text()',
         'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/').getstringval();
    raise_application_error(-20000, fault_code || ' - ' || fault_string);
    END IF;
    END;
    FUNCTION invoke(req IN OUT NOCOPY request,
    url IN VARCHAR2,
    action IN VARCHAR2) RETURN response AS
    env VARCHAR2(32767);
    http_req utl_http.req;
    http_resp utl_http.resp;
    resp response;
    BEGIN
    generate_envelope(req, env);
    -- show_envelope(env);
    http_req := utl_http.begin_request(url, 'POST','HTTP/1.0');
    utl_http.set_header(http_req, 'Content-Type', 'text/xml');
    utl_http.set_header(http_req, 'Content-Length', length(env));
    utl_http.set_header(http_req, 'SOAPAction', action);
    utl_http.write_text(http_req, env);
    http_resp := utl_http.get_response(http_req);
    utl_http.read_text(http_resp, env);
    utl_http.end_response(http_resp);
    resp.doc := xmltype.createxml(env);
    resp.doc := resp.doc.extract('/soap:Envelope/soap:Body/child::node()',
    'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"');
    -- show_envelope(resp.doc.getstringval());
    check_fault(resp);
    RETURN resp;
    END;
    FUNCTION get_return_value(resp IN OUT NOCOPY response,
    name IN VARCHAR2,
    namespace IN VARCHAR2) RETURN VARCHAR2 AS
    BEGIN
    RETURN resp.doc.extract('//'||name||'/child::text()',
    namespace).getstringval();
    END;
    END;
    show errors

  • Access odbc data sources from PL/SQL

    Dear All,
    I would like to know is there any way where i could access odbc data sources from pl/sql (i.e i would like to insert, update records into MSAccess table from pl/sql procedures, triggers). Would appreciate any help regarding this.

    The only way I know of how is to write and external function library and use that to access ODBC datasource ...if someone else knows something else I would be interesting in hearing about that also.

  • How to call javascript function from PL/SQL procedure

    Can anybody advice me how to call javascript function from PL/SQL procedure in APEX?

    Hi,
    I have a requirement to call Javascript function inside a After Submit Process.
    clear requirement below:
    1. User selects set of check boxes [ say user want to save 10 files and ticks 10 checkboxes]
    2. user clicks on "save files" button
    3. Inside a After submit process, in a loop, i want to call a javascript function for each of the file user want to save with the filename as a parameter.
    Hope this clarify U.
    Krishna.

  • Calling Javascript function from PL/SQL Process

    I am new to APEX and Javascript so please forgive my question.
    I have a process on page which successfully runs a few procedures etc. but now, as part of this process, I want to call a javascript function I have typed into the HTML Header.
    My question is how can I call the javascript function from my process? Is it possible?
    Many thanks
    Winnie
    ps. as an example my javascript looks like:
    <script language="JavaScript">
    function test(){
    var decision = confirm("Click a button below and watch what pops up next.");
    alert(decision);
    </script>

    See: How to call a javascript function from pl/sql?

  • Calling schema specific packe/function from PL/SQL

    From PL/SQL I am trying to call a package function in a specific schema (see below). When I try it gives me this error:
    Invalid function body condition: ORA-06550: line 3, column 15: PLS-00201: identifier 'SCHEMA1.SIS_EXPRESS' must be declared ORA-06550: line 3, column 1: PL/SQL: Statement ignored
    Am I missing something as I thought this was the correct syntax?
    DECLARE button_ok boolean := FALSE;
    BEGIN
    button_ok := my_schema.SIS_express.ok_to_add (:APP_USER,:P0_LOGIN_SCHOOL_YEAR,:P0_LOGIN_SCHOOL,:APP_ID,:APP_PAGE_ID);
    <<end_of_trigger>>
    return button_ok;
    END;

    An Apex workspace is associated with one or more schemas.
    An Apex application in that workspace needs to select one of these schemas as its parsing schema.
    This means that all application code (PL/SQL and SQL code you write in that Apex app) will be parsed (using the DBMS_SYS_SQL package) as the parsing schema.
    Note that the current and acual schema for the Apex database session will the anonymous schema account as configured for connectivity for that database access descriptor (DAD) on the Apache server. You do not connect (via Apex) as your parsing schema. You connect to an anonymous schema. It runs trusted Apex code (that executes with the Apex schema's privs). This code parses your Apex app code via the system package to be executed as your parsing schema.
    So you need to make sure that your parsing schema has the appropriate rights to execute the PL/SQL and SQL application code you put into your Apex application.
    Also be aware that if you use that DAD to directly execute your PL/SQL code in the database (procedures or functions), the call will be made from the anonymous database schema used by that Apache DAD connection - thus that schema will then need to have exec rights on your code.
    In the case of the Apex flow engine - public exec rights exist on it and thus that DAD session from Apache can logon as the anonymous schema and execute the Apex run-time to run an Apex application.

  • Accessing html field value from pl/sql code, in the same package

    hi friends,
    my pl/sql web application is working fine. but now i need a small requirment.
    ie, basicaly i need to access the user entered value of an element in html based form from pl/sql code, which is developed using pl/sql toolkit.
    Here is the scenario:-
    User entered a value in field1, then navigate to field2, and click a button for list of values,
    when he clicks the button, internaly it is opening a cursor, where i want to pass field1's value to my cursor as a parameter. So in my pls/sql code , i want to access the value of field1. If you know, please help.
    see the snippet of code.
    htp.p('
    function f1()
    if (parseInt(learnIdx) ==1 )
    for i in dev_Need('1')/*here i want to pass html form element value as a parameter */
    loop
    htp.p('content += "<option value='''||a.version_name||'''>'||a.version_name
    ||'</option>''"; ');
    end loop;
    thanks in advance.
    Zameer.N.A

    Hi,
    Here's my suggestion
    If you wanna access the dll check out "external procedures", you can search it everywhere in OTN.
    However it's easier to use Heterogenous Services to connect database with other sources.
    Check out http://asktom.oracle.com/pls/ask/f?p=4950:8:13454621522426176943::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:4406709207206,
    Tak Tang answer on May, 25, 2004 rules!

  • Calling a Java Function from PL/SQL

    Hi,
    I would like to call a Java API from a java class residing on the middle tier ($OA_JAVA)
    from the subscription code of a business event. The business event will have a
    subscription with java rule function as my Java API. And the business event will be
    raised from PL/SQL code using WF_EVENT.RAISE API. I want the Java API to
    executed SYNCHRONOUSLY without deferring the event. Can you please provide
    pointers to this.
    Regards
    Ramesh

    Documentation here: http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref185
    says JPublisher can publish records too.
    But when I change the example given at http://download-uk.oracle.com/docs/cd/B14117_01/java.101/b10983/datamap.htm#sthref190 as following:
    PACKAGE "COMPANY" AS
    type emp_rec is record (empno number, ename varchar2(10));
    type emp_list is varray(5) of emp_rec;
    type factory is record (
    name varchar(10),
    emps emp_list
    function get_factory(p_name varchar) return factory;
    END;
    then I see <unknown type or type not found> at sql or java files generated. Any ideas?

  • Calling function from PL/SQL block

    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?

    user610868 wrote:
    Hi,
    A very simple question.
    A have a function called "test1" in my database. It is there i double chekked.
    I would like to call this function from a block:
    DECLARE
    BEGIN
    TEST1(1202);
    END;
    This gives me an error.
    Why is this?Hello
    A very very basic thing to do when you get an error is to include details of it. That helps narrow it down from one of the 1000s of potential Oracle errors it could be.
    Anyway, a function returns a value, and in PL/SQL you need to capture that otherwise you'll get "an error". Modify your code like so
    DECLARE
       l_Test1Val     VARCHAR2(4000); --CHANGE THIS TO BE THE SAME AS THE RETURN TYPE FOR YOUR FUNCTION
    BEGIN
       l_Test1Val :=  TEST1(1202);
    END;HTH
    David
    Edited by: Bravid on Oct 25, 2011 3:57 PM
    removed a ;

  • Call javascript functions from PL/SQL

    Hi !
    I just want to know if it is possible to call a javascript function from a PL/SQL procedure. If yes, anybody can explain me the syntax ?
    Thanks
    Chantale

    You can call Java Script - kind of.
    PL/SQL has a "web browser" called UTL_HTTP. It allows you to make HTTP calls to a web server. This includes a function that can be used from SQL too (with a size limitation).
    Example:
    SQL> select UTL_HTTP.Request( 'http://some-web-server' ) as HTML_PAGE from dual;
    HTML_PAGE
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <META HTTP-EQUIV="Refresh" CONTENT="1;URL=http:/some-web-server:7777/index">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <img src="images/Wave.gif">
    Redirecting.. please standby..
    <hr>
    </html>
    SQL>The call to the web browser can be to execute and load, for example, a JSP page.
    However, if the page containts client-side Java script, i.e. code for the web browser to execute, than UTL_HTTP will merely return the contents & code of that page.
    Client-side Java Script requires an engine in the browser. The JS language is used to manipulate the rendering engine of the browser.
    The PL/SQL "web browser" does not have a display device to show a web page. Thus it is without a web browser rendering engine and therefore also cannot execute Java Script either.

  • Access Report Custom Functions from code

    Post Author: leedo
    CA Forum: .NET
    Hello,
    I am using VS2005 (VB) and was able to change formula text from within code using the "FormulaFieldDefinitions" object. However, I am having problems finding out how I can do the same to Report Custom Functions.  The reason I am doing all this is that I noticed during my Windows app is running the source of my .rpt file is thrown in the user "Local Settings\Temp" folder and all code is revealed by simply opening that file. Please help. ThanksLeedo

    Post Author: MJ@BOBJ
    CA Forum: .NET
    It looks like it is not possible to access the custom functions within a report using the CR .NET SDK.  However, to address the potential security issue that you may be concerned about, is this a Windows or ASP.NET application?  If this is an ASP.NET application, then you shouldn't have to worry about the security as the end-user (client) will not be able to access that folder since the rest of the web server is typically unaccessible by the client. 
    Another way to secure your reports is to use what we call "managed reporting" solutions such as Crystal Report Server or Business Objects Enterprise, which manages reports securely and your users are only allowed to access/see what you allow them to.  These solutions also provide public SDKs so you could incorporate the system into your own applications.  For more information, go to www.businessobjects.com/products.

  • Access a main function from a child MXML

    Hi im just a beginner in flex.Someone please giude me.
    I have a main MXML which holds another MXML.Is there any
    possiblity to access the main MXML component from the child MXML.If
    there is no possiblity i just want to know how to access the main
    MXML function from the child MXML script.
    thanks in advance
    karan

    Thankyou man..its working...i might require ur help in the
    coming days...
    hei do u have any experience in drawing API

  • Feature Request: Access to Pathfinder functions from JS

    It would be incredibly helpful to have access to the pathfinder from the JS API.
    These functions are pretty complex and rewriting them would surely result in slight implementation differences.

    it would be indeed fantastic if we had access to pathfinders
    post your request here
    http://forums.adobe.com/community/illustrator/illustrator_feature_requests

  • Calling C functions from PL/SQL. (without OCI )

    hi all,
    We are trying to call and external C routine (stored in a .so file) from a PL/SQL procedure.
    The error obtained is ORA-28576 ( which occurs after connection to the external routine has been established successfully.)
    , which states that the problem may lie in:
    a) Abnormal Termination of external C routine.(i.e a case of coredump, memory fault etc).
    b) Network Problems.
    c) Internal Logic Error in the RPC transfer code.
    We tried calling the C .so functions from a C executable and it is working fine. Also there doesn't appear to a problem in the network connections too.....
    The environment we are working on is Digital Unix 4.0 F. and we are using Oracle 8.0.6
    Please advise,
    Krishnan

    There have been reported problems with specific compiler versions. Check with oracle as see if there is a specific compiler version number you need for a specific database release.
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by krishg:
    hi all,
    We are trying to call and external C routine (stored in a .so file) from a PL/SQL procedure.
    The error obtained is ORA-28576 ( which occurs after connection to the external routine has been established successfully.)
    , which states that the problem may lie in:
    a) Abnormal Termination of external C routine.(i.e a case of coredump, memory fault etc).
    b) Network Problems.
    c) Internal Logic Error in the RPC transfer code.
    We tried calling the C .so functions from a C executable and it is working fine. Also there doesn't appear to a problem in the network connections too.....
    The environment we are working on is Digital Unix 4.0 F. and we are using Oracle 8.0.6
    Please advise,
    Krishnan<HR></BLOCKQUOTE>
    null

  • Accessing developer 6i functions from  C++ builder

    how can i call a function in dev 6i from a c++ builder application and pass its arguments and retrieving the result from an oracle database?

    Hi,
    you can not call a function from forms but you can call a stored procedure/function.
    From Metalink, an example of How to call stored procedure returning date as out parameter
    Overview
    This example demonstrates how to call a stored procedure that returns
    a date column as an OUT parameter. The program is written in C using
    the ODBC API.
    Program Notes
    o Steps to build the sample application:
    1. create the procedure check_date from the pl/sql provided using
    SQL*PLUS or Sqlworksheet.
    2. Create a new win-32 console application using MSVC 6.0.
    3. Add the an empty cpp source file to the project.
    4. Add the ODBC32.lib library to the project. (This should be located
    in the Microsoft Visual Studio\vc98\lib directory)
    5. Paste the code provided into the .cpp file.
    6. Choose the build command from the Build pull down menu.
    o The sample was tested using the following components:
    1. Windows NT 4.0 SP 6
    2. MSVC 6.0
    3. Oracle ODBC Driver 8.1.6.2.0
    4. Oracle RDBMS 8.1.6.0.0
    5. Oracle Net 8 8.1.6.0.0
    References
    Information in this article was taken from Oracle Source Code Repository
    Entry # 612.
    Caution
    The sample program in this article is provided for educational purposes only
    and is NOT supported by Oracle Support Services. It has been tested
    internally, however, and works as documented. We do not guarantee that it
    will work for you, so be sure to test it in your environment before relying
    on it.
    Program
    - - - - - - - - - - - - - - - - Code begins here - - - - - - - - - - - - - - - -
    -- The PL/SQL procedure
    create or replace procedure check_date(inNum IN number, outDate OUT DATE) is
    begin
    select sysdate into outDate from dual;
    end;
    // The C source code
    #include <windows.h>
    #include <stdio.h>
    #include <sql.h>
    #include <sqlext.h>
    #pragma comment(lib, "odbc32.lib")
    UCHAR szSqlState[200];
    SDWORD pfNativeError;
    UCHAR szErrorMsg[200];
    SWORD cbErrorMsgMax = 200;
    SWORD pcbErrorMsg;
    int show_error();
    static HENV henv;
    HDBC hdbc;
    HSTMT hStmt;
    HWND hwnd;
    int show_error();
    int main() {
    char db_name[100];
    char username[100];
    char password[100];
    SDWORD cbOut;
    TIMESTAMP_STRUCT inData2;
    int inData1;
    if ( SQLAllocEnv ( &henv ) != SQL_SUCCESS )
    return -1 ;
    if ( SQLAllocConnect (henv, &hdbc ) != SQL_SUCCESS )
    return -1 ;
    printf("Username: ");
    gets((char *) username);
    printf("Password: ");
    gets((char *) password);
    printf("Data Source Name: ");
    gets((char *) db_name);
    if ( SQLConnect ( hdbc, (unsigned char*)db_name, SQL_NTS,(unsigned char*)username, SQL_NTS, (unsigned char*)password, SQL_NTS ) != SQL_SUCCESS ) {
    printf("Cannot connect as %s.\n", username);
    printf("Try again.\n\n");
    return -1;
    if (SQLAllocStmt(hdbc, &hStmt) != SQL_SUCCESS) {
    show_error() ;
    return(-1);
    inData1 = 10;
    cbOut=0;
    if ( SQLBindParameter(hStmt, 1, SQL_PARAM_INPUT, SQL_C_SSHORT, SQL_INTEGER, 0, 0,&inData1, 0, &cbOut) != SQL_SUCCESS ) {
    show_error() ;
    return(-1);
    cbOut=sizeof(TIMESTAMP_STRUCT);
    if ( SQLBindParameter(hStmt, 2, SQL_PARAM_OUTPUT, SQL_C_TIMESTAMP, SQL_TIMESTAMP, 19, 0,&inData2, 0, &cbOut) != SQL_SUCCESS ) {
    show_error() ;
    return(-1);
    if ( SQLPrepare(hStmt, (unsigned char*)"{call check_date(?,?)}", SQL_NTS) != SQL_SUCCESS)
    return(-1) ;
    if (SQLExecute(hStmt) != SQL_SUCCESS) {
    show_error() ;
    return -1;
    printf("The date is:\nyear: %d\nmonth: %d\nday: %d\n", inData2.year, inData2.month, inData2.day);
    if (SQLFreeStmt(hStmt,SQL_DROP) != SQL_SUCCESS) {
    show_error() ;
    return -1;
    if (SQLDisconnect(hdbc) != SQL_SUCCESS) {
    show_error() ;
    return -1;
    return(0) ;
    int show_error() {
    int retcode;
    retcode = SQLError(henv, hdbc, hStmt, szSqlState, &pfNativeError, szErrorMsg, cbErrorMsgMax, &pcbErrorMsg);
    printf("%d - %s \n",retcode, szErrorMsg);
    return(0);
    - - - - - - - - - - - - - - - - Code ends here - - - - - - - - - - - - - - - -
    Sample Output
    The Date is:
    year: 2000
    month: 11
    day: 9
    press any key to continue
    Monica

Maybe you are looking for

  • Can no longer access songs on iTunes on Time Capsule

    Not sure what's gone wrong here. A month ago, I moved my whole iTunes library (60GB) to my Time Capsule. Have been playing all my music fine since then. Till today. Suddenly, everything's gone haywire. Only a random fraction of the songs and podcasts

  • Creative's Vista support is so bad - My horrible experience

    All,?Have used Creative products for years, but how they are handling Vista is bordering on criminal. I do not understand how they basically tell good customers to take a hike with such terribly bad Vista support. Here is my story:?Using my SB Li've

  • BAPI_ACC_DOCUMENT_POST - not updating in databse

    Hi,      In my program code for outgoing payments(F-53) I am passing the following values for the BAPI_ACC_DOCUMENT_POST and getting the message in RETURN table as Document Successfully Posted( S RW 605) and I am able to see the document number in ex

  • Way to trim precomp to current layer time?

    I've got an animation pretty much done as far as timing goes and everything. Now I'm going back and editing some things that require adding a few layers to add some things to the current layer that already is trimmed appropriately to the correct time

  • How to become a java guru?

    i have a question , i am a novice into java. I really want to master that language so i need some feedback from more experienced users. I started it off with a book called:" java sotfware solutions written by John and Lewis William Loftus" i think it