‎2008 Nov 05 9:41 PM
Hi,
I do have the following code:
EXEC SQL.
INSERT INTO ath_empgroup
(employee_groupid,
name,
start_date,
end_date)
VALUES (:it_zauthoria_bridge-auth_grp,
:it_zauthoria_bridge-auth_name,
:it_zauthoria_bridge-beg_date,
:it_zauthoria_bridge-end_date)
ENDEXEC.
But whenever I run the code I get the following runtime error saying "An SQL Error Occur When Executing Native SQL"
Does anyone know what could be a possible problem? The it_zauthoria_bridge is an internal table that I use on my ABAP program and ath_empgroup is a table under SQL environment.
Thanks,
Val.
‎2008 Nov 05 9:48 PM
a) What specific error message do you get?
b) why are you using native SQL for this?
Rob
‎2008 Nov 05 9:48 PM
a) What specific error message do you get?
b) why are you using native SQL for this?
Rob
‎2008 Nov 11 4:22 PM
Hi Rob,
I am using native SQL because major part of my program is in ABAP and I need to store some data in a table that is in our repository system called Authoria. Also with native SQL I am able to have access to databases that are not in SAP environment.
I have changed my code a little bit as I realized the date had some issues.. However, now I am getting another error 'ORA-00936 - Missing Expression'. My code now looks like the following:
EXEC SQL.
INSERT INTO ath_empgroup
(employee_groupid,
name,
start_date,
end_date)
VALUES (:it_zauthoria_grp-auth_group,
:it_zauthoria_grp-auth_group,
to_date(:it_zauthoria_grp- beg_date,'YYYYMMDD',)
to_date(:it_zauthoria_grp-end_date,'YYYYMMDD' )
ENDEXEC.
Thanks!
Val.
‎2008 Nov 11 5:04 PM
>
> > VALUES (:it_zauthoria_grp-auth_group,
> :it_zauthoria_grp-auth_group,
> to_date(:it_zauthoria_grp- beg_date,'YYYYMMDD',)
> to_date(:it_zauthoria_grp-end_date,'YYYYMMDD' )
>
> ENDEXEC.
>
> Val.
The comma on the first TO_DATE line should be after the bracket, not before.
‎2008 Nov 11 5:23 PM
Hi Christine,
I had tried that before but I got an error saying "Missing Comma".. but now it is fine after I changed to what it is now. If you look at the line above it is exactly the same as what is in the brackets.. so I guess it is supposed to be that way. But it could also be that I am missing another comma.
Let me know if you dohave any other idea.
Thanks,
Val.
‎2008 Nov 11 5:32 PM
>
> Hi Christine,
>
> I had tried that before but I got an error saying "Missing Comma".. but now it is fine after I changed to what it is now. If you look at the line above it is exactly the same as what is in the brackets.. so I guess it is supposed to be that way. But it could also be that I am missing another comma.
>
> Let me know if you dohave any other idea.
>
> Thanks,
>
> Val.
No, I think you do need to move the comma. And you'll also need to add another closing bracket at the end to close the 'VALUES' open bracket.
‎2008 Nov 11 5:37 PM
Start by getting rid of the space in :it_zauthoria_grp- beg_date
Rob
‎2008 Nov 11 5:40 PM
Thank you Christine!! It worked you earned the maximum points!! I dont know how I missed that!
‎2008 Nov 05 11:45 PM
Look in the trace files for the work process and you should see the text of the error message returned by the DBMS.
Cheers
Graham Robbo