![]() It was how they were used to programming, iterating over a set one row at a time. In olden times it was common to use cursors, as database developers were mainly made up of software developers who had moved over to databases. The Microsoft command object with a data reader makes a little more sense when executing a SQL statement I guess, but a data reader is basically the same as a cursor and you could argue that the command object just confuses things.įor the database side of things. It's only called a cursor to prevent you having to have to ways to run your queries depending on whether they return data or not. But that's just because it's the channel you're using attached to your database connection. ![]() When you're executing a command, either an update or a stored procedure that doesn't return anything, well you still use your cursor, even though it's totally not necessary for returning rows now. It's just different names for the same thing and the functionality is very similar, iterate over the record set returned from a query, or execute a query, or even execute a query AND return the results. If it was using the native driver and you wanted to connect from C#.NET, then you would create a command object and use a data reader object to read the results of a query. This is because it's using ODBC to connect to Python. If you look at the connection mechanism for SQL Server 2022 from Python for example: However, this isn't a PostgreSQL-specific thing, it's more of a carry-over from older naming conventions. So the reason they're both called cursors, is because they're essentially the same thing, as you figured already, particularly fetching one or more rows at a time when returning data. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |