Results 1 to 5 of 5
  1. #1
    Join Date
    Sep 2003
    Posts
    14

    Unanswered: Stored Procedure

    Hi,

    I have recently moved from Sybase 12.0 to Sybase 12.5.
    A stored procedure which worked perfectly in Sybase 12.0
    fails in Sybase 12.5 with an Error 203.

    Here is the log

    "description: [Native Error code: 203]
    [DataDirect ADO Sybase Provider] The name 'SptUpdateDatabase'patient_4_1_',0' is not a valid identifier."

    where SptUpdateDatabase name of the Stored procedure
    patient_4_1_ - is an input parameter of type Varchar
    0 - is an input parameter of type int.

    I call the stored procedure using a C++ client

    The code with which I call the client is

    rs = new CCommand<CManualAccessor, CRowset, CMultipleResults>;
    _TCHAR str_proc_call[SPT_DD_MAX_BUFFER];
    _tcscpy(str_proc_call, _T("{ Call ") );
    _tcscat(str_proc_call, str_proc_name_ptr );
    _tcscat(str_proc_call, _T(" ") );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, bstr_spt_patient_roid );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, _T(",") );
    _tcscat(str_proc_call, _T("0") );
    _tcscat(str_proc_call, _T(" }") );

    hr = rs->Create(GetSession(), str_proc_call);

    if(FAILED(hr))
    {
    //log
    }


    //-----------------------------------------------------
    // Open the rowset to get the information
    //so we can then bind the columns
    //-----------------------------------------------------
    if (rs->Open(NULL, NULL, false) != S_OK)
    {
    // Fails here!
    }

    Thanks
    Usha

  2. #2
    Join Date
    Sep 2003
    Location
    Switzerland
    Posts
    443

    Re: Stored Procedure

    Hi Usha,

    Try running the stored procedure through an isql session (using the same user as from the C++ program) just to make sure that the stored procedure exists and the user has the right permissions.

    Thanks,
    Vishi.

  3. #3
    Join Date
    Sep 2003
    Location
    India
    Posts
    17

    Re: Stored Procedure

    Drop and recreate those procedure

    Originally posted by usha_nandini
    Hi,

    I have recently moved from Sybase 12.0 to Sybase 12.5.
    A stored procedure which worked perfectly in Sybase 12.0
    fails in Sybase 12.5 with an Error 203.

    Here is the log

    "description: [Native Error code: 203]
    [DataDirect ADO Sybase Provider] The name 'SptUpdateDatabase'patient_4_1_',0' is not a valid identifier."

    where SptUpdateDatabase name of the Stored procedure
    patient_4_1_ - is an input parameter of type Varchar
    0 - is an input parameter of type int.

    I call the stored procedure using a C++ client

    The code with which I call the client is

    rs = new CCommand<CManualAccessor, CRowset, CMultipleResults>;
    _TCHAR str_proc_call[SPT_DD_MAX_BUFFER];
    _tcscpy(str_proc_call, _T("{ Call ") );
    _tcscat(str_proc_call, str_proc_name_ptr );
    _tcscat(str_proc_call, _T(" ") );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, bstr_spt_patient_roid );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, _T(",") );
    _tcscat(str_proc_call, _T("0") );
    _tcscat(str_proc_call, _T(" }") );

    hr = rs->Create(GetSession(), str_proc_call);

    if(FAILED(hr))
    {
    //log
    }


    //-----------------------------------------------------
    // Open the rowset to get the information
    //so we can then bind the columns
    //-----------------------------------------------------
    if (rs->Open(NULL, NULL, false) != S_OK)
    {
    // Fails here!
    }

    Thanks
    Usha

  4. #4
    Join Date
    Sep 2003
    Posts
    14

    Re: Stored Procedure

    Originally posted by usha_nandini
    Hi,

    I have recently moved from Sybase 12.0 to Sybase 12.5.
    A stored procedure which worked perfectly in Sybase 12.0
    fails in Sybase 12.5 with an Error 203.

    Here is the log

    "description: [Native Error code: 203]
    [DataDirect ADO Sybase Provider] The name 'SptUpdateDatabase'patient_4_1_',0' is not a valid identifier."

    where SptUpdateDatabase name of the Stored procedure
    patient_4_1_ - is an input parameter of type Varchar
    0 - is an input parameter of type int.

    I call the stored procedure using a C++ client

    The code with which I call the client is

    rs = new CCommand<CManualAccessor, CRowset, CMultipleResults>;
    _TCHAR str_proc_call[SPT_DD_MAX_BUFFER];
    _tcscpy(str_proc_call, _T("{ Call ") );
    _tcscat(str_proc_call, str_proc_name_ptr );
    _tcscat(str_proc_call, _T(" ") );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, bstr_spt_patient_roid );
    _tcscat(str_proc_call, _T("'") );
    _tcscat(str_proc_call, _T(",") );
    _tcscat(str_proc_call, _T("0") );
    _tcscat(str_proc_call, _T(" }") );

    hr = rs->Create(GetSession(), str_proc_call);

    if(FAILED(hr))
    {
    //log
    }


    //-----------------------------------------------------
    // Open the rowset to get the information
    //so we can then bind the columns
    //-----------------------------------------------------
    if (rs->Open(NULL, NULL, false) != S_OK)
    {
    // Fails here!
    }

    Thanks
    Usha

  5. #5
    Join Date
    Sep 2003
    Posts
    14

    Thumbs up

    Hi Trvishi and sachinbhas,
    Thanks a lot for your replies.

    I have indeed solved the problem.
    The Procedure is declared as
    Create Procedure XYZ(@ var1 varchar(50), @var2 int )
    as
    .
    .
    .
    .

    And in the client I call it as

    "Call XYZ var1, var2".

    I had to change it to "Call XYZ(var1, var2)". It works
    fine now.
    The strange thing is...in Sybase 12 the same client code
    was used and it worked. I am clueless as to why it should
    not work in Sybase 12.5

    Regards
    Usha

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •