cancel
Showing results for 
Search instead for 
Did you mean: 

Error witth a parameter in a WHERE clause

Former Member
0 Kudos

Hi experts I have the following code from an abap programa

I have done a conection with Sql

And I want to do a SELECT.. WHERE one value from a column in the table is the same that the ones I write like an input parameter... but when is done the comparation

appears the 207 error from Sql I don't know how to fix it

Please help me ¡¡

REPORT Z_CONEXBD_ARACELI2.

DATA: c_copi TYPE FLIGHTS-COPILOT.

DATA: c_pilot TYPE FLIGHTS-PILOT.

DATA: c_id TYPE FLIGHTS-ID.

DATA: con_name LIKE dbcon-con_name VALUE 'CON'.

*Here is the declaration of the parameter

PARAMETERS: P_PILOT LIKE FLIGHTS-PILOT.

EXEC SQL.

SET CONNECTION :con_name

ENDEXEC.

IF sy-subrc <> 0.

  • Connection not yet opened.

EXEC SQL.

CONNECT TO :con_name

ENDEXEC.

endif.

  • Do something on connection 'con_name'

EXEC SQL.

select PILOT, COPILOT, ID

into :c_pilot, :c_copi, :c_id

from FLIGHTS

*Here is the where clause comparing with the parameter P_PILOT

Where PILOT = P_PILOT

ENDEXEC.

*Commit the changes on 'con_name'

EXEC SQL.

COMMIT

ENDEXEC.

EXEC SQL.

SET CONNECTION :con_name

ENDEXEC.

EXEC SQL.

DISCONNECT :con_name

ENDEXEC.

WRITE: /5 'CATALOGO DE VUELOS'.

WRITE: /5 :c_copi, :c_pilot, :c_id.

Thank you very much

Edited by: ARACELI GONZALEZ on Jun 9, 2008 3:51 AM

Accepted Solutions (0)

Answers (1)

Answers (1)

antonio_voce
Contributor
0 Kudos

Hi , I think this is a post for abap programmers.

Antonio.