Procedure execution with date type argument in a dblink

0

When executing the procedure below, via DBLINK in Oracle

corporativo..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, "1", "20150806", "RJ", " ", " ", "000020"

I get the error:

  

error: Syntax error during implicit conversion of VARCHAR value   '' 20150806 "'to a DATE field.

Should I transcribe the procedure command, replacing "(quotation marks) with plics (')?

corporativo..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, '1', '20150806', 'RJ', ' ', ' ', '000020'

Hugs,

    
asked by anonymous 08.03.2016 / 13:54

2 answers

1

As it was a supplier's difficulty, I wanted to share the doubt before submitting the suggestion that I thought was most correct.

Well, the call in Sybase works fully in this format: corporate ..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, "1", "20150806", "RJ", "", "", "000020"

Where the field "20150806" is a date type in the procedure signature. If it is to call in the same way in Oracle, through a DBlink gives error in this date field, with the message Syntax error during implicit conversion of VARCHAR value '"20150806"' to DATE field.

I suggested that instead of using double quotation marks in this field "simulating" a date, use single quotation marks ('). It reminded me of something like this in my oracle era.

The provider implemented the suggestion and ran smoothly.

Looking like this: corporate ..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, "1", "20150806", "RJ", "", "", "000020"

Hugs, and thank you.

    
08.03.2016 / 15:16
0

You should know the structure of your Procedure , and the table, but try to add the to_date command, so you convert your string into date :

corporativo..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, '1', to_date('20150806','yyyymmdd'), 'RJ', ' ', ' ', '000020'
    
08.03.2016 / 15:01