Returns the value of the given column as a Cloud Spanner Value of the given type. This
method is used by a COPY ... FROM ... operation to convert a value to the type of the column
where it is being inserted. This method is supported for all types of CopyRecord.
Returns the value of the given column as a Cloud Spanner Value of the given type. This
method is used by a COPY ... FROM ... operation to convert a value to the type of the column
where it is being inserted. This method can only be used with records that contains column
names.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Interface CopyRecord (0.27.1)\n\nVersion latestkeyboard_arrow_down\n\n- [0.27.1 (latest)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.27.0](/java/docs/reference/pgadapter/0.27.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.26.0](/java/docs/reference/pgadapter/0.26.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.25.0](/java/docs/reference/pgadapter/0.25.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.24.0](/java/docs/reference/pgadapter/0.24.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.23.1](/java/docs/reference/pgadapter/0.23.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.22.1](/java/docs/reference/pgadapter/0.22.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.21.0](/java/docs/reference/pgadapter/0.21.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.20.0](/java/docs/reference/pgadapter/0.20.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.19.1](/java/docs/reference/pgadapter/0.19.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.18.4](/java/docs/reference/pgadapter/0.18.4/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.17.0](/java/docs/reference/pgadapter/0.17.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.16.0](/java/docs/reference/pgadapter/0.16.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.15.0](/java/docs/reference/pgadapter/0.15.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.14.1](/java/docs/reference/pgadapter/0.14.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.9.0](/java/docs/reference/pgadapter/0.9.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.8.0](/java/docs/reference/pgadapter/0.8.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.7.0](/java/docs/reference/pgadapter/0.7.0/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.6.1](/java/docs/reference/pgadapter/0.6.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord)\n- [0.5.1](/java/docs/reference/pgadapter/0.5.1/com.google.cloud.spanner.pgadapter.utils.CopyRecord) \n\n public interface CopyRecord\n\n[CopyRecord](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.CopyRecord) is a common interface for COPY data records that are produced by a parser for\na specific COPY format.\n\nMethods\n-------\n\n### getValue(Type type, int columnIndex)\n\n public abstract Value getValue(Type type, int columnIndex)\n\nReturns the value of the given column as a Cloud Spanner Value of the given type. This\nmethod is used by a COPY ... FROM ... operation to convert a value to the type of the column\nwhere it is being inserted. This method is supported for all types of [CopyRecord](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.CopyRecord).\n\n### getValue(Type type, String columnName)\n\n public abstract Value getValue(Type type, String columnName)\n\nReturns the value of the given column as a Cloud Spanner Value of the given type. This\nmethod is used by a COPY ... FROM ... operation to convert a value to the type of the column\nwhere it is being inserted. This method can only be used with records that contains column\nnames.\n\n### hasColumnNames()\n\n public abstract boolean hasColumnNames()\n\nReturns true if the copy record has column names. The [#getValue(Type, String)](/java/docs/reference/pgadapter/latest/com.google.cloud.spanner.pgadapter.utils.CopyRecord#com_google_cloud_spanner_pgadapter_utils_CopyRecord_getValue_com_google_cloud_spanner_Type_java_lang_String_) method\ncan only be used for records that have column names.\n\n### isEndRecord()\n\n public abstract boolean isEndRecord()\n\nReturns true if this record is the PG end record (.).\n\n### isNull(int columnIndex)\n\n public abstract boolean isNull(int columnIndex)\n\nReturns true if the value of the given column is null.\n\n### numColumns()\n\n public abstract int numColumns()\n\nReturns the number of columns in the record."]]