Running the Procedure with date type argument on a dblink

Asked

Viewed 84 times

0

when running the file below, via DBLINK on Oracle

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

get the bug:

error: Syntax error During implicit Conversion of VARCHAR value '"20150806"' to a DATE field.

I must transcribe the Procedure command, replacing "(quotes) with plics (')?

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

Hugs,

2 answers

1

As it was a problem for a supplier, I wanted to share the doubt before presenting the suggestion that I thought was right.

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

Where the "20150806" field is a date type in the Procedure signature. If calling in the same way in Oracle, through a Dblink gives error in this data field, with the message Syntax error During implicit Conversion of VARCHAR value '"20150806"' to a DATE field.

I suggested, that instead of using double quotes in this field "simulating" a date, use single quotes ('). I remember something like this in my time as an oracle.

The vendor implemented the suggestion and ran smoothly.

That being so: . UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, "1", '20150806', "RJ", ", ", "", "000020"

Hugs, and thank you.

0

You’d have to know the structure of your Procedure, and the table, but try to add the command to_date, for thus you convert your string in date:

corporativo..UP_COP025_ASS_DMANDA_JURID_I 17444968, 1, '1', to_date('20150806','yyyymmdd'), 'RJ', ' ', ' ', '000020'

Browser other questions tagged

You are not signed in. Login or sign up in order to post.