questdb icon indicating copy to clipboard operation
questdb copied to clipboard

questdb show me "table already specified"

Open tangweidali opened this issue 2 years ago • 5 comments

Describe the bug

  1. qdb version 6.6.1
  2. insert protocol 9009
  3. during insert, I ever update some data
  4. and then , when I keep inserting data , qdb show me "table already specified"

To reproduce

No response

Expected Behavior

how can I deal the problem?

Environment

- **QuestDB version**:
- **OS**:
- **Browser**:

Additional context

No response

tangweidali avatar Jan 09 '23 10:01 tangweidali

Can you provide step by step instructions how I can reproduce this please?

ideoma avatar Jan 12 '23 20:01 ideoma

@tangweidali could you help us understand the reproducer better? I'm afraid the current description isn't enough.

puzpuzpuz avatar Feb 13 '23 11:02 puzpuzpuz

@ideoma, @puzpuzpuz, @tangweidali, and anyone else experiencing this issue,

I experienced similar issue, using LineTcpSender instance. First row would insert, second would throw me the exception,

Originally I had the code as below: lineTcpSender.Table("myTable").Column("CreateDate", entity.CreateDate).Column("Description", entity.Description).Column("UniqueId", $"{entity.UniqueId}").Send();

To fix this, the lineTcpSender.Table("myTable") should be called only once, .Column and .Send() or .SendAsync() are called each time new row is being inserted,

  1. Set table which rows are being inserted to: lineTcpSender.Table("myTable");
  2. Insert column values for each row being inserted: lineTcpSender.Column("CreateDate", entity.CreateDate).Column("Description", entity.Description).Column("UniqueId", $"entity.UniqueId}") .Send();

tomaszkstech avatar Nov 03 '23 12:11 tomaszkstech

Hi @tomaszkstech

I assume you are using .NET client (https://github.com/questdb/net-questdb-client/). You should call At() at the end of the call chain for each row:

lineTcpSender.Column("CreateDate", entity.CreateDate)
             .Column("Description", entity.Description)
             .Column("UniqueId", $"entity.UniqueId}")
             .At(DateTime.UtcNow);
// Insert more rows here
// ...
// Send them over the wire all at once:
lineTcpSender.Send();

puzpuzpuz avatar Nov 03 '23 13:11 puzpuzpuz

I think this can be closed as error mentioned on title is likely due to developer coding error while using LineTcpSender

tomaszkstech avatar Nov 09 '23 15:11 tomaszkstech