Обсуждение: Fetching Date and Timestamp values

Поиск
Список
Период
Сортировка

Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
Hi,

Am facing issue while fetching Date and Timestamp values.

GetSqlData call as follows:

SQLGetData(my_stmt, my_col_no, SQL_C_CHAR, taget_var, sizeof(taget_var), &my_buff_len)

Above call returns empty value. Am missing anything obivious here?

Driver version - 9.2.1
Platform - RHEL 64-bit

Regards...

Re: Fetching Date and Timestamp values

От
David G Johnston
Дата:
Dev Kumkar wrote
> Am missing anything obivious here?

Details...

David J.



--
View this message in context:
http://postgresql.1045698.n5.nabble.com/Fetching-Date-and-Timestamp-values-tp5803925p5803926.html
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.


Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Wed, May 14, 2014 at 10:25 PM, David G Johnston <david.g.johnston@gmail.com> wrote:

Details...

David J.

Let me know what details needs to be added here?

Regards...

Re: Fetching Date and Timestamp values

От
David Johnston
Дата:
On Wed, May 14, 2014 at 1:41 PM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
On Wed, May 14, 2014 at 10:25 PM, David G Johnston <david.g.johnston@gmail.com> wrote:

Details...

David J.

Let me know what details needs to be added here?



​You probably don't need to be as thorough as a full bug report - though it doesn't hurt - but that is a good reference point.


At minimum I'm not sure how you'd expect a useful answer to a SQL-related question without providing any SQL statements...

You provided zero detail (no, an API description of a call does not count) which means you didn't even try to figure things out or were too lazy to supply whatever testing you attempted.  Why would you expect others to help when you don't show that you put forth any effort yourself?  I was tempted to just ignore the email but at least figured I could provide a direct answer to your question.

I was tempted to reply to the "Let me know..." question with a simple "No" but at least this should get you started.

FWIW I do not use the ODBC interface.

David J.


Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Thu, May 15, 2014 at 12:36 AM, David Johnston <david.g.johnston@gmail.com> wrote:
​You probably don't need to be as thorough as a full bug report - though it doesn't hurt - but that is a good reference point.


At minimum I'm not sure how you'd expect a useful answer to a SQL-related question without providing any SQL statements...

You provided zero detail (no, an API description of a call does not count) which means you didn't even try to figure things out or were too lazy to supply whatever testing you attempted.  Why would you expect others to help when you don't show that you put forth any effort yourself?  I was tempted to just ignore the email but at least figured I could provide a direct answer to your question.

I was tempted to reply to the "Let me know..." question with a simple "No" but at least this should get you started.

FWIW I do not use the ODBC interface.

David J.

My question was very basic here, wanted to check if SQL_C_CHAR is the correct way to fetch SQL_DATE or SQL_TIMESTAMP.

Regards...

Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Wed, May 14, 2014 at 10:19 PM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:
Hi,

Am facing issue while fetching Date and Timestamp values.

GetSqlData call as follows:

SQLGetData(my_stmt, my_col_no, SQL_C_CHAR, taget_var, sizeof(taget_var), &my_buff_len)

Above call returns empty value. Am missing anything obivious here?

Driver version - 9.2.1
Platform - RHEL 64-bit

Regards...

Over here the target column's type is SQL_DATE or SQL_TIMESTAMP, and am trying to get them as SQL_C_CHAR.
Just wanted to check if SQL_C_CHAR is the correct and what is the standard way to fetch SQL_DATE or SQL_TIMESTAMP.

Regards...

Re: Fetching Date and Timestamp values

От
David G Johnston
Дата:
On Wed, May 14, 2014 at 5:33 PM, Dev Kumkar [via PostgreSQL] <[hidden email]> wrote:
On Thu, May 15, 2014 at 12:36 AM, David Johnston <[hidden email]> wrote:
​You probably don't need to be as thorough as a full bug report - though it doesn't hurt - but that is a good reference point.


At minimum I'm not sure how you'd expect a useful answer to a SQL-related question without providing any SQL statements...

You provided zero detail (no, an API description of a call does not count) which means you didn't even try to figure things out or were too lazy to supply whatever testing you attempted.  Why would you expect others to help when you don't show that you put forth any effort yourself?  I was tempted to just ignore the email but at least figured I could provide a direct answer to your question.

