Re: Char to Int
[color=blue]
>[color=green]
>> Oops, there was a typo in my second example. Still have the problem
>> tho...
>>[color=darkred]
>> > rs=#
>> > rs=# insert into table2
>> > rs=# select CAST(my_Id as integer)
>> > ^^^^
>> > rs=# from table1;
>> > ERROR: Cannot cast type character to integer[/color][/color]
>
> Try the function to_number().
>[/color]
rs=# select to_number(my_Id ,'9999999999999 999') from table1;
It worked nicely. Thanks.
--Rick
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)
[color=blue]
>[color=green]
>> Oops, there was a typo in my second example. Still have the problem
>> tho...
>>[color=darkred]
>> > rs=#
>> > rs=# insert into table2
>> > rs=# select CAST(my_Id as integer)
>> > ^^^^
>> > rs=# from table1;
>> > ERROR: Cannot cast type character to integer[/color][/color]
>
> Try the function to_number().
>[/color]
rs=# select to_number(my_Id ,'9999999999999 999') from table1;
It worked nicely. Thanks.
--Rick
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddres sHere" to majordomo@postg resql.org)
Comment