ProgrammingError :(“ SQL包含0个参数标记,但提供了13个参数”,“ HY000”)

时间:2018-10-23 21:03:14

标签: python oracle pandas pyodbc

using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using Xamarin.Forms;

using Xamarin.Forms;
using Xamarin.Forms.Platform.UWP;

using Windows.UI.Core;
namespace NavigationPannel2.UWP
{
    public sealed partial class MainPage
    {
        public MainPage()
        {
            this.InitializeComponent();

            LoadApplication(new NavigationPannel2.App());
            CustomContentPage page = new PageTest1();
            Content = page.CreateFrameworkElement();

        }
    }
}

我正在尝试将此列表加载到Oracle表中。我收到以下错误

dataframe_list=df.values.tolist()
Conn = pyodbc.connect('Driver={Oracle};DBQ=DB_NAME;Uid=user_Name;Pwd=xxxxxxxx')
cursor = conn.cursor()

str_query = "INSERT INTO schema.Table(Year,BRAND,Model,Color,Country,State,City,Dealer,Month,sales,Adjusted_Sales,Price,ROW_INSERTED_DATE) VALUES ('{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}', '{}',);"

for index,elem in enumerate(dataframe_list): #iterating the list using index(int)
    cursor.execute(str_query,dataframe_list[index])

我有sqlalchemy,但无法安装cx_Oracle。我可以使用pyodbc从Oracle阅读。我正在寻找将数据框或列表(从数据框转换)写入Oracle的方法。

0 个答案:

没有答案