I was tempted to reply to the "Let me know..." question with a simple "No" but at least this should get you started.

FWIW I do not use the ODBC interface.

David J.

My question was very basic here, wanted to check if SQL_C_CHAR is the correct way to fetch SQL_DATE or SQL_TIMESTAMP.

Regards...


​And if you had actually asked that question initially I would have simply moved on as I have no clue due to not using ODBC.

But all you did was put out a little bit of code and asked if anything was obviously wrong.  Unless you intended to test the observation and knowledge capabilities of the readers of this list such a broad question is putting more burden on the reader than is necessary and doesn't let people quickly evaluate whether they can help.

All I wanted to do was avoid having you wait for hours just to get the same response that I put forth - provide more detail.

David J.



View this message in context: Re: Fetching Date and Timestamp values
Sent from the PostgreSQL - odbc mailing list archive at Nabble.com.

Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Thu, May 15, 2014 at 3:10 AM, David G Johnston <david.g.johnston@gmail.com> wrote:
​And if you had actually asked that question initially I would have simply moved on as I have no clue due to not using ODBC.

But all you did was put out a little bit of code and asked if anything was obviously wrong.  Unless you intended to test the observation and knowledge capabilities of the readers of this list such a broad question is putting more burden on the reader than is necessary and doesn't let people quickly evaluate whether they can help.

All I wanted to do was avoid having you wait for hours just to get the same response that I put forth - provide more detail.

David J.

Thanks and lets move on.

Regards...

Re: Fetching Date and Timestamp values

От
Adrian Klaver
Дата:
On 05/14/2014 02:33 PM, Dev Kumkar wrote:
> On Wed, May 14, 2014 at 10:19 PM, Dev Kumkar <devdas.kumkar@gmail.com
> <mailto:devdas.kumkar@gmail.com>> wrote:
>
>     Hi,
>
>     Am facing issue while fetching Date and Timestamp values.
>
>     GetSqlData call as follows:
>
>     SQLGetData(my_stmt, my_col_no, SQL_C_CHAR, taget_var,
>     sizeof(taget_var), &my_buff_len)
>
>     Above call returns empty value. Am missing anything obivious here?
>
>     Driver version - 9.2.1
>     Platform - RHEL 64-bit
>
>     Regards...
>
>
> Over here the target column's type is SQL_DATE or SQL_TIMESTAMP, and am
> trying to get them as SQL_C_CHAR.
> Just wanted to check if SQL_C_CHAR is the correct and what is the
> standard way to fetch SQL_DATE or SQL_TIMESTAMP.

Google search found this:

http://msdn.microsoft.com/en-us/library/ms714556%28v=vs.85%29.aspx

Search of the source found this (pgtypes.c):


http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgtypes.c;h=d7bde0ab11863171f17d3a1a534c23a9001c838f;hb=ad2a4aecb4748f8c5280aabf65dae570a9529065

>
> Regards...


--
Adrian Klaver
adrian.klaver@aklaver.com


Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Thu, May 15, 2014 at 3:39 AM, Adrian Klaver <adrian.klaver@aklaver.com> wrote:
Google search found this:

http://msdn.microsoft.com/en-us/library/ms714556%28v=vs.85%29.aspx

Search of the source found this (pgtypes.c):

http://git.postgresql.org/gitweb/?p=psqlodbc.git;a=blob;f=pgtypes.c;h=d7bde0ab11863171f17d3a1a534c23a9001c838f;hb=ad2a4aecb4748f8c5280aabf65dae570a9529065

Thanks, how normally a DATE and TIMESTAMP field is fetched from database? What should be the target type when calling GetSqlData ODBC function? Is there any sample program which can be referred?

Regards...

Re: Fetching Date and Timestamp values

От
Dev Kumkar
Дата:
On Thu, May 15, 2014 at 4:09 AM, Dev Kumkar <devdas.kumkar@gmail.com> wrote:

Thanks, how normally a DATE and TIMESTAMP field is fetched from database? What should be the target type when calling GetSqlData ODBC function? Is there any sample program which can be referred?

Can someone provide some help here?

regards...